/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    /* Color Palette */
    --color-bg: hsl(155, 24%, 96%);          /* Soft Mint Background */
    --color-surface: hsl(0, 0%, 100%);        /* Pure White Card Background */
    --color-card-bg: hsl(155, 25%, 90%);     /* Pastel Teal Card Background */
    --color-text-primary: hsl(155, 45%, 9%);  /* Deep Slate Text */
    --color-text-secondary: hsl(155, 12%, 35%); /* Medium Slate Text */
    --color-primary: hsl(155, 40%, 25%);      /* Darker Teal Accent */
    --color-accent: hsl(11, 95%, 60%);        /* Red-Orange Primary Action */
    --color-accent-hover: hsl(11, 95%, 52%);  /* Darker Red-Orange */
    --color-mint-light: hsl(155, 35%, 94%);   /* Very light mint */
    --color-border: hsl(155, 20%, 88%);       /* Subtle borders */
    
    /* Layout & Spacing */
    --container-width: 1200px;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --box-shadow-soft: 0 10px 30px -10px hsla(155, 45%, 9%, 0.06);
    --box-shadow-hover: 0 20px 40px -15px hsla(155, 45%, 9%, 0.12);
}

/* ==========================================================================
   Global Resets
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   Portfolio Page – Styles
   ========================================================================== */

/* ── Page Layout ─────────────────────────────────────────────────────────── */
.portfolio-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(
        160deg,
        hsl(155, 24%, 96%) 0%,
        hsl(155, 30%, 93%) 50%,
        hsl(155, 24%, 96%) 100%
    );
}

/* Subtle grid overlay */
.portfolio-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.012) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ── Top Navigation Bar ──────────────────────────────────────────────────── */
.portfolio-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: hsla(155, 24%, 96%, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-nav.scrolled {
    box-shadow: var(--box-shadow-soft);
}

.portfolio-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.portfolio-nav .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.portfolio-nav .logo-icon {
    background-color: var(--color-text-primary);
    color: var(--color-surface);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 900;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.portfolio-nav .logo-text {
    font-weight: 800;
    font-size: 1.1rem;
}

.portfolio-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-back-link:hover {
    color: var(--color-text-primary);
}

.nav-back-link:hover svg {
    transform: translateX(-3px);
}

.nav-back-link svg {
    transition: transform 0.3s;
}

.nav-divider {
    color: var(--color-border);
    opacity: 0.5;
    font-size: 0.85rem;
    user-select: none;
}

.nav-logoff-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-family: inherit;
    padding: 0;
}

.nav-logoff-btn:hover {
    color: var(--color-accent);
}

.nav-logoff-btn:hover svg {
    transform: translateX(3px);
}

.nav-logoff-btn svg {
    transition: transform 0.3s;
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.portfolio-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 24px 80px;
}

/* ── Hero / Page Header ──────────────────────────────────────────────────── */
.portfolio-hero {
    text-align: center;
    margin-bottom: 56px;
    opacity: 0;
    transform: translateY(24px);
    animation: revealUp 0.7s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portfolio-hero .page-badge {
    display: inline-block;
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.portfolio-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.portfolio-hero .subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Section Cards (Unused but can align tiles grid) ─────────────────────── */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 48px;
    margin-bottom: 50px;
}

/* ── Interactive Portfolio Tile ────────────────────────────────────────── */
.portfolio-tile {
    background: hsla(0, 0%, 100%, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg, 24px);
    border: 1px solid hsla(155, 20%, 88%, 0.5);
    box-shadow:
        0 8px 30px -8px hsla(155, 45%, 9%, 0.05),
        0 0 0 1px hsla(155, 20%, 88%, 0.4);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-tile:hover {
    transform: translateY(-8px);
    background: #ffffff;
    border-color: hsla(155, 40%, 25%, 0.15);
    box-shadow:
        0 20px 48px -12px hsla(155, 45%, 9%, 0.12),
        0 0 0 1px hsla(155, 40%, 25%, 0.08);
}

/* Icons styling inside tiles */
.tile-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-tile:hover .tile-icon-wrapper {
    transform: scale(1.1);
}

.tile-icon-wrapper.teal {
    background: hsla(155, 40%, 25%, 0.08);
    color: var(--color-primary);
}

.tile-icon-wrapper.coral {
    background: hsla(11, 95%, 60%, 0.08);
    color: var(--color-accent);
}

.tile-icon-wrapper.slate {
    background: hsla(155, 45%, 9%, 0.06);
    color: var(--color-text-primary);
}

/* Tile Typography & action links */
.portfolio-tile h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.012em;
}

.portfolio-tile p {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.tile-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-primary);
    transition: gap 0.25s, color 0.3s;
}

.tile-action .arrow {
    transition: transform 0.25s;
}

.portfolio-tile:hover .tile-action {
    color: var(--color-primary);
}

.portfolio-tile:hover .tile-action .arrow {
    transform: translateX(4px);
}

/* ── Modal Pop-up System ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(14, 25, 21, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow:
        0 32px 80px -16px rgba(10, 24, 18, 0.2),
        0 0 0 1px rgba(10, 24, 18, 0.04);
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.35s ease;
    overflow: hidden;
}

/* Wide & responsive online resume modal */
#modal-resume .modal-card {
    max-width: 1060px;
}

