:root {
  --bg: #07080a;
  --ink: #d9dde3;
  --dim: #8a9099;
  --silver: linear-gradient(100deg, #8e949c 0%, #e9ecf0 22%, #9aa1ab 40%, #f6f7f9 52%, #858b94 68%, #cfd3da 84%, #9ca2ab 100%);
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 2vw, 30px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; touch-action: none; }

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(4) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} }

/* Silver lettering with a light that follows the pointer + a sweeping glint */
.lux {
  --mx: 30%; --my: 40%;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,1) 0%, rgba(255,255,255,.55) 10%, rgba(255,255,255,0) 26%),
    linear-gradient(105deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.95) 50%, rgba(255,255,255,0) 58%),
    var(--silver);
  background-size: 100% 100%, 300% 100%, 220% 100%;
  background-repeat: no-repeat, no-repeat, repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(210, 216, 228, .16));
  animation: lux 7s cubic-bezier(.6,0,.4,1) infinite;
}
@keyframes lux {
  0%   { background-position: 0 0, 150% 0, 0 0; }
  45%  { background-position: 0 0, -50% 0, -110% 0; }
  100% { background-position: 0 0, -50% 0, -220% 0; }
}

/* Logo */
.logo { font-size: 15px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; display: inline-flex; align-items: center; color: var(--ink); }
.logo b { font-weight: 500; }
.logo i { display: inline-block; width: 16px; height: 10px; margin-left: 3px; background: currentColor;
  clip-path: polygon(0 0, 50% 50%, 50% 0, 100% 50%, 50% 100%, 50% 50%, 0 100%); }

/* Loader */
#loader {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  transition: opacity 1.4s ease, visibility 0s linear 1.4s;
}
#loader.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.bar i { display: block; height: 100%; width: 0; background: var(--silver); background-size: 200% 100%; }
.loader-logo { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); }
.pct { position: absolute; left: var(--gutter); bottom: 14px; font-size: clamp(64px, 12vw, 160px); font-weight: 400; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.loader-enter { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 16px;
  opacity: 0; transform: translate(-50%, calc(-50% + 12px)); transition: opacity .8s, transform .8s; pointer-events: none; }
.loader-enter.ready { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.loader-enter button { font-size: 14px; text-transform: uppercase; letter-spacing: .12em; padding: 20px 38px; border-radius: 999px;
  background: var(--silver); background-size: 200% 100%; color: #0a0b0d; font-weight: 500; transition: background-position .6s; }
.loader-enter button:hover { background-position: 100% 0; }
.loader-enter button.ghost { background: none; color: var(--dim); padding: 6px 4px; }
.loader-enter button.ghost:hover { color: var(--ink); }

/* HUD */
.hud { position: fixed; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 0 var(--gutter); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { top: 16px; }
.hud-top { justify-content: space-between; }
.hud a { color: inherit; text-decoration: none; }
.hud a:hover { color: var(--ink); }
.hud-top .logo { position: absolute; left: 50%; transform: translateX(-50%); }
.hud-bottom { bottom: 14px; color: #c9ced5; align-items: flex-end; }
.hud-top .track, .hud-bottom > span:first-child { opacity: 0; transition: opacity 2.5s ease; }
body.scrolled .hud-top .track, body.scrolled .hud-bottom > span:first-child { opacity: 1; }
.play-hint { color: #5ff0ff; text-shadow: 0 0 8px rgba(60, 230, 255, .7), 0 0 18px rgba(60, 230, 255, .35); }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.credits { font-size: 9px; letter-spacing: .02em; text-transform: none; color: #8d939b; max-width: 70ch; }
.audio { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.bars i { width: 2px; height: 2px; background: currentColor; }
.audio.on .bars i { animation: bar .9s ease-in-out infinite alternate; }
.audio.on .bars i:nth-child(2) { animation-delay: -.3s; }
.audio.on .bars i:nth-child(3) { animation-delay: -.6s; }
.audio.on .bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes bar { from { height: 2px; } to { height: 10px; } }

.run { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid #5ff0ff; border-radius: 999px;
  box-shadow: 0 0 10px rgba(60,230,255,.35), inset 0 0 6px rgba(60,230,255,.15);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); white-space: nowrap; transition: background .3s, color .3s; }
.run i { width: 7px; height: 7px; border-radius: 50%; background: #1f6f7a; box-shadow: 0 0 4px rgba(60,230,255,.5); transition: background .2s, box-shadow .2s; }
.run.on i { background: #5ff0ff; box-shadow: 0 0 10px #5ff0ff, 0 0 18px rgba(60,230,255,.6); }
.run:hover { background: var(--ink); color: var(--bg); }

/* Hero copy (fades out as you dive) */
.overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; will-change: opacity, transform; mix-blend-mode: difference; }
.mega { font-weight: 400; letter-spacing: -.035em; line-height: .88; }
.mega span { position: absolute; display: block; padding-bottom: .12em; white-space: nowrap; }
.mega-a { top: 46px; left: var(--gutter); font-size: clamp(44px, 9vw, 160px); }
.mega-b { bottom: 40px; right: var(--gutter); font-size: clamp(64px, 12vw, 230px); }
.lede { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1300px, calc(100% - 2 * var(--gutter)));
  text-align: center; font-size: clamp(20px, 2.7vw, 44px); font-weight: 300; line-height: 1.18; letter-spacing: -.015em; color: #e6e9ee;
  text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.scroll-arrow { display: block; width: 14px; height: 14px; margin: .9em auto 0;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; opacity: .8;
  transform: rotate(45deg); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(8px) rotate(45deg); } }
.scroll-word { display: block; margin-top: .9em; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; opacity: .6; }
.play-hint, .run { transition: opacity .6s; }
body:not(.machine) .play-hint, body:not(.machine) .run { opacity: 0; pointer-events: none; }

/* SoundCloud: hidden, shown only if the browser blocks playback */
#sc { position: fixed; right: var(--gutter); bottom: 60px; width: 320px; height: 120px; border: 0; z-index: 20;
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .4s, transform .4s; }
#sc.visible { opacity: 1; pointer-events: auto; transform: none; }

@media (max-width: 760px) {
  .hud-bottom > span:first-child, .play-hint { display: none; }
  .hud-top { justify-content: space-between; }
  .hud-top .logo { position: static; transform: none; }
  .hud-top .track { display: none; }
  .mega-a { top: 52px; }
  .mega-b { bottom: 64px; }
  #sc { left: var(--gutter); width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lux, .grain { animation: none; }
}
