/* Keel website: shared styles */
:root {
  --night: #09090b;
  --ink: #f5f6f8;
  --ink-soft: rgba(236, 238, 244, 0.68);
  --ink-faint: rgba(236, 238, 244, 0.5);
  --line: rgba(255, 255, 255, 0.09);
  --field: #111114;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
a { color: inherit; }
::selection { background: rgba(255, 255, 255, 0.2); }

/* ---------- Landing ---------- */
.stage {
  --rim: 15svh;   /* how far the planet's edge sits above the bottom of the page */
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -3; }

/* Blue light along the top: a faint wash, plus one glow that wanders slowly
   across the top edge (right -> centre -> left and back, about 70 s each way) and breathes */
.haze {
  position: absolute; inset: 0; z-index: -4; pointer-events: none;
  background: radial-gradient(120% 60% at 50% -12%, rgba(30, 70, 170, 0.22), transparent 70%);
}
.glow {
  position: absolute; z-index: -4; pointer-events: none;
  top: -38vmax; left: 50%;
  width: 95vmax; height: 70vmax;
  margin-left: -47.5vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(60, 120, 240, 0.55), rgba(35, 87, 201, 0.26) 45%, rgba(20, 50, 140, 0.08) 72%, transparent 100%);
  filter: blur(10px);
  animation: wander 140s ease-in-out infinite, breathe 12s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes wander {
  0%   { transform: translate(38vw, 2vh) scale(1); }
  25%  { transform: translate(8vw, -1vh) scale(1.08); }
  50%  { transform: translate(-34vw, 3vh) scale(.95); }
  75%  { transform: translate(-6vw, 0) scale(1.05); }
  100% { transform: translate(38vw, 2vh) scale(1); }
}
@keyframes breathe { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }

/* The horizon: a vast dark planet whose edge catches the light from behind */
.horizon {
  position: absolute;
  left: 50%;
  top: calc(100% - var(--rim));
  width: max(1150px, 102vw);
  aspect-ratio: 3.2 / 1;
  translate: -50% 0;
  z-index: -1;
  pointer-events: none;
  animation: horizon-in 2.4s cubic-bezier(.2, .7, .1, 1) both;
}
/* light spilling up into the sky, strongest at the centre of the edge */
.horizon__glow {
  position: absolute;
  left: 50%; top: 0;
  width: 64%; height: 70%;
  translate: -50% -86%;
  background: radial-gradient(50% 62% at 50% 100%, rgba(225, 230, 240, 0.42), rgba(150, 160, 178, 0.16) 42%, transparent 74%);
  filter: blur(8px);
  animation: dawn 10s ease-in-out infinite;
}
.horizon__body {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #121214 0%, #0a0a0b 6%, #070708 30%);
  /* the thin bright edge, then its soft bloom */
  box-shadow:
    inset 0 3px 1px -1px #fff,
    inset 0 4px 3px -1px rgba(255, 255, 255, 0.85),
    inset 0 12px 22px -8px rgba(235, 240, 250, 0.5),
    0 -2px 6px rgba(255, 255, 255, 0.6),
    0 -8px 28px rgba(225, 232, 245, 0.28);
  /* the edge fades out towards both ends */
  -webkit-mask: linear-gradient(90deg, transparent 6%, #000 30%, #000 70%, transparent 94%);
          mask: linear-gradient(90deg, transparent 6%, #000 30%, #000 70%, transparent 94%);
}

@keyframes horizon-in { from { opacity: 0; translate: -50% 3svh; } to { opacity: 1; translate: -50% 0; } }
@keyframes dawn { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }

/* ---------- Content ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 0 16px 9svh;
  position: relative; z-index: 2;
}

/* each piece (and each word) arrives out of a soft blur */
.in { opacity: 0; filter: blur(10px); translate: 0 6px; animation: focus .9s cubic-bezier(.2, .7, .1, 1) forwards; animation-delay: var(--d, 0s); }
/* each word gets room for descenders and italic overhang, or the blur layer clips them (y, f, g) */
.w { display: inline-block; white-space: pre; padding: .12em .2em .4em; margin: -.12em -.2em -.4em; }
/* ends on filter:none so no blur layer is left behind to clip the italic f's tail */
@keyframes focus { to { opacity: 1; filter: blur(0); translate: 0 0; } }
.in.settled { animation: none; opacity: 1; filter: none; translate: none; }

.pill {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px; font-weight: 500; color: var(--ink);
  text-decoration: none;
  transition: background .2s;
}
.pill:hover { background: rgba(255, 255, 255, 0.12); }

/* the Keel mark; its star (left quarter of the logo) glows and breathes, like the app's KeelGlow */
.mark { position: relative; margin: 18px 0 20px; width: 128px; }
.logo { width: 100%; height: auto; display: block; position: relative; }
.mark__glow {
  position: absolute;
  left: 13.2%; top: 50%;
  width: 230%; aspect-ratio: 1;
  max-width: 104px;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.8), rgba(170, 205, 255, 0.4) 28%, rgba(92, 162, 252, 0.14) 58%, transparent 100%);
  animation: star-glow 4.5s ease-in-out infinite;
  pointer-events: none;
}
.mark .logo { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35)); }
@keyframes star-glow { 0%, 100% { opacity: .55; scale: .85; } 50% { opacity: 1; scale: 1.08; } }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 em { font-style: italic; font-weight: 600; padding-right: .06em; }

