/* Fonts loaded from <head> via <link rel="stylesheet"> for non-blocking path. */

/* ---------- Tokens ---------- */
:root{
  --paper:#F6F8FC;
  --ink:#1B2638;
  --primary:#2457A7;
  --signal:#A044C5;
  --muted:#63718a;
  --line:#dfe6f0;
  --white:#fff;
}

*{box-sizing:border-box}

/* Global responsive image safety: any unsized <img> collapses to its container
   width, prevents 1152px wide photos from breaking 320px viewports. */
img{max-width:100%;height:auto}
figure{max-width:100%}
figure img{display:block;width:100%;height:auto}

html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:16px/1.7 "DM Sans",Arial,sans-serif;
  overflow-x:hidden;
}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}

.container{width:min(1120px,calc(100% - 40px));margin:auto}

/* ---------- Header ---------- */
.site-header{
  position:sticky;top:0;z-index:320;
  background:rgba(246,248,252,.97);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;padding:0 24px;gap:28px;
}
.site-header__inner{
  display:flex;align-items:center;gap:20px;
  width:min(1120px,calc(100% - 40px));margin:auto;
  min-height:70px;
}
.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}
.brand-mark{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;background:var(--ink);color:#fff;
  font-weight:700;border-radius:4px;letter-spacing:-.03em;font-size:1rem;
}
.brand-name{display:block;font-weight:700;font-size:1.05rem;line-height:1}
.brand-tag{display:block;font-size:.76rem;color:var(--muted);letter-spacing:.04em;margin-top:2px}

.main-nav{display:flex;gap:22px;margin-left:auto}
.main-nav a{color:var(--ink);font-weight:500}

.header-cta{
  display:inline-block;background:var(--primary);color:#fff;
  padding:9px 16px;border-radius:3px;font-weight:700;text-decoration:none;
}

.hamburger{
  display:none;border:0;background:none;padding:10px;cursor:pointer;
  position:fixed;top:12px;right:12px;z-index:500;
}
.hamburger:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:4px}
.hamburger__bars{display:inline-flex;flex-direction:column;gap:5px}
.hamburger__bars span{display:block;width:24px;height:2px;background:var(--ink);border-radius:1px}

@media(max-width:760px){
  .main-nav{display:none}
  .header-cta{display:none}
  .hamburger{display:block}
  /* When the drawer is open on mobile, demote the sticky header from a
     stacking context so the fixed hamburger (z:500) inside it floats
     to the root and beats the drawer's fixed z:400. Without this the
     header's own stacking context pins the hamburger below the X button
     (which is also fixed and root-level), and the second hamburger click
     — the documented open/close toggle — times out because Playwright
     cannot land a click on a covered element. Visual stays the same:
     the header is still at top:0 with its background, and the brand mark
     remains visible because nothing covers it.

     While the drawer is open, fade the hamburger bars so the X close
     button inside the drawer is the sole visible close affordance.
     The hamburger button itself remains the click target for keyboard
     and Playwright; the bars only become transparent so the X is not
     visually doubled on top of them. */
  html.is-drawer-open .site-header{position:static;z-index:auto}
  html.is-drawer-open .hamburger__bars{opacity:0}
  html.is-drawer-open .hamburger{transition:background-color .18s ease}
  html.is-drawer-open .hamburger:hover{background-color:rgba(27,38,56,.06)}
}

