/* ==========================================================================
   NY Digital Accessibility — styles.css
   Target: WCAG 2.2 AA. All color pairs chosen for ≥ 4.5:1 on their
   backgrounds (≥ 3:1 for large text / UI graphics). Verify after any edit.
   ========================================================================== */

:root {
  /* Palette */
  --paper: #FBFAF7;        /* page background */
  --paper-2: #F3F1EA;      /* alternate section background */
  --ink: #1A2430;          /* primary text — 14.9:1 on paper */
  --ink-soft: #43505E;     /* secondary text — 7.6:1 on paper */
  --petrol: #12324A;       /* brand navy from logo — 12.4:1 on paper */
  --petrol-deep: #0C273B;  /* logo ink */
  --cobalt: #21519C;       /* links — 6.4:1 on paper */
  --seal-green: #1E6B41;   /* active status — 5.8:1 on white */
  --amber-ink: #7A5200;    /* caution text — 5.9:1 on paper */
  --rule: #D8D4C8;         /* hairlines */
  --card: #FFFFFF;
  --footer-bg: #122029;
  --footer-ink: #D9E2E8;   /* 11.9:1 on footer-bg */
  --footer-link: #A9C6D9;  /* 8.5:1 on footer-bg */
  --focus: #B34700;        /* focus ring — 3.6:1 vs paper, 3.2:1 vs white */

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Albert Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;

  --measure: 68ch;
  --radius: 10px;
  --radius-sm: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img, svg { max-width: 100%; height: auto; }
main { display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; }
p, ul, ol, dl { margin: 0 0 1em; max-width: var(--measure); }
li { margin-bottom: 0.35em; }

a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--petrol-deep); }

/* Visible focus for every interactive element (WCAG 2.4.7 / 2.4.13) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible { text-decoration: none; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--petrol-deep);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

/* ---------- Layout ---------- */
.container { max-width: 76rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.narrow { max-width: 52rem; }
.section { padding-block: var(--space-6); }
.section-alt { background: var(--paper-2); }
.section-header { max-width: 52rem; margin-bottom: var(--space-4); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--petrol);
  margin-bottom: var(--space-1);
}

/* Dotted ledger leader — the signature record motif */
.ledger { max-width: var(--measure); }
.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.4rem;
}
.ledger-row dt { flex-shrink: 0; font-weight: 600; }
.ledger-row .leader {
  flex: 1;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-4px);
  min-width: 2rem;
}
.ledger-row dd { margin: 0; font-family: var(--font-mono); font-size: 0.95rem; text-align: right; }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: 0.9rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  margin-right: auto;
}
.brand img { width: 58px; height: 58px; }
.brand-name { font-size: 1rem; line-height: 1.25; }
.brand-name span { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 0.55rem 0.15rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--petrol); color: var(--petrol-deep); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--petrol); font-weight: 600; }

.button {
  display: inline-block;
  background: var(--petrol);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--petrol);
  min-height: 44px;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-body);
}
.button:hover { background: var(--petrol-deep); border-color: var(--petrol-deep); color: #fff; }
.button-secondary { background: transparent; color: var(--petrol); }
.button-secondary:hover { background: var(--petrol); color: #fff; }
.header-cta { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { padding-block: var(--space-5) var(--space-6); border-bottom: 1px solid var(--rule); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}
.hero p.lede { font-size: 1.2rem; color: var(--ink-soft); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* Demo record card in hero */
.record-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-3) var(--space-2);
  box-shadow: 0 1px 2px rgba(26, 36, 48, 0.06), 0 12px 32px -18px rgba(15, 76, 92, 0.35);
  position: relative;
}
.record-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
}
.record-id { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); }
.status-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--seal-green);
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  white-space: nowrap;
}
.status-seal::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-seal.seal-neutral { color: var(--petrol); }
.status-seal.seal-caution { color: var(--amber-ink); }
.record-card .disclaimer { font-size: 0.82rem; color: var(--ink-soft); border-top: 1px solid var(--rule); padding-top: var(--space-1); margin-top: var(--space-2); margin-bottom: 0; }
.demo-banner {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--amber-ink);
  color: #fff;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.35rem 1rem;
  margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-2);
}

/* ---------- Cards / grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .eyebrow { color: var(--ink-soft); }

.pathway { border-top: 4px solid var(--petrol); }

/* Process — a genuine sequence, so numbering carries meaning */
.process-list { list-style: none; counter-reset: step; margin: 0; padding: 0; max-width: 52rem; }
.process-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: var(--space-2);
  padding-block: var(--space-2);
  border-bottom: 1px dotted var(--rule);
}
.process-list li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--petrol);
  padding-top: 0.1rem;
}
.process-list h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.25em; }
.process-list p { margin-bottom: 0; color: var(--ink-soft); }

