/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
    --bg: #050507;
    --surface: #0a0b0f;
    --card: rgba(255, 255, 255, 0.025);
    --card-hover: rgba(255, 255, 255, 0.045);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f3f4f7;
    --muted: #8c909c;
    --faint: #565a66;

    --accent: #3b6cff;
    --accent-rgb: 59, 108, 255;
    --accent-soft: rgba(var(--accent-rgb), 0.14);

    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --radius: 18px;
    --radius-lg: 28px;
    --header-h: 76px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-accent="violet"]  { --accent: #9d5cff; --accent-rgb: 157, 92, 255; }
[data-accent="pink"]    { --accent: #ff4fa3; --accent-rgb: 255, 79, 163; }
[data-accent="emerald"] { --accent: #20c997; --accent-rgb: 32, 201, 151; }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--accent); color: #fff; }

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

.container { width: min(1180px, 100% - 48px); margin-inline: auto; }
/* Readable by search engines and screen readers, not shown on screen */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.accent { color: var(--accent); }

/* ==========================================================================
   BACKGROUND LAYERS
   ========================================================================== */
#particles {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* Grid that lights up around the cursor */
.bg-grid {
    position: fixed; inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), #000 0%, transparent 70%);
            mask-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), #000 0%, transparent 70%);
}

.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 2px; z-index: 200;
    pointer-events: none;
}
.scroll-progress span {
    display: block; height: 100%;
    width: 100%;
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
    background: linear-gradient(90deg, transparent, var(--accent));
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8);
}

/* ==========================================================================
   BUTTONS & SHARED BITS
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600; font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), 0.7);
}
.btn-primary:hover { box-shadow: 0 14px 40px -10px rgba(var(--accent-rgb), 0.95); }
.btn-ghost {
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
}
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), 0.6); background: var(--accent-soft); }
.btn-block { width: 100%; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.35s, background 0.35s, transform 0.45s var(--ease);
}
.card:hover { border-color: rgba(var(--accent-rgb), 0.35); background: var(--card-hover); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
    padding: 6px 13px;
    font-size: 0.8rem; font-weight: 500;
    color: #d5d8e0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(20px, 4vw, 48px);
    transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
    border-bottom: 1px solid transparent;
}
.header.scrolled {
    background: rgba(5, 5, 7, 0.8);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 800; font-size: 1.35rem;
    letter-spacing: 0.04em;
}
.nav-logo span { color: var(--accent); }

.nav-pills {
    position: relative;
    display: flex; gap: 2px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}
.nav-pill {
    position: relative; z-index: 1;
    padding: 9px 18px;
    font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
    border-radius: 999px;
    transition: color 0.3s;
}
.nav-pill:hover, .nav-pill.active { color: #fff; }
.nav-indicator {
    position: absolute; top: 0; left: 0;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.18);
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.35), inset 0 0 12px rgba(var(--accent-rgb), 0.2);
    transition: transform 0.5s var(--ease), width 0.5s var(--ease), height 0.5s var(--ease);
    pointer-events: none;
}

.nav-resume {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    transition: border-color 0.3s, background 0.3s;
}
.nav-resume:hover { border-color: var(--accent); background: var(--accent-soft); }

.mobile-toggle {
    display: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    position: relative;
}
.mobile-toggle span {
    position: absolute; left: 13px; right: 13px;
    height: 2px; border-radius: 2px;
    background: #fff;
    transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.mobile-toggle span:first-child { top: 17px; }
.mobile-toggle span:last-child { top: 25px; }
.mobile-toggle.active span:first-child { top: 21px; transform: rotate(45deg); }
.mobile-toggle.active span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-drawer {
    position: fixed; inset: 0;
    z-index: 90;
    display: flex; flex-direction: column; justify-content: center; gap: 40px;
    padding: 100px 28px 40px;
    background: rgba(5, 5, 7, 0.96);
    -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}
.mobile-drawer.active { opacity: 1; visibility: visible; }
.mobile-drawer nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-link {
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 800;
    color: var(--faint);
    transition: color 0.3s;
}
.mobile-link.active, .mobile-link:hover { color: #fff; }
.mobile-link.active::after { content: '.'; color: var(--accent); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh; height: 100svh;
    min-height: 680px;
    overflow: hidden;
}

.hero-bg-word {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(5rem, 21vw, 22rem);
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.045);
    pointer-events: none;
    user-select: none;
    will-change: transform, opacity;
}

.hero-portrait {
    position: absolute;
    left: 50%; bottom: 0;
    width: min(46vw, 680px);
    transform: translateX(-50%);
    will-change: transform, opacity;
}
.portrait-inner { position: relative; isolation: isolate; }
.portrait-inner img {
    position: relative;
    width: 100%; height: auto;
    filter: contrast(1.04);
    /* Fade the cut-off shoulders into the page */
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
            mask-image: linear-gradient(to bottom, #000 62%, transparent 98%);
}
/* Glow and ring sit behind the head (head centre ≈ 50% x, 30% y of the photo) */
.portrait-glow {
    position: absolute;
    left: 50%; top: 32%;
    width: 72%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.6), rgba(var(--accent-rgb), 0.18) 55%, transparent 100%);
    filter: blur(24px);
    z-index: -1;
}
.portrait-arc {
    position: absolute;
    left: 50%; top: 32%;
    width: 60%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.25), inset 0 0 40px rgba(var(--accent-rgb), 0.15);
    -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 80%);
            mask-image: linear-gradient(to bottom, #000 35%, transparent 80%);
    z-index: -1;
}

