/* ==========================================================================
   PORTFOLIO — "Engineering Blueprint" design system
   Ink canvas · schematic grid · editorial serif headlines · mono telemetry
   Every token below can be overridden from the ⚙ Config sheet (THEME block).
   ========================================================================== */

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

:root {
    /* ── Surface ─────────────────────────────────────────── */
    --bg: #08090B;
    --bg-2: #0C0E11;
    --surface: #101317;
    --surface-2: #161A1F;
    --line: #23282F;
    --line-soft: #1A1E24;

    /* ── Ink ─────────────────────────────────────────────── */
    --text: #ECEAE4;
    --muted: #949AA3;
    --faint: #5F656E;

    /* ── Accent ──────────────────────────────────────────── */
    --accent: #C9F24D;
    --accent-ink: #0A0D06;
    --accent-dim: rgba(201, 242, 77, .12);
    --accent-line: rgba(201, 242, 77, .32);
    --accent-2: #FF7A45;
    --accent-2-dim: rgba(255, 122, 69, .12);

    /* ── Semantic ────────────────────────────────────────── */
    --ok: #4ADE80;
    --warn: #FBBF24;
    --err: #F87171;

    /* ── Type ────────────────────────────────────────────── */
    --ff-display: 'Instrument Serif', 'Times New Roman', serif;
    --ff-sans: 'Sora', system-ui, sans-serif;
    --ff-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* ── Shape ───────────────────────────────────────────── */
    --r-xs: 4px;
    --r-sm: 8px;
    --r: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* ── Rhythm ──────────────────────────────────────────── */
    --shell: 1220px;
    --gut: clamp(1.1rem, 4vw, 2.6rem);
    --sec-y: clamp(4.5rem, 9vw, 8.5rem);

    /* ── Depth ───────────────────────────────────────────── */
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --sh: 0 18px 44px -20px rgba(0, 0, 0, .85);
    --sh-lg: 0 40px 90px -40px rgba(0, 0, 0, .95);

    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Light mode — set "Theme Mode: light" in the Config sheet */
[data-theme="light"] {
    --bg: #F7F6F2;
    --bg-2: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F1EFE9;
    --line: #E1DED5;
    --line-soft: #EDEAE3;
    --text: #14161A;
    --muted: #5D636C;
    --faint: #8B919A;
    --accent: #4C7A0B;
    --accent-ink: #FFFFFF;
    --accent-dim: rgba(76, 122, 11, .10);
    --accent-line: rgba(76, 122, 11, .28);
    --sh: 0 18px 40px -24px rgba(20, 22, 26, .28);
    --sh-lg: 0 40px 80px -44px rgba(20, 22, 26, .35);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ff-sans);
    font-size: 15.5px;
    font-weight: 300;
    line-height: 1.65;
    letter-spacing: -.005em;
    overflow-x: hidden;
    /* clip does not create a scroll container, which keeps Lenis happy.
       Browsers without support fall back to the hidden above. */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.locked {
    overflow: hidden;
}

/* ── Lenis ─────────────────────────────────────────────────────────────
   Only the page scroller is virtualised. Anything marked
   [data-lenis-prevent] (the project panel, the mobile drawer) keeps its
   native scrolling, and Lenis is stopped outright while one is open.
   The usual `iframe { pointer-events: none }` rule from lenis.css is
   deliberately omitted so project videos stay clickable.              */

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

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

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

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 999;
    background: var(--accent);
    color: var(--accent-ink);
    padding: .6rem 1rem;
    border-radius: var(--r-sm);
    font-weight: 600;
}

.skip-link:focus {
    top: 1rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 99px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--faint);
}

/* ==========================================================================
   AMBIENT LAYERS
   ========================================================================== */

.bg-grid,
.bg-glow,
.bg-grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    background-image:
        linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
    opacity: .8;
}

.bg-glow {
    background:
        radial-gradient(52rem 30rem at 78% -8%, var(--accent-dim), transparent 62%),
        radial-gradient(40rem 28rem at 8% 12%, var(--accent-2-dim), transparent 60%);
}

.bg-grain {
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

body.no-grain .bg-grain {
    display: none;
}

.cursor-glow {
    position: fixed;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-dim), transparent 62%);
    transition: opacity .4s var(--ease);
}

body.cursor-on .cursor-glow {
    opacity: 1;
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 120;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .12s linear;
}

/* ==========================================================================
   PRELOADER — instrument boot sequence
   The blueprint language of the page, compressed into one screen: a
   drafting sheet rules itself out, the monogram is struck through a
   scan, telemetry counts up on a ticked rail, then the whole sheet is
   pulled up off the page to hand over to the hero.
   ========================================================================== */

#preloader {
    --pre-lift: cubic-bezier(.65, .02, .2, 1);
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(38rem 24rem at 50% 42%, var(--accent-dim), transparent 66%),
        radial-gradient(30rem 20rem at 84% 96%, var(--accent-2-dim), transparent 64%),
        var(--bg);

    /* The lift itself. Visibility is held until the wipe finishes so the
       sheet cannot swallow a click on its way out. */
    clip-path: inset(0 0 0 0);
    /* A held beat, then a sweep. --ease-out is far too front-loaded here:
       it clears 75% of the wipe in its first 200ms and crawls the rest. */
    transition:
        clip-path .85s var(--pre-lift),
        visibility 0s linear .85s;
}

#preloader[hidden] {
    display: none;
}

#preloader.done {
    /* Retracts downward, so the header and hero are uncovered first and the
       last sliver to go is the empty bottom of the fold. */
    clip-path: inset(100% 0 0 0);
    visibility: hidden;
    pointer-events: none;
}