/* Status definitions */
.status-block { border-left: 4px solid var(--petrol); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--space-3); margin-bottom: var(--space-3); }
.status-block > .status-seal { margin-bottom: 1.1rem; }
.status-block h3 { margin-top: 0; }
.record-card-head { flex-wrap: wrap; }
.tel-wrap { display: flex; align-items: center; gap: 0.5rem; }
.tel-wrap .tel-prefix { font-weight: 600; color: var(--ink-soft); }
.tel-wrap input { flex: 1; }
.check-list .checkbox-row { margin-bottom: 0.55rem; }
.check-list .checkbox-row label { font-weight: 500; }
.status-block .disclaimer { font-size: 0.92rem; color: var(--ink-soft); background: var(--paper-2); border-radius: var(--radius-sm); padding: var(--space-2); margin-bottom: 0; }
.status-block .disclaimer strong { color: var(--ink); }

/* Notice / info panels */
.notice {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--amber-ink);
  background: var(--card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-2) var(--space-3);
  max-width: var(--measure);
}
.notice p:last-child { margin-bottom: 0; }
.notice-brand { border-left-color: var(--petrol); }

/* FAQ */
.faq details {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--card);
  margin-bottom: var(--space-1);
  max-width: 52rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  list-style-position: inside;
}
.faq summary:hover { color: var(--petrol-deep); }
.faq details > div { padding: 0 1.1rem 1rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-shell { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 52rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: var(--space-2); }
.form-field.full { grid-column: 1 / -1; }
label { font-weight: 600; }
.hint { font-size: 0.9rem; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #8A94A0;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: #A33000; border-width: 2px; }
.error-text { color: #A33000; font-weight: 600; font-size: 0.92rem; }
.required-mark { color: #A33000; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
legend { font-weight: 600; padding-inline: 0.4rem; }

.checkbox-row { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; max-width: var(--measure); }
.checkbox-row input[type="checkbox"] { width: 24px; height: 24px; margin-top: 0.2rem; accent-color: var(--petrol); }
.consent-panel { border: 2px solid var(--petrol); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); background: #F5F9FA; margin-bottom: var(--space-2); }
.consent-panel p { font-size: 0.95rem; }

.error-summary {
  border: 2px solid #A33000;
  border-radius: var(--radius-sm);
  background: #FCF3EF;
  color: var(--ink);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.error-summary h2 { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4em; }
.error-summary ul { margin-bottom: 0; }
.error-summary a { color: #A33000; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- Verification ---------- */
.verify-result { margin-block: var(--space-4); }
.verify-result .record-card { margin-bottom: var(--space-2); }
.verify-page h2 { margin-top: var(--space-5); }
.verify-page .notice { margin-top: var(--space-4); }
.verify-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--space-2) var(--space-3); align-items: end; }
.or-divider { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 0.9rem; }
@media (max-width: 700px) { .verify-grid { grid-template-columns: 1fr; } .or-divider { padding: 0; text-align: center; } }
.record-meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); }
.status-history { border-collapse: collapse; width: 100%; max-width: 52rem; }
.status-history caption { text-align: left; font-weight: 600; padding-bottom: 0.5rem; }
.status-history th, .status-history td { text-align: left; border-bottom: 1px solid var(--rule); padding: 0.55rem 0.75rem 0.55rem 0; font-size: 0.95rem; }
.status-history th { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Badges page ---------- */
.badge-figure { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-3); text-align: center; }
.badge-figure img { width: 200px; }
.badge-figure figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: var(--space-1); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: var(--space-6); }
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-4); padding-block: var(--space-5) var(--space-3); }
.footer-grid h2 { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--footer-ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-bottom { border-top: 1px solid rgba(217, 226, 232, 0.25); padding-block: var(--space-3); font-size: 0.9rem; }
.footer-bottom p { max-width: none; }
.footer-badge { margin-top: var(--space-2); }
.footer-badge img { width: 236px; height: auto; border-radius: 8px; display: block; }

/* ---------- Legal pages ---------- */
.legal-page h2 { margin-top: var(--space-4); }
.legal-review {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #FCEFDD;
  color: var(--amber-ink);
  border: 1px solid var(--amber-ink);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  vertical-align: middle;
}
.arbitration-warning {
  border: 2px solid var(--amber-ink);
  background: #FCF7EC;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  max-width: var(--measure);
}
mark { background: #FCEFA8; padding: 0.05em 0.2em; }

/* ---------- Motion & preferences ---------- */
@media (prefers-reduced-motion: no-preference) {
  a, .button, .site-nav a, input, select, textarea { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
  .card, .record-card { transition: box-shadow 160ms ease; }
  html:focus-within { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .status-seal, .button { forced-color-adjust: auto; }
  .ledger-row .leader { border-bottom-color: CanvasText; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .form-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; gap: 0; padding-block: var(--space-1); }
  .site-nav a { display: block; padding: 0.7rem 0.25rem; min-height: 44px; }
  /* Without JavaScript the toggle is hidden and the menu stays visible */
  .no-js .nav-toggle { display: none; }
  .no-js .site-nav { display: block; }
}
@media (max-width: 480px) {
  .hero-ctas .button { width: 100%; text-align: center; }
}

@media print {
  .site-header, .site-footer, .hero-ctas, .nav-toggle { display: none; }
}