.hero-left {
    position: absolute;
    left: clamp(24px, 6vw, 96px);
    top: 24%;
    max-width: 380px;
    z-index: 2;
    will-change: transform, opacity;
}
.hero-greeting {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 3.6vw, 3.2rem);
    font-weight: 300;
    line-height: 1.1;
}
.greeting-hi { font-weight: 800; }
.greeting-im { color: var(--muted); }
.hero-name {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 4.6vw, 4.2rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-top: 4px;
}
.hero-name .name-last { display: block; color: var(--accent); }
.hero-mobile-roles { display: none; }
.hero-desc {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.98rem;
}

/* Fade-swap rotating words */
.rotator { position: relative; display: grid; color: var(--text); font-weight: 600; }
.rotator .rotating-word, .about-rotator .rotating-word {
    grid-area: 1 / 1;
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), filter 0.45s;
}
.rotating-word.active { opacity: 1; transform: none; filter: none; }
.rotating-word.exit { opacity: 0; transform: translateY(-10px); filter: blur(4px); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-right {
    position: absolute;
    right: clamp(24px, 6vw, 96px);
    bottom: 18%;
    text-align: right;
    z-index: 2;
    will-change: transform, opacity;
}
.role-tag {
    font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.32em; text-transform: uppercase;
    color: var(--accent);
}
.role-main {
    display: flex; flex-direction: column;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-top: 6px;
}

.scroll-hint {
    position: absolute;
    left: 50%; bottom: 26px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-mouse {
    width: 24px; height: 38px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    position: relative;
}
.scroll-wheel {
    position: absolute; top: 7px; left: 50%;
    width: 3px; height: 7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: #fff;
    animation: wheel 1.8s infinite var(--ease);
}
@keyframes wheel {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(12px); }
}
.scroll-text {
    font-size: 0.66rem; font-weight: 600;
    letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--muted);
}

/* Hidden until the intro animation runs (removed if JS/GSAP fails) */
.js-anim [data-intro] { opacity: 0; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { position: relative; padding: clamp(90px, 12vw, 150px) 0; }
.section-head { margin-bottom: clamp(40px, 6vw, 64px); }
.eyebrow {
    display: inline-block;
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.section-sub { color: var(--muted); max-width: 560px; margin-top: 16px; }
.sub-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: clamp(70px, 9vw, 110px) 0 28px;
}

/* ---------- About ---------- */
.about { overflow: hidden; }
.about-bg-word {
    position: absolute;
    top: 120px; right: -4vw;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(5rem, 17vw, 16rem);
    line-height: 1;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
    pointer-events: none;
    user-select: none;
    will-change: transform;
}
.about-top {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(32px, 6vw, 80px);
    align-items: center;
}
.about-photo { position: relative; }
.about-photo::before {
    content: '';
    position: absolute;
    inset: 12% -10% -6%;
    background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.4), transparent 75%);
    filter: blur(30px);
    z-index: -1;
}
.about-photo-frame {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.about-photo-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    transition: transform 1.2s var(--ease);
}
.about-photo:hover .about-photo-frame img { transform: scale(1.04); }
.about-photo-badge {
    position: absolute;
    left: 20px; bottom: 20px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.78rem; font-weight: 600;
    background: rgba(5, 5, 7, 0.72);
    border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
}
.about-photo-badge i { color: var(--accent); }

