/* ==========================================================================
   Umit Kavala — Engineering Leadership Portfolio
   Design system: adaptive light/dark, fluid type, restrained glass surfaces.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Typography */
    --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

    --step--1: clamp(0.8rem, 0.76rem + 0.18vw, 0.875rem);
    --step-0: clamp(0.95rem, 0.9rem + 0.22vw, 1.0625rem);
    --step-1: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
    --step-2: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
    --step-3: clamp(1.7rem, 1.35rem + 1.6vw, 2.6rem);
    --step-4: clamp(2.1rem, 1.5rem + 3vw, 4rem);

    /* Brand hues — shared across themes */
    --brand-cyan: #0ea5e9;
    --brand-indigo: #6366f1;
    --brand-amber: #f59e0b;
    --brand-emerald: #10b981;

    /* Geometry */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-full: 9999px;

    --space-section: clamp(4.5rem, 3rem + 7vw, 8rem);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --t-fast: 0.18s var(--ease-out);
    --t-normal: 0.32s var(--ease-out);
    --t-slow: 0.6s var(--ease-out);

    /* ---- Palette (dark only) ---- */
    color-scheme: dark;

    --bg-primary: #070a12;
    --bg-secondary: #0d111c;
    --bg-tertiary: #161c2b;

    --surface: rgba(19, 25, 39, 0.66);
    --surface-solid: #101624;
    --surface-raised: rgba(27, 34, 51, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(56, 189, 248, 0.42);
    --glass-blur: blur(18px) saturate(1.5);

    --text-primary: #f1f5f9;
    --text-secondary: #a3aec1;
    --text-muted: #6f7c92;

    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.14);
    --accent-2: #818cf8;
    --accent-3: #fbbf24;
    --accent-4: #34d399;

    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 55%, #c084fc 100%);
    --gradient-text: linear-gradient(120deg, #f8fafc 15%, #38bdf8 55%, #a78bfa 100%);
    --gradient-surface: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 100%);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 16px 34px -16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 70px -30px rgba(0, 0, 0, 0.85);
    --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.22), 0 22px 48px -24px rgba(56, 189, 248, 0.4);

    --glow-opacity: 0.3;
    --grid-line: rgba(255, 255, 255, 0.035);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    letter-spacing: -0.005em;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color var(--t-normal), color var(--t-normal);
}

/* Subtle blueprint grid behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 85%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-inline:
        max(clamp(1.1rem, 4vw, 2rem), env(safe-area-inset-left))
        max(clamp(1.1rem, 4vw, 2rem), env(safe-area-inset-right));
}

.section {
    padding: var(--space-section) 0;
    position: relative;
    z-index: 1;
}

.text-center { text-align: center; }

/* Accessibility helpers */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100%;
    z-index: 2000;
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-xs);
    font-weight: 600;
    transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

/* Reading progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: var(--gradient-primary);
    z-index: 1200;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. Ambient Background
   -------------------------------------------------------------------------- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: 0;
    opacity: var(--glow-opacity);
    transition: opacity var(--t-slow);
    will-change: transform;
}

.bg-glow-1 { width: 46vw; height: 46vw; min-width: 380px; min-height: 380px; background: var(--brand-cyan); top: -12vh; left: -10vw; animation: drift-a 24s var(--ease-in-out) infinite alternate; }
.bg-glow-2 { width: 52vw; height: 52vw; min-width: 420px; min-height: 420px; background: var(--brand-indigo); top: 38%; right: -16vw; animation: drift-b 30s var(--ease-in-out) infinite alternate; }
.bg-glow-3 { width: 40vw; height: 40vw; min-width: 320px; min-height: 320px; background: var(--brand-amber); bottom: -14vh; left: 22vw; animation: drift-a 34s var(--ease-in-out) infinite alternate-reverse; }

@keyframes drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(4vw, 5vh, 0) scale(1.12); } }
@keyframes drift-b { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-5vw, -4vh, 0) scale(0.95); } }

/* --------------------------------------------------------------------------
   4. Surfaces
   -------------------------------------------------------------------------- */
.glass-panel {
    position: relative;
    background-color: var(--surface);
    background-image: var(--gradient-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-normal), box-shadow var(--t-normal), border-color var(--t-normal);
}

