/* ============================================================
   NOCTURNE — Observatory Glass
   Canvas #05060B · aurora teal #5EEAD4 · violet #8B7CF6
   Fraunces (display) · Manrope (body) · JetBrains Mono (labels)
   ============================================================ */

:root {
    --canvas: #05060B;
    --canvas-raised: #0A0C16;
    --teal: #5EEAD4;
    --violet: #8B7CF6;
    --magenta: #F472B6;
    --ink-hi: #EDF0F7;
    --ink-mid: #A6ADC2;
    --ink-low: #7C849C; /* ≥4.5:1 on canvas and on glass fills (WCAG AA at 12px) */
    --line: rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.06);
    --line-top: rgba(255, 255, 255, 0.16);
    --grad: linear-gradient(135deg, #5EEAD4 0%, #8B7CF6 100%);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --wrap: 1200px;
    --pad-card: 40px;
    --pad-card-sm: 32px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    background: var(--canvas);
    color: var(--ink-mid);
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-x: clip;
}

::selection { background: var(--teal); color: var(--canvas); }

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }

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

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mono {
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-low);
}

.eyebrow { margin-bottom: 24px; }

.grad {
    font-style: italic;
    background: linear-gradient(120deg, var(--teal), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-right: 0.06em; /* italic overhang clip guard */
}

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 48px);
}

.wrap--narrow { max-width: 800px; }

.section { padding-block: clamp(96px, 12vw, 160px); position: relative; z-index: 4; }

h1, h2, h3, .pull {
    font-family: "Fraunces", serif;
    font-optical-sizing: auto;
    color: var(--ink-hi);
}

.h2 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 420;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: clamp(40px, 6vw, 72px);
}

.skip {
    position: fixed;
    top: -100px;
    left: 24px;
    z-index: 200;
    background: var(--canvas-raised);
    color: var(--ink-hi);
    padding: 12px 20px;
    border-radius: 8px;
    transition: top 200ms;
}
.skip:focus-visible { top: 24px; }

/* ============================================================
   SIGNATURE SPLASH SCREEN
   ============================================================ */

.loader {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    background:
        radial-gradient(45% 40% at 50% 48%, rgba(139, 124, 246, 0.10), transparent 70%),
        #05060B;
    transition: opacity 700ms ease;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader[hidden] { display: none; } /* author rule so [hidden] actually wins */
html:not(.js) .loader { display: none; } /* never trap no-JS visitors */

/* pure-CSS failsafe: if main.js never runs, don't let the splash block the
   site forever — fade it out after 7s regardless. */
html.js .loader { animation: loaderFailsafe 0.5s linear 7s forwards; }
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }

.loader__sig {
    width: min(82vw, 560px);
    height: auto;
    overflow: visible;
    /* "a bit of glow": soft white ink glow with a faint aurora halo */
    filter: drop-shadow(0 0 8px rgba(237, 240, 247, 0.35))
            drop-shadow(0 0 26px rgba(139, 124, 246, 0.22));
}

/* each letter is a real vector path (extracted from the Sacramento signature
   font) so JS can draw them one at a time, in writing order, via
   stroke-dashoffset — white ink, thin nib */
.loader__name .sig-l {
    fill: #EDF0F7;
    fill-opacity: 0;
    stroke: #EDF0F7;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0; /* JS reveals each letter as its draw starts */
}

@media (prefers-reduced-motion: reduce) {
    /* no drawing — show the finished signature immediately */
    .loader__name .sig-l { opacity: 1; fill-opacity: 1; stroke-dashoffset: 0; }
    html.js .loader { animation: none; }
}

/* ============================================================
   FIXED ATMOSPHERE
   ============================================================ */

.progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 150;
    pointer-events: none;
}

.sky, .stars, .veil {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.sky { z-index: 0; }
.stars { z-index: 1; }
.veil { z-index: 2; }

body::before { /* page depth wash */
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #05060B 0%, #0A0C16 45%, #05060B 100%);
    z-index: -1;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    will-change: transform;
}
.orb--a {
    width: 60vmax; aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(94, 234, 212, 0.16), transparent 70%);
    top: -12%; left: -18%;
    animation: drift-a 87s ease-in-out infinite alternate;
}
.orb--b {
    width: 72vmax; aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(139, 124, 246, 0.14), transparent 70%);
    top: 18%; right: -22%;
    animation: drift-b 121s ease-in-out infinite alternate;
}
.orb--c {
    width: 50vmax; aspect-ratio: 1;
    background: radial-gradient(closest-side, rgba(244, 114, 182, 0.08), transparent 70%);
    bottom: -28%; left: 28%;
    animation: drift-c 149s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(6vw, 4vh) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-5vw, 5vh) scale(1.08); } }