.about-intro {
    display: flex; align-items: flex-end; gap: clamp(20px, 4vw, 48px);
    flex-wrap: wrap;
}
.about-title {
    font-family: var(--font-display);
    font-size: clamp(3.6rem, 10vw, 7.5rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.03em;
}
.about-rotator {
    display: grid;
    padding-bottom: 14px;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 600;
    color: var(--muted);
    position: relative;
}
.about-rotator::after {
    content: '';
    position: absolute; left: 0; bottom: 4px;
    width: 32px; height: 2px;
    background: var(--accent);
}
.about-bio {
    max-width: 720px;
    margin-top: 36px;
    font-size: clamp(1.02rem, 1.4vw, 1.15rem);
    color: #c3c6cf;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 56px;
}
.focus-card { padding: 26px 22px; }
.focus-card i { font-size: 1.2rem; color: var(--accent); }
.focus-card h3 {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    margin: 16px 0 8px;
}
.focus-card p { color: var(--muted); font-size: 0.9rem; }

.about-quote {
    display: flex; gap: 20px; align-items: flex-start;
    padding: 28px 30px;
    margin-top: 16px;
    border-left: 2px solid var(--accent);
}
.about-quote i { color: var(--accent); font-size: 1.3rem; margin-top: 3px; }
.about-quote p { font-size: 1.05rem; font-style: italic; color: #d5d8e0; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 56px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat { padding: 30px 8px; }
.stat + .stat { border-left: 1px solid var(--border); padding-left: 28px; }
.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}
.stat-label {
    display: block; margin-top: 8px;
    font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--muted);
}

.about-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    margin-top: 64px;
}
.mini-heading {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
}
.mini-heading i { color: var(--accent); }

.bars { display: flex; flex-direction: column; gap: 22px; }
.bar-head { display: flex; justify-content: space-between; font-size: 0.92rem; font-weight: 500; margin-bottom: 9px; }
.bar-head span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar span {
    display: block; height: 100%;
    width: var(--w);
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.4), var(--accent));
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}