.lede {
  margin-top: 18px;
  max-width: 43rem;
  font-size: clamp(15px, 1.4vw, 16.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: balance;
}

.signup { margin-top: 30px; width: min(420px, 100%); }
.field {
  display: flex; align-items: center; gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid var(--line);
  transition: border-color .25s;
}
.field:focus-within { border-color: rgba(255, 255, 255, 0.28); }
.field input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  padding: 0 12px;
  font: inherit; font-size: 15px; color: var(--ink);
}
.field input::placeholder { color: var(--ink-faint); }
.btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 0; border-radius: 8px;
  background: #f2f2f3; color: #0b0b0d;
  font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .2s, transform .15s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.note { margin-top: 12px; font-size: 12.5px; color: var(--ink-faint); min-height: 1.3em; }
.note.err { color: #ffb4b4; }

.done { display: none; flex-direction: column; align-items: center; gap: 4px; }
.done strong { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 24px; }
.done span { font-size: 14px; color: var(--ink-soft); }
.signup.is-done .field, .signup.is-done .note { display: none; }
.signup.is-done .done { display: flex; animation: focus .9s forwards; }

/* launch mode: App Store button instead of the email box */
.launch { display: none; margin-top: 30px; flex-direction: column; align-items: center; }
.launch .btn { height: 50px; padding: 0 24px; border-radius: 12px; font-size: 15px; }
.launch .btn svg { width: 19px; height: 19px; }
body[data-mode="launch"] .signup { display: none; }
body[data-mode="launch"] .launch { display: flex; }

.foot {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 20px 16px 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-faint);
}
.foot a { text-decoration: none; transition: color .2s; }
.foot a:hover { color: var(--ink); }
.foot .dot { opacity: .5; }

@media (max-width: 560px) {
  .hero { padding-bottom: 12svh; }
  h1 { font-size: 35px; }
  h1 br { display: none; }
  .mark { width: 112px; margin: 18px 0 14px; }
  .stage { --rim: 13svh; }
  .horizon { width: 260vw; aspect-ratio: 3 / 1; }
  .horizon__glow { width: 46%; }
  /* email and button stay side by side on phones, as on desktop */
  .field { padding: 4px; gap: 4px; }
  .field input { padding: 0 10px; font-size: 16px; } /* 16px stops iPhone zooming in on tap */
  .field .btn { height: 42px; padding: 0 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
}

/* ---------- Legal pages ---------- */
.legal { position: relative; min-height: 100svh; overflow-x: hidden; }
.legal .top {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px clamp(16px, 4vw, 40px);
  font-size: 13px; color: var(--ink-soft);
  background: linear-gradient(180deg, rgba(9, 9, 11, 0.95), rgba(9, 9, 11, 0));
}
.legal .top a { text-decoration: none; }
.legal .top a:hover { color: var(--ink); }
.legal .top img { width: 84px; display: block; }
.doc {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 110px;
  line-height: 1.7;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.doc h1 { color: var(--ink); font-size: clamp(38px, 6vw, 56px); }
.doc .meta { margin: 14px 0 34px; font-size: 13px; color: var(--ink-faint); }
.doc .summary {
  margin: 0 0 40px; padding: 22px 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.doc .summary p { color: var(--ink); }
.doc .summary ul { margin-top: 10px; }
.doc h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; color: var(--ink); margin: 44px 0 12px; letter-spacing: -0.01em; }
.doc h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 22px 0 6px; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 10px 0 0 20px; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--ink); font-weight: 600; }
.doc .tbl { overflow-x: auto; }