@keyframes drift-c { to { transform: translate(4vw, -5vh) scale(1.1); } }

.stars__layer {
    position: absolute;
    top: 0; left: 0;
    width: 1px; height: 1px;
    background: transparent;
}
.stars__layer--still { opacity: 0.5; }
.stars__layer--twinkle { animation: twinkle 6s ease-in-out infinite alternate; }

@keyframes twinkle { from { opacity: 0.2; } to { opacity: 0.65; } }

.veil {
    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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
}
.veil::after { /* vignette */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 90% at 50% 38%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ============================================================
   GLASS
   ============================================================ */

.glass {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--line);
    border-top-color: var(--line-top);
    border-radius: 24px;
    box-shadow: 0 32px 64px -24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 300ms ease, background 300ms ease, transform 300ms ease;
}

/* specular flashlight sweep (--mx/--my set from JS) */
.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(320px at var(--mx, 50%) var(--my, -40%), rgba(255, 255, 255, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}
.glass:hover::before { opacity: 1; }
.glass:hover {
    border-color: rgba(94, 234, 212, 0.25);
    transform: translateY(-4px);
}

.glass--chip {
    background: rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 6px 14px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mid);
    list-style: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass, .glass--chip, .sheet { background: rgba(13, 15, 26, 0.88); }
    .nav, .nav.is-condensed { background: rgba(10, 12, 22, 0.92); }
}

/* prismatic gradient hairline (teal ↖ / violet ↘) */
.prism::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.5), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.05) 58%, rgba(139, 124, 246, 0.55));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
    padding-inline: 28px;
    background: rgba(10, 12, 22, 0.55);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.5);
    transition: height 300ms var(--ease-out), padding 300ms var(--ease-out), background 300ms ease;
}
.nav.is-condensed {
    height: 48px;
    padding-inline: 22px;
    background: rgba(10, 12, 22, 0.72);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
}

.nav__brand {
    font-family: "Fraunces", serif;
    font-style: italic;
    font-weight: 500;
    font-size: 20px;
    color: var(--ink-hi);
    padding: 8px 4px;
}
.nav__brand span { color: var(--teal); font-size: 14px; vertical-align: super; }

.nav__links { display: flex; gap: 12px; }
.nav__links a {
    position: relative;
    font-weight: 500;
    font-size: 14px;
    color: var(--ink-mid);
    padding: 10px 8px; /* comfortable touch/click target */
    transition: color 200ms;
}
.nav__links a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--teal);
    transform: translateX(-50%) scale(0);
    transition: transform 200ms;
}
.nav__links a:hover { color: var(--ink-hi); }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: translateX(-50%) scale(1); }
.nav__links a.is-active { color: var(--ink-hi); }

.nav__burger {
    display: none;
    width: 44px; height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.nav__burger span {
    display: block;
    width: 16px; height: 1.5px;
    background: var(--ink-hi);
    transition: transform 300ms var(--ease-out), opacity 200ms;
}
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.sheet {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(10, 12, 22, 0.7);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}
.sheet[hidden] { display: none; } /* author-origin rule so [hidden] actually wins */
.sheet.is-open { opacity: 1; pointer-events: auto; }
.sheet nav { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sheet a {
    font-family: "Fraunces", serif;
    font-size: 32px;
    font-weight: 420;
    color: var(--ink-hi);
    padding: 8px 16px;
}
.sheet__motto { margin-top: 40px; text-align: center; padding-inline: 32px; }

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

.hero {
    position: relative;
    min-height: 100svh;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 48px);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: end;
    z-index: 4;
}

.hero__text {
    grid-column: 1 / 9;
    grid-row: 1;
    align-self: center;
    padding-bottom: 10vh;
    position: relative;
    z-index: 3;
}

.hero__title {
    font-size: clamp(3.25rem, 8vw, 6.5rem);
    font-weight: 380;
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 20px 0 28px;
}
.hero__title .mask { display: block; }

.hero__sub {
    max-width: 46ch;
    margin-bottom: 40px;
}

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

.btn {
    display: inline-block;
    padding: 15px 32px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    transition: transform 300ms var(--ease-out), box-shadow 300ms ease, border-color 300ms ease;
    cursor: pointer;
}
.btn--primary {
    background: var(--grad);
    color: var(--canvas);
    border: none;
}
.btn--primary:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 40px -8px rgba(94, 234, 212, 0.35);
}
.btn--ghost {
    border: 1px solid var(--line-top);
    color: var(--ink-hi);
}
.btn--ghost:hover { border-color: rgba(94, 234, 212, 0.4); transform: scale(1.03); }

