/* TurnUp static site.
 *
 * The palette and the light/dark mechanism are lifted from the app so the two
 * halves of turnup.fyi match: this bucket serves /, the app serves /terms and
 * /privacy, and a visitor crossing between them should not see the brand
 * change. Sources:
 *   nextjs/turnup/www/src/lib/brand/palette.ts  (the ramps)
 *   nextjs/turnup/www/src/app/globals.css       (dark default + light remap)
 *
 * Ramps are copied rather than imported because there is no build step here —
 * that is the point of a static site. If the brand palette moves, move these.
 */

:root {
  /* Hot magenta. */
  --p-50:  #fff0f8;
  --p-100: #ffd9ee;
  --p-200: #ffb0dc;
  --p-300: #ff7ac4;
  --p-400: #ff4fb0;
  --p-500: #ff2ca2;
  --p-600: #e01388;
  --p-700: #b30a6b;
  --p-800: #7d0a4c;
  --p-900: #4d0a30;
  --p-950: #2f0a1e;

  /* Bone -> Plum Black. Plum-biased neutrals, 50 lightest text -> 950 page. */
  --n-50:  #efe9f0;
  --n-100: #e3dee4;
  --n-200: #ccc7ce;
  --n-300: #b5b0b7;
  --n-400: #9e99a1;
  --n-500: #87818a;
  --n-600: #706b73;
  --n-700: #59535d;
  --n-800: #423d46;
  --n-900: #2b2530;
  --n-950: #140f1a;

  --accent: var(--p-400);
  --bad:    #f87171;

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;

  /* The site ships dark. color-scheme drives native controls (form fields,
     scrollbars) so they are not light chrome on a dark page. */
  color-scheme: dark;
}

/* Light is the same scale read from the opposite end, exactly as the app does
   it — one remap, so every rule below keeps using the same tokens. */
:root[data-theme="light"] {
  --n-50:  #140f1a;
  --n-100: #2b2530;
  --n-200: #423d46;
  --n-300: #59535d;
  --n-400: #706b73;
  --n-500: #9e99a1;
  --n-600: #b5b0b7;
  --n-700: #ccc7ce;
  --n-800: #e3dee4;
  --n-900: #efe9f0;
  --n-950: #faf5fb;

  /* 400 is tuned for a dark page; on the light page it fails contrast against
     body text, so the accent steps down the ramp. */
  --accent: var(--p-600);
  --bad:    #b91c1c;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--n-950);
  color: var(--n-50);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- masthead ---------- */

header {
  padding-block: 24px;
  border-bottom: 1px solid var(--n-800);
}

header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--n-50);
}

.mark img { width: 30px; height: 30px; display: block; }

.mark span {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.state {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--n-300);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.state:hover { color: var(--n-50); }
.state:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Theme toggle: two glyphs, one shown per theme, so the control says what it
   will do rather than what is currently true. */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--n-400);
  cursor: pointer;
  padding: 7px;
  display: inline-flex;
  line-height: 0;
}

.theme-toggle:hover { color: var(--n-50); border-color: var(--n-800); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-toggle svg { width: 18px; height: 18px; display: block; }

.theme-toggle .to-light { display: block; }
.theme-toggle .to-dark  { display: none; }
:root[data-theme="light"] .theme-toggle .to-light { display: none; }
:root[data-theme="light"] .theme-toggle .to-dark  { display: block; }

/* ---------- main ---------- */

main { flex: 1 0 auto; padding-block: clamp(56px, 12vh, 120px) 72px; }

h1 {
  font-size: clamp(2.6rem, 7.5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 700;
  margin: 0 0 24px;
  max-width: 15ch;
  text-wrap: balance;
}

h1 .accent { color: var(--accent); }

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--n-300);
  max-width: var(--measure);
  margin: 0;
}

.lede strong { color: var(--n-50); font-weight: 600; }

/* ---------- invite form ---------- */

.request {
  margin-top: 48px;
  padding-top: 34px;
  border-top: 1px solid var(--n-800);
  max-width: var(--measure);
}

.request h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--n-400);
  margin: 0 0 16px;
}

form { display: flex; flex-wrap: wrap; gap: 10px; }

label.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

input[type="email"],
input[type="password"] {
  background: var(--n-900);
  border: 1px solid var(--n-800);
  border-radius: 6px;
  color: var(--n-50);
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  width: 100%;
}

.request input[type="email"] { flex: 1 1 17rem; min-width: 0; width: auto; }

input::placeholder { color: var(--n-500); }

input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

button.primary {
  flex: 0 0 auto;
  background: var(--p-600);
  color: #fff;
  border: 1px solid var(--p-600);
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

button.primary:hover:not(:disabled) { background: var(--p-500); border-color: var(--p-500); }
button.primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary:disabled { opacity: .5; cursor: default; }

.note {
  margin: 14px 0 0;
  font-size: .93rem;
  color: var(--n-400);
  min-height: 1.5em;
}

.note.ok  { color: var(--n-200); }
.note.bad { color: var(--bad); }

/* ---------- sign-in card ---------- */

.card { width: 100%; max-width: 23rem; margin-inline: auto; }

.card h1 {
  font-size: 1.9rem;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  max-width: none;
}

.card .sub { color: var(--n-400); margin: 0 0 28px; font-size: .97rem; }

.card form { flex-direction: column; flex-wrap: nowrap; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--n-400);
}

.card button.primary { width: 100%; margin-top: 4px; }

.error {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-size: .93rem;
  color: var(--bad);
}

.alt {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--n-800);
  font-size: .93rem;
  color: var(--n-400);
}

.alt a { color: var(--n-200); text-decoration: none; border-bottom: 1px solid var(--n-700); }
.alt a:hover { color: var(--n-50); border-bottom-color: var(--n-500); }
.alt a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--n-800);
  padding-block: 24px 32px;
  font-size: .88rem;
  color: var(--n-500);
}

footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: baseline;
  justify-content: space-between;
}

footer p { margin: 0; }

footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }

footer a {
  color: var(--n-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

footer a:hover { color: var(--n-50); border-bottom-color: var(--n-600); }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