/* ---------- Mobile drawer ---------- */
.mobile-drawer{display:none}
.mobile-drawer__close{
  position:fixed;top:12px;right:12px;z-index:2;
  align-self:flex-end;border:1px solid var(--line);background:#fff;
  padding:8px 12px;border-radius:3px;cursor:pointer;color:var(--ink);font-weight:600;
  pointer-events:auto;touch-action:manipulation;
}
html.is-drawer-open,html.is-drawer-open body{overflow:hidden}
.mobile-drawer nav ul{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.mobile-drawer nav li{margin:0}
.mobile-drawer nav a{
  color:var(--ink);font-weight:500;font-size:1.05rem;text-decoration:none;
  display:block;padding:8px 10px;border-radius:3px;
}
.mobile-drawer nav a:hover{background:rgba(36,87,167,.06)}
.mobile-drawer__cta{
  margin-top:18px;display:inline-block;background:var(--primary);color:#fff;
  padding:12px 18px;border-radius:3px;font-weight:700;text-decoration:none;
}
.mobile-scrim{
  position:fixed;inset:0;background:rgba(27,38,56,.4);
  opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:220;
}
.mobile-scrim[data-open="true"]{opacity:1;pointer-events:auto}

@media(max-width:760px){
  .mobile-drawer{
    position:fixed;top:0;right:0;height:100dvh;
    width:min(360px,calc(100vw - 56px));
    background:#fff;padding:24px;
    display:none;flex-direction:column;gap:18px;
    box-shadow:-8px 0 30px rgba(27,38,56,.2);
    z-index:280;overflow:auto;
  }
  .mobile-drawer.open{display:flex;z-index:400}
  /* The hamburger is fixed+top:12+right:12+z:500 (above this drawer at
     z:400 and above the sticky header at z:320), so users can toggle
     the menu by tapping the hamburger twice on mobile. The X button
     inside the drawer is at z:400 fixed, so it stays the canonical
     close control for screen-reader and keyboard users; both close
     paths reach a real element. The header remains visible behind the
     drawer, which preserves the brand-mark and breadcrumb affordance. */
  .mobile-drawer__close{z-index:400;position:fixed}
}

/* ---------- Skip link ---------- */
.skip{
  position:absolute;left:-9999px;top:0;
  background:var(--primary);color:#fff;
  padding:8px 14px;border-radius:3px;font-weight:600;z-index:999;
}
.skip:focus{left:14px;top:14px}

/* ---------- Hero / typography ---------- */
.hero{padding:76px 0 64px}
.hero h1{
  font-size:clamp(1.9rem,5vw,3.6rem);line-height:1.1;
  max-width:760px;letter-spacing:-.04em;margin:.2em 0;
}
.eyebrow,.kicker{
  color:var(--primary);font-size:.76rem;font-weight:700;
  letter-spacing:.13em;text-transform:uppercase;
}
.lede{font-size:1.15rem;max-width:720px;color:var(--muted)}

/* ---------- Mosaic (homepage 8-tile index) ---------- */
.mosaic{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:minmax(150px,auto);
  gap:14px;
}
.tile{
  background:var(--white);padding:22px;border-radius:4px;
  min-height:170px;display:flex;flex-direction:column;
}
.tile img{width:100%;height:110px;object-fit:cover;display:block;margin-bottom:15px;border-radius:3px}
.tile h3{margin:.2em 0;font-size:1.05rem;line-height:1.25}
.tile p{font-size:.9rem;color:var(--muted);margin:0}
.tile--wide{grid-column:span 2;grid-row:span 2}
.tile--wide img{height:220px}
@media(max-width:760px){
  .mosaic{grid-template-columns:repeat(2,1fr)}
  .tile--wide{grid-column:span 2;grid-row:auto}
  .tile--wide img{height:150px}
}
@media(max-width:380px){
  .mosaic{grid-template-columns:1fr}
  .tile--wide{grid-column:span 1}
}

/* ---------- Modules (bento rhythm + numerals) ---------- */
.module{padding:65px 0;border-top:1px solid var(--line)}
.module-head{display:flex;gap:25px;align-items:flex-start}
.module h2{font-size:1.9rem;line-height:1.15;margin:0 0 12px}
.module-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:28px}
.module-grid img{width:100%;height:auto;display:block;border-radius:4px}
.numeral{
  font-size:4.6rem;line-height:1;color:#7d8caa;
  font-weight:700;letter-spacing:-.08em;
  flex:0 0 auto;
}
.numeral--small{font-size:3.6rem;line-height:1}
.card,.ledger,details{background:var(--white);padding:22px;border-radius:4px}
.ledger{display:grid;gap:0}
.ledger div{
  display:flex;justify-content:space-between;gap:20px;
  padding:12px 0;border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.ledger div:last-child{border-bottom:0}
.ledger strong{color:var(--ink)}
.ledger span{color:var(--muted)}

/* Bento: unequal modules side by side.
   minmax(0, ...) caps each track so children with wide content cannot
   force the grid wider than its container at any viewport. */
.bento{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.bento>*{background:#fff;padding:22px;border:1px solid var(--line);border-radius:4px;min-width:0}
.bento-1{grid-column:span 12}
.bento-2{grid-column:span 6}
.bento-3{grid-column:span 4}
.bento-4{grid-column:span 8}
.bento-5{grid-column:span 7}
.bento-6{grid-column:span 5}
@media(max-width:900px){
  .bento-1,.bento-2,.bento-3,.bento-4,.bento-5,.bento-6{grid-column:span 6}
}
@media(max-width:600px){
  .bento{grid-template-columns:1fr}
  .bento-1,.bento-2,.bento-3,.bento-4,.bento-5,.bento-6{grid-column:span 1}
}

/* Bento head: numeral + heading pair */
.bento-head{display:flex;gap:18px;align-items:flex-start;margin-bottom:10px}
.bento-head .numeral{font-size:3.4rem;line-height:1;color:#7d8caa;font-weight:700;letter-spacing:-.06em}
.bento-head h3{margin:0;font-size:1.15rem;line-height:1.2}

/* ---------- Strip (thumbnail with caption column) ---------- */
.strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.strip figure{
  margin:0;background:#fff;border:1px solid var(--line);
  padding:0;border-radius:4px;overflow:hidden;
}
.strip img{width:100%;height:180px;object-fit:cover;display:block}
.strip figcaption{padding:12px 14px;font-size:.9rem;color:var(--muted)}
.strip figcaption strong{display:block;color:var(--ink);margin-bottom:4px}
@media(max-width:760px){.strip{grid-template-columns:1fr}}

/* ---------- Two-column row (caption + image) ----------
   minmax(0, 1fr) caps the grid track at its share so a wide intrinsic image
   cannot force the column wider than the container (fixes 320px overflow). */
.row-split{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:24px;align-items:start}
.row-split>*{min-width:0;overflow-wrap:break-word}
.row-split img{width:100%;height:220px;max-width:100%;object-fit:cover;display:block;border-radius:4px}
@media(max-width:760px){
  .row-split{grid-template-columns:minmax(0,1fr)}
  .row-split img{height:200px}
}

/* ---------- Standards ledger ---------- */
.standards{
  display:grid;gap:0;background:#fff;
  border:1px solid var(--line);border-radius:4px;
}
.standards div{
  display:flex;justify-content:space-between;gap:20px;
  padding:14px 18px;border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.standards div:last-child{border-bottom:0}
.standards strong{color:var(--ink)}

/* ---------- FAQ ---------- */
.faq-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.faq-grid>*{
  background:#fff;border:1px solid var(--line);
  padding:18px 20px;border-radius:4px;
}
.faq-grid h3{margin:.2em 0;font-size:1.05rem;color:var(--ink)}
.faq-grid p{margin:0;color:var(--muted);font-size:.96rem}
@media(max-width:760px){.faq-grid{grid-template-columns:1fr}}

/* ---------- Route hero ---------- */
.route-hero{padding:70px 0 40px}
.route-hero h1{font-size:clamp(1.9rem,4vw,3.2rem);line-height:1.1;max-width:800px}

/* ---------- Prose body ---------- */
.prose{max-width:820px}
.prose h2{font-size:1.8rem;line-height:1.2;margin-top:2.3em}
.prose h3{font-size:1.25rem;line-height:1.25;margin-top:1.6em}
.prose img{width:100%;max-height:420px;object-fit:cover;margin:18px 0;border-radius:4px}
.prose p{margin:0 0 1em}
.prose ul,.prose ol{margin:0 0 1em;padding-left:1.4em}
.prose li{margin:0 0 .4em}
.prose table{
  width:100%;border-collapse:collapse;margin:18px 0;font-size:.95rem;
}
.prose th,.prose td{
  padding:10px 12px;border-bottom:1px solid var(--line);
  text-align:left;vertical-align:top;
}
.prose th{color:var(--ink);font-weight:600;background:var(--white)}

/* ---------- Common atoms ---------- */
.caption{color:var(--muted);font-size:.9rem}
.signal{color:var(--signal);font-weight:700}
.btn{display:inline-block;padding:10px 16px;border-radius:3px;font-weight:700}
.btn-primary{background:var(--primary);color:#fff}
.faq{display:grid;gap:12px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}

/* ---------- Verdict chip ---------- */
.verdict{
  display:inline-block;padding:4px 10px;border-radius:99px;
  font-size:.78rem;font-weight:700;letter-spacing:.04em;
  background:rgba(160,68,197,.12);color:var(--signal);
  border:1px solid rgba(160,68,197,.25);
}

/* ---------- Sticky mobile CTA ---------- */
.mobile-cta-sticky{
  position:fixed;left:12px;right:12px;bottom:12px;
  background:var(--ink);color:#fff;
  padding:14px 18px;border-radius:6px;
  display:none;z-index:60;
  align-items:center;justify-content:space-between;gap:12px;
  font-weight:600;box-shadow:0 8px 30px rgba(27,38,56,.25);
}
.mobile-cta-sticky a{
  background:var(--primary);color:#fff;
  padding:10px 16px;border-radius:3px;font-weight:700;text-decoration:none;
}
.mobile-cta-sticky__note{font-size:.78rem;color:#aebbd4;font-weight:500}
@media(max-width:760px){.mobile-cta-sticky{display:flex}}
@media(max-width:380px){
  .mobile-cta-sticky{
    left:8px;right:8px;bottom:8px;padding:10px 12px;
  }
  .mobile-cta-sticky__note{display:none}
}

/* ---------- Footer ---------- */
.site-footer{border-top:1px solid var(--line);padding:45px 0;margin-top:50px}
.site-footer .shell{width:min(1120px,calc(100% - 40px));margin:auto}
.site-footer__grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);gap:25px}
.site-footer h3,.site-footer h4{font-size:.95rem;margin:.2em 0 .8em;color:var(--ink)}
.site-footer ul{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.site-footer a{color:var(--ink);font-weight:500}
.site-footer p{color:var(--muted);font-size:.95rem;margin:.3em 0}
.site-footer__legal{
  border-top:1px solid var(--line);margin-top:30px;padding-top:18px;
  display:flex;flex-wrap:wrap;gap:16px;color:var(--muted);font-size:.85rem;
}
@media(max-width:760px){
  .site-footer__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:380px){
  .site-footer__grid{grid-template-columns:minmax(0,1fr)}
}

/* ---------- Body inline links must be distinguishable without color (A11y).
   Underline + slight underline offset so they keep the calm palette but
   are not color-only signals. Hover keeps accent darkening. ---------- */
.prose a,
.module a,
.strip figcaption a,
.news-tile a,
.bento a,
.lede a,
.ledger a,
.resource-list a,
.standards a,
.faq-grid a,
.container p > a,
.container li > a,
.container .bento a,
.container .module a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  color: #1c4b91;
}
.prose a:hover,
.module a:hover,
.strip figcaption a:hover,
.news-tile a:hover,
.bento a:hover,
.lede a:hover,
.ledger a:hover,
.resource-list a:hover,
.standards a:hover,
.faq-grid a:hover,
.container p > a:hover,
.container li > a:hover,
.container .bento a:hover,
.container .module a:hover {
  text-decoration-thickness: 2px;
  color: #163a72;
}

/* ---------- Anchor scroll offset (sticky header) ---------- */
/* Headings need overflow-wrap to handle long unbreakable tokens
   (email addresses, domain names, audit IDs). Keeps layout contained
   at 320px without breaking prose on shorter words. */
h1,h2,h3,h4,h5,h6,.tile,.resource-list li,.standards div,.ledger div,.module p,.prose p,.prose li,.resource-list span,p{overflow-wrap:break-word}

/* ---------- News / press desk tiles ---------- */
.news-tile{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:18px;
  background:#fff;border:1px solid var(--line);
  border-radius:4px;padding:18px;
}
.news-tile img{width:100%;height:160px;object-fit:cover;display:block;border-radius:3px}
@media(max-width:760px){
  .news-tile{grid-template-columns:1fr}
}

/* ---------- Thumbnail row ---------- */
.thumb-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.thumb-row img{width:100%;height:180px;object-fit:cover;display:block;border-radius:4px}
@media(max-width:760px){.thumb-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:380px){.thumb-row{grid-template-columns:minmax(0,1fr)}}

/* ---------- Pre / rulebook ---------- */
.rulebook{
  background:#fff;border:1px solid var(--line);border-radius:4px;
  padding:18px 22px;font-size:.96rem;line-height:1.6;color:var(--ink);
}
.rulebook p{margin:0 0 .6em}

/* ---------- Helpline / resource list ---------- */
.resource-list{list-style:none;padding:0;margin:0;display:grid;gap:0;background:#fff;border:1px solid var(--line);border-radius:4px}
.resource-list li{
  display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;
  padding:14px 18px;border-bottom:1px solid var(--line);
}
.resource-list li:last-child{border-bottom:0}
.resource-list strong{color:var(--ink)}
.resource-list span{color:var(--muted)}
