/* Nerd Studio web pages. One calm doc column, the Nerd platform palette and type.
   Tokens copied from ../nerd-platform/apps/web/src/styles/theme.css and product-tokens.css (values written out, not linked). */

/* Fonts copied from ../nerd-platform/apps/web/src/vendor-fonts/fonts.css (self-hosted, OFL). */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/Schibsted_Grotesk_variable.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/static/fonts/Fraunces_variable.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* fig ink and its lifts */
  --ink: #1c1220;
  --ink-2: #55495c;
  --muted: #6f6678;
  /* one hue at a few alphas, as in theme.css */
  --ink-rgb: 28 18 32;
  --band: rgb(var(--ink-rgb) / 0.025);
  --fill: rgb(var(--ink-rgb) / 0.04);
  --line: rgb(var(--ink-rgb) / 0.085);
  --line-2: rgb(var(--ink-rgb) / 0.16);
  --bg: #ffffff;
  --surface: #ffffff;
  /* blueberry: links, focus, the one accent */
  --accent: #4b5be8;
  --accent-ink: #3542c4;
  --accent-soft: #e9ebff;
  /* primary action is fig, not blue (Design System CTA rule) */
  --cta: #1c1220;
  --cta-on: #fbfafc;
  /* status text on fills */
  --ok: #17803d;
  --ok-fill: #e4f8e9;
  --warn: #b35b00;
  --warn-fill: #fff0df;
  --info: #3542c4;
  --info-fill: #eef0ff;
  --danger: #c4183c;
  --danger-fill: #ffe7eb;

  --font-sans: "Schibsted Grotesk", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --r-md: 10px;
  --r-lg: 14px;
  --col: 680px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    /* dark values from theme.css `.dark` */
    --ink: #f3eff5;
    --ink-2: #b0a6b8;
    --muted: #8a8092;
    --ink-rgb: 255 255 255;
    --band: rgb(var(--ink-rgb) / 0.035);
    --fill: rgb(var(--ink-rgb) / 0.05);
    --line: rgb(var(--ink-rgb) / 0.09);
    --line-2: rgb(var(--ink-rgb) / 0.15);
    --bg: #120c16;
    --surface: #1e1524;
    --accent: #8091ff;
    --accent-ink: #a6b2ff;
    --accent-soft: rgba(128, 145, 255, 0.15);
    --cta: #f3eff5;
    --cta-on: #120c16;
    --ok: #8ce9a6;
    --ok-fill: rgba(91, 221, 126, 0.14);
    --warn: #ffc078;
    --warn-fill: rgba(255, 169, 77, 0.14);
    --info: #a6b2ff;
    --info-fill: rgba(128, 145, 255, 0.15);
    --danger: #ffa3b5;
    --danger-fill: rgba(255, 122, 147, 0.14);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--accent-soft); color: var(--ink); }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header and footer ---------- */
.top {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 24;
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}
.brand img { width: 32px; height: 32px; border-radius: 50%; display: block; background: #fff; }
.top nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top nav a, .top nav button.link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}
.top nav a:hover, .top nav button.link:hover { background: var(--fill); color: var(--ink); text-decoration: none; }

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px var(--gutter) 72px;
}

.foot {
  width: 100%;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.foot .inner { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.foot p { margin: 0; }

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--ink); margin: 0; }
h1 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 48;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 8px 0 12px;
  text-wrap: balance;
}
h2 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 18;
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
h3 { font-size: 0.95rem; font-weight: 600; margin: 20px 0 4px; color: var(--ink-2); }
p { margin: 0 0 12px; }
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
ul, ol { margin: 0 0 12px; padding-left: 1.3em; }
li { margin: 4px 0; }
li::marker { color: var(--muted); }
strong { font-weight: 600; }

/* ---------- Doc sections: hairline-separated, not boxed ---------- */
.doc > section, .doc > .section { padding: 28px 0; border-top: 1px solid var(--line); }
.doc > section:first-child { border-top: 0; padding-top: 0; }
.doc > header { padding-bottom: 28px; }

