/* stvnhost — dark cinematic portfolio. WebGL canvas sits behind the content; html.gl = 3D running, otherwise static fallback. */
:root { --bg: #000; --text: #E8EEF2; --muted: #8FA3B0; --line: rgba(143, 163, 176, .22); --mint: #9FF2E0;
  --f: "Roboto Flex", system-ui, sans-serif; --mono: "Roboto Mono", ui-monospace, monospace; --gut: clamp(20px, 4.2vw, 64px); --nav: 76px; }
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 400 1rem/1.5 var(--f); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 2px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--mint); color: #06251f; padding: 10px 16px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: none; }
.gl #gl { display: block; }

.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--nav); padding: 0 var(--gut); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .78); backdrop-filter: blur(10px); }
.brand { display: block; padding: 6px 0; }
.brand img { height: 26px; width: auto; display: block; }
.nav nav { display: flex; gap: clamp(14px, 2.4vw, 34px); }
.nav nav a { font-size: .875rem; color: var(--muted); text-decoration: none; padding: 12px 2px; position: relative; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--text); }
.nav nav a[aria-current]::after { content: ""; position: absolute; left: 2px; bottom: 6px; width: 22px; height: 2px; background: var(--mint); }

main { position: relative; z-index: 1; }
.scene { position: relative; }
.stage { position: relative; min-height: 100svh; padding: calc(var(--nav) + 34px) var(--gut) 0; display: flex; flex-direction: column; }
.gl .welcome { height: 520svh; }
.gl .contact { height: 220svh; }
.gl .welcome .stage, .gl .contact .stage { position: sticky; top: 0; height: 100svh; overflow: clip; }
.stage-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0 26px; font-size: .875rem; }
.stage-foot a { text-decoration: none; padding: 8px 0; }
.stage-foot a:hover { color: var(--mint); }
.count { font: 400 .75rem var(--mono); letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.lede { font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 500; }
.sub { color: var(--muted); font-size: .9375rem; margin-top: 4px; }

/* 01 welcome — the word is drawn in WebGL; as text only in the static fallback */
.welcome-word { margin: auto 0; text-align: center; font-weight: 300; font-size: clamp(3rem, 15vw, 13rem); letter-spacing: .08em; text-transform: uppercase; line-height: 1; color: #B9C8D4; }
.gl .welcome-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 02 work */
.work .stage { height: 100svh; min-height: 620px; }
.work-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.work-head h2 { font-size: clamp(1.75rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -.01em; }
.gallery { flex: 1; min-height: 220px; margin: 14px calc(var(--gut) * -1); position: relative; touch-action: pan-y; cursor: grab; user-select: none; }
.gallery.dragging { cursor: grabbing; }
.gl .cards { display: none; }
.cards { list-style: none; margin: 0; padding: 0 var(--gut) 12px; height: 100%; display: flex; gap: 20px; overflow-x: auto; align-items: center; scroll-snap-type: x mandatory; }
.cards li { flex: 0 0 min(78vw, 560px); scroll-snap-align: center; }
.cards a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #0a0d10; }
.cards img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.cards span { display: block; padding: 14px 18px; font-weight: 600; }
.cards small { display: block; color: var(--muted); font-weight: 400; }
html:not(.gl) .work-cap, html:not(.gl) .drag { display: none; }
.work-cap { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 18px; }
.work-cap h3 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); font-weight: 700; line-height: 1.1; }
.work-cap p { color: var(--muted); font-size: .9375rem; margin-top: 6px; }
.view { text-decoration: none; font-weight: 500; padding: 10px 0; white-space: nowrap; }
.view:hover { color: var(--mint); }
.drag { color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.drag button { background: none; border: 0; color: var(--text); font: inherit; font-size: 1.1rem; min-width: 44px; min-height: 44px; cursor: pointer; }
.drag button:hover { color: var(--mint); }

/* 03 contact — in 3D mode the copy is unveiled from the centre as the fins open (--open 0..1) */
.contact-in { flex: 1; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 24px; }
.gl .contact-in { clip-path: inset(0 calc((1 - var(--open, 0)) * 50%)); }
.contact-copy h2 { font-size: clamp(3rem, 8vw, 6.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 10px; }
.contact-copy .sub { font-size: clamp(1rem, 1.5vw, 1.25rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 12px 20px; background: var(--mint); color: #06251f; font-weight: 600; text-decoration: none; border: 1px solid var(--mint); }
.btn:hover { background: #c4f8ec; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--mint); color: var(--mint); background: transparent; }
.orb { aspect-ratio: 1; width: min(100%, 52svh); justify-self: center; }
html:not(.gl) .orb { display: none; }
html:not(.gl) .contact-in { grid-template-columns: 1fr; }

.foot { position: relative; z-index: 1; background: #1F2221; padding: 40px var(--gut); display: grid; gap: 10px; }
.foot img { height: 30px; width: auto; }
.foot p { color: #B9C0BD; font-size: .9375rem; }
.foot .fine { font: 400 .75rem var(--mono); letter-spacing: .08em; }

.motion-toggle { position: fixed; left: 50%; translate: -50% 0; bottom: 14px; z-index: 30; min-height: 36px; padding: 8px 12px; background: rgba(0, 0, 0, .8); color: var(--text); border: 1px solid var(--line); font: 500 .6875rem var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
html:not(.gl) .motion-toggle { display: none; }

@media (max-width: 760px) {
  :root { --nav: 64px; }
  .brand img { height: 22px; }
  .contact-in { grid-template-columns: 1fr; align-content: center; }
  .orb { width: min(46vw, 26svh); grid-row: 1; justify-self: start; }
  .stage-foot { padding-bottom: 60px; }
}

/* project detail page */
.project { max-width: 1180px; margin: 0 auto; padding: calc(var(--nav) + 40px) var(--gut) 80px; }
.project .back a { color: var(--muted); text-decoration: none; padding: 8px 0; display: inline-block; }
.project .back a:hover { color: var(--mint); }
.project h1 { font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: 10px 0 18px; }
.p-sum { max-width: 62ch; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: #C6D2DA; text-wrap: pretty; }
.p-hero { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 40px 0; border: 1px solid var(--line); border-radius: 18px; background: #0a0d10; }
.p-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding: 28px 0; border-block: 1px solid var(--line); }
.p-meta h2 { font: 400 .75rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.p-meta ul { margin: 0; padding-left: 1.1em; }
.p-meta li + li { margin-top: 4px; }
.p-shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0 8px; }
.p-shots img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.project .fine { font: 400 .75rem var(--mono); color: var(--muted); margin-top: 28px; }
@media (max-width: 760px) { .p-meta, .p-shots { grid-template-columns: 1fr; } }

/* live site showcase */
.p-live { margin: 40px 0 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0a0d10; }
.p-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 400 .75rem var(--mono); color: var(--muted); }
.p-bar .dots { width: 44px; height: 10px; background: radial-gradient(circle 5px at 5px 5px, #3a4650 98%, transparent) 0 0 / 17px 10px repeat-x; }
.p-bar .url { flex: 1; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-bar a { text-decoration: none; color: var(--text); white-space: nowrap; padding: 6px 0; }
.p-bar a:hover { color: var(--mint); }
.p-live iframe { display: block; width: 100%; height: min(78svh, 820px); min-height: 460px; border: 0; background: #fff; }
.p-live figcaption { padding: 10px 14px; font-size: .8125rem; color: var(--muted); border-top: 1px solid var(--line); }
.p-h { font: 400 .75rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 40px; }
.p-hero { margin-top: 14px; }

/* hero intro: appears after WELCOME bursts back into stars (--intro 0..1 from welcome.js); plain block in the static fallback */
.about { max-width: 880px; margin: 0 auto; padding: 24px 0 40px; text-align: center; }
.about-k { font: 400 .75rem var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--mint); }
.about h2 { font-size: clamp(2rem, 5.4vw, 4.25rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; margin: 16px 0 18px; text-wrap: balance; }
.about-p { color: #B7C4CD; font-size: clamp(1rem, 1.5vw, 1.25rem); max-width: 56ch; margin: 0 auto; text-wrap: pretty; }
.about-l { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.about-l li { font: 400 .75rem var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); }
.gl .about { position: absolute; inset: var(--nav) var(--gut) 70px; margin: auto; height: fit-content; padding: 0; opacity: var(--intro, 0); translate: 0 calc((1 - var(--intro, 0)) * 26px); }