.hero__portrait {
    grid-column: 8 / 13;
    grid-row: 1;
    align-self: end;
    justify-self: center;
    position: relative;
    z-index: 2;
    /* glow lives on the UNMASKED wrapper: the mask on the img would clip
       these shadows to the image's border box — a visible glowing square */
    filter: drop-shadow(0 0 1px #05060B)
            drop-shadow(0 0 50px rgba(139, 124, 246, 0.35))
            drop-shadow(0 0 110px rgba(94, 234, 212, 0.18));
}
.hero__portrait img {
    /* svh cap for tall screens, vw cap for narrow/square screens, px cap for 4K */
    height: min(86svh, 62vw, 860px);
    width: auto;
    max-width: none;
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* the figure floats transparent on the night sky — no backing shape;
   only a soft silhouette-following rim light keeps the dark suit legible */

.hero__meta {
    position: absolute;
    left: clamp(20px, 4vw, 48px);
    right: clamp(20px, 4vw, 48px);
    bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
    z-index: 5;
}

.hero__pulse { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-mid); }
.hero__pulse i {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--teal);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
    50%      { box-shadow: 0 0 0 7px rgba(94, 234, 212, 0); }
}

.hero__scroll { display: inline-flex; align-items: center; gap: 12px; }
.hero__scroll-line {
    width: 44px; height: 1px;
    background: var(--grad);
    transform-origin: left;
    animation: scrollcue 2.4s ease-in-out infinite;
}
@keyframes scrollcue {
    0%   { transform: scaleX(0); }
    50%  { transform: scaleX(1); }
    100% { transform: scaleX(0); transform-origin: right; }
}

/* hero entrance choreography */
.mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.mask__inner { display: inline-block; }
body.is-loading .mask__inner { transform: translateY(110%); }
body.is-loaded .mask__inner {
    transform: translateY(0);
    transition: transform 900ms var(--ease-out);
}
body.is-loaded .hero__title .mask:nth-child(1) .mask__inner { transition-delay: 90ms; }
body.is-loaded .hero__title .mask:nth-child(2) .mask__inner { transition-delay: 180ms; }
body.is-loaded .hero__sub .mask__inner { transition-delay: 280ms; }

body.is-loading .hero__cta,
body.is-loading .hero__meta { opacity: 0; }
body.is-loaded .hero__cta,
body.is-loaded .hero__meta {
    opacity: 1;
    transition: opacity 900ms ease 450ms;
}
body.is-loading .hero__portrait { opacity: 0; transform: translateY(24px); }
body.is-loaded .hero__portrait {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1100ms var(--ease-out) 200ms, transform 1100ms var(--ease-out) 200ms;
}

/* ============================================================
   01 SIGNAL
   ============================================================ */

.signal__grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: clamp(40px, 5vw, 64px);
    align-items: center;
}

.signal__intro {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-mid);
    margin-bottom: 28px;
    max-width: 54ch;
}
.signal__intro strong { color: var(--ink-hi); font-weight: 600; }

.pull {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.35;
}

.signal__card { padding: var(--pad-card); }

.facts div {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 16px;
    padding-block: 14px;
    border-bottom: 1px solid var(--line-soft);
    align-items: baseline;
}
.facts dt { min-width: 96px; }
.facts div:last-child { border-bottom: none; }
.facts dd { color: var(--ink-hi); font-weight: 500; font-size: 15px; }

/* ============================================================
   02 WORK
   ============================================================ */

.work__featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 48px;
    margin-bottom: 24px;
}
.work__featured-copy { display: flex; flex-direction: column; gap: 16px; }

.work__index { margin-bottom: 4px; }

.work h3 {
    font-family: "Manrope", sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.01em;
    color: var(--ink-hi);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin-top: 8px;
}