/* A seam of accent light rides the leading edge of the wipe — same
   duration and easing as the clip, so it tracks the cut exactly. */
#preloader::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-2) 70%, transparent);
    box-shadow: 0 0 18px var(--accent-line);
    opacity: 0;
}

#preloader.done::after {
    opacity: 1;
    animation: pre-seam .85s var(--pre-lift) forwards;
}

@keyframes pre-seam {
    from { top: 0; }
    to   { top: 100%; }
}

/* ── Schematic backdrop ───────────────────────────────────────────── */

.pre-grid {
    position: absolute;
    inset: -76px;
    background-image:
        linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: radial-gradient(ellipse 62% 54% at 50% 50%, #000 8%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 62% 54% at 50% 50%, #000 8%, transparent 72%);
    animation: pre-drift 20s linear infinite;
}

/* One full cell of travel, so the loop is seamless. */
@keyframes pre-drift {
    to { transform: translate3d(76px, 76px, 0); }
}

/* ── Corner brackets ──────────────────────────────────────────────── */

.pre-frame span {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    opacity: 0;
    animation: pre-corner .6s var(--ease-out) forwards;
}

.pre-frame span:nth-child(1) {
    top: var(--gut);
    left: var(--gut);
    border-right: 0;
    border-bottom: 0;
    animation-delay: .04s;
}

.pre-frame span:nth-child(2) {
    top: var(--gut);
    right: var(--gut);
    border-left: 0;
    border-bottom: 0;
    animation-delay: .09s;
}

.pre-frame span:nth-child(3) {
    bottom: var(--gut);
    right: var(--gut);
    border-left: 0;
    border-top: 0;
    animation-delay: .14s;
}

.pre-frame span:nth-child(4) {
    bottom: var(--gut);
    left: var(--gut);
    border-right: 0;
    border-top: 0;
    animation-delay: .19s;
}

@keyframes pre-corner {
    from { opacity: 0; transform: scale(.4); }
    to   { opacity: 1; transform: none; }
}

/* Overriding name and delay together, because a forwards-filling
   animation outranks any transition on the same properties. */
#preloader.done .pre-frame span {
    animation: pre-corner-out .5s var(--ease) forwards;
    animation-delay: 0s;
}

@keyframes pre-corner-out {
    to { opacity: 0; transform: scale(1.5); }
}

/* ── Monogram ─────────────────────────────────────────────────────── */

.pre-inner {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2.4rem;
    transition: opacity .32s var(--ease), transform .45s var(--ease);
}

#preloader.done .pre-inner {
    opacity: 0;
    transform: scale(.97);
}

.pre-stage {
    position: relative;
    display: grid;
    place-items: center;
    padding: 1.4rem 2.6rem;
    overflow: hidden;
}

/* Centre rules, drawn outward from the monogram. */
.pre-rule {
    position: absolute;
    background: var(--line);
    opacity: .9;
}

.pre-rule-x {
    left: 0;
    right: 0;
    height: 1px;
    transform: scaleX(0);
    animation: pre-rule-x .8s var(--ease-out) .06s forwards;
}

.pre-rule-y {
    top: 0;
    bottom: 0;
    width: 1px;
    transform: scaleY(0);
    animation: pre-rule-y .8s var(--ease-out) .12s forwards;
}

@keyframes pre-rule-x { to { transform: scaleX(1); } }
@keyframes pre-rule-y { to { transform: scaleY(1); } }

.pre-mark {
    position: relative;
    font-family: var(--ff-display);
    font-size: clamp(3.4rem, 10vw, 5.2rem);
    line-height: 1;
    letter-spacing: .01em;
    color: var(--accent);
    text-shadow: 0 0 46px var(--accent-line);
    /* Struck up from beneath the baseline rather than faded in. */
    clip-path: inset(105% 0 -10% 0);
    animation: pre-strike .8s var(--ease-out) .14s forwards;
}

@keyframes pre-strike {
    from { clip-path: inset(105% 0 -10% 0); }
    to   { clip-path: inset(-25% 0 -10% 0); }
}

/* Scan pass across the monogram. */
.pre-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    top: 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    animation: pre-scan 1.6s var(--ease) .45s infinite;
}

@keyframes pre-scan {
    0%        { top: 0;    opacity: 0; }
    12%       { opacity: .85; }
    58%, 100% { top: 100%; opacity: 0; }
}

/* ── Telemetry ────────────────────────────────────────────────────── */

.pre-meter {
    width: min(320px, 64vw);
    display: grid;
    gap: .65rem;
    opacity: 0;
    animation: pre-rise .6s var(--ease-out) .26s forwards;
}

