/* Tectonix — MFIPPA Privacy Readiness
   Shared stylesheet. Institutional "official record" system:
   navy + paper, serif body (reads like statute), grotesque sans for structure.
   Signature devices: § clause markers, the Jan 1 2027 deadline meter. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #14181d;
  --ink-2: #4a545f;
  --ink-3: #5c6672;
  --rule: #e4e1db;
  --accent: #1c4f7c;
  --accent-2: #2b6ba3;
  --accent-soft: #eef3f8;
  --flag: #8a4a1f;
  --flag-soft: #f6efe7;
  --ok: #2f6b4f;
  --measure: 38rem;
  --wide: 64rem;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --shadow: 0 1px 2px rgba(20, 24, 29, 0.04), 0 8px 24px -12px rgba(20, 24, 29, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #161a1f;
    --surface-2: #1b2027;
    --ink: #eef1f4;
    --ink-2: #a8b2bc;
    --ink-3: #7b8590;
    --rule: #272c33;
    --accent: #7cb2e0;
    --accent-2: #9ac6ea;
    --accent-soft: #1a222b;
    --flag: #d99a63;
    --flag-soft: #221a12;
    --ok: #6fbf97;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #101317; --surface: #161a1f; --surface-2: #1b2027;
  --ink: #eef1f4; --ink-2: #a8b2bc; --ink-3: #7b8590; --rule: #272c33;
  --accent: #7cb2e0; --accent-2: #9ac6ea; --accent-soft: #1a222b;
  --flag: #d99a63; --flag-soft: #221a12; --ok: #6fbf97;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 12px 30px -14px rgba(0,0,0,0.6);
}
:root[data-theme="light"] {
  --bg: #fbfaf8; --surface: #ffffff; --surface-2: #f4f1ea;
  --ink: #14181d; --ink-2: #4a545f; --ink-3: #5c6672; --rule: #e4e1db;
  --accent: #1c4f7c; --accent-2: #2b6ba3; --accent-soft: #eef3f8;
  --flag: #8a4a1f; --flag-soft: #f6efe7; --ok: #2f6b4f;
  --shadow: 0 1px 2px rgba(20,24,29,0.04), 0 8px 24px -12px rgba(20,24,29,0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* One column for every page: same left edge as the hero, content fills the full width. */
.wrap, .wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, .eyebrow, .mark, nav, footer, .btn, .tag, .meter, label, input, select, textarea, .pill {
  font-family: var(--sans);
}

/* ---- Skip link + focus ---- */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: 0 0 4px 0; z-index: 100;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---- Header / nav ---- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--wide); margin: 0 auto; padding: 0.7rem 1.5rem;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand img { height: 30px; width: auto; display: block; }
.brand .mark { font-weight: 700; font-size: 0.98rem; letter-spacing: 0.01em; }
/* Gap and size are tuned so the full "PIA and privacy support" label fits on one line
   beside the full company name at the 64rem column width. */