.work__visual {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 280px;
    background:
        radial-gradient(80% 90% at 20% 15%, rgba(94, 234, 212, 0.28), transparent 60%),
        radial-gradient(90% 80% at 85% 90%, rgba(139, 124, 246, 0.32), transparent 60%),
        #0A0C16;
    border: 1px solid var(--line-soft);
}
.work__visual svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* second featured: warmer hue mix */
.work__visual--apps {
    background:
        radial-gradient(80% 90% at 80% 10%, rgba(94, 234, 212, 0.26), transparent 60%),
        radial-gradient(90% 80% at 15% 90%, rgba(244, 114, 182, 0.14), transparent 60%),
        radial-gradient(70% 70% at 50% 50%, rgba(139, 124, 246, 0.22), transparent 70%),
        #0A0C16;
}

/* mini visual atop each grid card */
.work__thumb {
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background:
        radial-gradient(90% 100% at 18% 0%, rgba(94, 234, 212, 0.10), transparent 60%),
        radial-gradient(90% 100% at 85% 100%, rgba(139, 124, 246, 0.13), transparent 60%),
        rgba(10, 12, 22, 0.5);
    overflow: hidden;
    margin-bottom: 6px;
}
.work__thumb { height: 150px; }
.work__thumb svg { display: block; width: 100%; height: 100%; }

/* ---- project SVG line-art system ---- */
.psvg { overflow: visible; }
.psvg [class*="sv-"] { stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.psvg [class*="sv-"]:not([fill]) { fill: none; }
.psvg .sv-b { stroke: rgba(237, 240, 247, 0.38); }
.psvg .sv-d { stroke: rgba(237, 240, 247, 0.16); }
.psvg .sv-t { stroke: #5EEAD4; }
.psvg .sv-v { stroke: #8B7CF6; }

.psvg .sv-flow { stroke-dasharray: 3 7; animation: svflow 1.4s linear infinite; }
.psvg .sv-pulse { animation: svpulse 2.4s ease-in-out infinite; }
.psvg .sv-ping { animation: svping 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.psvg .sv-float { animation: svfloat 4.5s ease-in-out infinite alternate; }
.psvg .sv-blink { animation: svblink 2s steps(2, end) infinite; }
.psvg .sv-drawloop { stroke-dasharray: 46; animation: svdrawloop 3.2s ease-in-out infinite; }
.psvg .sv-cursor { animation: svcursor 5s ease-in-out infinite; }
.psvg .sv-load { transform-box: fill-box; transform-origin: left center; animation: svload 2.8s ease-in-out infinite; }
.psvg .sv-drive { animation: svdrive 4.5s ease-in-out infinite; }
.psvg .sv-packet { animation: svpacket 2.2s ease-in infinite; }
.psvg .sv-travelx { animation: svtravelx 2.6s ease-in-out infinite; }
.psvg .sv-fly { animation: svfly 5s ease-in-out infinite; }
.psvg .sv-send { animation: svsend 3.2s ease-in infinite; }
.psvg .svd1 { animation-delay: 0.6s; }
.psvg .svd2 { animation-delay: 1.2s; }
.psvg .svd3 { animation-delay: 1.8s; }

@keyframes svflow { to { stroke-dashoffset: -10; } }
@keyframes svpulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes svping { 0% { transform: scale(0.5); opacity: 0.8; } 100% { transform: scale(2); opacity: 0; } }
@keyframes svfloat { to { transform: translateY(-5px); } }
@keyframes svblink { 50% { opacity: 0.15; } }
@keyframes svdrawloop {
    0%, 15% { stroke-dashoffset: 46; opacity: 1; }
    55%, 85% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes svcursor {
    0%, 100% { transform: translate(0, 0); }
    35% { transform: translate(46px, 14px); }
    70% { transform: translate(14px, 24px); }
}
@keyframes svload { 0%, 100% { transform: scaleX(0.22); } 60%, 75% { transform: scaleX(0.94); } }
@keyframes svdrive {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(140px, 14px); }
    90% { opacity: 1; }
    100% { transform: translate(278px, -4px); opacity: 0; }
}
@keyframes svpacket {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { transform: translate(52px, -20px); opacity: 0; }
}
@keyframes svtravelx {
    0% { transform: translateX(0); opacity: 0; }
    15% { opacity: 0.9; }
    85% { opacity: 0.9; }
    100% { transform: translateX(56px); opacity: 0; }
}
@keyframes svfly {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    12% { opacity: 1; }
    50% { transform: translate(78px, -38px) rotate(4deg); }
    88% { opacity: 1; }
    100% { transform: translate(158px, 0) rotate(10deg); opacity: 0; }
}
@keyframes svsend {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate(88px, -16px); opacity: 0; }
}

/* slow light sweep across featured visuals */
.visual__sweep {
    position: absolute;
    inset: -40%;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.06) 50%, transparent 58%);
    animation: sweep 7s ease-in-out infinite;
    pointer-events: none;
}
@keyframes sweep {
    0%, 55%  { transform: translateX(-45%); }
    85%, 100% { transform: translateX(45%); }
}

/* asymmetric grid: natural flow keeps DOM order = visual order */
.work__grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 24px;
}

