/* gethorizon.lol: dark violet air, cream type and buttons, the HUD as a lit glass slab. */

:root {
  --air-top: #1a1021;
  --air: #100b15;
  --air-low: #0a080d;
  --panel: #110d17;
  --cream: #f4efe6;
  --ink: #f3eff8;
  --dim: rgba(232, 225, 242, 0.64);
  --faint: rgba(232, 225, 242, 0.4);
  --line: rgba(205, 185, 255, 0.14);
  --violet: #a47cff;
  --heading: linear-gradient(180deg, #ffffff 30%, #d6cbec);
  --halo: drop-shadow(0 0 30px rgba(146, 102, 255, 0.4));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --snap: cubic-bezier(0.7, 0, 0.2, 1);
  --sans: "Geist", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  --page: 1200px;
  --gutter: clamp(20px, 4.5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; background: var(--air-low); scroll-padding-top: 84px; }
/* Lenis (smooth wheel scrolling, front page only) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
/* the air: violet at the top of the window going down to almost black, held still while the page moves over it */
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: linear-gradient(180deg, var(--air-top), var(--air) 55%, var(--air-low)) fixed;
}
/* fine grain over the air, so its long gradients can't band */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url(img/grain.png); opacity: 0.04; }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--cream); }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(164, 124, 255, 0.5); color: #fff; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
kbd { font: 500 11.5px/1 var(--mono); padding: 3px 6px; border-radius: 5px; background: rgba(205, 185, 255, 0.12); color: var(--dim); }
.wrap { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
main { position: relative; z-index: 1; }

/* ---- top bar */
.top { position: fixed; inset: 0 0 auto; z-index: 50; transition: background 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease; }
.top.stuck { background: rgba(16, 11, 21, 0.72); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 1px 0 rgba(205, 185, 255, 0.1); }
.bar { display: flex; align-items: center; gap: 30px; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 18px var(--gutter); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
.links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.links a { position: relative; color: var(--dim); text-decoration: none; transition: color 0.3s ease; }
/* a line draws in from the left under the link, and leaves to the right */
.links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--cream); transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--snap); }
.links a:hover, .links a[aria-current] { color: var(--cream); }
.links a:hover::after, .links a[aria-current]::after { transform: scaleX(1); transform-origin: left; }

/* ---- buttons. Nothing floats: a fill wipes across under the label, the arrow steps forward, a press pushes in.
   The fill is the button's own background (a gradient layer growing from the left), not a second shape on top:
   two shapes meeting on one rounded edge leave a light halo and notches at the corners. */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 23px; border: 1px solid var(--cream); border-radius: 9px;
  font: 500 15.5px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  background: linear-gradient(#17111f, #17111f) 0 0 / 0% 100% no-repeat border-box, var(--cream);
  color: #17111f;
  transition: background-size 0.5s var(--snap), color 0.5s var(--snap), border-color 0.3s ease, transform 0.15s ease;
}
.btn:hover { background-size: 100% 100%, auto; color: var(--cream); border-color: rgba(244, 239, 230, 0.5); }
.btn:active { transform: scale(0.97); }
.btn i { font-style: normal; transition: transform 0.5s var(--snap); }
.btn:hover i { transform: translateX(5px); }
.btn.ghost { background: linear-gradient(var(--cream), var(--cream)) 0 0 / 0% 100% no-repeat border-box, transparent; color: var(--cream); border-color: rgba(244, 239, 230, 0.4); }
.btn.ghost:hover { background-size: 100% 100%, auto; color: #17111f; border-color: var(--cream); }
.bar .btn { padding: 9px 15px; font-size: 14px; border-radius: 8px; }

/* ---- headings: white going lilac with a little glow. .lines come up line by line (site.js). */
.lines > span { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines > span > b { display: inline-block; font-weight: 600; background: var(--heading); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lines { filter: var(--halo); }

/* ---- hero: everything centred under one light just above the top edge, the HUD leaning back under the buttons */
.hero { position: relative; isolation: isolate; overflow-x: clip; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(150px, 22vh, 230px) var(--gutter) 0; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: min(1100px, 140vh); pointer-events: none; background: radial-gradient(ellipse 60% 62% at 50% -6%, rgba(162, 112, 255, 0.34), rgba(112, 64, 214, 0.14) 46%, transparent 74%); }
.hero h1 { font-size: clamp(42px, 6.6vw, 112px); line-height: 0.95; letter-spacing: -0.055em; }
.hero .lede { max-width: 26em; margin: clamp(20px, 2.2vw, 28px) 0 34px; font-size: clamp(18px, 1.5vw, 20px); line-height: 1.45; color: var(--dim); }
.acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
/* The HUD leans back with its lower part fading into the dark, and stands up and comes out whole as it scrolls in
   (site.js sets --t, 1 to 0). The picture is cut to the window's own corner (24 px on 1640 x 1120) and a ring on that
   same curve lights its top edge, so the corners stay clean. */
.slab { width: min(1080px, 100%); margin-top: clamp(48px, 6vw, 72px); perspective: 1500px; }
.win {
  position: relative; overflow: hidden; border-radius: 1.47% / 2.15%; transform-origin: 50% 0;
  transform: rotateX(calc(var(--t, 1) * 22deg));
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--t, 1) * 55%), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - var(--t, 1) * 55%), transparent);
  filter: drop-shadow(0 -14px 40px rgba(150, 100, 255, 0.3));
}
.win img { width: 100%; }
.win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 rgba(244, 236, 255, 0.6), inset 0 0 0 1px rgba(205, 185, 255, 0.16); }