@keyframes pre-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.pre-read {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--ff-mono);
    font-size: .62rem;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.pre-txt {
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Terminal cursor, so a stalled network still looks alive. */
.pre-txt::after {
    content: "_";
    margin-left: .1em;
    color: var(--accent);
    animation: pre-blink 1.05s steps(1) infinite;
}

@keyframes pre-blink {
    50% { opacity: 0; }
}

.pre-pct {
    color: var(--accent);
    letter-spacing: .12em;
    font-variant-numeric: tabular-nums;
}

.pre-pct b {
    font-weight: 500;
}

/* Ticked rail — a measuring scale, not a loading bar. */
.pre-bar {
    position: relative;
    height: 2px;
    background: var(--line);
}

.pre-tick {
    position: absolute;
    top: 4px;
    width: 1px;
    height: 6px;
    background: var(--line);
}

.pre-bar span {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    width: 0;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    box-shadow: 0 0 14px var(--accent-line);
}

/* Playhead at the leading edge, riding above the rail. */
.pre-bar span::after {
    content: "";
    position: absolute;
    right: 0;
    top: -5px;
    width: 2px;
    height: 12px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

@media (prefers-reduced-motion: reduce) {

    /* The global reduce rule zeroes durations but not delays, which would
       otherwise hold visibility for the full .85s after the clip has gone. */
    #preloader {
        transition-delay: 0s;
    }

    .pre-grid,
    .pre-scan,
    .pre-txt::after {
        animation: none !important;
    }

    .pre-scan {
        opacity: 0;
    }
}

/* ==========================================================================
   LAYOUT PRIMITIVES
   ========================================================================== */

.shell {
    width: min(100% - (var(--gut) * 2), var(--shell));
    margin-inline: auto;
}

main {
    position: relative;
    z-index: 2;
}

.section {
    padding-block: var(--sec-y);
    position: relative;
}

.section+.section {
    border-top: 1px solid var(--line-soft);
}

.sec-head {
    display: grid;
    gap: .9rem;
    margin-bottom: clamp(2.2rem, 4vw, 3.4rem);
    max-width: 62ch;
}

.sec-head.center {
    margin-inline: auto;
    text-align: center;
    justify-items: center;
}

.mono-label {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.mono-label::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--accent-line);
}

.sec-head.center .mono-label::after {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--accent-line);
}

h1,
h2,
h3,
h4 {
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.sec-title {
    font-family: var(--ff-display);
    font-size: clamp(2.1rem, 4.6vw, 3.5rem);
    line-height: 1.05;
}

.sec-title em {
    font-style: normal;
    color: var(--accent);
    font-weight: 700;
}

.sec-sub {
    color: var(--muted);
    font-size: 1rem;
    max-width: 58ch;
}

.eyebrow-num {
    font-family: var(--ff-mono);
    color: var(--faint);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    --btn-bg: transparent;
    --btn-fg: var(--text);
    --btn-bd: var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .85rem 1.5rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    border-radius: var(--r-pill);
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: -.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .3s var(--ease), border-color .3s, background .3s, color .3s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: .82em;
    transition: transform .3s var(--ease);
}

.btn:hover i.fa-arrow-right {
    transform: translateX(3px);
}

.btn-accent {
    --btn-bg: var(--accent);
    --btn-fg: var(--accent-ink);
    --btn-bd: var(--accent);
    font-weight: 600;
}

.btn-accent:hover {
    box-shadow: 0 12px 30px -12px var(--accent-line);
}

.btn-ghost:hover {
    --btn-bd: var(--accent-line);
    background: var(--accent-dim);
}

.btn-sm {
    padding: .58rem 1.1rem;
    font-size: .8rem;
}

.btn-block {
    width: 100%;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color .25s, color .25s, background .25s;
}

.icon-btn:hover {
    border-color: var(--accent-line);
    color: var(--accent);
}

/* ── Card shell with schematic corner ticks ──────────────── */

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    transition: border-color .35s var(--ease), transform .35s var(--ease), background .35s;
}

.card::before,
.card::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid var(--accent);
    opacity: 0;
    transition: opacity .35s var(--ease);
}

.card::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
}

.card::after {
    bottom: -1px;
    right: -1px;
    border-left: 0;
    border-top: 0;
}

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

.card:hover::before,
.card:hover::after {
    opacity: 1;
}

/* ── Pills / tags ────────────────────────────────────────── */

.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .34rem .72rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .04em;
    color: var(--muted);
    white-space: nowrap;
}

.pill.accent {
    border-color: var(--accent-line);
    background: var(--accent-dim);
    color: var(--accent);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* ── Reveal on scroll ────────────────────────────────────── */

[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
    transition-delay: var(--d, 0ms);
}

[data-reveal].in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   HEADER + NAV
   ========================================================================== */

#site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    padding-block: .9rem;
    transition: background .4s var(--ease), border-color .4s, padding .4s;
    border-bottom: 1px solid transparent;
}

#site-header.stuck {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom-color: var(--line-soft);
    padding-block: .55rem;
}

.nav-shell {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-shrink: 0;
    margin-right: auto;
    /* ⬅️ Pushes everything to the right */
}

.brand-mark {
    /* width: 38px;
    height: 38px; */
    width: 80px;
    height: auto;
    display: grid;
    place-items: center;
    /* border: 1px solid var(--accent-line); */
    border-radius: var(--r-sm);
    /* background: var(--accent-dim); */
    color: var(--accent);
    font-family: var(--ff-mono);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: -.03em;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text {
    /* display: grid; */
    display: none;
    line-height: 1.15;
}

.brand-name {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.brand-sub {
    font-family: var(--ff-mono);
    font-size: .6rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-left: auto;
}

.nav-links a {
    position: relative;
    padding: .5rem .85rem;
    font-size: .87rem;
    color: var(--muted);
    border-radius: var(--r-sm);
    transition: color .25s;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: .85rem;
    right: .85rem;
    bottom: .28rem;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after,
.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
    /* ⬅️ Ensures nav-right stays on the right */
}

.status-chip {
    /* display: inline-flex; */
    display: none;
    align-items: center;
    gap: .45rem;
    padding: .4rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font-family: var(--ff-mono);
    font-size: .66rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 var(--ok);
    animation: ping 2.4s infinite;
}

@keyframes ping {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, .5);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    margin-left: auto;
    /* ⬅️ Pushes burger to the right */
}

.nav-burger span {
    width: 17px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .3s;
}

/* ── Drawer ──────────────────────────────────────────────── */

.drawer-veil {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .35s var(--ease);
}

.drawer-veil.show {
    opacity: 1;
}

#drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    width: min(86vw, 340px);
    background: var(--bg-2);
    border-left: 1px solid var(--line);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    transform: translateX(100%);
    transition: transform .45s var(--ease-out);
}