.glass-panel:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   5. Typography & Section Headers
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.section-header {
    max-width: 46rem;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

.section-subtitle {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.section-title {
    font-size: var(--step-3);
    margin-bottom: 1rem;
    text-wrap: balance;
}

.section-description {
    color: var(--text-secondary);
    font-size: var(--step-1);
    line-height: 1.7;
    text-wrap: pretty;
}

.section-divider {
    width: 64px;
    height: 3px;
    margin: 1.6rem auto 0;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
}

/* --------------------------------------------------------------------------
   6. Buttons & Badges
   -------------------------------------------------------------------------- */
.btn {
    --btn-bg: transparent;
    --btn-fg: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-heading);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--t-fast), box-shadow var(--t-normal),
                background-color var(--t-normal), border-color var(--t-normal), color var(--t-normal);
}

.btn svg { flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: var(--shadow-lg), var(--shadow-glow); filter: brightness(1.06); }

.btn-secondary {
    background: var(--surface-raised);
    border-color: var(--border-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}
.btn-secondary:hover { border-color: var(--border-accent); box-shadow: var(--shadow-md); }

.btn-outline {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }

.btn-sm { padding: 0.55rem 1.05rem; font-size: 0.8rem; }

.badge-primary, .badge-secondary, .badge-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.8rem;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-primary { background: var(--accent-soft); color: var(--accent); border-color: var(--border-accent); }
.badge-secondary { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.badge-ghost { background: var(--bg-tertiary); color: var(--text-muted); border-color: var(--border); }

/* --------------------------------------------------------------------------
   7. Navigation
   -------------------------------------------------------------------------- */
.navbar-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.1rem 0;
    border-bottom: 1px solid transparent;
    transition: padding var(--t-normal), background-color var(--t-normal),
                border-color var(--t-normal), box-shadow var(--t-normal);
}

.navbar-header.scrolled {
    padding: 0.6rem 0;
    background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.02rem;
    flex-shrink: 0;
}

.logo-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-strong);
    transition: border-color var(--t-normal), transform var(--t-normal);
}

.brand-logo:hover .logo-avatar { border-color: var(--accent); transform: scale(1.06); }
.logo-text { letter-spacing: -0.02em; }
.accent-dot { color: var(--accent); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--t-fast), background-color var(--t-fast);
}

.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--accent-soft); }
.nav-link.active { color: var(--accent); font-weight: 600; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
    cursor: pointer;
}

.mobile-nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--text-primary);
    transition: transform var(--t-normal), opacity var(--t-fast);
}

.mobile-nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    z-index: 1;
    padding: clamp(8rem, 12vw, 11rem) 0 var(--space-section);
    display: flex;
    align-items: center;
    min-height: 100svh;
}

.hero-container {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.95rem 0.4rem 0.7rem;
    margin-bottom: 1.6rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-4);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-4) 60%, transparent);
    animation: pulse 2.4s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-4) 60%, transparent); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
    font-size: var(--step-4);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 1.4rem;
    text-wrap: balance;
}

.hero-subtitle {
    max-width: 40rem;
    font-size: var(--step-1);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    text-wrap: pretty;
}

.hero-subtitle strong { color: var(--text-primary); font-weight: 600; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.hero-quick-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.5rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
}

.info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.info-item svg { color: var(--accent); }

/* Hero code card */
.hero-card-visual { perspective: 1400px; }

.executive-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: rotateY(-5deg) rotateX(2deg);
    transition: transform var(--t-slow), box-shadow var(--t-slow);
}

.executive-card:hover { transform: rotateY(0deg) rotateX(0deg) translateY(-6px); }

.card-header-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    background: color-mix(in srgb, var(--bg-tertiary) 70%, transparent);
    border-bottom: 1px solid var(--border);
}

.window-dot { width: 11px; height: 11px; border-radius: 50%; }
.window-dot.red { background: #ff5f57; }
.window-dot.yellow { background: #febc2e; }
.window-dot.green { background: #28c840; }

.window-title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
}

.card-body { padding: 1.5rem 1.4rem; }

.code-block {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 2;
    color: var(--text-secondary);
    /* Wrap long lines instead of scrolling sideways */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.code-keyword { color: var(--accent-2); }
.code-var { color: var(--accent); }
.code-string { color: var(--accent-4); }
.code-num { color: var(--accent-3); }

.card-footer-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-tertiary) 45%, transparent);
}

