/* Agentmatik Legal - waitlist landing
   Design system: Agentmatik Warm (brand repo ~/code/brand)
   Cream + two oranges + ink, Instrument Sans, one Instrument Serif italic accent.
   No gradients anywhere (brand rule). Solid fills only. */

/* ---------- Fonts (self-hosted, subset latin + latin-ext) ---------- */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrumentsans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrumentsans-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrumentsans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrumentserif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Agentmatik Warm - locked palette */
  --cream: #FBF0E0;
  --cream-deep: #F4E3CB;
  --orange: #F39340;
  --deep-orange: #D96A1E;
  --ink: #0F0F0F;
  --gray-line: #D9CFC0;

  /* Semantic */
  --bg: var(--cream);
  --surface: var(--cream-deep);
  --heading: var(--ink);
  --body: #55504a;        /* warmer, darker than brand gray #666 - keeps 7:1 on cream */
  --accent: var(--deep-orange);
  --accent-warm: var(--orange);
  --line: var(--gray-line);
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  --focus-ring: #B4551A;

  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --radius-card: 10px;
  --radius-pill: 999px;
  --container: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171310;
    --surface: #221C16;
    --heading: #F6EDDD;
    --body: #C9BEAD;
    --accent: #F39340;        /* warm orange reads better than deep orange on dark */
    --accent-warm: #F39340;
    --line: #3A322A;
    --btn-bg: #F39340;
    --btn-fg: #171310;
    --focus-ring: #F39340;
  }
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 3.8vw, 2.75rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.012em; }
h3 { font-size: 1.125rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: 65ch; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--heading); }

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

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

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 10;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.15s ease-out;
}
.skip-link:focus-visible { top: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform 0.12s ease-out, background-color 0.15s ease-out;
}
.btn:hover { background: var(--accent); color: var(--cream); }
@media (prefers-color-scheme: dark) {
  .btn:hover { background: #F6EDDD; color: #171310; }
}
.btn:active { transform: translateY(1px); }
.btn-primary { padding: 14px 30px; font-size: 1.0625rem; }
.btn-small { padding: 9px 20px; font-size: 0.9375rem; }

.link-quiet {
  color: var(--heading);
  font-weight: 600;
  text-decoration-color: var(--accent-warm);
  text-decoration-thickness: 2px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  font-weight: 700;
  font-size: 1.1875rem;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark-tag {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 8vh, 88px) 0 clamp(40px, 7vh, 72px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.pilot-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--deep-orange);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin: 0 0 20px;
}
@media (prefers-color-scheme: dark) {
  .pilot-badge { color: #171310; background: var(--orange); }
}

.accent-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  padding-bottom: 0.05em; /* descender clearance */
}

.hero-sub {
  font-size: 1.1875rem;
  margin: 20px 0 28px;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Sample answer figure */

.sample-answer {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px 28px 22px;
}
.sample-caption {
  font-size: 0.8125rem;
  color: var(--body);
  margin-bottom: 14px;
}
.sample-q {
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 14px;
}
.sample-a { border-top: 1px solid var(--line); padding-top: 14px; }
.sample-a p { font-size: 0.9875rem; }
.sample-cite {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--heading);
}
.cite-chip {
  display: inline-block;
  background: var(--deep-orange);
  color: var(--cream);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-right: 6px;
}
@media (prefers-color-scheme: dark) {
  .cite-chip { background: var(--orange); color: #171310; }
}

/* ---------- Value props ---------- */

.values { padding: clamp(40px, 7vh, 72px) 0; border-top: 1px solid var(--line); }

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.value { padding: 0 32px; border-left: 1px solid var(--line); }
.value:first-child { border-left: none; padding-left: 0; }
.value h3 { margin-bottom: 8px; }
.value p { font-size: 0.9875rem; margin: 0; }

/* ---------- How it works ---------- */

.how { padding: clamp(48px, 8vh, 88px) 0; }
.how h2 { margin-bottom: 36px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step-num {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
}
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; font-size: 0.9875rem; }

/* ---------- Trust strip ---------- */

.trust {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding: 32px 0;
}
.trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.trust-row p { margin: 0; font-size: 0.9375rem; }
.trust-row strong {
  display: block;
  color: var(--heading);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------- Pro koho ---------- */

.who { padding: clamp(48px, 8vh, 88px) 0; }
.who-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.who-list { margin: 0; }
.who-row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.who-row:last-child { border-bottom: 1px solid var(--line); }
.who-row dt { font-weight: 700; color: var(--heading); }
.who-row dd { margin: 4px 0 0; font-size: 0.9875rem; }

/* ---------- Register form ---------- */

.register {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: clamp(48px, 8vh, 88px) 0;
}
.register-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.register-intro p { font-size: 1.0625rem; }

.interest-form { display: grid; gap: 22px; }

.field { margin: 0; padding: 0; border: none; }
.field label,
.field legend {
  display: block;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 8px;
  font-size: 0.9875rem;
}
.legend-note { font-weight: 400; color: var(--body); }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--heading);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
input::placeholder, textarea::placeholder { color: var(--body); opacity: 0.75; }
input[aria-invalid="true"],
textarea[aria-invalid="true"],
.field-invalid .choice input {
  border-color: #B43A28;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.field .choice,
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--heading);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  margin-bottom: 0;
  font-size: 0.9875rem;
}
.choice:has(input:checked) {
  border-color: var(--deep-orange);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--deep-orange);
}
.choice input { accent-color: var(--deep-orange); margin: 0; }
@media (prefers-color-scheme: dark) {
  .choice:has(input:checked) { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
  .choice input { accent-color: var(--orange); }
}

.choice-consent {
  border-radius: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  line-height: 1.5;
}
.choice-consent input { margin-top: 4px; flex-shrink: 0; }
.choice-consent span { font-size: 0.9375rem; }

.field-error {
  color: #9E2F1F;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 6px 0 0;
}
@media (prefers-color-scheme: dark) {
  .field-error { color: #F0917B; }
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.btn-submit { justify-self: start; }
.btn-submit[disabled] { opacity: 0.6; cursor: wait; }

.form-status { margin: 0; font-weight: 600; color: var(--heading); min-height: 1.5em; }
.form-status.is-error { color: #9E2F1F; }
@media (prefers-color-scheme: dark) {
  .form-status.is-error { color: #F0917B; }
}

.form-success {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 32px;
}
.form-success h3 { font-size: 1.375rem; }
.form-success p { margin: 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
}
.footer-grid { display: grid; gap: 10px; }
.footer-brand { font-weight: 700; color: var(--heading); margin: 0; }
.footer-contact { margin: 0; font-size: 0.9375rem; }
.footer-legal { font-size: 0.875rem; margin: 8px 0 0; max-width: 70ch; }
.footer-copy { font-size: 0.875rem; margin: 8px 0 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid,
  .who-grid,
  .register-grid { grid-template-columns: 1fr; }

  .values-grid { grid-template-columns: 1fr; gap: 28px; }
  .value { border-left: none; padding: 0; }

  .trust-row { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .hero-actions { gap: 16px; }
  .btn-primary { width: 100%; text-align: center; }
  .btn-submit { justify-self: stretch; }
  .step { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
}