.work__card {
    padding: var(--pad-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.work__archive {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
    line-height: 2.1;
}

/* ============================================================
   03 CRAFT
   ============================================================ */

.craft__head { text-align: center; }
.craft__head .h2 { margin-bottom: clamp(24px, 4vw, 48px); }

.craft__svg { width: 100%; height: auto; }

.c-cluster {
    font-family: "Fraunces", serif;
    font-style: italic;
    font-size: 22px;
    fill: var(--ink-hi);
}

.c-lines line {
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 1;
    transition: stroke-dashoffset 1.2s var(--ease-out);
}

.c-nodes circle {
    fill: var(--teal);
    transition: transform 200ms var(--ease-out);
    transform-box: fill-box;
    transform-origin: center;
}
.c-nodes text {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    fill: var(--ink-mid);
    text-anchor: middle;
    transition: fill 200ms;
}
.c-nodes g:hover circle { transform: scale(1.6); }
.c-nodes g:hover text { fill: var(--ink-hi); }

/* per-node twinkle variety */
.c-nodes g:nth-child(3n) circle { opacity: 0.9; animation: nodetwinkle 5s ease-in-out infinite alternate; }
.c-nodes g:nth-child(3n+1) circle { opacity: 0.75; animation: nodetwinkle 7s ease-in-out infinite alternate 1s; }
.c-nodes g:nth-child(3n+2) circle { opacity: 1; animation: nodetwinkle 4s ease-in-out infinite alternate 2s; }
@keyframes nodetwinkle { from { opacity: 0.45; } to { opacity: 1; } }

.craft__chips { display: none; }
.craft__chipgroup { padding: var(--pad-card-sm); margin-bottom: 16px; }
.craft__chipgroup h3 { margin-bottom: 16px; color: var(--teal); }

/* ============================================================
   04 ORBIT — orrery (JS) with stacked-timeline fallback (no-JS)
   ============================================================ */

html.js .orbit__fallback { display: none; }
html:not(.js) .orbit__system { display: none; }

.orbit__system {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.orbit__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.orrery {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1;
}

.orrery__ring {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
    transition: border-color 300ms ease;
    pointer-events: none;
}
.orrery__ring.is-selected { border-color: rgba(94, 234, 212, 0.3); }

.orrery__sun {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 84px; height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.30), rgba(139, 124, 246, 0.14) 55%, transparent 72%);
    z-index: 2;
    pointer-events: none;
}
.orrery__sun span { font-size: 10px; color: var(--ink-mid); }

.orrery__planet {
    position: absolute;
    left: 0; top: 0;
    width: 44px; height: 44px;
    margin: -22px 0 0 -22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 200ms ease;
}
.orrery__planet .dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(237, 240, 247, 0.85);
    box-shadow: 0 0 10px rgba(237, 240, 247, 0.25);
    transition: background 200ms ease, box-shadow 200ms ease;
}
.orrery__planet .lbl {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-low);
    white-space: nowrap;
    transition: color 200ms ease;
}
.orrery__planet:hover .dot { background: var(--ink-hi); box-shadow: 0 0 12px rgba(237, 240, 247, 0.5); }
.orrery__planet.is-selected .dot { background: var(--teal); box-shadow: 0 0 14px rgba(94, 234, 212, 0.8); }
.orrery__planet.is-selected .lbl { color: var(--teal); }

.orrery__hint { letter-spacing: 0.12em; }

.orbit__detail-wrap {
    padding: var(--pad-card-sm);
    display: flex;
    flex-direction: column;
    min-height: 380px;
}
.orbit__detail-wrap:hover { transform: none; }