.mini-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 1rem 0.5rem;
    text-align: center;
}

/* Dividers for a 2-column grid */
.mini-stat:nth-child(odd) { border-right: 1px solid var(--border); }
.mini-stat:nth-child(n+3) { border-top: 1px solid var(--border); }

/* The leadership stat gets the emphasis */
.mini-stat-featured {
    background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%);
}

.mini-stat-featured::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--gradient-primary);
}

.mini-stat-featured .stat-val { font-size: 1.5rem; }

.mini-stat-featured .stat-lbl {
    color: var(--accent);
    font-weight: 600;
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.stat-lbl { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   9. About Pillars
   -------------------------------------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.about-card { padding: 2rem 1.75rem; }
.about-card:hover { transform: translateY(-5px); border-color: var(--border-accent); }

.about-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}

.about-card h3 { font-size: var(--step-1); margin-bottom: 0.7rem; }
.about-card p { color: var(--text-secondary); font-size: 0.94rem; line-height: 1.7; }

/* --------------------------------------------------------------------------
   10. Impact Metrics
   -------------------------------------------------------------------------- */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.impact-card {
    position: relative;
    padding: 2rem 1.5rem;
    text-align: center;
    overflow: hidden;
}

.impact-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--t-normal);
}

.impact-card:hover::before { transform: scaleX(1); }
.impact-card:hover { transform: translateY(-5px); border-color: var(--border-accent); }

.impact-number {
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.impact-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    margin: 0.5rem 0 0.4rem;
}

.impact-desc { font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }

/* --------------------------------------------------------------------------
   11. AI Engineering
   -------------------------------------------------------------------------- */
.ai-hero-banner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: clamp(1.75rem, 4vw, 3rem);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.ai-banner-content h3 { font-size: var(--step-2); margin-bottom: 0.9rem; text-wrap: balance; }
.ai-banner-content p { color: var(--text-secondary); line-height: 1.75; margin-bottom: 1.5rem; }

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.9rem 0.35rem 0.65rem;
    margin-bottom: 1.1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-accent);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.ai-badge-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.4s infinite;
}

.ai-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.ai-pill {
    padding: 0.42rem 0.9rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.ai-pill:hover { transform: translateY(-2px); border-color: var(--border-accent); color: var(--text-primary); }

.ai-pill.highlight-pill,
.skill-pill.highlight-pill {
    background: var(--accent-soft);
    border-color: var(--border-accent);
    color: var(--accent);
    font-weight: 600;
}

.ai-pipeline-visual {
    padding: 1.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
}

.pipeline-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border-strong);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pipeline-header svg { color: var(--accent); }

.pipeline-steps { display: flex; flex-direction: column; }

.p-step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-raised);
    transition: border-color var(--t-fast), transform var(--t-fast);
}

.p-step:hover { transform: translateX(4px); border-color: var(--border-accent); }
.p-step.active-step { border-color: var(--border-accent); box-shadow: inset 3px 0 0 var(--accent); }
.p-step.success-step { border-color: color-mix(in srgb, var(--accent-4) 45%, transparent); box-shadow: inset 3px 0 0 var(--accent-4); }

.step-num {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
}

.step-text { display: flex; flex-direction: column; line-height: 1.4; }
.step-text strong { font-size: 0.88rem; font-family: var(--font-heading); }
.step-text span { font-size: 0.78rem; color: var(--text-muted); }

.p-step-arrow {
    align-self: center;
    padding: 0.15rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.ai-card { padding: 1.75rem 1.5rem; }
.ai-card:hover { transform: translateY(-5px); border-color: var(--border-accent); }

.ai-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1.1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid var(--border-accent);
    color: var(--accent);
}

.ai-card h4 { font-size: 1.02rem; margin-bottom: 0.55rem; }
.ai-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }

/* --------------------------------------------------------------------------
   12. Experience Timeline
   -------------------------------------------------------------------------- */