/* ---- glass: the frames the videos sit in, lit along the top edge */
.glass { position: relative; border-radius: 14px; background: var(--panel); box-shadow: 0 0 0 1px rgba(205, 185, 255, 0.16), 0 40px 80px -40px rgba(0, 0, 0, 0.8); }
.glass::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(230, 214, 255, 0.1), transparent 22%); box-shadow: inset 0 1px 0 rgba(244, 239, 230, 0.45); }

/* ---- parts further down */
.part { padding-top: clamp(130px, 15vw, 210px); }
.head { max-width: 760px; margin: 0 auto clamp(30px, 3.6vw, 48px); text-align: center; }
.head h2 { font-size: clamp(36px, 4.8vw, 68px); line-height: 1; letter-spacing: -0.05em; }
.head p { margin: 16px 0 0; color: var(--dim); font-size: 17.5px; }

/* presets: a picture of each look under the video */
.picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 16px); max-width: 1100px; margin: 18px auto 0; }
.picker button { appearance: none; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; color: var(--faint); font-size: 14px; line-height: 1.2; }
.picker img { width: 100%; aspect-ratio: 1280 / 592; object-fit: cover; border-radius: 8px; opacity: 0.4; outline: 2px solid transparent; outline-offset: 2px; transition: opacity 0.3s ease, outline-color 0.3s ease; }
.picker span { display: block; margin-top: 11px; transition: color 0.3s ease; }
.picker button:hover img { opacity: 0.75; }
.picker button:hover span { color: var(--dim); }
.picker button[aria-selected="true"] img { opacity: 1; outline-color: var(--cream); }
.picker button[aria-selected="true"] span { color: var(--cream); }
.pic { max-width: 1100px; margin: 0 auto; aspect-ratio: 1280 / 592; cursor: pointer; touch-action: pan-y; }
.pic video, .pic canvas { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; user-select: none; -webkit-user-drag: none; }
.pic .plain, .pic .was { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.pic .plain { transition: opacity 0.15s ease; }
.pic.held .plain { opacity: 1; }
/* previous preset, held until the next one plays (site.js) */
.pic .was { transition: opacity 0.6s ease; }
.pic .was.on { opacity: 1; transition: none; }
.pic::before { content: "Without Horizon"; position: absolute; z-index: 3; left: 16px; top: 16px; padding: 7px 11px; border-radius: 7px; background: rgba(16, 11, 21, 0.75); font: 500 13px/1 var(--sans); color: var(--cream); opacity: 0; transition: opacity 0.15s ease; }
.pic.held::before { opacity: 1; }
.rest { margin: 18px 0 0; text-align: center; font-size: 14.5px; color: var(--faint); }

/* effects: six groups, three to a row */
.groups { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 20px); }
.groups li { aspect-ratio: 640 / 360; overflow: hidden; }
.groups video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.groups p { position: absolute; z-index: 3; left: 16px; bottom: 13px; margin: 0; display: flex; align-items: baseline; gap: 10px; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.groups b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--cream); }
.groups i { font-style: normal; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* the three questions, side by side */
.facts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(28px, 4vw, 64px); padding-top: clamp(28px, 3vw, 40px); border-top: 1px solid var(--line); }
.facts h3 { margin-bottom: 10px; font-size: 21px; letter-spacing: -0.02em; color: var(--cream); }
.facts p { margin: 0; color: var(--dim); font-size: 16px; line-height: 1.55; }
.facts a { color: var(--cream); }