#drawer.show {
    transform: none;
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-links {
    display: grid;
    gap: .1rem;
}

.drawer-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .95rem .2rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1.05rem;
    color: var(--muted);
    transition: color .25s, padding-left .25s;
}

.drawer-links a:hover {
    color: var(--accent);
    padding-left: .6rem;
}

.drawer-links a span.idx {
    font-family: var(--ff-mono);
    font-size: .62rem;
    color: var(--faint);
}

.drawer-foot {
    margin-top: auto;
    display: grid;
    gap: 1rem;
}

.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.social-row a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--muted);
    transition: all .3s var(--ease);
}

.social-row a:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-dim);
    transform: translateY(-3px);
}

/* ==========================================================================
   HERO
   ========================================================================== */

#hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-block: clamp(7rem, 14vh, 10rem) clamp(3rem, 8vh, 5rem);
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--ff-mono);
    font-size: .7rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--accent);
    padding: .45rem .9rem;
    border: 1px solid var(--accent-line);
    border-radius: var(--r-pill);
    background: var(--accent-dim);
    margin-bottom: 1.6rem;
}

.hero h1 {
    font-family: var(--ff-display);
    font-size: clamp(2.7rem, 7.2vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.03em;
    margin-bottom: 1.4rem;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
    position: relative;
    font-weight: 700;
    font-size: 1em;
}

.hero-sub {
    color: var(--muted);
    font-size: clamp(.98rem, 1.4vw, 1.1rem);
    max-width: 52ch;
    margin-bottom: 2.2rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-bottom: 2.6rem;
}

.hero-trust {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line-soft);
}

.avatars {
    display: flex;
}

.avatars img,
.avatars .av-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg);
    margin-left: -12px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-family: var(--ff-mono);
    font-size: .62rem;
    color: var(--muted);
}

.avatars>*:first-child {
    margin-left: 0;
}

.trust-txt {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.45;
}

.trust-txt strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Terminal card ───────────────────────────────────────── */

.term {
    background: linear-gradient(160deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    overflow: hidden;
    position: relative;
}

.term::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, var(--accent-dim));
    pointer-events: none;
    opacity: .5;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.term-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line);
}

.term-dot:nth-child(1) {
    background: #FF5F57;
}

.term-dot:nth-child(2) {
    background: #FEBC2E;
}

.term-dot:nth-child(3) {
    background: #28C840;
}

.term-title {
    margin-left: auto;
    font-family: var(--ff-mono);
    font-size: .66rem;
    color: var(--faint);
    letter-spacing: .05em;
}

.term-body {
    padding: 1.2rem 1.15rem 1.5rem;
    font-family: var(--ff-mono);
    font-size: .78rem;
    line-height: 2;
    min-height: 190px;
}

.term-line {
    display: flex;
    gap: .6rem;
    color: var(--muted);
    opacity: 0;
    transform: translateY(6px);
    animation: termIn .5s var(--ease-out) forwards;
}

.term-line .p {
    color: var(--accent);
}

.term-line b {
    color: var(--text);
    font-weight: 500;
}

@keyframes termIn {
    to {
        opacity: 1;
        transform: none;
    }
}

.term-caret {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: var(--accent);
    vertical-align: -2px;
    animation: blink 1.05s steps(2) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 1.6rem;
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    gap: .5rem;
    font-family: var(--ff-mono);
    font-size: .6rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--faint);
}

.scroll-hint span.rail {
    width: 1px;
    height: 42px;
    background: linear-gradient(var(--accent), transparent);
    animation: railDrop 2s var(--ease) infinite;
}

@keyframes railDrop {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* ==========================================================================
   STATS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    overflow: hidden;
}

.stat {
    background: var(--bg);
    padding: clamp(1.4rem, 3vw, 2.1rem);
    display: grid;
    gap: .35rem;
    transition: background .35s var(--ease);
    position: relative;
}

.stat:hover {
    background: var(--surface);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--faint);
}

.stat-top i {
    font-size: .95rem;
    color: var(--accent);
}

.stat-delta {
    font-family: var(--ff-mono);
    font-size: .64rem;
    padding: .18rem .45rem;
    border-radius: var(--r-xs);
    background: var(--accent-dim);
    color: var(--accent);
}

.stat-delta.down {
    background: var(--accent-2-dim);
    color: var(--accent-2);
}

.stat-val {
    font-family: var(--ff-display);
    font-size: clamp(2.1rem, 4.4vw, 3rem);
    line-height: 1;
    letter-spacing: -.02em;
    font-weight: 700;
}

.stat-lbl {
    font-size: .88rem;
    font-weight: 500;
}

.stat-sub {
    font-family: var(--ff-mono);
    font-size: .66rem;
    color: var(--faint);
    letter-spacing: .04em;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.about-media {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
}

.about-media img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    filter: grayscale(.35) contrast(1.05);
    transition: filter .6s var(--ease), transform .8s var(--ease);
}

.about-media:hover img {
    filter: none;
    transform: scale(1.03);
}

.about-media figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem 1.2rem 1.1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, .88));
    display: grid;
    gap: .15rem;
}