.edu-list { display: flex; flex-direction: column; gap: 14px; }
.edu-card { padding: 22px 24px; }
.edu-date { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.edu-card h4 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
.edu-school { display: block; color: #c3c6cf; font-size: 0.92rem; }
.edu-card p { color: var(--muted); font-size: 0.86rem; margin-top: 10px; }

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.skill-card { padding: 28px; }
.skill-card h3 {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--font-display);
    font-size: 1.12rem; font-weight: 700;
    margin-bottom: 18px;
}
.skill-card h3 i { color: var(--accent); width: 20px; text-align: center; }

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.service-card {
    position: relative;
    padding: 30px 26px 32px;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(400px circle at var(--cx, 50%) var(--cy, 0%), rgba(var(--accent-rgb), 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.service-card:hover { transform: translateY(-6px); }
.service-card:hover::before { opacity: 1; }
.service-num {
    position: absolute; top: 22px; right: 24px;
    font-family: var(--font-display);
    font-weight: 800; font-size: 0.9rem;
    color: var(--faint);
}
.service-icon {
    display: grid; place-items: center;
    width: 52px; height: 52px;
    border-radius: 14px;
    font-size: 1.35rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 700;
    line-height: 1.2;
    margin: 22px 0 10px;
}
.service-card p { color: var(--muted); font-size: 0.92rem; }
.service-card ul { margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.service-card li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #d5d8e0; }
.service-card li::before {
    content: ''; flex: none;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* ---------- Projects (expanding cards) ---------- */
.projects {
    display: flex; gap: 12px;
    height: 540px;
}
.project {
    position: relative;
    flex: 1;
    min-width: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: flex 0.7s var(--ease), border-color 0.4s;
    isolation: isolate;
}
.project.active { flex: 5.5; cursor: default; border-color: rgba(var(--accent-rgb), 0.45); }
.project > img {
    position: absolute;
    top: 0; left: 50%;
    width: 560px; max-width: none; height: 100%;
    margin-left: -280px;
    object-fit: cover;
    z-index: -2;
    will-change: transform;
    filter: saturate(0.85) brightness(0.65);
    transform: scale(1.06);
    transition: transform 0.9s var(--ease), filter 0.6s;
}
.project.active > img { transform: scale(1); filter: saturate(1) brightness(0.75); }
.project::after {
    content: '';
    position: absolute; inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(5, 5, 7, 0.97) 0%, rgba(5, 5, 7, 0.86) 40%, rgba(5, 5, 7, 0.35) 68%, rgba(5, 5, 7, 0.1) 100%);
}
.project-spine {
    position: absolute;
    left: 50%; bottom: 28px;
    transform: translateX(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    font-family: var(--font-display);
    font-weight: 700; font-size: 0.95rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
    transition: opacity 0.3s;
}
.project.active .project-spine { opacity: 0; }
.project-body {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: clamp(24px, 3vw, 40px);
    max-width: 640px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s, transform 0.5s var(--ease);
    pointer-events: none;
}
.project.active .project-body {
    opacity: 1; transform: none;
    transition-delay: 0.3s;
    pointer-events: auto;
}
.project-cat {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: #fff;
    background: rgba(5, 5, 7, 0.75);
    border: 1px solid rgba(var(--accent-rgb), 0.6);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}
.project-body h3 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 8px 0 12px;
}
.project-body p { color: #c3c6cf; font-size: 0.95rem; margin-bottom: 18px; }
.project-body .chips li { background: rgba(var(--accent-rgb), 0.16); border-color: rgba(var(--accent-rgb), 0.35); color: #fff; }
.project-link { margin-top: 20px; padding: 11px 20px; font-size: 0.88rem; }

/* ---------- Media carousels (graphic design + video cards) ---------- */
/* Frame on top, text below: the frame takes whatever height the text leaves */
.project-media { display: flex; flex-direction: column; }
.project-media .project-body {
    position: relative;
    flex: none;
    min-width: 300px;
    padding: 16px 24px 22px;
}
.project-media .project-body h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin: 8px 0 12px; }
.project-media.active > img { filter: blur(16px) brightness(0.35); }

.media-carousel {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    margin: 16px 16px 0;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.45s, transform 0.6s var(--ease);
    pointer-events: none;
}
.project.active .media-carousel {
    opacity: 1; transform: none;
    transition-delay: 0.25s;
    pointer-events: auto;
}
.media-track { position: absolute; inset: 0; }
.media-slide {
    position: absolute; inset: 0;
    will-change: transform, opacity;
    display: grid; place-items: center;
    opacity: 0;
    transform: translateX(6%);
    transition: opacity 0.7s var(--ease), transform 0.8s var(--ease);
}
.media-slide.is-active { opacity: 1; transform: none; }
.media-slide.is-leaving { opacity: 0; transform: translateX(-6%); }
/* Blurred copy fills the frame behind the contained image/video */
.media-slide::before {
    content: '';
    position: absolute; inset: -20px;
    background: var(--slide-bg) center / cover no-repeat;
    filter: blur(22px) brightness(0.45) saturate(1.2);
}
.media-slide img, .media-slide video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.media-nav, .media-sound {
    position: absolute;
    z-index: 2;
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(5, 5, 7, 0.6);
    border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.3s, background 0.3s, border-color 0.3s;
}
.media-nav:hover, .media-sound:hover { opacity: 1; background: var(--accent); border-color: var(--accent); }
.media-nav { top: 50%; translate: 0 -50%; }
.media-prev { left: 12px; }
.media-next { right: 12px; }
.media-sound { top: 12px; right: 12px; }
.media-sound[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }

.media-dots {
    position: absolute; z-index: 2;
    left: 50%; bottom: 12px;
    translate: -50% 0;
    display: flex; gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(5, 5, 7, 0.55);
}
.media-dots span {
    width: 6px; height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    transition: width 0.4s var(--ease), background 0.3s;
}
.media-dots span.is-active { width: 20px; background: var(--accent); }

/* ---------- Testimonials ---------- */
.testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.testimonial { padding: 28px; display: flex; flex-direction: column; }
.testimonial > i { color: var(--accent); font-size: 1.2rem; }
.testimonial blockquote { margin: 14px 0 24px; color: #d5d8e0; flex: 1; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; }
.testimonial img {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(var(--accent-rgb), 0.5);
    background: var(--surface);
}
/* Company logos sit in a rounded box instead of a round photo */
.testimonial img.logo { border-radius: 10px; border-color: var(--border-strong); }
.testimonial img.logo-wide {
    width: auto; max-width: 72px;
    height: 38px;
    object-fit: contain;
    background: #000;
}
.testimonial strong { display: block; font-family: var(--font-display); font-weight: 700; }

/* Rotating reviews: every card is as tall as the longest review so swaps never shift the page */
.testimonial { min-height: var(--review-h, auto); }
.testimonial.is-leaving { animation: reviewOut 0.45s ease forwards; pointer-events: none; }
.testimonial.is-entering { animation: reviewIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both; }
.testimonial.is-entering > i { animation: reviewQuote 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
@keyframes reviewOut {
    to { opacity: 0; transform: translateY(-14px) scale(0.96); }
}
@keyframes reviewIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
}
@keyframes reviewQuote {
    from { opacity: 0; transform: scale(0.4) rotate(-20deg); }
}
.testimonial small { color: var(--muted); font-size: 0.82rem; }

/* ---------- Pricing ---------- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: stretch;
}
.plan {
    position: relative;
    display: flex; flex-direction: column;
    padding: 34px 30px;
}
.plan h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.plan-desc { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.plan-price {
    font-family: var(--font-display);
    font-size: 3rem; font-weight: 800;
    letter-spacing: -0.02em;
    margin: 22px 0 6px;
}
.plan-price small {
    font-size: 0.85rem; font-weight: 500;
    color: var(--muted);
    margin-left: 8px;
    letter-spacing: 0;
}
.plan ul {
    display: flex; flex-direction: column; gap: 11px;
    margin: 18px 0 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    flex: 1;
}
.plan li { display: flex; gap: 12px; font-size: 0.92rem; color: #d5d8e0; }
.plan li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 0.78rem;
    color: var(--accent);
    margin-top: 3px;
}
.plan-featured {
    border-color: rgba(var(--accent-rgb), 0.55);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.02) 60%);
    box-shadow: 0 30px 80px -40px rgba(var(--accent-rgb), 0.7);
}
.plan-badge {
    position: absolute; top: -13px; left: 30px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    background: var(--accent);
    color: #fff;
}

/* ---------- FAQ ---------- */
.faq-wrap {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(32px, 5vw, 72px);
    margin-top: clamp(70px, 9vw, 110px);
}
.faq-intro .sub-title { margin-top: 0; margin-bottom: 14px; }
.faq-intro p { color: var(--muted); margin-bottom: 24px; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    transition: border-color 0.3s;
}
.faq-item.open { border-color: rgba(var(--accent-rgb), 0.4); }
.faq-q {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    width: 100%;
    padding: 20px 22px;
    text-align: left;
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 600;
}
.faq-q i { color: var(--accent); font-size: 0.85rem; transition: transform 0.4s var(--ease); flex: none; }
.faq-item.open .faq-q i { transform: rotate(45deg); }
.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease);
}
.faq-a > * {
    overflow: hidden;
    min-height: 0;
    padding: 0 22px;
    color: var(--muted);
    font-size: 0.94rem;
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-item.open .faq-a > p { padding-bottom: 20px; }

/* Answers arrive as a message from Jeniel (markup built in initFaq) */
.faq-a > .faq-msg-wrap { padding: 0 14px; }
.faq-msg {
    position: relative;
    margin: 2px 0 16px;
    padding: 14px 16px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    transform-origin: 30px 0;
}
.msg-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.msg-avatar {
    display: grid; place-items: center;
    width: 30px; height: 30px; flex: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800; font-size: 0.8rem;
}
.msg-from { line-height: 1.25; }
.msg-from strong { display: block; color: #fff; font-family: var(--font-display); font-size: 0.86rem; font-weight: 700; }
.msg-from small { font-size: 0.74rem; color: var(--muted); }
.msg-icon {
    position: relative;
    margin-left: auto;
    color: var(--accent);
    font-size: 0.95rem;
}
/* "New mail" dot on the envelope */
.msg-icon::after {
    content: '';
    position: absolute;
    top: -3px; right: -5px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #ff5d6c;
    box-shadow: 0 0 0 2px var(--bg, #050507);
}
.msg-body { position: relative; }
.msg-text { color: #c3c6cf; }
.msg-typing {
    position: absolute; top: 4px; left: 0;
    display: flex; gap: 5px;
    padding: 9px 12px;
    border-radius: 12px 12px 12px 4px;
    background: rgba(255, 255, 255, 0.06);
    opacity: 0;
}
.msg-typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

@keyframes msgPop {
    0% { opacity: 0; transform: translateY(14px) scale(0.94); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.01); }
    100% { opacity: 1; transform: none; }
}
@keyframes msgTyping {
    0%, 85% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: scale(0.85); }
}
@keyframes msgDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes msgText {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes msgRing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-16deg); }
    40% { transform: rotate(13deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(4deg); }
}
@keyframes msgPing {
    0% { transform: scale(0); }
    60% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
/* Animations only run once the FAQ is on screen (class added in JS) */
.faq.animate .faq-item.open .faq-msg { animation: msgPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }
.faq.animate .faq-item.open .msg-icon { animation: msgRing 0.7s ease 0.45s; }
.faq.animate .faq-item.open .msg-icon::after { animation: msgPing 0.4s ease 0.4s both; }
.faq.animate .faq-item.open .msg-typing { animation: msgTyping 1.1s ease 0.25s both; }
.faq.animate .faq-item.open .msg-typing span { animation: msgDot 0.9s ease-in-out infinite; }
.faq.animate .faq-item.open .msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.faq.animate .faq-item.open .msg-typing span:nth-child(3) { animation-delay: 0.3s; }
.faq.animate .faq-item.open .msg-text { animation: msgText 0.45s cubic-bezier(0.22, 1, 0.36, 1) 1.3s both; }

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}
.contact-info h3 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.contact-info > p { color: var(--muted); margin: 12px 0 28px; }
.contact-list { display: flex; flex-direction: column; gap: 12px; }

/* Social links: small dark tiles, icon only; accent fill on hover */
.socials { margin-top: 26px; }
.socials-label {
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}
.social-links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; }
.social {
    display: grid; place-items: center;
    width: 50px; height: 50px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #0c0d12;
    color: #fff;
    font-size: 1.15rem;
    transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.social:hover, .social:focus-visible {
    transform: translateY(-3px);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 24px -10px rgba(var(--accent-rgb), 0.8);
}
.contact-item { display: flex; align-items: center; gap: 18px; padding: 18px 22px; }
.contact-item i {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex: none;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
}
.contact-item span { font-weight: 600; word-break: break-word; }
.contact-item small {
    display: block;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--muted);
}

.contact-form { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 18px; }
.field label {
    display: block;
    font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.field input, .field textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}
.field.invalid input, .field.invalid textarea { border-color: #ff5d6c; }
.form-feedback { min-height: 1.4em; font-size: 0.9rem; color: var(--muted); text-align: center; }
.form-feedback.error { color: #ff7b87; }

/* ---------- Tools marquee ---------- */
.tools { padding: 20px 0 90px; }
.tools-label {
    text-align: center;
    font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.26em; text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 28px;
}
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex; gap: 14px;
    width: max-content;
    animation: marquee 60s linear infinite;
}
.marquee:hover .marquee-track,
.marquee-track.paused { animation-play-state: paused; }
.marquee-track li {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 22px 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    font-family: var(--font-display);
    font-weight: 600;
    color: #c3c6cf;
    white-space: nowrap;
}
.marquee-track img {
    width: 22px; height: 22px;
    object-fit: contain;
    flex: none;
}
/* Tools without an official logo use a coloured stand-in icon */
.marquee-track li > i {
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
    color: var(--ic, var(--accent));
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 48px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.footer-logo { display: block; }
.footer-logo img { display: block; width: auto; height: 104px; transition: transform 0.4s var(--ease); }
.footer-logo:hover img { transform: scale(1.04); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.3s; }
.footer-links a:hover { color: #fff; }
.footer-copy { color: var(--faint); font-size: 0.84rem; }

/* ---------- Accent switcher ---------- */
.theme-switcher {
    position: fixed; right: 22px; bottom: 22px;
    z-index: 80;
    display: flex; align-items: center; gap: 10px;
}
.theme-toggle {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(15, 16, 22, 0.85);
    border: 1px solid var(--border-strong);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    transition: border-color 0.3s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-swatches {
    display: flex; gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 16, 22, 0.85);
    border: 1px solid var(--border);
    opacity: 0; visibility: hidden;
    transform: translateX(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.4s var(--ease);
}
.theme-switcher.open .theme-swatches { opacity: 1; visibility: visible; transform: none; }
.theme-swatches button {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--sw);
    border: 2px solid transparent;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}
.theme-swatches button:hover { transform: scale(1.12); }
.theme-swatches button[aria-pressed="true"] { border-color: #fff; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    .hero-portrait { width: 44vw; }
    .hero-left { max-width: 30vw; }
}

@media (max-width: 1080px) {
    .nav-pill { padding: 9px 13px; }
    .focus-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
    .nav-pills, .nav-resume { display: none; }
    .mobile-toggle { display: block; }
    .header { z-index: 100; }
}

@media (max-width: 820px) {
    /* Hero stacks: text on top, portrait below */
    .hero {
        height: auto; min-height: 100svh;
        display: flex; flex-direction: column; align-items: center;
        padding-top: calc(var(--header-h) + 28px);
        text-align: center;
    }
    .hero-left { position: relative; left: auto; top: auto; max-width: 520px; padding: 0 20px; order: -1; }
    .hero-name .name-last { display: inline; }
    .hero-mobile-roles {
        display: flex; justify-content: center; align-items: center; gap: 10px;
        margin-top: 14px;
        font-size: 0.74rem; font-weight: 700;
        letter-spacing: 0.18em; text-transform: uppercase;
        color: var(--accent);
    }
    .hero-mobile-roles .dot { color: var(--faint); }
    .hero-cta { justify-content: center; }
    .hero-right, .scroll-hint { display: none; }
    .hero-bg-word { top: 62%; }
    .hero-portrait {
        position: relative; left: auto; bottom: auto;
        transform: none;
        width: min(100vw, 480px);
        margin-top: auto;
        padding-top: 48px;
    }

    .about-top { grid-template-columns: 1fr; }
    .about-photo { max-width: 420px; }

    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3) { border-left: 0; padding-left: 8px; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
    .about-columns, .skills-grid, .contact-grid, .faq-wrap { grid-template-columns: 1fr; }
    .testimonials, .pricing-grid { grid-template-columns: 1fr; }
    .pricing-grid { max-width: 480px; }

    /* Projects become a vertical accordion */
    .projects { flex-direction: column; height: auto; }
    .project { flex: none; height: 92px; transition: height 0.7s var(--ease), border-color 0.4s; }
    .project.active { flex: none; height: 460px; }
    .project > img { left: 0; top: 50%; width: 100%; height: 640px; margin: -320px 0 0; }
    .project-media.active { height: 640px; }
    .project-spine {
        writing-mode: horizontal-tb;
        transform: none;
        left: 24px; bottom: auto; top: 50%;
        translate: 0 -50%;
        font-size: 1.05rem;
    }
}

@media (max-width: 560px) {
    .container { width: calc(100% - 32px); }
    .focus-grid, .services-grid { grid-template-columns: 1fr; }
    .about-quote { padding: 22px; gap: 14px; }
    .stat + .stat { padding-left: 18px; }
    .stat:nth-child(3) { padding-left: 8px; }
    .project.active { height: 520px; }
    .project-media.active { height: 600px; }
    .project-media .project-body { min-width: 0; padding: 14px 18px 18px; }
    .project-body p { font-size: 0.9rem; }
    .theme-switcher { right: 16px; bottom: 16px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
}