.timeline {
    position: relative;
    max-width: 62rem;
    margin: 0 auto;
    padding-left: 2.25rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 7px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    top: 1.85rem;
    left: -2.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    transition: transform var(--t-normal);
}

.timeline-item:hover .timeline-dot { transform: scale(1.25); }

.timeline-content { padding: 1.75rem; }
.timeline-content:hover { transform: translateX(5px); border-color: var(--border-accent); }

.timeline-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.role-title { font-size: var(--step-1); margin-bottom: 0.25rem; }
.company-name { font-size: 0.88rem; font-weight: 500; color: var(--accent); }
.role-period { flex-shrink: 0; }

.role-highlights { list-style: none; display: grid; gap: 0.6rem; }

.role-highlights li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.role-highlights li::before {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.role-tech-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.25rem; }

.tag {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: color var(--t-fast), border-color var(--t-fast);
}

.tag:hover { color: var(--accent); border-color: var(--border-accent); }

/* --------------------------------------------------------------------------
   13. Case Studies
   -------------------------------------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 1.9rem 1.75rem;
}

.project-card:hover { transform: translateY(-6px); border-color: var(--border-accent); box-shadow: var(--shadow-lg); }

.project-tag {
    align-self: flex-start;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.1rem;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    border: 1px solid var(--border-accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-title { font-size: var(--step-1); margin-bottom: 0.7rem; text-wrap: balance; }
.project-summary { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 1.4rem; }

.project-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.75rem;
    padding: 1rem 0;
    margin: auto 0 1.4rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.p-metric { display: flex; flex-direction: column; gap: 0.1rem; }

.p-metric-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.p-metric-lbl { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }

.open-modal-btn { align-self: flex-start; }

/* --------------------------------------------------------------------------
   14. Skills
   -------------------------------------------------------------------------- */
.skills-filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.skills-tab {
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}

.skills-tab:hover { color: var(--text-primary); border-color: var(--border-strong); transform: translateY(-2px); }

.skills-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.skills-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.skill-category-block {
    padding: 1.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    background-image: var(--gradient-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
    transition: opacity var(--t-normal), transform var(--t-normal), border-color var(--t-normal);
}

.skill-category-block:hover { border-color: var(--border-accent); }

.skill-category-block.hidden {
    display: none;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.02rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.category-title svg { color: var(--accent); }

.skill-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.skill-pill {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.skill-pill:hover { transform: translateY(-2px); border-color: var(--border-accent); color: var(--text-primary); }

/* --------------------------------------------------------------------------
   15. Education & Certifications
   -------------------------------------------------------------------------- */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
}

.column-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: var(--step-1);
    margin-bottom: 1.4rem;
}

.column-title svg { color: var(--accent); }

.edu-card {
    position: relative;
    padding: 1.6rem;
    margin-bottom: 1rem;
}

.edu-card:hover { transform: translateY(-4px); border-color: var(--border-accent); }

.highlight-border {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
}

.edu-badge-rank {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.edu-degree { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; padding-right: 5rem; }
.edu-institution { font-size: 0.9rem; color: var(--accent); font-weight: 500; }
.edu-gpa { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin: 0.35rem 0 0.7rem; }
.edu-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.85rem; }

.cert-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
}

.cert-card:hover { transform: translateY(-3px); border-color: var(--border-accent); }

.cert-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--gradient-primary);
}