/* ---- the end */
/* a horizon under it: the lit edge of something huge and dark coming up from below */
.end { position: relative; isolation: isolate; overflow: hidden; max-width: none; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(150px, 18vw, 240px); padding-bottom: clamp(220px, 24vw, 320px); }
.end::before { content: ""; position: absolute; z-index: -1; left: 50%; top: calc(100% - clamp(110px, 12vw, 160px)); width: max(2200px, 220vw); aspect-ratio: 1; translate: -50% 0; border-radius: 50%; pointer-events: none; background: linear-gradient(180deg, #140f1c, var(--air-low) 12%); box-shadow: 0 0 0 1px rgba(222, 206, 255, 0.6), 0 -8px 40px rgba(170, 120, 255, 0.35), 0 -40px 160px rgba(130, 80, 240, 0.28); }
.end h2 { font-size: clamp(48px, 7.6vw, 116px); line-height: 0.95; letter-spacing: -0.055em; }
.end p { margin: 22px 0 32px; color: var(--dim); font-size: 18px; }

/* ---- footer */
.foot { position: relative; z-index: 1; padding: 30px 0 44px; color: var(--faint); font-size: 14px; border-top: 1px solid var(--line); background: rgba(10, 8, 13, 0.6); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; justify-content: space-between; }
.foot .brand { color: var(--dim); font-size: 15px; }
.foot nav { display: flex; gap: 22px; }
.foot nav a { text-decoration: none; }
.foot a:hover { color: var(--cream); }
.foot p { margin: 0; flex: 0 0 100%; font-size: 13px; }

/* ---- docs */
pre { margin: 0; padding: clamp(18px, 2.2vw, 26px); border-radius: 12px; background: rgba(17, 13, 23, 0.85); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(244, 239, 230, 0.1); color: var(--dim); font: 400 14px/1.7 var(--mono); overflow-x: auto; tab-size: 4; }
code { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { padding: 0.12em 0.4em; border-radius: 5px; background: rgba(205, 185, 255, 0.11); white-space: nowrap; }
pre code { font-size: inherit; }
.k, .s { color: var(--ink); }
.c { color: var(--faint); font-style: italic; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px clamp(28px, 6vw, 96px); padding-top: clamp(120px, 14vw, 170px); padding-bottom: 110px; }
.toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 15px; scrollbar-width: thin; scrollbar-color: rgba(205, 185, 255, 0.25) transparent; }
.toc .eyebrow { display: block; margin-bottom: 10px; font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc ol + .eyebrow { margin-top: 28px; }
.toc a { display: block; padding: 5px 0; color: var(--dim); text-decoration: none; transition: color 0.2s ease; }
.toc a:hover { color: var(--cream); }
.toc .sub a { padding-left: 14px; font-size: 14px; color: var(--faint); }
.prose { min-width: 0; max-width: 800px; }
.prose h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1; letter-spacing: -0.05em; margin-bottom: 0.5em; background: var(--heading); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.06em; }
.prose h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.05; margin: 2.2em 0 0.6em; padding-top: 1.2em; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.prose h3 { font-size: 22px; letter-spacing: -0.015em; margin: 2em 0 0.5em; scroll-margin-top: 96px; }
.prose p, .prose li { color: var(--dim); }
.prose p strong, .prose li strong { color: var(--ink); font-weight: 600; }
.prose h1 + p { font-size: clamp(19px, 2vw, 23px); line-height: 1.4; color: var(--ink); max-width: 30em; }
.prose ol, .prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.35em 0; }
.prose pre { margin: 1.4em 0; }
.prose a { text-decoration-color: rgba(244, 239, 230, 0.5); }
.table { margin: 1.2em 0 1.6em; overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: rgba(17, 13, 23, 0.5); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
.prose th { text-align: left; font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--faint); padding: 12px 16px; white-space: nowrap; }
.prose td { padding: 11px 16px; border-top: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.prose td:first-child { color: var(--ink); }
.prose td code { background: none; padding: 0; white-space: normal; font-size: 13.5px; }
.prose td:first-child code { white-space: nowrap; }

/* ---- 404 */
.lost { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 120px var(--gutter); }
.lost h1 { font-size: clamp(48px, 9vw, 128px); line-height: 0.95; letter-spacing: -0.055em; background: var(--heading); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.06em; filter: var(--halo); }
.lost p { margin: 18px 0 30px; color: var(--dim); }

/* ---- motion */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes lift { from { opacity: 0; transform: translateY(70px); } }
@keyframes line { from { transform: translateY(110%); } }

/* on arrival: the headline comes up, then the words under it, then the HUD */
.home .top { animation: rise 0.9s var(--ease) 0.5s both; }
.home .hero h1 > span > b { animation: line 1.2s var(--ease) 0.2s both; }
.home .hero .lede { animation: rise 1s var(--ease) 0.45s both; }
.home .hero .acts { animation: rise 1s var(--ease) 0.55s both; }
.home .hero .slab { animation: lift 1.5s var(--ease) 0.7s both; }

/* further down, once each as they come on screen (site.js adds .in): headings come up, the rest rises and fades in */
.js .home .lines.rv > span > b { transform: translateY(110%); transition: transform 1.1s var(--ease); }
.js .home .lines.rv.in > span > b { transform: none; }
.js .home .up { opacity: 0; transform: translateY(32px); transition: opacity 0.9s ease var(--d, 0s), transform 1.1s var(--ease) var(--d, 0s); }
.js .home .up.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .links { display: none; }
  .bar .btn { margin-left: auto; }
  .picker { display: flex; overflow-x: auto; scrollbar-width: none; margin: 14px calc(-1 * var(--gutter)) 0; padding: 4px var(--gutter); }
  .picker button { flex: 0 0 132px; }
  .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .bar { padding-block: 13px; }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .prose th, .prose td { padding: 10px 12px; }
  .prose td:first-child code { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .win { transform: none; -webkit-mask-image: none; mask-image: none; }
  .js .home .lines.rv > span > b { transform: none; }
  .js .home .up { opacity: 1; transform: none; }
}
