/* Cruuvo public site. One stylesheet, no build step.
   Colour, radius, spacing and type-scale values come from the Cruuvo brand
   tokens (legacy cruuvo-web brand/tokens/tokens.css). The brand names Sora and
   Inter, but no font files exist to self-host, so a system stack is used. */

:root {
  --purple: #7c3aed;
  --purple-hover: #6d28d9;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --navy: #070b2d;
  --ink: #0b102f;
  --gradient: linear-gradient(135deg, var(--purple) 0%, var(--blue) 50%, var(--cyan) 100%);

  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #94a3b8;
  --fg: #0b102f;
  --fg-muted: #475569;
  --link: #6d28d9;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --on-primary: #ffffff;
  --focus: #2563eb;
  --ok-bg: #ecfdf3;
  --ok-fg: #14532d;
  --ok-border: #16a34a;
  --err-fg: #b91c1c;
  --err-border: #dc2626;
  --tint: #f3effe;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px rgba(7, 11, 45, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Avenir Next", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b2d;
    --surface: #10163f;
    --border: #2a3160;
    --border-strong: #6b76a8;
    --fg: #eef1fb;
    --fg-muted: #b4bcd6;
    --link: #c4b5fd;
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --on-primary: #0b102f;
    --focus: #7dd3fc;
    --ok-bg: #0f2e24;
    --ok-fg: #bbf7d0;
    --ok-border: #22c55e;
    --err-fg: #fca5a5;
    --err-border: #f87171;
    --tint: #171d4d;
    --shadow-sm: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 46rem; }

.skip {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--surface); color: var(--fg);
  padding: 0.5rem 0.75rem; border: 2px solid var(--focus); border-radius: var(--radius-sm);
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* The honeypot is kept out of sight and out of the tab order. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg); text-decoration: none; }
.brand img { width: 2.25rem; height: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; }
.brand-by { font-size: 0.72rem; color: var(--fg-muted); letter-spacing: 0.02em; margin-top: 0.15rem; }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.7rem 1.2rem; border-radius: var(--radius-md);
  border: 2px solid var(--primary); background: var(--primary); color: var(--on-primary);
  text-decoration: none; text-align: center; line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn-small { padding: 0.35rem 0.65rem; font-size: 0.875rem; border-width: 1px; border-radius: var(--radius-sm); }
.btn-quiet { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-quiet:hover { background: var(--tint); border-color: var(--fg-muted); }
.btn-danger { background: transparent; color: var(--err-fg); border-color: var(--err-border); }
.btn-danger:hover { background: var(--tint); border-color: var(--err-border); }

/* Landing */
.hero { padding: 3.5rem 0 2.5rem; }
.hero .lede { font-size: 1.3rem; max-width: 44ch; color: var(--fg); }
.status-line { color: var(--fg-muted); font-size: 0.95rem; margin-top: 1rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.5rem; }

.section { padding: 2.25rem 0; border-top: 1px solid var(--border); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1.5rem; padding: 0; list-style: none; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem; box-shadow: var(--shadow-sm); margin: 0;
}
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--fg-muted); }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 36rem) { .points { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .points { grid-template-columns: repeat(4, 1fr); } }
.points li { margin: 0; }
.points h2 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.points p { margin: 0; color: var(--fg-muted); }
.handoff { list-style: none; padding: 0; margin: 1rem 0 0; max-width: 40rem; }
.handoff li { margin: 0; padding: 0.7rem 0; border-top: 1px solid var(--border); font-size: 1.1rem; }
.handoff li:first-child { border-top: 0; }
.cta-note, .form-note { margin: 0; color: var(--fg-muted); font-size: 0.95rem; }
.form-note { margin-top: 0.9rem; }
.cta-band { background: var(--tint); }

/* Text pages */
.page { padding: 2.5rem 0 3.5rem; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.page h2 { margin-top: 1.75rem; font-size: 1.2rem; }
.page .updated { color: var(--fg-muted); font-size: 0.95rem; }
.placeholder { font-family: var(--font-mono); font-size: 0.95em; background: var(--tint); padding: 0.05em 0.35em; border-radius: var(--radius-sm); overflow-wrap: anywhere; }

/* Forms */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.field { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 700; margin-bottom: 0.4rem; padding: 0; }
.hint { display: block; color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
input[type="email"], input[type="text"], input[type="search"], textarea, select {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.6rem 0.7rem;
}
textarea { min-height: 7rem; resize: vertical; }
.choice { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.35rem 0; }
.choice input { width: 1.15rem; height: 1.15rem; margin: 0.25rem 0 0; flex: none; accent-color: var(--primary); }
.choice label { font-weight: 400; }
.error { color: var(--err-fg); font-size: 0.92rem; font-weight: 600; margin: 0.35rem 0 0; }
[aria-invalid="true"] { border-color: var(--err-border); border-width: 2px; }
.counter { color: var(--fg-muted); font-size: 0.85rem; text-align: right; margin: 0.25rem 0 0; }
.notice {
  border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: var(--radius-md);
  padding: 1rem 1.25rem; background: var(--surface); margin: 0 0 1.5rem;
}
.notice.ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-fg); }
.notice.ok a { color: inherit; }
.notice.bad { border-color: var(--err-border); }
.notice h2 { font-size: 1.25rem; margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 0 2rem; font-size: 0.92rem; color: var(--fg-muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.site-footer li { margin: 0; }
.site-footer p { margin: 0; }

/* Admin */
.admin main { padding: 1.5rem 0 3rem; }
.admin h1 { font-size: 1.6rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin: 1rem 0; }
.toolbar .field { margin: 0; flex: 1 1 12rem; }
.toolbar .field > label { font-size: 0.85rem; margin-bottom: 0.2rem; }
.toolbar input, .toolbar select { padding: 0.4rem 0.55rem; }
.stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1rem 0; }
.stats .card { padding: 0.9rem 1rem; }
.stats h2 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.stats dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem; font-size: 0.92rem; }
.stats dt { color: var(--fg-muted); }
.stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
caption { text-align: left; padding: 0.6rem 0.75rem; color: var(--fg-muted); }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-top: 1px solid var(--border); }
th { white-space: nowrap; font-size: 0.82rem; color: var(--fg-muted); }
td.q3, td.note { min-width: 14rem; max-width: 24rem; overflow-wrap: anywhere; white-space: pre-wrap; }
td.email { overflow-wrap: anywhere; min-width: 11rem; }
td.actions { min-width: 13rem; }
td.actions .btn { margin: 0 0.25rem 0.3rem 0; }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.pill.invited { border-color: var(--ok-border); color: var(--ok-fg); background: var(--ok-bg); }
.pill.declined { border-color: var(--err-border); color: var(--err-fg); }
.pill.past { border-color: var(--err-border); color: var(--err-fg); border-width: 2px; }
.pill.soon { border-style: dashed; }
.stats .card p { margin: 0.6rem 0 0; }
.uid { font-family: var(--font-mono); font-size: 0.95rem; background: var(--tint); padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); overflow-wrap: anywhere; display: inline-block; }
.status-msg { min-height: 1.5rem; color: var(--fg-muted); font-size: 0.92rem; }
.row-inline { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

@media (max-width: 30rem) {
  .hero { padding: 2.5rem 0 2rem; }
  .form { padding: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, a { transition: background-color 120ms ease, border-color 120ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