.orbit__nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}
.orbit__arrow {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-mid);
    font-size: 15px;
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease;
}
.orbit__arrow:hover { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); }

.orbit__detail.swap { animation: detailfade 350ms var(--ease-out); }
@keyframes detailfade {
    from { opacity: 0; transform: translateY(10px); }
}
.orbit__detail h3 {
    font-family: "Manrope", sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ink-hi);
}
.orbit__detail p:not(.mono):not(.timeline__org) { font-size: 15px; }

.timeline {
    position: relative;
    padding-left: 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(94, 234, 212, 0.4), rgba(139, 124, 246, 0.4), transparent);
}

.timeline__item { padding: var(--pad-card-sm); }
.timeline__item::after { /* node on the line */
    content: "";
    position: absolute;
    left: -52px;
    top: 32px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 12px rgba(94, 234, 212, 0.6);
}

.timeline__date { margin-bottom: 10px; }

.timeline__list {
    list-style: none;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timeline__list li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
}
.timeline__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--teal);
    opacity: 0.7;
}
.timeline__item h3 {
    font-family: "Manrope", sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--ink-hi);
}
.timeline__org { color: var(--ink-mid); font-weight: 500; font-size: 14px; margin: 2px 0 10px; }
.timeline__item p:not(.mono):not(.timeline__org) { font-size: 15px; }

/* ============================================================
   05 TRANSMISSION
   ============================================================ */

.transmission__head { text-align: center; }

.transmission__title {
    font-family: "Fraunces", serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 420;
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
}
.transmission__copy {
    max-width: 44ch;
    margin-inline: auto;
    margin-bottom: clamp(40px, 6vw, 72px);
}

.transmission__grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

.transmission__globe {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
#globe {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1;
    display: block;
}
.globe__caption { text-align: center; letter-spacing: 0.12em; }