.about-media .nm {
    font-family: var(--ff-display);
    font-size: 1.5rem;
    color: #fff;
}

.about-media .rl {
    font-family: var(--ff-mono);
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}

.about-body h3 {
    font-family: var(--ff-display);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin-bottom: 1.1rem;
}

.about-body p {
    color: var(--muted);
    margin-bottom: 1rem;
    max-width: 62ch;
}

.about-body p strong {
    color: var(--text);
    font-weight: 500;
}

.about-marks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .8rem;
    margin: 1.8rem 0;
}

.about-mark {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: .85rem;
}

.about-mark i {
    color: var(--accent);
    margin-top: .2rem;
}

/* ==========================================================================
   VIDEO
   ========================================================================== */

.video-frame {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--sh-lg);
    aspect-ratio: 16/9;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ==========================================================================
   SKILLS
   ========================================================================== */

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

.skill-card {
    padding: 1.5rem 1.4rem;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.skill-ico {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    border: 1px solid var(--accent-line);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 1.05rem;
}

.skill-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.skill-items {
    display: grid;
    gap: .45rem;
    list-style: none;
}

.skill-items li {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .84rem;
    color: var(--muted);
}

.skill-items li::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.skill-meter {
    height: 3px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
}

.skill-meter span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 1.2s var(--ease-out);
}

/* ── Marquee ─────────────────────────────────────────────── */

.marquee {
    margin-top: 2.6rem;
    border-block: 1px solid var(--line-soft);
    padding-block: 1.1rem;
    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: 2.6rem;
    width: max-content;
    animation: slide 38s linear infinite;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

@keyframes slide {
    to {
        transform: translateX(-50%);
    }
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--ff-mono);
    font-size: .82rem;
    letter-spacing: .04em;
    color: var(--faint);
    white-space: nowrap;
    transition: color .3s;
}

.marquee-item:hover {
    color: var(--accent);
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 2rem;
}

/* display:flex above would otherwise beat the UA's [hidden] rule. */
.filter-row[hidden] {
    display: none;
}

.filter-btn {
    padding: .5rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--muted);
    font-size: .8rem;
    cursor: pointer;
    transition: all .3s var(--ease);
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--accent-line);
}

.filter-btn.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.1rem;
    /* Collapsing the grid shrinks content above the viewport. Without this
       the browser's scroll anchoring tries to compensate and fights the
       deliberate scroll back to the section. */
    overflow-anchor: none;
}

.proj {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    cursor: pointer;
    text-align: left;
    padding: 0;
    background: var(--surface);
    animation: fadeUp .5s var(--ease-out) both;
    color: inherit;
    text-decoration: none;
}

/* The card is an anchor now, so its inner wrappers are spans. */
.proj-thumb,
.proj-body,
.proj .tag-row,
.proj-meta,
.proj-sum {
    display: block;
}

.proj:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

.proj-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-2);
}

.proj-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s var(--ease), filter .5s;
    filter: grayscale(.25);
}

.proj:hover .proj-thumb img {
    transform: scale(1.06);
    filter: none;
}

.proj-thumb .veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 45%, rgba(6, 8, 10, .92));
}

.proj-cat {
    position: absolute;
    top: .8rem;
    left: .8rem;
    z-index: 2;
}

.proj-star {
    position: absolute;
    top: .8rem;
    right: .8rem;
    z-index: 2;
    color: var(--accent);
    font-size: .8rem;
}

.proj-open {
    position: absolute;
    right: .8rem;
    bottom: .8rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: .75rem;
    opacity: 0;
    transform: translateY(8px) rotate(-25deg);
    transition: all .4s var(--ease);
}

.proj:hover .proj-open {
    opacity: 1;
    transform: none;
}

.proj-body {
    padding: 1.2rem 1.25rem 1.35rem;
    display: grid;
    gap: .6rem;
    align-content: start;
}

.proj-body h3 {
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -.015em;
}

.proj-body p,
.proj-sum {
    font-size: .86rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proj .tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.proj-meta {
    display: flex;
}

.proj-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-top: .3rem;
    padding-top: .8rem;
    border-top: 1px solid var(--line-soft);
    font-family: var(--ff-mono);
    font-size: .66rem;
    color: var(--faint);
}

.proj-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    margin-top: 2.4rem;
}

.proj-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 .4rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, currentColor 16%, transparent);
    font-family: var(--ff-mono);
    font-size: .68rem;
    font-weight: 600;
    line-height: 1;
}

#proj-toggle i {
    transition: transform .35s var(--ease);
}

#proj-toggle[data-expanded="true"] i {
    transform: translateY(-1px);
}

#proj-toggle:hover i {
    transform: translateY(2px);
}

#proj-toggle[data-expanded="true"]:hover i {
    transform: translateY(-3px);
}

/* Play badge on cards that carry a Video URL */
.proj-play {
    position: absolute;
    left: .8rem;
    bottom: .8rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .6rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--bg) 62%, transparent);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: var(--ff-mono);
    font-size: .62rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.proj-play i {
    color: var(--accent);
    font-size: .6rem;
}

.empty-note {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--faint);
    font-family: var(--ff-mono);
    font-size: .8rem;
}



/* ==========================================================================
   SERVICES
   ========================================================================== */

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

.svc {
    padding: 1.7rem 1.5rem;
    display: grid;
    gap: 1rem;
    align-content: start;
    overflow: hidden;
}

.svc-num {
    position: absolute;
    top: .8rem;
    right: 1.1rem;
    font-family: var(--ff-display);
    font-size: 2.6rem;
    color: var(--line);
    line-height: 1;
    transition: color .4s var(--ease);
}

