/* Greg Althoff — landing experience, version 2.
   Measurements come from the "Website EXP" frames in Figma (1500 × 760). */

/* Berkelium Sans: headers and running text. */
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-thin.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-thin-italic.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-semibold.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-bold-italic.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-extrabold.otf') format('opentype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Berkelium Sans'; src: url('/site/assets/fonts/berkelium-extrabold-italic.otf') format('opentype'); font-weight: 800; font-style: italic; font-display: swap; }

/* Aeonik Fono (variable): smaller all-caps headers and labels, tracked at 10%. */
@font-face { font-family: 'Aeonik Fono'; src: url('/site/assets/fonts/aeonik-fono-vf.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --font-display: 'Berkelium Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-label: 'Aeonik Fono', 'Helvetica Neue', Arial, sans-serif;
  --label-tracking: 0.1em;
  --ink: #070708;
  --text: #c8d5e4;
  --lilac-dark: #7c79ac;
  --lilac-light: #d4d3ec;
  --line: rgba(255, 255, 255, 0.1);
  --violet: #605da1;
  --ease-liquid: cubic-bezier(0.45, 0, 0.2, 1);
  --edge: 40px;
  --col-left: 22.667vw;   /* 340 / 1500 */
  --col-right: 63.933vw;  /* 959 / 1500 */
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; }

/* Headers: Berkelium Bold. Smaller all-caps headers: Aeonik Fono, 10% tracking. */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
}
.label-caps {
  font-family: var(--font-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#bg { z-index: 0; }

/* The blurry vignette that settles over the field before the beacon. */
.vignette {
  z-index: 1;
  opacity: 0;
  background: radial-gradient(circle 57vmax at 50% 50%, rgba(7, 7, 8, 0) 39.4%, var(--ink) 100%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image: radial-gradient(circle 60vmax at 50% 50%, transparent 28%, #000 70%);
  mask-image: radial-gradient(circle 60vmax at 50% 50%, transparent 28%, #000 70%);
  transition: opacity 2.6s var(--ease-liquid);
}
.vignette.is-on { opacity: 1; }

.topfade {
  z-index: 1;
  height: 178px;
  background: linear-gradient(to bottom, rgba(7, 7, 8, 0.4), rgba(7, 7, 8, 0));
  transition: opacity 2.4s var(--ease-liquid);
}
.topfade.is-off { opacity: 0; }

#scene { z-index: 2; }

/* ---------- the starlight glyph (the dithered halo is drawn on #scene) ---------- */

.star {
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  width: 33px;
  height: 47px;
  margin: -23.5px 0 0 -16.5px;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
.star svg { display: block; filter: drop-shadow(0 0 6px rgba(200, 213, 228, 0.35)); }

/* ---------- words ---------- */

.view-home {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  outline: none;
}
.view-home button, .view-home a { pointer-events: auto; }

/* Near the top of the climb, a quiet word that the path splits ahead. */
.pathhint {
  position: absolute;
  right: 112px;
  bottom: 52px;
  margin: 0;
  font-size: 11px;
  color: rgba(200, 213, 228, 0.5);
  opacity: 0;
  transition: opacity 1.4s var(--ease-liquid);
  pointer-events: none;
}
.pathhint.is-on { opacity: 1; }

/* For keyboard and screen reader users: skip the intro, straight to the work. */
.skip-intro, .skip {
  position: fixed;
  z-index: 40;
  left: var(--edge);
  top: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #13131a;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.4s var(--ease-liquid);
}
.skip-intro:focus-visible, .skip:focus-visible { transform: none; outline: 1px solid rgba(200, 213, 228, 0.6); }

.line { margin: 0; white-space: nowrap; }

.intro {
  position: absolute;
  left: var(--col-left);
  top: 50%;
  font-size: 20px;
  letter-spacing: 0.4px;
  line-height: 24px;
  color: var(--text);
  transform: translateY(-12px);
  transition: transform 2.4s var(--ease-liquid);
}
.intro .line {
  position: absolute;
  left: 0;
  opacity: 0;
}
.intro .line:nth-child(1) { top: 0; }
.intro .line:nth-child(2) { top: 30px; }
.intro .line:nth-child(3) { top: 60px; }

.verse {
  position: absolute;
  left: var(--col-right);
  top: calc(50% - 30px);
  font-size: 14px;
  letter-spacing: 0.56px;
  line-height: 17px;
  display: grid;           /* every line shares the width of the longest, so one gradient spans the block */
  justify-items: stretch;
}
.verse .line {
  opacity: 0;
  min-height: 17px;
  color: transparent;
  /* Darker on the left, lighter on the right, drifting slowly but never flipping. */
  background-image: linear-gradient(86deg, #6c69a0 0%, var(--lilac-dark) 12%, #a3a1cf 42%, var(--lilac-light) 68%, #e9e8f8 84%, var(--lilac-light) 100%);
  background-size: 190% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: drift 16s var(--ease-liquid) infinite alternate;
}
@keyframes drift {
  from { background-position: 0% 0; }
  to { background-position: 46% 0; }
}

/* ---------- buttons ---------- */

.btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 12px;
  border: 3px solid var(--line);
  border-radius: 6px 6px 32px 6px;
  background: transparent;
  font-size: 14px;
  letter-spacing: 0.56px;
  line-height: 1;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.9s var(--ease-liquid), box-shadow 1.1s var(--ease-liquid);
}
.btn[hidden] { display: none; }
.btn:focus-visible { outline: 1px solid rgba(200, 213, 228, 0.6); outline-offset: 4px; }

/* The glass itself (refraction, rim, shadow, the swell under the pointer) is Liquid Glass UI, drawn on a
   canvas inside each button. What is added here is the reflection: a band of light that crosses the glass
   on hover, and a soft specular that follows the pointer. */
.btn::after,
.avatar-sheen {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(70% 90% at var(--mx, 30%) var(--my, 30%), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 70%),
    linear-gradient(112deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, 0.2) 47%, rgba(255, 255, 255, 0.34) 50%, rgba(212, 211, 236, 0.16) 54%, rgba(255, 255, 255, 0) 66%) no-repeat;
  background-size: 100% 100%, 280% 100%;
  background-position: 0 0, 135% 0;
}
.btn:hover::after, .btn:focus-visible::after,
.avatar:hover .avatar-sheen, .avatar:focus-visible .avatar-sheen, .avatar[data-open] .avatar-sheen {
  opacity: 1;
  animation: glass-sweep 1.5s var(--ease-liquid) both;
}
/* While a button (or the path controls) liquifies in or out, its glass waits, then fades in. */
[data-glass-host] > canvas { transition: opacity 1.1s var(--ease-liquid); }
/* The prism glass a button turns into on hover (prism.ts): over the label, under the reflection sweep. */
.btn-prism { position: absolute; z-index: 1; pointer-events: none; }
.btn::after { z-index: 2; }
.is-liquid[data-glass-host] > canvas,
.is-liquid [data-glass-host] > canvas { opacity: 0; transition-duration: 0.45s; }

@keyframes glass-sweep {
  from { background-position: 0 0, 135% 0; opacity: 0; }
  12% { opacity: 1; }
  to { background-position: 0 0, -35% 0; opacity: 0.7; }
}

.btn .label {
  color: transparent;
  background-image: linear-gradient(84deg, var(--lilac-dark) 6.45%, var(--lilac-light) 108%);
  background-size: 160% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-position 1.2s var(--ease-liquid);
  padding: 1px 0;
}
.btn:hover .label, .btn:focus-visible .label { background-position: 100% 0; }

.btn .arrow { display: block; fill: #cac9e5; transition: transform 0.9s var(--ease-liquid); }
.btn .arrow-right { transform: rotate(90deg); }
.btn .arrow-down { transform: rotate(180deg); }
.btn-continue:hover .arrow-right, .btn-next:hover .arrow-right { transform: rotate(90deg) translateY(-2px); }

.btn-follow {
  left: var(--col-left);
  top: min(calc(50% + 275px), calc(100% - 64px));
  transform: translateY(-50%);
}

/* The lamp: a violet beacon that breathes and sends out slow echoes. */
.lamp {
  position: relative;
  width: 12px;
  height: 12px;
  margin: -2px 0;
  flex: none;
}
.lamp i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.lamp i:nth-child(1) {
  inset: 2px;
  background: var(--violet);
  box-shadow: 0 0 0 2px rgba(200, 213, 228, 0.2);
  animation: lamp-breathe 3.2s ease-in-out infinite;
}
.lamp i:nth-child(2), .lamp i:nth-child(3) {
  border: 1px solid rgba(165, 160, 235, 0.55);
  opacity: 0;
}
.lamp.ping i:nth-child(2) { animation: lamp-echo 2.8s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
.lamp.ping i:nth-child(3) { animation: lamp-echo 3.4s cubic-bezier(0.2, 0.6, 0.3, 1) 0.42s both; }
@keyframes lamp-breathe {
  0%, 100% { background: var(--violet); box-shadow: 0 0 0 2px rgba(200, 213, 228, 0.2), 0 0 0 rgba(130, 125, 230, 0); }
  12% { background: #8f8be0; box-shadow: 0 0 0 2px rgba(200, 213, 228, 0.35), 0 0 12px rgba(130, 125, 230, 0.9); }
}
@keyframes lamp-echo {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(3.6); opacity: 0; }
}

.btn-continue {
  right: var(--edge);
  bottom: 30px;
  padding: 12px 20px 12px 12px;
}
.btn-next {
  right: var(--edge);
  bottom: 30px;
  /* From Figma: 20 / 26 — the big corner takes visual weight, so the arrow sits a touch left of the box centre. */
  padding: 12px 26px 12px 20px;
}

.pathnav {
  position: absolute;
  right: 56px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.pathnav[hidden] { display: none; }
.btn-v {
  position: relative;
  width: 41px;
  height: 64px;
  padding: 0;
  justify-content: center;
}
.btn-up { border-radius: 32px 6px 6px 6px; }
.btn-down { border-radius: 6px 6px 32px 6px; }
/* Optical centring: nudge each arrow away from the big corner by 3px (Figma uses 20 / 26 padding). */
.btn-up .arrow { margin-top: 6px; }
.btn-down .arrow { margin-bottom: 6px; }
.btn-v[aria-disabled='true'] { cursor: default; }
.btn-v[aria-disabled='true'] .arrow { opacity: 0.35; }

/* ---------- menu: Liquid Glass thumbnail + list (built from v2-glass/) ---------- */

.menu {
  position: fixed;
  z-index: 6;
  top: 0;
  right: 0;
  width: 160px;
  height: 160px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 3.2s var(--ease-liquid);
}
.menu.is-in { opacity: 1; }
/* Once the story starts the thumbnail steps back; it comes forward again when you reach for it. */
.avatar { transition: opacity 1.6s var(--ease-liquid); }
.menu.is-dim .avatar:not(:hover):not(:focus-visible):not([data-open]) { opacity: 0.55; }

.avatar {
  position: absolute;
  top: var(--edge);
  right: var(--edge);
  width: 80px;
  height: 80px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  display: block;
  -webkit-tap-highlight-color: transparent;
}
.avatar:focus-visible { outline: 1px solid rgba(200, 213, 228, 0.6); outline-offset: 5px; }
/* The library wraps a trigger's children in a span that sways with the glass; let it fill the button. */
.avatar > span { position: absolute; inset: 0; display: block; }
/* The photo sits in the glass like a gem in its bezel: the rim bends and shines around it. */
.avatar-photo {
  position: absolute;
  inset: 5px;
  border-radius: 13px;
  background: url('/site/assets/avatar.jpg') -19.83px -9.92px / 110.83px 110.83px no-repeat;
}
.avatar-sheen { inset: 5px; border-radius: 13px; }

/* The list: one body of glass with the thumbnail, joined by a neck that stretches and snaps. */
/* (No Tailwind reset on this page, so the browser's own popover border and fill are cleared here.) */
/* It lives inside .menu, which ignores the pointer so its empty box can't block the page; the list must take it back. */
.menu-pop { min-width: 200px; padding: 8px; border: 0; background: transparent; overflow: visible; font-family: var(--font-display); outline: none; pointer-events: auto; }
/* An invisible bridge over the gap up to the thumbnail, so the pointer never "leaves" on the way down. */
.menu-pop::after { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  color: var(--text);
  font-size: 20px;
  letter-spacing: 0.8px;
  cursor: pointer;
  outline: none;
  transition: color 0.5s var(--ease-liquid);
}
/* The item under the pointer. */
.menu-item { position: relative; isolation: isolate; background: none; }
.menu-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.34), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.45s var(--ease-liquid), transform 0.7s var(--ease-liquid);
}
.menu-item[data-highlighted] { color: #f4f6fb; }
/* Without WebGL2 the item under the pointer gets this flat glass pill; with it, the prism lens (prism.ts). */
.menu-pop:not(.has-prism) .menu-item[data-highlighted]::before { opacity: 1; transform: none; }
.prism { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* ---------- sound ---------- */

.sound {
  position: fixed;
  z-index: 6;
  left: var(--edge);
  bottom: 34px;
  padding: 6px 0;
  border: 0;
  background: none;
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  color: rgba(200, 213, 228, 0.56);
  cursor: pointer;
  opacity: 0;
  transition: opacity 2s var(--ease-liquid), color 0.6s;
}
.sound.is-on { opacity: 1; }
.sound:hover, .sound:focus-visible { color: rgba(200, 213, 228, 0.75); outline: none; }

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  :root { --edge: 22px; --col-left: 9vw; --col-right: 9vw; }
  .avatar { width: 64px; height: 64px; border-radius: 16px; }
  .avatar-photo { inset: 4px; border-radius: 12px; background-position: -15.7px -7.9px; background-size: 88.7px 88.7px; }
  .avatar-sheen { inset: 4px; border-radius: 12px; }
  .verse { top: auto; bottom: 24vh; }
  .btn-follow { top: auto; bottom: 9vh; transform: none; }
  .pathnav { right: 22px; bottom: 24px; }
  .btn-continue, .btn-next { bottom: 24px; }
  .pathhint { right: 76px; bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .verse .line { animation: none; }
  .lamp i:nth-child(1) { animation-duration: 6s; }
}

.btn-down .arrow { opacity: 0.55; }
