:root {
  color-scheme: dark;
  --paper: #fff;
  --ease: cubic-bezier(.19, 1, .22, 1);
  font-family: "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: #101411; color: var(--paper); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--paper); outline-offset: 6px; }

.intro { display: none; }
html[data-intro="loading"] body, html[data-intro="falling"] body { background: #060707; }
html[data-intro="loading"] .hero, html[data-intro="falling"] .hero { opacity: 0; pointer-events: none; }
html[data-intro="revealing"] .hero { opacity: 1; transition: opacity 1.35s var(--ease); }
html[data-intro] .intro:not([hidden]) {
  display: grid; place-items: center; position: fixed; inset: 0;
  z-index: 10; background: #060707; overflow: hidden;
}
.intro-word {
  position: relative; margin: 0; font-size: clamp(46px, 6vw, 116px);
  font-weight: 300; letter-spacing: -.055em; line-height: 1.04; white-space: nowrap;
  color: #484a49;
}
.intro-fill { position: absolute; inset: 0; color: #fff; clip-path: inset(0 100% 0 0); animation: intro-fill 1.15s ease-in-out forwards; }
@keyframes intro-fill { to { clip-path: inset(0 0 0 0); } }
.intro-drop, .intro-waves {
  position: absolute; left: 50%; top: calc(50% + clamp(48px, 5vw, 88px) + 2.5px);
  transform: translate(-50%, -50%); pointer-events: none;
}
.intro-drop { --drop-width: 29px; width: var(--drop-width); aspect-ratio: 29 / 41; will-change: transform; }
.intro-drop svg { display: block; width: 100%; height: 100%; }
.intro-waves { width: 44px; height: 44px; }
.intro-waves svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.intro-waves circle { fill: none; stroke: rgb(226 242 230 / .5); stroke-width: .7px; opacity: 0; }
html[data-intro="revealing"] .intro:not([hidden]) { background: transparent; pointer-events: none; }
html[data-intro="revealing"] .intro-waves circle { animation: intro-wave 1.3s var(--ease) forwards; }
html[data-intro="revealing"] .intro-waves svg + svg circle { animation-delay: .12s; }
@keyframes intro-wave { 0% { r: 1px; opacity: .4; } 100% { r: 480px; opacity: 0; } }

.hero { position: relative; isolation: isolate; width: 100%; height: 100%; height: 100svh; height: 100dvh; overflow: hidden; touch-action: pinch-zoom; }
.atmosphere, .liquid, .veil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Immediate, static fallback: no blank canvas, spinner or loading gate. */
.atmosphere {
  background:
    radial-gradient(ellipse at 88% 14%, transparent 19%, #111914 43%, transparent 62%),
    radial-gradient(ellipse at 63% 35%, #766547 0%, #405343 30%, transparent 57%),
    radial-gradient(ellipse at 20% 62%, #ac8850 0%, #354d3b 38%, #101411 75%);
}
.liquid { opacity: 0; transition: opacity 1.25s var(--ease); }
.liquid[data-renderer="webgl"] { opacity: 1; }
.veil { background: radial-gradient(ellipse at center, transparent 25%, rgb(0 0 0 / .22) 100%); }

.header {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(42px, env(safe-area-inset-top)) max(64px, env(safe-area-inset-right)) 0 max(64px, env(safe-area-inset-left));
}
.wordmark { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; font-size: 28px; font-weight: 500; letter-spacing: -.065em; line-height: 1; }
.wordmark span { opacity: .65; }
.projects { display: grid; justify-items: start; }
.projects-label { margin: 10px 0 9px; color: rgb(255 255 255 / .58); font-size: 10px; font-weight: 400; line-height: 1.2; letter-spacing: .13em; text-transform: uppercase; }
.project { display: flex; align-items: center; justify-content: flex-start; gap: 11px; min-height: 36px; font-size: 12px; font-weight: 400; line-height: 1.4; color: rgb(255 255 255 / .87); transition: color .4s ease; }
.arrow { display: block; flex: 0 0 12px; width: 12px; height: 12px; opacity: .6; transform: translate(0, 0); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.project:hover, .project:focus-visible { color: #fff; }
.project:hover .arrow, .project:focus-visible .arrow { opacity: 1; transform: translate(2px, -2px); }

.title-wrap { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 160px 28px; pointer-events: none; }
h1 { margin: 0; font-size: clamp(46px, 6vw, 116px); font-weight: 300; line-height: 1.04; letter-spacing: -.055em; white-space: nowrap; }
.title-dot { position: absolute; top: calc(50% + clamp(48px, 5vw, 88px)); width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .85; }

@media (max-width: 680px) {
  .intro-word { font-size: clamp(36px, 10vw, 64px); }
  .intro-drop { --drop-width: clamp(14px, 4.6vw, 20px); }
  .intro-drop, .intro-waves { top: calc(50% + 56px); }
  .header { padding: max(26px, env(safe-area-inset-top)) max(25px, env(safe-area-inset-right)) 0 max(25px, env(safe-area-inset-left)); }
  .wordmark { font-size: 25px; }
  .projects-label { margin-top: 12px; font-size: 9px; }
  .project { min-height: 44px; font-size: 12px; }
  h1 { font-size: clamp(36px, 10vw, 64px); letter-spacing: -.055em; }
  .title-wrap { padding-inline: 20px; }
  .title-dot { top: calc(50% + 54px); width: 4px; height: 4px; }
}
@media (max-height: 450px) {
  .header { padding-top: max(16px, env(safe-area-inset-top)); }
  .title-wrap { padding-block: 70px; }
  .projects-label { margin-bottom: 4px; }
  .project { min-height: 30px; }
}
@media (max-height: 450px) and (pointer: coarse) {
  .intro-drop { --drop-width: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none !important; }
  html[data-intro] .hero { opacity: 1; transition: none; pointer-events: auto; }
  .liquid, .project, .arrow { transition: none; }
}