.svc:hover .svc-num {
    color: var(--accent-line);
}

.svc-ico {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 1.1rem;
}

.svc h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.svc p {
    font-size: .87rem;
    color: var(--muted);
}

.svc ul {
    display: grid;
    gap: .5rem;
    list-style: none;
    padding-top: .9rem;
    border-top: 1px solid var(--line-soft);
}

.svc ul li {
    display: flex;
    gap: .6rem;
    font-size: .83rem;
    color: var(--muted);
}

.svc ul li i {
    color: var(--accent);
    font-size: .72rem;
    margin-top: .32rem;
}

.svc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding-top: .3rem;
}

.svc-price {
    font-family: var(--ff-mono);
    font-size: .76rem;
    color: var(--accent);
}


/* ==========================================================================
   TESTIMONIALS - SMOOTH SCROLLING CAROUSEL (FULL WIDTH)
   ========================================================================== */

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

.tst {
    padding: 1.6rem 1.5rem;
    display: grid;
    gap: 1.1rem;
    align-content: start;
    position: relative;
    transition: box-shadow 0.5s ease, transform 0.5s ease;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

/* ── Shadow for cards ─────────────────────────────────────── */

.tst {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tst:hover {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(201, 242, 77, 0.06);
    transform: translateY(-4px);
    border-color: var(--accent-line);
}

/* ── Scroll container - FULL WIDTH ────────────────────────── */

.tst-scroll-container {
    overflow: hidden;
    width: 100vw;
    /* ⬅️ Full viewport width */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0.5rem 0;
}

.tst-scroll-track {
    display: flex;
    gap: 1.1rem;
    width: max-content;
    will-change: transform;
    animation: tstScroll 120s linear infinite;
    padding: 0 2rem;
}

.tst-scroll-track:hover {
    animation-play-state: paused;
}

.tst-scroll-track .tst {
    min-width: 340px;
    max-width: 400px;
    flex-shrink: 0;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.6s ease, border-color 0.4s ease;
}

.tst-scroll-track .tst:hover {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7), 0 0 80px rgba(201, 242, 77, 0.08);
}

/* ── Fade edges - FULL WIDTH ──────────────────────────────── */

.tst-scroll-container::before,
.tst-scroll-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 180px;
    /* ⬅️ Wider fade for full width */
    z-index: 2;
    pointer-events: none;
}

.tst-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
}

.tst-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
}

@keyframes tstScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ── Quote mark ───────────────────────────────────────────── */

.tst .quote-mark {
    font-family: var(--ff-display);
    font-size: 3.6rem;
    line-height: 0.6;
    color: var(--accent);
    opacity: 0.3;
    text-shadow: 0 4px 30px rgba(201, 242, 77, 0.12);
    transition: opacity 0.4s ease, text-shadow 0.4s ease;
}

.tst:hover .quote-mark {
    opacity: 0.5;
    text-shadow: 0 8px 50px rgba(201, 242, 77, 0.2);
}

/* ── Testimonial text ────────────────────────────────────── */

.tst blockquote {
    font-size: 0.93rem;
    color: var(--text);
    font-weight: 300;
    line-height: 1.7;
}

/* ── Author info ─────────────────────────────────────────── */

.tst-foot {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}

.tst-foot img,
.tst-foot .av-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.tst-who {
    display: grid;
    line-height: 1.35;
}

.tst-who b {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.tst-who span {
    font-size: 0.75rem;
    color: var(--faint);
}

/* ── Stars ────────────────────────────────────────────────── */

.stars {
    margin-left: auto;
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
    text-shadow: 0 0 30px rgba(201, 242, 77, 0.08);
    transition: text-shadow 0.4s ease;
    display: inline-flex;
    gap: .18em;
    align-items: center;
}

/* .proj-star is absolutely positioned on a project thumbnail — undo that
   here so the same icon can be reused for ratings. */
.stars .proj-star {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    font-size: inherit;
    color: inherit;
}

.tst:hover .stars {
    text-shadow: 0 0 50px rgba(201, 242, 77, 0.2);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .tst-scroll-container::before,
    .tst-scroll-container::after {
        width: 120px;
    }
}

@media (max-width: 720px) {
    .tst-scroll-track {
        gap: 1.1rem;
        animation-duration: 90s;
        padding: 0 1rem;
    }

    .tst-scroll-track .tst {
        min-width: 280px;
        max-width: 320px;
    }

    .tst-scroll-container::before,
    .tst-scroll-container::after {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .tst-scroll-track {
        gap: 1rem;
        animation-duration: 70s;
        padding: 0 0.5rem;
    }

    .tst-scroll-track .tst {
        min-width: 240px;
        max-width: 280px;
    }

    .tst-scroll-container::before,
    .tst-scroll-container::after {
        width: 50px;
    }

    @keyframes tstScroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(-50%);
        }
    }
}


/* ==========================================================================
   EXPERIENCE TIMELINE
   ========================================================================== */

.tl {
    display: grid;
    gap: 0;
    position: relative;
    padding-left: 1.6rem;
}

.tl::before {
    content: "";
    position: absolute;
    left: 5px;
    top: .6rem;
    bottom: .6rem;
    width: 1px;
    background: linear-gradient(var(--accent-line), var(--line-soft));
}

.tl-item {
    position: relative;
    padding: 0 0 1.9rem .4rem;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: -1.6rem;
    top: .55rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
}

.tl-when {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.tl-item h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: .3rem;
}

.tl-org {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: .5rem;
}

