/* Darvy marketing site — shared styles
 *
 * Design tokens match the investor deck at /deck:
 *   - Inter sans, generous whitespace
 *   - Cobalt accent (#1d4ed8 light / #60a5fa dark) used SPARINGLY
 *   - System dark mode via prefers-color-scheme
 *
 * Accessibility budget (WCAG 2.1 AA):
 *   - Body text contrast ≥ 7:1 (#111 on #fff = 19.6:1; #f5f5f4 on #0d0d0d = 17.4:1)
 *   - Muted text contrast checked: #666 on #fff = 5.7:1 (passes AA for normal text)
 *   - Focus indicator: 3px solid outline + 2px offset (visible on all themes)
 *   - prefers-reduced-motion honored (see bottom)
 *   - Min tap target 44x44px on interactive elements
 */

:root {
  color-scheme: light dark;
  --ink: #111;
  --paper: #ffffff;
  --muted: #555;       /* darker than deck's #666 for stricter AA pass */
  --rule: #e5e5e5;
  --accent: #1d4ed8;   /* deep cobalt — same as deck */
  --accent-ink: #ffffff;
  --danger: #b91c1c;
  --success: #15803d;
  --card-bg: #fafafa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f4;
    --paper: #0d0d0d;
    --muted: #a0a0a0;
    --rule: #2a2a2a;
    --accent: #60a5fa;
    --accent-ink: #0d0d0d;
    --danger: #fca5a5;
    --success: #86efac;
    --card-bg: #161616;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link — visually hidden until focused. Critical for keyboard / screen
 * reader users to bypass the nav on every page. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  z-index: 2000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ── Header / nav ─────────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
}
.brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
}
.site-nav a:hover { background: var(--card-bg); }
.site-nav a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.site-nav a[aria-current="page"] {
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
}

/* ── Layout ───────────────────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
main { padding: 64px 0 96px 0; }
main > section { margin-bottom: 96px; }
main > section:last-child { margin-bottom: 0; }

/* ── Typography ───────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 24px 0;
}
h1 { font-size: 56px; letter-spacing: -0.03em; }
h2 { font-size: 36px; }
h3 { font-size: 22px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

p { margin: 0 0 16px 0; max-width: 68ch; }
p.lead { font-size: 22px; line-height: 1.5; color: var(--ink); max-width: 32ch; }
p.muted { color: var(--muted); }

.section-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 18px;
}

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

ul, ol { padding-left: 22px; margin: 0 0 16px 0; }
ul li, ol li { margin-bottom: 8px; }

strong { font-weight: 700; }
.accent { color: var(--accent); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 48px 0;
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 24px;
  min-height: 48px;          /* tap target ≥ 44 */
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  line-height: 1.2;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn.secondary:hover { background: var(--ink); color: var(--paper); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0;
}

/* ── Cards / grids ────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
  background: var(--card-bg);
}
.card h3 { margin-top: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* "→" example bullets — same look as the deck */
.examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.examples li {
  font-size: 19px;
  font-weight: 500;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--card-bg);
  border-radius: 0 8px 8px 0;
  line-height: 1.45;
  margin: 0;
}
.examples li .marker {
  color: var(--muted);
  font-weight: 400;
  margin-right: 6px;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero {
  padding: 48px 0 32px 0;
}
.hero h1 { max-width: 18ch; }
.hero .lead { margin-bottom: 32px; }
@media (max-width: 640px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  p.lead { font-size: 19px; }
}

/* ── Pricing card ─────────────────────────────────────────────────── */

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 24px 0;
}
.price .amount {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price .period { color: var(--muted); font-size: 18px; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}
.feature-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  margin: 0;
}
.feature-list li .check {
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

/* ── Forms ────────────────────────────────────────────────────────── */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 15px;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.form-hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 14px; margin-top: 4px; font-weight: 600; }

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 48px 0 40px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
.site-footer h4 { color: var(--ink); margin-bottom: 14px; font-size: 13px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.site-footer .legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  font-size: 13px;
}

/* ── Misc ─────────────────────────────────────────────────────────── */

.callout {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 6px;
  background: var(--card-bg);
  margin: 24px 0;
}
.callout p:last-child { margin-bottom: 0; }

table.plain {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}
table.plain th,
table.plain td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
table.plain th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

details {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
details summary {
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
  padding-right: 32px;
  position: relative;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
}
details[open] summary::after { content: "−"; }
details summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
details > *:not(summary) { margin-top: 14px; }

/* sr-only helper for accessibility — visually hidden but readable */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion ───────────────────────────────────────────────── */

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

/* AEO heading-hierarchy fix: footer column titles are h3 (for screen-reader
   heading nav) but keep the small-caps footer look; step eyebrows are labels. */
.site-footer h3 { color: var(--ink); margin-bottom: 14px; font-size: 13px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.step-eyebrow { font-size: 14px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin: 0 0 6px; }