/* Kept for markup that still uses .card: a quiet bordered block. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin: 16px 0; }
.card.danger { border-color: color-mix(in oklab, var(--danger) 30%, transparent); }
.narrow { max-width: 440px; }

/* ---------- Home hero ---------- */
.hero { display: grid; gap: 20px; padding: 16px 0 36px; }
.hero .mascot { width: 104px; height: 104px; border-radius: 50%; display: block; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1.02; margin: 0; max-width: 14ch; }
.promise {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "WONK" 0, "opsz" 24;
  font-size: 1.25rem;
  line-height: 1.45;
  font-weight: 450;
  color: var(--ink);
  margin: 0;
  max-width: 34ch;
}
.steps { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; margin: 0; align-items: start; }
.steps li::before {
  content: counter(step);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 600;
  background: var(--fill); color: var(--ink-2);
}

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.button, button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--cta);
  border-radius: var(--r-md);
  background: var(--cta);
  color: var(--cta-on);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.12);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.button:hover, button:hover { background: color-mix(in oklab, var(--cta) 86%, var(--bg)); text-decoration: none; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.button.ghost:hover { border-color: var(--accent); color: var(--accent-ink); background: transparent; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .button.danger { color: #120c16; } }
.button.danger:hover { background: color-mix(in oklab, var(--danger) 88%, #000); }
button.link {
  background: none; border: 0; box-shadow: none; min-height: 0; padding: 0;
  color: var(--accent-ink); font-weight: 500; font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
button.link:hover { background: none; text-decoration-thickness: 2px; }
button:disabled { opacity: 0.6; cursor: wait; }
form.inline { display: inline; margin: 0; }

/* ---------- Badges and chips (Title Case in markup) ---------- */
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans);
  font-size: 0.75rem; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  background: var(--fill); color: var(--ink-2);
  letter-spacing: 0;
}
.badge.ok { background: var(--ok-fill); color: var(--ok); }
.badge.warn { background: var(--warn-fill); color: var(--warn); }
.badge.info { background: var(--info-fill); color: var(--info); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 12px; font-size: 0.9rem; font-weight: 500; color: var(--ink);
  background: var(--surface);
}

/* ---------- Connector URL field ---------- */
.field-label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
code.copy {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  background: var(--band);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin: 0 0 16px;
  user-select: all;
  -webkit-user-select: all;
  color: var(--ink);
}

/* ---------- Nerd page ---------- */
.nerd .handle { color: var(--muted); margin: 0 0 14px; font-size: 1rem; }
.nerd .handle strong { color: var(--ink-2); font-weight: 600; }
.nerd .why { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }

/* ---------- Lists with actions (Me) ---------- */
.rows { list-style: none; padding: 0; margin: 4px 0 0; }
.rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; margin: 0; border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; }
.rows .what { min-width: 0; overflow-wrap: anywhere; }
.rows .what .muted { margin-left: 6px; }
.rows form, .rows button { flex: none; }

.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 1.1rem;
}
.profile p { margin: 0; }

.flash {
  background: var(--ok-fill); color: var(--ok);
  font-weight: 500;
  padding: 10px 14px; border-radius: var(--r-md); margin: 0 0 20px;
}
.danger-zone {
  margin-top: 8px;
  border: 1px solid color-mix(in oklab, var(--danger) 28%, transparent);
  border-radius: var(--r-lg);
  padding: 20px;
}
.danger-zone h2 { color: var(--danger); }

/* ---------- Forms ---------- */
label { display: block; margin: 10px 0; font-weight: 500; font-size: 0.95rem; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--danger); margin: 0; }
input[type=email], input[type=text] {
  display: block;
  font: inherit; font-weight: 400;
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
input[type=email]:focus, input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Sign-in panel */
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 24px 0 8px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin #google { width: 100%; }
.signin .card { margin-top: 8px; }

/* Consent */
.consent .lists { display: grid; gap: 4px; }
.consent ul { list-style: none; padding: 0; }
.consent ul:last-child, .card > :last-child { margin-bottom: 0; }
.consent li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; }
.consent .can li::before { content: "\2713"; color: var(--ok); font-weight: 700; }
.consent .cannot li::before { content: "\2715"; color: var(--muted); font-weight: 700; }
.consent .actions button { flex: 1 1 140px; }

@media (max-width: 480px) {
  .top { padding-top: 14px; padding-bottom: 14px; }
  .rows li { flex-wrap: wrap; gap: 4px 16px; }
  main { padding-top: 12px; }
}

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