.cert-icon.aws { background: linear-gradient(135deg, #ff9900, #e07000); }
.cert-icon.itil { background: linear-gradient(135deg, #10b981, #059669); }
.cert-icon.agile { background: linear-gradient(135deg, #6366f1, #4338ca); }
.cert-icon.psm { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.cert-icon.ms { background: linear-gradient(135deg, #64748b, #334155); }
.cert-icon.sec { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.cert-info { min-width: 0; }
.cert-name { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 600; line-height: 1.35; }
.cert-issuer { font-size: 0.76rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   16. Contact
   -------------------------------------------------------------------------- */
.contact-box {
    padding: clamp(2.25rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    border-radius: var(--radius-lg);
    max-width: 60rem;
    margin: 0 auto;
}

.contact-box .section-title { margin-top: 0.4rem; }

.contact-text {
    max-width: 40rem;
    margin: 1rem auto 2rem;
    color: var(--text-secondary);
    font-size: var(--step-1);
    line-height: 1.7;
    text-wrap: pretty;
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.contact-detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.15rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.contact-detail-item:hover { color: var(--accent); border-color: var(--border-accent); transform: translateY(-2px); }
.contact-detail-item svg { color: var(--accent); flex-shrink: 0; }

.contact-social-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

.kvkk-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    max-width: 44rem;
    margin: 2.25rem auto 0;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: left;
}

.kvkk-notice svg { flex-shrink: 0; margin-top: 0.2rem; color: var(--accent-4); }

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.footer {
    position: relative;
    z-index: 1;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-secondary) 60%, transparent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-left { display: flex; flex-direction: column; gap: 0.2rem; }
.footer-logo { font-family: var(--font-heading); font-weight: 700; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; }

.footer-links a {
    font-size: 0.86rem;
    color: var(--text-secondary);
    transition: color var(--t-fast);
}

.footer-links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   18. Modals
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: color-mix(in srgb, #020617 72%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-normal), visibility var(--t-normal);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    position: relative;
    width: 100%;
    max-width: 46rem;
    max-height: 88vh;
    overflow-y: auto;
    padding: clamp(1.6rem, 4vw, 2.75rem);
    border-radius: var(--radius-lg);
    background-color: var(--surface-solid);
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform var(--t-normal), opacity var(--t-normal);
    overscroll-behavior: contain;
}

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

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.modal-close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

.modal-header { margin-bottom: 1.5rem; }
.modal-header h2 { font-size: var(--step-2); margin-top: 0.8rem; text-wrap: balance; }

.modal-body h4 {
    font-size: 0.78rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 1.6rem 0 0.6rem;
}

.modal-body h4:first-child { margin-top: 0; }
.modal-body p { color: var(--text-secondary); line-height: 1.8; font-size: 0.94rem; }
.modal-body ul { list-style: none; display: grid; gap: 0.6rem; }

.modal-body li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.7;
}

.modal-body li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-4);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   19. Scroll Reveal
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   22. Personal Projects
   -------------------------------------------------------------------------- */
.personal-projects-list {
    display: grid;
    gap: 1.5rem;
    max-width: 68rem;
    margin: 0 auto;
}

.side-project {
    padding: clamp(1.5rem, 3.5vw, 2.75rem);
    /* Grid items default to min-width:auto, which would let the screenshot
       gallery's min-content width stretch the card past the container. */
    min-width: 0;
}

.side-project-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.side-project-store { flex-shrink: 0; }

.side-project-titleline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.side-project-name {
    font-size: var(--step-2);
    letter-spacing: -0.03em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.side-project-year {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
}

.side-project-tagline {
    font-size: var(--step-1);
    color: var(--text-secondary);
    line-height: 1.5;
}

.side-project-role {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
}

.side-project-summary {
    margin: 1.4rem 0 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    line-height: 1.8;
    text-wrap: pretty;
}

.side-project-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.75rem;
}

.detail-block { margin-top: 1.75rem; }
.side-project-detail .detail-block { margin-top: 0; }

.detail-block h4 {
    font-size: 0.76rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.65rem;
}

.detail-block > p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
    text-wrap: pretty;
}

.side-project-highlights {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.6rem 1.5rem;
}

.side-project-highlights li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.side-project-highlights li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-4);
}

/* ---- Screenshot gallery ---- */
.shot-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    min-width: 0;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.shot-gallery::-webkit-scrollbar { height: 6px; }
.shot-gallery::-webkit-scrollbar-track { background: transparent; }
.shot-gallery::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}

.shot {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    scroll-snap-align: start;
    text-align: left;
}

/* Phone-style frame around each screenshot */
.shot-frame {
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--bg-tertiary);
    padding: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--t-normal), border-color var(--t-normal), box-shadow var(--t-normal);
}

.shot-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 640 / 1387;
    object-fit: cover;
    object-position: top center;
    border-radius: calc(var(--radius-md) - 6px);
}

.shot:hover .shot-frame,
.shot:focus-visible .shot-frame {
    transform: translateY(-6px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.shot-caption {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
    transition: color var(--t-fast);
}

.shot:hover .shot-caption { color: var(--text-secondary); }

.side-project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.side-project-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.side-project-note svg { flex-shrink: 0; margin-top: 0.15rem; color: var(--accent-3); }

/* --------------------------------------------------------------------------
   23. Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.5rem, 2vw, 1.5rem);
    padding: clamp(1rem, 4vw, 2.5rem);
    background: color-mix(in srgb, #01040a 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-normal), visibility var(--t-normal);
}

.lightbox.active { opacity: 1; visibility: visible; }

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-height: 100%;
    min-width: 0;
}

.lightbox-figure img {
    max-height: min(80dvh, 900px);
    max-width: 100%;
    width: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: scale(0.96);
    transition: transform var(--t-normal);
}

.lightbox.active .lightbox-figure img { transform: scale(1); }

.lightbox-figure figcaption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    text-wrap: balance;
}

.lightbox-close,
.lightbox-nav {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--text-primary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.lightbox-close:hover,
.lightbox-nav:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.08); }

.lightbox-close {
    position: absolute;
    top: clamp(1rem, 3vw, 2rem);
    right: clamp(1rem, 3vw, 2rem);
    font-size: 1.9rem;
}

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
/* ---- Large desktop: let the layout breathe ---- */
@media (min-width: 1440px) {
    .container { max-width: 1320px; }
}

/* ---- Tablet & below: nav collapses into a slide-in sheet ---- */
@media (max-width: 1080px) {
    .nav-menu {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(86vw, 340px);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.35rem;
        padding: calc(5.5rem + env(safe-area-inset-top)) 1.35rem
                 calc(2rem + env(safe-area-inset-bottom))
                 1.35rem;
        padding-right: calc(1.35rem + env(safe-area-inset-right));
        background: var(--bg-secondary);
        border-left: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform var(--t-normal), visibility var(--t-normal);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .nav-menu.active { transform: translateX(0); visibility: visible; }

    /* 48px tap targets inside the sheet */
    .nav-link {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .mobile-nav-toggle { display: flex; }

    /* LinkedIn button collapses to an icon so the header never wraps */
    .nav-social-btn span { display: none; }
    .nav-social-btn { width: 42px; height: 42px; padding: 0; border-radius: var(--radius-full); }

    .navbar-container { gap: 0.75rem; }
    .education-grid { gap: 2.5rem; }
}

/* ---- Hero stacks; text stays above the code card ---- */
@media (max-width: 900px) {
    .hero-section {
        min-height: auto;
        padding-top: calc(7rem + env(safe-area-inset-top));
    }

    .hero-container { grid-template-columns: 1fr; }
    .hero-content { order: 1; }
    .hero-card-visual { order: 2; perspective: none; }
    .executive-card { transform: none; }
    .executive-card:hover { transform: translateY(-4px); }
    .ai-hero-banner { grid-template-columns: 1fr; }
}

/* ---- Small tablets / large phones ---- */
@media (max-width: 720px) {
    .section-header { margin-bottom: 2.25rem; }

    .about-grid,
    .impact-grid,
    .ai-grid,
    .projects-grid,
    .skills-matrix,
    .cert-grid,
    .education-grid {
        grid-template-columns: 1fr;
    }

    .about-card,
    .ai-card,
    .project-card,
    .skill-category-block,
    .timeline-content { padding: 1.4rem 1.25rem; }

    .impact-card { padding: 1.6rem 1.25rem; }

    /* Filter tabs scroll sideways instead of wrapping into four rows */
    .skills-filter-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.4rem;
        margin-inline: calc(clamp(1.1rem, 4vw, 2rem) * -1);
        padding-inline: clamp(1.1rem, 4vw, 2rem);
    }

    .skills-filter-container::-webkit-scrollbar { display: none; }
    .skills-tab { flex: 0 0 auto; scroll-snap-align: start; }

    .side-project { padding: 1.4rem 1.25rem; }
    .side-project-detail { gap: 0; }
    .side-project-detail .detail-block + .detail-block { margin-top: 1.5rem; }
    .shot-gallery { grid-auto-columns: minmax(150px, 62%); }
}

/* ---- Phones ---- */
@media (max-width: 560px) {
    .hero-badge { font-size: 0.74rem; padding: 0.35rem 0.75rem 0.35rem 0.6rem; }
    .hero-actions { gap: 0.6rem; }
    .hero-actions .btn { flex: 1 1 100%; }

    .hero-quick-info { flex-direction: column; gap: 0.55rem; }

    .timeline { padding-left: 1.6rem; }
    .timeline::before { left: 5px; }
    .timeline-dot { left: -1.6rem; width: 13px; height: 13px; top: 1.6rem; }
    .timeline-content:hover { transform: none; }
    .timeline-header { flex-direction: column; }

    .card-footer-stats { grid-template-columns: 1fr; }
    .mini-stat:nth-child(odd) { border-right: none; }
    .mini-stat + .mini-stat { border-top: 1px solid var(--border); }
    .card-body { padding: 1.1rem 1rem; }
    .code-block { font-size: 0.7rem; line-height: 1.9; }

    .project-metrics { grid-template-columns: repeat(2, 1fr); }
    .open-modal-btn { align-self: stretch; }

    .contact-details { flex-direction: column; align-items: stretch; }
    .contact-detail-item { justify-content: center; }
    .contact-social-buttons .btn { flex: 1 1 100%; }

    .footer-container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }

    .edu-degree { padding-right: 0; }
    .edu-badge-rank { position: static; display: inline-block; margin-bottom: 0.6rem; }

    .modal-container {
        max-height: 92dvh;
        padding: 1.35rem 1.15rem calc(1.35rem + env(safe-area-inset-bottom));
    }

    .p-step { padding: 0.65rem 0.75rem; }
    .step-text strong { font-size: 0.84rem; }

    .shot-gallery { grid-auto-columns: minmax(140px, 72%); }
    .lightbox { padding: 1rem 0.75rem; gap: 0.35rem; }
    .lightbox-close, .lightbox-nav { width: 42px; height: 42px; }
    .lightbox-figure img { max-height: 72dvh; }
}

/* ---- Very small phones (iPhone SE and similar) ---- */
@media (max-width: 380px) {
    .logo-text { display: none; }
    .project-metrics { grid-template-columns: 1fr; }
    .cert-card { gap: 0.7rem; padding: 0.75rem 0.85rem; }
    .cert-icon { width: 38px; height: 38px; font-size: 0.65rem; }
    .skill-pill, .ai-pill { font-size: 0.75rem; }
}

/* ---- Phones held sideways: the hero must not eat the whole screen ---- */
@media (max-height: 520px) and (orientation: landscape) {
    .hero-section { min-height: auto; padding-top: 6.5rem; padding-bottom: 3rem; }
    .nav-menu { padding-top: 4.5rem; }
    .modal-container { max-height: 94dvh; }
}

/* ---- Touch devices: no hover lift, comfortable targets ---- */
@media (hover: none) {
    .btn:hover,
    .glass-panel:hover,
    .about-card:hover,
    .impact-card:hover,
    .ai-card:hover,
    .project-card:hover,
    .edu-card:hover,
    .cert-card:hover,
    .skills-tab:hover,
    .skill-pill:hover,
    .ai-pill:hover,
    .timeline-content:hover,
    .p-step:hover,
    .contact-detail-item:hover,
    .executive-card:hover,
    .shot:hover .shot-frame {
        transform: none;
    }

    .btn { min-height: 44px; }
    .skills-tab { min-height: 44px; }
    .modal-close { width: 44px; height: 44px; }
}

/* --------------------------------------------------------------------------
   21. Motion & Print Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .reveal { opacity: 1; transform: none; }
    .executive-card { transform: none; }
}

@media print {
    .navbar-header, .bg-glow, .scroll-progress, .skip-link,
    .hero-card-visual, .modal-overlay, .skills-filter-container { display: none !important; }

    body { background: #fff; color: #000; }
    .glass-panel, .skill-category-block { box-shadow: none; border: 1px solid #ddd; background: #fff; }
    .section { padding: 1.5rem 0; break-inside: avoid; }
}