/* --- form --- */
.form {
    padding: var(--pad-card);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form:hover { transform: none; } /* keep the form still */

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form__field { display: flex; flex-direction: column; gap: 8px; }
.form__field label { letter-spacing: 0.12em; }

.form input[type="text"],
.form input[type="email"],
.form textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--ink-hi);
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    transition: border-color 200ms ease, background 200ms ease;
    resize: vertical;
    min-height: 44px;
}
.form textarea { min-height: 120px; }
.form input::placeholder,
.form textarea::placeholder { color: var(--ink-low); }
.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.form__foot {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.form__send { min-width: 160px; }
.form__send[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.form__status { letter-spacing: 0.1em; }
.form__status.is-ok { color: var(--teal); }
.form__status.is-err { color: var(--magenta); }

/* --- direct email fallback --- */
.transmission__alt {
    margin-top: clamp(56px, 8vw, 96px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.transmission__or { margin-bottom: 24px; }

.pillhome { display: inline-block; }
.pillwrap {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
}
.pillwrap:hover { transform: none; }
.pill {
    display: inline-flex;
    align-items: center;
    padding: 18px 26px 18px 36px;
    font-weight: 600;
    font-size: clamp(16px, 2.4vw, 21px);
    color: var(--ink-hi);
    letter-spacing: -0.01em;
    border-radius: 999px 0 0 999px;
}
.copy {
    padding: 18px 32px 18px 24px;
    border: none;
    border-left: 1px solid var(--line-soft);
    background: transparent;
    color: var(--ink-low);
    cursor: pointer;
    transition: color 200ms;
    border-radius: 0 999px 999px 0;
    min-height: 44px;
}
.copy:hover { color: var(--teal); }
.copy.is-done { color: var(--teal); }

.transmission__links { margin-top: 44px; letter-spacing: 0.14em; }
.transmission__links a {
    color: var(--ink-low);
    transition: color 200ms;
    padding: 10px 4px; /* touch target */
    display: inline-block;
}
.transmission__links a:hover { color: var(--teal); }

.transmission__motto {
    margin-top: 48px;
    font-family: "Fraunces", serif;
    font-style: italic;
    font-size: 17px;
    color: var(--ink-low);
}

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

.footer {
    position: relative;
    z-index: 4;
    border-top: 1px solid var(--line-soft);
    padding-block: 32px;
}
.footer__grid {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   REVEALS (gated on html.js so no-JS visitors see everything)
   ============================================================ */

html.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}
html.js [data-reveal].in { opacity: 1; transform: translateY(0); }

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

@media (max-width: 1100px) {
    .hero__text { grid-column: 1 / 10; }
    .hero__portrait { grid-column: 7 / 13; }
    .work__featured { gap: 36px; }
}

@media (max-width: 1020px) {
    /* constellation labels get too small below here — switch to chips */
    .craft__chart { display: none; }
    .craft__chips { display: block; }

    .signal__grid { grid-template-columns: 1fr; gap: 40px; }
    .signal__card { max-width: 560px; }

    .transmission__grid { grid-template-columns: 1fr; }
    .transmission__globe { order: -1; }
    #globe { max-width: 340px; }
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        align-items: start;
        padding-top: 88px;
    }
    /* crammed view: figure becomes the BACKGROUND, text overlaps on top */
    .hero__portrait {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        align-self: start;
        z-index: 1;
    }
    .hero__portrait img {
        height: min(62svh, 540px);
        /* longer fade so the lower half recedes beneath the overlapping text */
        -webkit-mask-image: linear-gradient(to bottom, black 52%, transparent 94%);
        mask-image: linear-gradient(to bottom, black 52%, transparent 94%);
    }
    .hero__text {
        grid-column: 1;
        grid-row: 1;
        align-self: end;
        z-index: 3;
        margin-top: 0;
        padding-bottom: 8px;
    }
    .hero__meta {
        position: static;
        grid-row: 2;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 32px;
        margin-bottom: 24px;
    }
    .hero__scroll { display: none; }

    .work__featured { grid-template-columns: 1fr; padding: var(--pad-card-sm); }
    .work__featured--alt .work__visual { order: 2; } /* keep copy first when stacked */
    .work__visual { min-height: 220px; }
    .work__grid { grid-template-columns: 1fr; }
    .work__grid .work__card { grid-column: auto !important; grid-row: auto !important; }

    .orbit__system { grid-template-columns: 1fr; gap: 32px; }
    .orrery { max-width: 360px; }
    .orbit__detail-wrap { min-height: 0; }
}

@media (max-width: 480px) {
    /* declutter the orrery: only the selected planet keeps its label */
    .orrery__planet .lbl { display: none; }
    .orrery__planet.is-selected .lbl { display: block; }
}

/* short-landscape screens (phones sideways, very short laptop windows):
   keep the figure beside the text instead of stacking a tiny portrait */
@media (max-height: 520px) and (min-width: 640px) {
    .hero {
        grid-template-columns: repeat(12, 1fr);
        align-items: end;
        padding-top: 0;
    }
    .hero__text {
        grid-column: 1 / 8;
        grid-row: 1;
        align-self: center;
        margin-top: 0;
        padding-bottom: 10vh;
    }
    .hero__portrait {
        grid-column: 8 / 13;
        grid-row: 1;
        align-self: end;
        justify-self: center;
    }
    .hero__portrait img { height: min(78svh, 34vw); }
    .hero__meta {
        position: absolute;
        left: clamp(20px, 4vw, 48px);
        right: clamp(20px, 4vw, 48px);
        bottom: 12px;
        margin: 0;
        grid-row: auto;
    }
    .hero__title { font-size: clamp(2.4rem, 5.5vw, 4rem); }
    .hero__sub { margin-bottom: 24px; }
}

@media (max-width: 720px) {
    .nav {
        left: 20px;
        right: 20px;
        transform: none;
        justify-content: space-between;
        gap: 0;
    }
    .nav__links { display: none; }
    .nav__burger { display: flex; }

    .glass { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
    .sheet, .nav, .nav.is-condensed { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

    .timeline { padding-left: 28px; }
    .timeline__item::after { left: -32px; }

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

    .pillhome { width: 100%; }
    .pillwrap { flex-direction: column; width: 100%; border-radius: 24px; }
    .pill { border-radius: 24px 24px 0 0; padding: 18px; width: 100%; justify-content: center; }
    .copy { width: 100%; padding: 14px; border-left: none; border-top: 1px solid var(--line-soft); border-radius: 0 0 24px 24px; }

    .footer__grid { flex-direction: column; gap: 8px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html.js [data-reveal] { opacity: 1; transform: none; }
    body.is-loading .mask__inner,
    body.is-loading .hero__portrait,
    body.is-loading .hero__cta,
    body.is-loading .hero__meta { transform: none; opacity: 1; }
}
