/* ==========================================================================
   Square One, All Business — Phase 1 marketing site
   Design tokens + shared styles. Built against the approved Build Spec
   (claude/product-build-phase1-website-spec.md, approved 2026-08-30).

   PALETTE RULE (WCAG, verified in the spec):
   - Slate Light #9FB8C9 is decorative-accent and DARK-BACKGROUND text only.
     Never text on white/off-white at any size (2.06:1 / 1.89:1 — hard fail).
   - Navy Deep on white: 17.54:1. Steel Blue on white: 8.90:1. Both pass AA.
   ========================================================================== */

:root {
  /* Color tokens */
  --navy: #081A2E;        /* Navy Deep — primary text on light, dark surfaces */
  --steel: #1F4E6B;       /* Steel Blue — links, accents on light bg */
  --slate: #9FB8C9;       /* Slate Light — DARK BACKGROUNDS ONLY */
  --offwhite: #F2F5F7;
  --white: #FFFFFF;
  --rule: #D8E0E6;        /* hairline borders on light surfaces */

  /* Type tokens — font is a late-binding swap per spec */
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Layout */
  --measure: 42rem;       /* readable line length */
  --wide: 68rem;          /* page shell */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--offwhite);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}
.site-header .shell {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--navy);
}
.brand svg { display: block; }
.brand .brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.brand .brand-sub {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--steel);
}

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  color: var(--navy);
  border-radius: 4px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { background: var(--offwhite); }
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--steel);
  font-weight: 600;
}

/* ---------- Shell ---------- */
.shell {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; }

/* ---------- Hero (dark) ----------
   Signature element: a faint ledger-grid over Navy Deep — the bookkeeping
   vernacular, kept quiet. Slate Light is safe here (8.5:1 on navy). */
.hero {
  background:
    linear-gradient(rgba(8, 26, 46, 0.92), rgba(8, 26, 46, 0.97)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(159, 184, 201, 0.35) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(159, 184, 201, 0.35) 31px 32px),
    var(--navy);
  color: var(--white);
  padding: 4.5rem 0 4rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  max-width: 22ch;
}
.hero p.lede {
  color: var(--slate); /* on navy: 8.5:1 — passes */
  font-size: 1.15rem;
  max-width: var(--measure);
  margin: 0 0 1.75rem;
}
.hero .eyebrow {
  color: var(--slate);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

/* Page-title band for interior pages */
.page-title {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 0 2.25rem;
}
.page-title h1 { margin: 0 0 0.35rem; font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
.page-title p { margin: 0; color: var(--slate); max-width: var(--measure); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary { background: var(--white); color: var(--navy); }
.btn-primary:hover { background: var(--offwhite); }
.btn-outline { border-color: var(--slate); color: var(--white); }
.btn-outline:hover { background: rgba(159, 184, 201, 0.15); }
.btn-steel { background: var(--steel); color: var(--white); }
.btn-steel:hover { background: #17405a; }

a { color: var(--steel); }
a:focus-visible, .btn:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 2px;
}

/* ---------- Sections ---------- */
.section { padding: 3rem 0; }
.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}
.section .intro { max-width: var(--measure); }

/* ---------- Cards / service blocks ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.card p.summary { margin: 0 0 0.75rem; color: var(--steel); font-weight: 500; }
.card ul { margin: 0; padding-left: 1.2rem; }
.card li { margin-bottom: 0.35rem; }

.badge {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

/* ---------- Content slots (pre-content markers) ----------
   Marketing/Brand replaces these. Steel Blue on white passes AA (8.9:1). */
.slot {
  color: var(--steel);
  font-style: italic;
  border-bottom: 1px dashed var(--steel);
}
/* On dark surfaces, slot markers use Slate Light (8.5:1 on navy) */
.hero .slot, .page-title .slot, .site-footer .slot {
  color: var(--slate);
  border-bottom-color: var(--slate);
}
/* Slot inside a light button keeps the light-surface color */
.btn-primary .slot { color: var(--steel); border-bottom-color: var(--steel); }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  max-width: var(--measure);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 1.25rem;
  list-style-position: inside;
}
.faq details[open] summary { border-bottom: 1px solid var(--rule); }
.faq .answer { padding: 1rem 1.25rem; }
.faq .answer p { margin-top: 0; }

/* ---------- Forms Library ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.doc-list li {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.doc-list .doc-meta { flex: 1 1 16rem; }
.doc-list h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.doc-list p { margin: 0; font-size: 0.95rem; }

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2rem;
}
form.contact-form { max-width: 34rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.field .hint { font-weight: 400; color: var(--steel); font-size: 0.9rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--navy);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--steel);
  border-radius: 6px;
  background: var(--white);
}
.field .error-msg {
  display: none;
  color: #8C2F1B; /* 7.4:1 on white */
  font-size: 0.92rem;
  margin-top: 0.3rem;
}
.field.invalid .error-msg { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #8C2F1B; border-width: 2px; }
.form-status { margin-top: 1rem; font-weight: 600; }

address { font-style: normal; }
.contact-details p { margin: 0 0 0.85rem; }
.contact-details .label { font-weight: 700; display: block; }

/* ---------- Policy page ---------- */
.policy { max-width: var(--measure); }
.policy h2 { font-size: 1.25rem; margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 2.5rem 0 2rem;
  margin-top: 3rem;
}
.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer .muted { color: var(--slate); } /* on navy: passes */
.site-footer a { color: var(--white); }
/* CalOPPA: privacy link conspicuous — same size as footer text, contrasting */
.site-footer a.privacy-link {
  color: var(--slate);
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .site-header .shell { gap: 0.75rem; }
  .site-nav { margin-left: 0; width: 100%; }
  .hero { padding: 3rem 0 2.75rem; }
}
