/* Starlit Arc — public site. Black sky, ivory type, one blue puck riding the arc. The only JavaScript is top.js. */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000;
  --ivory: #f2efe8;
  --stone: #a3a097;
  --ash: #6c6963;
  --champagne: #c9a96a;
  --hairline: rgb(242 239 232 / .1);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --hz: clamp(220px, 42vh, 420px); /* height of the horizon band */
  --spring: linear(0, 0.0294, 0.0993, 0.1892, 0.286, 0.3816, 0.4714, 0.5529, 0.6251, 0.6879, 0.7417, 0.7874, 0.8258, 0.8579, 0.8844, 0.9063, 0.9243, 0.939, 0.9509, 0.9606, 0.9684, 0.9748, 0.9799, 0.9839, 0.9872, 0.9898, 0.9919, 0.9936, 0.9949, 0.996, 0.9968, 0.9975, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ivory); background: var(--black);
  font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
}
a { color: inherit; }
::selection { background: rgb(201 169 106 / .35); }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 12px; }
.skip:focus { left: 12px; background: var(--ivory); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* header floats over the sky */
.top {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(22px, env(safe-area-inset-top)) var(--gutter) 22px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; letter-spacing: -.005em; }
.top nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.top nav a { text-decoration: none; color: var(--stone); font-size: .95rem; transition: color .15s ease; }
.top nav a:hover { color: var(--ivory); }

/* the night sky */
.sky {
  position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  padding: 120px var(--gutter) calc(var(--hz) * .55);
  background: url("/stars.svg") center / cover no-repeat, var(--black);
}
.sky-copy { max-width: 46rem; text-align: center; }
.kicker { text-wrap: balance; margin: 0 0 22px; color: var(--stone); font-size: .98rem; letter-spacing: .01em; }
h1 {
  margin: 0; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 72;
  font-size: clamp(2.9rem, 8.4vw, 6.4rem); line-height: .98; letter-spacing: -.028em; text-wrap: balance;
}
.lede { margin: 26px auto 0; max-width: 34rem; color: var(--stone); font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.6; text-wrap: pretty; }
.actions { margin: 36px 0 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; text-decoration: none;
  font-size: .98rem; font-weight: 550; transition: transform 90ms ease-out, background-color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn-solid { background: var(--ivory); color: #000; }
.btn-solid:hover { background: #fff; }
.btn-ghost { border: 1px solid rgb(242 239 232 / .22); color: var(--ivory); }
.btn-ghost:hover { border-color: rgb(242 239 232 / .5); }

/* the horizon: a soft glow with the arc rising across it, revealed once on load */
.horizon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: var(--hz); z-index: -1; }
.horizon .arc { animation: rise 1.8s var(--spring) .2s both; }
@keyframes rise { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* RaceNet's blue map puck, gliding in along the arc and coming to rest at t = .62.
   --t is the arc's own parameter (M-40 420 Q800 40 1640 420), so the puck is placed with
   the curve's equations: x = -40 + 1680t, y = 420 - 760t + 760t², slope dy/dx = (1520t - 760) / 1680.
   The arc is stretched (preserveAspectRatio="none"), so the on-screen slope is scaled by
   (--hz / 420) / (width / 1600); atan2 turns that into the heading. It shares the arc's
   duration and spring but only travels ~65% of the width, so it always trails the drawing
   edge and settles as the line finishes. */
@property --t { syntax: "<number>"; inherits: true; initial-value: .62; }
.puck {
  position: absolute; z-index: -1; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  left: calc((-40 + 1680 * var(--t)) / 1600 * 100%);
  top: calc(100% - var(--hz) + (420 - 760 * var(--t) + 760 * var(--t) * var(--t)) / 420 * var(--hz));
  animation: glide 1.8s var(--spring) .2s both;
}
.puck svg {
  display: block; width: 100%; height: 100%; overflow: visible;
  transform: rotate(96deg);                                           /* fallback: no CSS atan2 */
  transform: rotate(calc(90deg + atan2(calc((1520 * var(--t) - 760) * .0022676 * var(--hz)), 100vw)));
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / .3));
}
@keyframes glide { from { --t: 0; opacity: 0; } 12% { opacity: 1; } to { --t: .62; opacity: 1; } }

/* about */
.about {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(28px, 6vw, 96px);
  max-width: 1120px; margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter);
}
.about h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-variation-settings: "opsz" 48; font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; }
.about-body { max-width: 40rem; }
.about-body p { margin: 0 0 20px; color: var(--stone); }
.about-body .about-lead { color: var(--ivory); font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.4; letter-spacing: -.005em; margin-bottom: 28px; }
.beliefs { margin: 44px 0; border-top: 1px solid var(--hairline); }
.beliefs > div { display: grid; grid-template-columns: 9rem 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.beliefs dt { font-family: var(--serif); font-size: 1.2rem; color: var(--ivory); }
.beliefs dd { margin: 0; color: var(--stone); }
.contact a { color: var(--ivory); text-decoration-color: rgb(242 239 232 / .35); text-underline-offset: 3px; }
.contact a:hover { text-decoration-color: var(--champagne); }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1120px; margin: 0 auto;
  padding: 26px var(--gutter) max(30px, env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline);
  color: var(--ash); font-size: .9rem;
}
.foot a { color: var(--ash); text-decoration: none; }
.foot a:hover { color: var(--ivory); }

@media (max-width: 720px) {
  .about { grid-template-columns: 1fr; }
  .beliefs > div { grid-template-columns: 1fr; gap: 4px; }
  .btn { min-width: 60%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .horizon .arc, .puck { animation: none; }
  .btn:active { transform: none; }
}
@media (prefers-contrast: more) {
  :root { --stone: #d6d2c8; --ash: #b7b3aa; --hairline: rgb(242 239 232 / .35); }
}