.tl-item p {
    font-size: .86rem;
    color: var(--muted);
    max-width: 68ch;
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-wrap {
    display: grid;
    gap: .6rem;
    max-width: 880px;
    margin-inline: auto;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .3s;
}

.faq-item.open {
    border-color: var(--accent-line);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.3rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-size: .96rem;
    font-weight: 500;
    letter-spacing: -.01em;
}

.faq-q .qn {
    font-family: var(--ff-mono);
    font-size: .68rem;
    color: var(--accent);
    flex-shrink: 0;
}

.faq-q .chev {
    margin-left: auto;
    color: var(--faint);
    font-size: .8rem;
    transition: transform .35s var(--ease), color .3s;
}

.faq-item.open .chev {
    transform: rotate(180deg);
    color: var(--accent);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .45s var(--ease);
}

.faq-a p {
    padding: 0 1.3rem 1.3rem 3.2rem;
    color: var(--muted);
    font-size: .89rem;
}

.faq-cta {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px dashed var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    display: grid;
    gap: .7rem;
    justify-items: center;
}

.faq-cta h3 {
    font-family: var(--ff-display);
    font-size: 1.6rem;
}

.faq-cta p {
    color: var(--muted);
    font-size: .9rem;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: clamp(1.6rem, 4vw, 3.4rem);
    align-items: start;
}

.contact-info {
    display: grid;
    gap: 1.4rem;
    align-content: start;
}

.contact-info h3 {
    font-family: var(--ff-display);
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
}

.contact-info>p {
    color: var(--muted);
    font-size: .93rem;
    max-width: 48ch;
}

.contact-lines {
    display: grid;
    gap: .55rem;
}

.contact-line {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    transition: all .3s var(--ease);
}

a.contact-line:hover {
    border-color: var(--accent-line);
    transform: translateX(4px);
}

.contact-line i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--r-xs);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: .82rem;
    flex-shrink: 0;
}

.contact-line span {
    display: grid;
    line-height: 1.3;
}

.contact-line .k {
    font-family: var(--ff-mono);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
}

.contact-line .v {
    font-size: .88rem;
}

.why-list {
    display: grid;
    gap: .6rem;
    list-style: none;
}

.why-list li {
    display: flex;
    gap: .7rem;
    font-size: .86rem;
    color: var(--muted);
}

.why-list li i {
    color: var(--accent);
    margin-top: .28rem;
    font-size: .78rem;
}

/* ── Form ────────────────────────────────────────────────── */

.form-card {
    padding: clamp(1.4rem, 3vw, 2.1rem);
    display: grid;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field {
    display: grid;
    gap: .4rem;
}

.field label {
    font-family: var(--ff-mono);
    font-size: .64rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
}

.field label .req {
    color: var(--accent-2);
}

.field input,
.field select,
.field textarea {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: .8rem .95rem;
    font-size: .9rem;
    font-family: var(--ff-sans);
    font-weight: 300;
    transition: border-color .25s, background .25s;
    width: 100%;
}

.field textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.6;
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23949AA3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    background-size: 15px;
    padding-right: 2.2rem;
    cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--faint);
}

.field.bad input,
.field.bad select,
.field.bad textarea {
    border-color: var(--err);
}

.form-note {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .76rem;
    color: var(--faint);
    font-family: var(--ff-mono);
}

.form-note i {
    color: var(--accent);
}

.form-done {
    display: grid;
    justify-items: center;
    gap: .8rem;
    text-align: center;
    padding: 2.6rem 1rem;
}

.form-done .tick {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 1.3rem;
}

.form-done h3 {
    font-family: var(--ff-display);
    font-size: 1.7rem;
}

.form-done p {
    color: var(--muted);
    font-size: .89rem;
    max-width: 40ch;
}

.form-done .ref {
    font-family: var(--ff-mono);
    font-size: .74rem;
    color: var(--accent);
    padding: .4rem .8rem;
    border: 1px dashed var(--accent-line);
    border-radius: var(--r-xs);
}

.spin {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

#site-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    padding-block: clamp(2.4rem, 5vw, 3.6rem) 1.4rem;
}

.foot-top {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--line-soft);
}

.foot-brand {
    display: grid;
    gap: .3rem;
}

.foot-brand .fb-name {
    font-family: var(--ff-display);
    font-size: 1.8rem;
}

.foot-brand .fb-tag {
    font-family: var(--ff-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
}

.foot-bot {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.4rem;
    font-family: var(--ff-mono);
    font-size: .68rem;
    color: var(--faint);
    letter-spacing: .04em;
}

.foot-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

/* ==========================================================================
   PROJECT PANEL
   ========================================================================== */

.sheet-veil {
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(3, 5, 7, .8);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .4s var(--ease);
}

.sheet-veil.show {
    opacity: 1;
}

#project-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: min(100vw, 820px);
    background: var(--bg);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform .5s var(--ease-out);
    display: flex;
    flex-direction: column;
}

#project-panel.show {
    transform: none;
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(8px);
    color: var(--text);
    cursor: pointer;
    transition: all .3s var(--ease);
}

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

.panel-scroll {
    overflow-y: auto;
    height: 100%;
}

.pp-hero {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--surface-2);
}

.pp-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-hero .veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 40%, var(--bg));
}

.pp-wrap {
    padding: 0 clamp(1.2rem, 4vw, 2.6rem) 3rem;
    margin-top: -3.5rem;
    position: relative;
}

.pp-head {
    display: grid;
    gap: .8rem;
    margin-bottom: 1.6rem;
}