.nav-links { display: flex; gap: 1.05rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: 0.82rem; color: var(--ink-2); text-decoration: none; font-weight: 500;
  white-space: nowrap;
  padding: 0.3rem 0; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
/* Selector must out-specify `.nav-links a` above, or the pill loses its horizontal padding. */
.nav-links a.nav-cta {
  font-size: 0.84rem; font-weight: 600; background: var(--accent); color: var(--bg);
  padding: 0.45rem 0.9rem; border-radius: 4px; text-decoration: none;
  border-bottom: 0; white-space: nowrap;
}
.nav-links a.nav-cta:hover { background: var(--accent-2); color: var(--bg); border-color: transparent; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 4px;
  color: var(--ink); padding: 0.4rem 0.55rem; cursor: pointer;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

/* Collapses at 1023px, not 720px: below the content column the full nav labels
   cannot fit on one line, and nowrap would overflow the viewport. */
@media (max-width: 1023px) {
  .nav { flex-wrap: wrap; }
  /* No-JS default: links stay visible, stacked, in normal flow. */
  .nav-links { width: 100%; flex-direction: column; align-items: flex-start; gap: 0; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .nav-cta { margin-top: 0.6rem; }
  /* With JS: collapse behind the toggle as a dropdown. */
  .js .nav-toggle { display: inline-flex; }
  .js .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.5rem 1rem; box-shadow: var(--shadow);
  }
  .js .nav-links.open { display: flex; }
}

/* ---- Eyebrows: the § clause motif (true to statute content) ---- */
.eyebrow {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-size: 0.74rem; letter-spacing: 0.11em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-3); margin: 0 0 0.9rem;
}
.eyebrow::before {
  content: "§"; font-size: 0.95rem; color: var(--accent); font-weight: 700;
  transform: translateY(0.05em);
}

/* ---- Type scale ---- */
.hero { padding: 3.5rem 0 2.75rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center; }
@media (max-width: 720px) { .hero-grid { grid-template-columns: 1fr; gap: 1.75rem; } .hero-art { max-width: 340px; } }
@media (max-width: 560px) { .hero-art { display: none; } }

/* Framed "exhibit" plate so baked-palette SVG art stays legible in light AND dark */
.art-plate { background: #f6f3ec; border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.art-plate img { display: block; width: 100%; height: auto; }
h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 6vw, 3.15rem); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 0 1.1rem; text-wrap: balance;
}
h1 .date-emph { color: var(--accent); font-style: italic; }
/* No width cap: on the home hero the grid column bounds it; elsewhere it fills the column. */
.standfirst { font-size: clamp(1.08rem, 2.2vw, 1.25rem); color: var(--ink-2); margin: 0 0 1.75rem; text-wrap: pretty; }
h2 { font-family: var(--serif); font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1.18; letter-spacing: -0.015em; font-weight: 600; margin: 0 0 0.9rem; text-wrap: balance; }
h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 650; letter-spacing: -0.005em; margin: 0 0 0.4rem; }
p { margin: 0 0 1.1rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
.lede { font-size: 1.08rem; color: var(--ink-2); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
section { padding: 2.75rem 0; }
.section-line { border-top: 1px solid var(--rule); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: var(--bg); font-size: 0.94rem; font-weight: 600;
  padding: 0.72rem 1.35rem; border-radius: 5px; text-decoration: none; border: 1px solid var(--accent);
  cursor: pointer; transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); transform: none; box-shadow: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.email-plain { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); }

/* ---- Deadline meter (signature) ---- */
.meter {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 1.15rem 1.3rem; box-shadow: var(--shadow); margin: 1.75rem 0 0;
}
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.meter-count { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; color: var(--accent); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
/* Matches .meter-target exactly so both labels on the meter read as one typographic voice. */
.meter-count span { font-size: 0.82rem; font-weight: 400; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; margin-left: 0.4rem; }
/* The count itself is a span too, so it needs to out-specify the label rule above —
   without this the clamp on .meter-count never reaches any text. */
.meter-count [data-days] { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; color: var(--accent); letter-spacing: -0.02em; margin-left: 0; }
.meter-target { font-size: 0.82rem; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.meter-track { position: relative; height: 6px; border-radius: 3px; background: var(--rule); margin-top: 0.9rem; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 0 0 0; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }
.meter-ends { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.72rem; color: var(--ink-3); letter-spacing: 0.04em; }

/* ---- "Is this you?" recognition grid ---- */
.recog { background: var(--surface-2); border-radius: 12px; padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem); }
.recog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.recog-item { display: flex; gap: 0.85rem; align-items: flex-start; }
.recog-item svg, .recog-item .ico { flex: 0 0 26px; width: 26px; height: 26px; color: var(--accent); margin-top: 0.15rem; }
.recog-item p { font-size: 0.96rem; color: var(--ink-2); margin: 0; }
.recog-foot { margin-top: 1.6rem; font-size: 0.98rem; color: var(--ink); }

/* ---- What-changes duties ---- */
.duties { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0; }
.duties li { padding: 1.15rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.duties .num { font-family: var(--sans); font-weight: 700; color: var(--accent); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.duties p { font-size: 0.97rem; color: var(--ink-2); margin: 0.3rem 0 0; }
.cite { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3); margin-top: 1.1rem; }
.cite a { color: var(--ink-3); }
.reviewed { font-family: var(--sans); font-size: 0.76rem; color: var(--ink-3); letter-spacing: 0.03em; margin-top: 0.35rem; }

/* ---- Service cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1.6rem 1.5rem 1.5rem; display: flex; flex-direction: column;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; text-decoration: none; color: inherit;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card .tag { font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 0.7rem; }
.card .art { margin: 0.2rem 0 1rem; color: var(--accent); }
.card .art:not(.art-plate) { height: 96px; }
.card .art:not(.art-plate) svg, .card .art:not(.art-plate) img { height: 100%; width: auto; }
.card .art-plate { padding: 0.7rem 0.9rem; }
.card .art-plate img { width: 100%; height: auto; }
.card p { font-size: 0.96rem; color: var(--ink-2); }
.card .go { font-family: var(--sans); font-size: 0.86rem; font-weight: 600; color: var(--accent); margin-top: auto; padding-top: 1rem; }

/* ---- Process steps ---- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem; margin-top: 1.6rem; }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0; font-family: var(--sans); font-weight: 700;
  font-size: 0.95rem; color: var(--bg); background: var(--accent);
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-bottom: 0.35rem; }
.step p { font-size: 0.94rem; color: var(--ink-2); }

/* ---- Service spine (readiness / pia pages) ---- */
.spine { display: grid; gap: 1.2rem; margin-top: 1.6rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .spine { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--rule); border-radius: 10px; padding: 1.4rem 1.4rem; background: var(--surface); }
.panel.out { background: var(--flag-soft); }
.panel h3 { display: flex; align-items: center; gap: 0.55rem; }
.panel h3::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 3px; flex: none; }
.panel.in h3::before { background: var(--ok); }
.panel.out h3::before { background: var(--flag); }
.checklist { list-style: none; padding: 0; margin: 0.9rem 0 0; }
.checklist li { font-family: var(--serif); font-size: 0.96rem; color: var(--ink-2); padding: 0.5rem 0 0.5rem 1.6rem; position: relative; border-bottom: 1px solid var(--rule); }
.checklist li:last-child { border-bottom: 0; }
.checklist.in li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.checklist.out li::before { content: "—"; position: absolute; left: 0; color: var(--flag); font-weight: 700; }

/* ---- Practice ---- */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 1rem; }
.pill { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.03em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  padding: 0.25rem 0.6rem; border-radius: 999px; }

/* ---- Contact form ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 1.5rem; align-items: start; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; gap: 1.75rem; } }
form.contact { display: grid; gap: 0.9rem; }
/* Off-screen rather than display:none, which spam bots detect and skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.field input, .field select, .field textarea {
  font-size: 0.95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px; padding: 0.6rem 0.7rem; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 96px; }
.field .err { font-size: 0.76rem; color: var(--flag); display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--flag); }
.field.invalid .err { display: block; }
.form-note { font-size: 0.8rem; color: var(--ink-3); background: var(--flag-soft); border-radius: 6px; padding: 0.7rem 0.85rem; }
.form-status { font-family: var(--sans); font-size: 0.88rem; color: var(--ok); min-height: 1.2em; }

/* ---- FAQ ---- */
.faq { margin-top: 1.4rem; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: 1.1rem 2rem 1.1rem 0; cursor: pointer; position: relative; list-style: none; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.95rem; font-size: 1.4rem; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 1.2rem; color: var(--ink-2); font-size: 0.97rem; }

/* ---- Prose (explainer / privacy pages) ---- */
.prose h2 { margin-top: 2.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; color: var(--ink-2); }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); margin: 1.4rem 0; padding: 1rem 1.2rem; border-radius: 0 6px 6px 0; }
.prose blockquote p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }

/* ---- Disclaimer / footer ---- */
.disclaimer { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-3); background: var(--surface-2); border-radius: 8px; padding: 0.9rem 1.1rem; }
.site-foot { border-top: 1px solid var(--rule); margin-top: 3rem; background: var(--surface); }
.foot-grid { max-width: var(--wide); margin: 0 auto; padding: 2.5rem 1.5rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
.foot-grid h4 { font-family: var(--sans); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 0.8rem; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 0.45rem; }
.foot-grid a { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); }
.foot-legal { max-width: var(--wide); margin: 0 auto; padding: 1.2rem 1.5rem 2.5rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.78rem; color: var(--ink-3); line-height: 1.6; }

/* ---- Reveal on scroll (only hides when JS is confirmed running) ---- */
/* Content is visible by default; the animation is opt-in. main.js adds .armed only to
   sections that start below the fold, so nothing can be stranded invisible by a jump-to-anchor
   or a fast scroll. Revert to hide-by-default by setting REVEAL_SAFE = false in main.js. */
.js .reveal.armed { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.armed.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal.armed { opacity: 1; transform: none; transition: none; } }

.needs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.6rem; margin-top: 1.5rem; }
.needs-grid > div { border-top: 2px solid var(--accent); padding-top: 0.9rem; }
.needs-grid p { font-size: 0.95rem; color: var(--ink-2); margin: 0.3rem 0 0; }

.build-note { display: none; }