#modal-resume .modal-scrollable > * {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1600px) {
    #modal-resume .modal-card {
        max-width: 1220px;
    }
}

@media (max-width: 1200px) {
    #modal-resume .modal-card {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    #modal-resume .modal-card {
        max-width: 760px;
    }
}

@media (max-width: 768px) {
    #modal-resume .modal-card {
        max-width: 100%;
    }
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

/* Close action button */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f5f4;
    border: none;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: #e8ebea;
    color: var(--color-text-primary);
    transform: rotate(90deg);
}

/* Modal Inner Scrollable elements */
.modal-scrollable {
    overflow-y: auto;
    padding: 44px;
    max-height: 85vh;
}

/* Beautiful Loading Components */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    min-height: 350px;
    background: #ffffff;
}

.resume-spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid hsla(155, 40%, 25%, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin-anim 1s infinite linear;
    margin-bottom: 20px;
}

.modal-loading .loading-text {
    font-weight: 700;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

@keyframes spin-anim {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Scrollbar for the CV Popup Modal */
.modal-scrollable::-webkit-scrollbar {
    width: 6px;
}
.modal-scrollable::-webkit-scrollbar-track {
    background: #f7f9f8;
}
.modal-scrollable::-webkit-scrollbar-thumb {
    background: #d4dad7;
    border-radius: 10px;
}
.modal-scrollable::-webkit-scrollbar-thumb:hover {
    background: #bdc5c2;
}

/* ── CV Content Formatting inside Dialog ────────────────────────────────── */
.cv-header {
    text-align: left;
    margin-bottom: 24px;
}

.cv-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--color-primary);
    background: hsla(155, 40%, 25%, 0.08);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}

.cv-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.15;
}

.cv-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: 6px;
    margin-bottom: 16px;
}

.cv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cv-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.cv-divider {
    height: 1px;
    background: #e8ebea;
    margin: 28px 0;
}

.cv-section {
    margin-bottom: 32px;
}

.cv-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.cv-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cv-bullet.teal { background-color: var(--color-primary); }
.cv-bullet.coral { background-color: var(--color-accent); }
.cv-bullet.purple { background-color: #8b5cf6; }

.cv-section-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.cv-paragraph {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

/* CV Jobs timeline items */
.cv-job {
    margin-bottom: 24px;
}

.cv-job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.cv-job-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.cv-job-company {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 2px;
}

.cv-job-duration {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    background: #f3f5f4;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.cv-job-bullets {
    padding-left: 18px;
    margin: 0;
}

.cv-job-bullets li {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}

/* Skills tags */
.cv-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cv-skill-tag {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-primary);
    background: #f0f3f2;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e3e8e6;
}

/* ── Video Modal Card ──────────────────────────────────────────────────── */
.video-modal-card {
    max-width: 780px;
    padding: 36px;
}

.modal-video-header {
    margin-bottom: 18px;
    padding-right: 32px;
}

.modal-video-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.modal-video-header p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.video-container {
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    box-shadow: 0 12px 32px -4px rgba(10, 24, 18, 0.15);
}

.video-container video {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Thank You Modal Window ────────────────────────────────────────────── */
.thanks-modal-card {
    max-width: 480px;
    padding: 44px;
    align-items: center;
    text-align: center;
}

.thanks-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: hsla(11, 95%, 60%, 0.08);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.thanks-modal-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.015em;
}

.thanks-quote {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    background: #f7faf9;
    border-left: 3px solid var(--color-accent);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    text-align: left;
    margin-bottom: 28px;
}

.thanks-primary-btn {
    width: 100%;
    padding: 14px 28px;
    background: var(--color-text-primary);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s;
}

.thanks-primary-btn:hover {
    background: #2d4a3e;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 25, 21, 0.15);
}

/* Animation helpers */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Back to Top styles ──────────────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .portfolio-content {
        padding: 88px 16px 60px;
    }

    .tiles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .portfolio-tile {
        padding: 30px 24px;
        border-radius: var(--border-radius-md, 16px);
    }

    .portfolio-hero h1 {
        font-size: 1.8rem;
    }

    .modal-scrollable {
        padding: 28px 20px;
    }

    .cv-job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .cv-job-duration {
        align-self: flex-start;
    }
}

/* ── Recruiter / Company Custom Greeting Badge ────────────────────────────── */
.portfolio-greeting-banner {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.greeting-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--color-mint-light);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 14px rgba(25, 76, 56, 0.05);
}

.greeting-badge .wave-emoji {
    animation: wave-hand 2s infinite ease-in-out;
    transform-origin: 70% 70%;
    display: inline-block;
}

@keyframes wave-hand {
    0%, 100% { transform: rotate( 0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(14deg); }
    80% { transform: rotate(-4deg); }
}

/* ── Get in Touch Button ────────────────────────────────────────────────── */
.contact-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px !important;
    border-radius: 100px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--color-surface) !important;
    background-color: var(--color-accent) !important;
    border: none !important;
    cursor: pointer;
    transition: var(--transition-smooth) !important;
    box-shadow: 0 4px 12px rgba(255, 90, 54, 0.23) !important;
    outline: none !important;
    text-decoration: none !important;
}

.contact-cta-btn:hover {
    background-color: var(--color-accent-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(255, 90, 54, 0.35) !important;
}