.pp-head h2 {
    font-family: var(--ff-display);
    font-size: clamp(1.9rem, 4.4vw, 2.9rem);
    line-height: 1.05;
}

.pp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 1.8rem;
}

.pp-fact {
    background: var(--surface);
    padding: .9rem 1rem;
    display: grid;
    gap: .2rem;
}

.pp-fact .k {
    font-family: var(--ff-mono);
    font-size: .6rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
}

.pp-fact .v {
    font-size: .88rem;
    font-weight: 500;
}

.pp-block {
    margin-bottom: 1.7rem;
}

.pp-block h3 {
    font-family: var(--ff-mono);
    font-size: .7rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .8rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.pp-block h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-soft);
}

.pp-block p {
    color: var(--muted);
    font-size: .92rem;
    margin-bottom: .7rem;
}

.pp-list {
    display: grid;
    gap: .55rem;
    list-style: none;
}

.pp-list li {
    display: flex;
    gap: .7rem;
    font-size: .89rem;
    color: var(--muted);
}

.pp-list li i {
    color: var(--accent);
    font-size: .75rem;
    margin-top: .3rem;
}

.pp-steps {
    counter-reset: s;
    display: grid;
    gap: .7rem;
    list-style: none;
}

.pp-steps li {
    counter-increment: s;
    display: flex;
    gap: .8rem;
    font-size: .89rem;
    color: var(--muted);
}

.pp-steps li::before {
    content: counter(s, decimal-leading-zero);
    font-family: var(--ff-mono);
    font-size: .68rem;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    border-radius: var(--r-xs);
    padding: .1rem .35rem;
    height: fit-content;
    flex-shrink: 0;
}

.pp-video {
    margin-top: .2rem;
}

.pp-video-note {
    margin-top: .55rem;
    font-family: var(--ff-mono);
    font-size: .68rem;
    color: var(--faint);
}

.pp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .6rem;
}

.pp-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
}

.pp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line-soft);
}

/* ==========================================================================
   TOAST + TO TOP
   ========================================================================== */

#toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translate(-50%, 20px);
    z-index: 250;
    padding: .85rem 1.3rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--sh-lg);
    font-size: .86rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    opacity: 0;
    transition: all .4s var(--ease-out);
    max-width: min(92vw, 460px);
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

#toast.ok i {
    color: var(--accent);
}

#toast.err i {
    color: var(--err);
}

#to-top {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: all .4s var(--ease);
}

#to-top.show {
    opacity: 1;
    transform: none;
}

#to-top:hover {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1020px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.6rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-media {
        max-width: 380px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .nav-burger {
        display: flex;
        order: 2;
        /* ⬅️ Ensures burger is after the CTA button */
    }

    .status-chip {
        display: none;
    }

    .nav-right {
        margin-left: auto;
        /* ⬅️ Pushes everything to the right */
        gap: 0.4rem;
    }

    #nav-cta {
        order: 1;
        /* ⬅️ CTA button appears before burger */
    }

    .brand {
        margin-right: 0;
        /* ⬅️ Brand stays on the left */
    }
}

@media (max-width: 620px) {
    body {
        font-size: 15px;
    }

    html {
        scroll-padding-top: 78px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-trust {
        gap: .8rem;
    }

    .brand-sub {
        display: none;
    }

    #nav-cta {
        display: none;
        /* ⬅️ Hide CTA on very small screens */
    }

    .nav-burger {
        display: flex;
        order: 1;
        /* ⬅️ Burger is the only thing on the right */
    }

    .nav-right {
        margin-left: auto;
        /* ⬅️ Pushes burger to the right */
    }

    .scroll-hint {
        display: none;
    }

    .marquee-track {
        animation-duration: 26s;
    }

    .pp-wrap {
        margin-top: -2.2rem;
    }

    .faq-a p {
        padding-left: 1.3rem;
    }
}

@media print {

    #site-header,
    #drawer,
    #to-top,
    .bg-grid,
    .bg-glow,
    .bg-grain,
    .cursor-glow {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}



/* ==========================================================================
   ROUTED PAGES  —  /portfolio and /portfolio/<slug>
   ========================================================================== */

/* No hero on these pages, so the first section clears the fixed header. */
.page-top {
    padding-top: calc(var(--sec-y) + 3.4rem);
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.6rem;
    font-family: var(--ff-mono);
    font-size: .72rem;
    color: var(--faint);
}

.crumbs a {
    color: var(--muted);
    transition: color .3s var(--ease);
}

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

.crumbs i {
    font-size: .6rem;
    opacity: .5;
}

.crumbs [aria-current] {
    color: var(--text);
    max-width: 46ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-head {
    max-width: 68ch;
}

.page-head h1 {
    font-family: var(--ff-display);
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 400;
    line-height: 1.06;
    letter-spacing: -.02em;
}

.page-head h1 em {
    color: var(--accent);
    font-style: normal;
}

.page-count {
    color: var(--faint);
}

/* ── Project page ──────────────────────────────────────────────────── */

.pp-hero-page {
    aspect-ratio: 16/8;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    margin: 0 0 2.6rem;
}

.pp-hero-page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pp-body {
    max-width: 76ch;
}

.proj-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3.2rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--line-soft);
}

.pager-link {
    display: grid;
    gap: .4rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    transition: border-color .3s var(--ease), transform .3s var(--ease);
}

.pager-link:hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
}

.pager-link b {
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: -.01em;
}

.pager-link.next {
    text-align: right;
}

@media (max-width: 620px) {
    .proj-pager {
        grid-template-columns: 1fr;
    }

    .pager-link.next {
        text-align: left;
    }
}
