/* ============================================================================
   gh-design v1.1.0 — Glass Hull design system (GH-W1-001 §1)
   One system for every witness and product surface: verifier, certificates,
   GRANNY cards, Doll rings, dashboards. Palette = the Romanian flag (v1.1.0,
   Principal 2026-09-24): Romanian blue #002B7F is the page, Romanian yellow
   #FCD116 the seal and focus, Romanian red #CE1126 the fills, stripes and rules;
   red TEXT on the blue page uses a red tint (#FF8A96) because #CE1126 on #002B7F
   is 2.26:1. Blue = witness/structure, red = generated assets / emphasis, gold =
   the seal and VERIFIED only. Never orange. Fonts self-hosted
   (fonts.css). WCAG AA on every pair listed in CONTRAST.md.
   ========================================================================== */
:root {
  --ro-blue:   #002B7F;  --us-blue:  #002868;
  --ro-red:    #CE1126;  --us-red:   #BF0A30;
  --ro-yellow: #FCD116;  --gold-ink: #9A7D00;  --gold-ink-text: #7A6300;  /* gold-ink passes AA only at large/bold size; gold-ink-text (5.8:1 on white) carries small gold text on light surfaces */
  --white:     #FFFFFF;  --paper:    #F7F7F5;  --ink: #1E2126;  --graph: #4A4F57;
  --pale-blue: #EEF1F8;  --pale-red: #FBEAEC;  --pale-gold: #FFF8D6;

  /* semantic tokens — BLUE is the page (Principal's ruling 2026-09-06: the entire page is blue, not white).
     The paper theme is opt-in with data-theme="light". Every pair below is in CONTRAST.md (the DARK rows). */
  --bg: var(--ro-blue);          --surface: #0A2566;            --surface-2: #123489;
  --fg: var(--white);            --fg-muted: #C9D0E3;
  --structure: #DCE4F7;          --deep: #071540;
  --emphasis: #FF8A96;           --alert: #FF8A96;   /* Romanian-red tints: AA 5.65:1 on --ro-blue */
  --seal: var(--ro-yellow);      --seal-text: var(--ro-yellow);  --seal-word: var(--ro-yellow);  --seal-ground: #3A3200;
  --witness-row: #123489;        --generated-row: #4A1520;
  --rule-blue: #8FA4E0;          --rule-red: var(--ro-red);
  --link: #C9D6FF;               --focus: var(--ro-yellow);
  --ring-lit: var(--ro-yellow);  --ring-dark: #6C7386;
  --border-soft: #2E4A99;
  --button-fg: var(--ro-blue);
  --logo-ground: var(--deep);    /* the hero band and the nav mark tile: one step deeper than the page */

  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ui: 'IBM Plex Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;

  --measure: 72ch;  --ui-min: 15px;  --hash-min: 12px;
  --space-1: .25rem; --space-2: .5rem; --space-3: 1rem; --space-4: 1.5rem; --space-5: 2.5rem; --space-6: 4rem;
  --radius: 3px;
  color-scheme: dark;
}
/* Opt-in paper theme (data-theme="light"): the palette's light set, used for print-like surfaces on request. */
:root[data-theme="light"] {
  --bg: var(--paper);            --surface: var(--white);       --surface-2: var(--pale-blue);
  --fg: var(--ink);              --fg-muted: var(--graph);
  --structure: var(--ro-blue);   --deep: var(--us-blue);
  --emphasis: var(--ro-red);     --alert: var(--us-red);
  --seal: var(--ro-yellow);      --seal-text: var(--gold-ink-text);  --seal-word: var(--gold-ink);  --seal-ground: var(--pale-gold);
  --witness-row: var(--pale-blue); --generated-row: var(--pale-red);
  --rule-blue: var(--ro-blue);   --rule-red: var(--ro-red);
  --link: var(--ro-blue);        --focus: var(--ro-blue);
  --ring-lit: var(--ro-yellow);  --ring-dark: var(--graph);
  --border-soft: #D5D8DF;
  --button-fg: var(--white);
  --logo-ground: var(--us-blue);
  color-scheme: light;
}

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.gh {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 17.5px; line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
}
@media (min-width: 900px) { body.gh { font-size: 18px; } }
.gh a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.gh :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gh img, .gh svg { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { .gh *, .gh *::before, .gh *::after { animation: none !important; transition: none !important; } }

.gh-page { max-width: 68rem; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-6); }
.gh-page > *, .gh-cert, .gh-granny, .gh-provenance, .gh-note, .gh-alert { min-width: 0; max-width: 100%; }
.gh-mono, .gh code, .gh .mono, .gh .num { overflow-wrap: anywhere; }
@media (max-width: 480px) { .gh-page { padding-left: var(--space-3); padding-right: var(--space-3); } }
.gh-prose { max-width: var(--measure); }
.gh-prose p { margin: 0 0 var(--space-3); }
.gh-single { max-width: 46rem; margin: 0 auto; }          /* certificates: single column */

/* ---- typography ---------------------------------------------------------- */
.gh h1, .gh-display { font-family: var(--font-display); font-weight: 700; color: var(--structure); line-height: 1.12; text-wrap: balance; letter-spacing: .005em; }
.gh h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); margin: 0 0 var(--space-4); }
.gh h2 { font-family: var(--font-display); font-weight: 600; color: var(--structure); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); line-height: 1.2; margin: var(--space-5) 0 var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--rule-blue); text-wrap: balance; }
.gh h3 { font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem; color: var(--emphasis); margin: var(--space-4) 0 var(--space-2); padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule-red); }
.gh-cert-title { font-family: var(--font-display); font-variant-caps: small-caps; font-weight: 700; letter-spacing: .06em; }
.gh-eyebrow { font-family: var(--font-ui); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.gh-ui, .gh table, .gh button, .gh input, .gh select, .gh label { font-family: var(--font-ui); font-size: max(var(--ui-min), .95rem); }
.gh-mono, .gh code, .gh .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gh .hash { font-family: var(--font-mono); font-size: var(--hash-min); word-break: break-all; cursor: copy; color: var(--fg); }
.gh .hash[data-copied]::after { content: " copied"; font-family: var(--font-ui); color: var(--seal-text); font-size: .75rem; }
.gh .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.gh small, .gh .small { font-size: .875rem; }

/* ---- rules --------------------------------------------------------------- */
.gh-rule-blue { border: 0; border-top: 1px solid var(--rule-blue); margin: var(--space-4) 0; }
.gh-rule-red  { border: 0; border-top: 1px solid var(--rule-red);  margin: var(--space-3) 0; }

/* ---- tables -------------------------------------------------------------- */
.gh-table-wrap { overflow-x: auto; }
.gh table { border-collapse: collapse; width: 100%; background: var(--surface); }
.gh th { text-align: left; font-weight: 600; color: var(--white); background: var(--ro-blue); padding: .55rem .7rem; font-size: .9rem; letter-spacing: .02em; }
.gh td { padding: .55rem .7rem; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.gh tr.witness td { background: var(--witness-row); }
.gh tr.witness td:first-child { border-left: 4px solid var(--ro-blue); }
.gh tr.generated td { background: var(--generated-row); }
.gh tr.generated td:first-child { border-left: 4px solid var(--ro-red); }
.gh td.num, .gh th.num { text-align: right; }

/* ---- verdict chips ------------------------------------------------------- */
.gh-chip { display: inline-flex; align-items: center; gap: .4em; font-family: var(--font-ui); font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; padding: .28em .7em; border-radius: var(--radius); border: 1px solid transparent; line-height: 1.2; }
.gh-chip.verified     { background: var(--ro-yellow); color: #1E2126; border-color: var(--gold-ink); }
.gh-chip.denied       { background: var(--ro-red); color: var(--white); }
.gh-chip.unreconciled { background: var(--graph); color: var(--white); }
.gh-chip.pending      { background: transparent; color: var(--fg-muted); border-color: var(--fg-muted); }
.gh-chip.unsealed     { background: transparent; color: var(--fg-muted); border-style: dashed; border-color: var(--fg-muted); }

/* ---- provenance strip ---------------------------------------------------- */
.gh-provenance { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-family: var(--font-mono); font-size: .8rem; color: var(--fg-muted); padding: .6rem .8rem; border-top: 1px solid var(--rule-blue); border-bottom: 1px solid var(--rule-blue); background: var(--surface-2); }
.gh-provenance span b { font-family: var(--font-ui); font-weight: 600; color: var(--structure); margin-right: .35em; letter-spacing: .04em; text-transform: uppercase; font-size: .7rem; }

/* ---- seal mark ----------------------------------------------------------- */
.gh-seal { display: inline-grid; place-items: center; width: 7.5rem; height: 7.5rem; border-radius: 50%; border: 4px solid var(--seal); box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--seal); background: var(--seal-ground); color: var(--seal-text); text-align: center; font-family: var(--font-ui); position: relative; }
.gh-seal .word { font-family: var(--font-display); font-variant-caps: small-caps; font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; line-height: 1; color: var(--seal-word); }
.gh-seal .serial { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .04em; line-height: 1.25; }
.gh-seal .ots { font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.gh-seal.unsealed { border-color: var(--graph); border-style: dashed; box-shadow: none; background: transparent; color: var(--fg-muted); }
.gh-seal.unsealed .word { color: var(--fg-muted); }

/* ---- certificate card ---------------------------------------------------- */
.gh-cert { background: var(--surface); border: 1px solid var(--rule-blue); padding: var(--space-5) var(--space-5) var(--space-4); position: relative; }
.gh-cert::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--rule-blue); pointer-events: none; }
.gh-cert header { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); align-items: start; }
.gh-cert .finding { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.gh-cert .finding .k { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.gh-cert .finding > div { min-width: 0; }
.gh-cert .finding .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(1.05rem, 3.6vw, 1.35rem); color: var(--structure); overflow-wrap: anywhere; }
.gh-cert .finding .v.alert { color: var(--alert); }
.gh-cert .headline { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--structure); line-height: 1.05; }
@media (max-width: 600px) { .gh-cert { padding: var(--space-4) var(--space-3); } .gh-cert header { grid-template-columns: 1fr; } .gh-cert .headline { font-size: 1.9rem; } }

/* ---- both-arms table ----------------------------------------------------- */
.gh-arms td:first-child { font-family: var(--font-ui); font-weight: 600; white-space: nowrap; }
.gh-arms .arm-accept td:first-child { border-left: 4px solid var(--ro-blue); }
.gh-arms .arm-refuse td:first-child { border-left: 4px solid var(--us-red); }

/* ---- verifier input ------------------------------------------------------ */
.gh-field { display: grid; gap: .35rem; }
.gh-field label { font-weight: 600; color: var(--structure); }
.gh input[type="text"], .gh input[type="search"], .gh select { width: 100%; padding: .6rem .7rem; border: 1px solid var(--graph); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-family: var(--font-mono); font-size: max(var(--ui-min), .95rem); }
.gh button, .gh .gh-btn { cursor: pointer; padding: .6rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--structure); background: var(--structure); color: var(--button-fg); font-weight: 600; letter-spacing: .02em; }
.gh button.secondary { background: transparent; color: var(--structure); }
.gh button:disabled { opacity: .55; cursor: default; }

/* ---- GRANNY verdict card ------------------------------------------------- */
.gh-granny { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-3); background: var(--surface); border: 1px solid var(--rule-blue); border-top: 4px solid var(--ro-blue); padding: var(--space-3); max-width: 34rem; }
.gh-granny .portrait { width: 7rem; height: 7rem; background: var(--surface-2); border: 1px solid var(--rule-blue); display: grid; place-items: center; font-family: var(--font-display); font-size: 2.4rem; color: var(--structure); }
.gh-granny .character { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--structure); }
.gh-granny .finding { margin: .35rem 0; }
.gh-granny .check { font-family: var(--font-ui); font-size: .85rem; }
@media (max-width: 420px) { .gh-granny { grid-template-columns: 1fr; } }

/* ---- Doll ring renderer -------------------------------------------------- */
.gh-doll { width: 9rem; height: 9rem; }
.gh-doll circle.ring { fill: none; stroke-width: 9; stroke: var(--ring-dark); }
.gh-doll circle.ring.lit { stroke: var(--ring-lit); }
.gh-doll text { font-family: var(--font-ui); font-size: 10px; fill: var(--fg); text-anchor: middle; }

/* ---- layout helpers ------------------------------------------------------ */
.gh-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.gh-stack { display: grid; gap: var(--space-3); }
.gh-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.gh-footer { margin-top: var(--space-6); padding: var(--space-4); background: var(--us-blue); color: var(--white); font-family: var(--font-ui); font-size: .9rem; }
.gh-footer a { color: var(--white); }
.gh-alert { border-left: 4px solid var(--alert); background: var(--generated-row); padding: .7rem 1rem; }
.gh-note { border-left: 4px solid var(--ro-blue); background: var(--witness-row); padding: .7rem 1rem; }
.gh-staleness { margin: 0 0 var(--space-3); padding: .8rem 1.1rem; border: 1px solid var(--alert); border-left: 6px solid var(--alert); background: var(--generated-row); font-family: var(--font-ui); font-size: .92rem; font-weight: 600; line-height: 1.45; }
.gh-nav { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: baseline; padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule-blue); margin-bottom: var(--space-4); font-family: var(--font-ui); }
.gh-nav .brand { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--structure); text-decoration: none; }
@media print { body.gh { background: #fff; color: #000; } .gh-cert { border-color: #002B7F; } .no-print { display: none !important; } }

/* ---- brand: the Glass Hull logo (logo/) --------------------------------- */
.gh-nav .brand { display: inline-flex; align-items: center; gap: .55rem; }
.gh-mark { width: 36px; height: 36px; border-radius: 6px; background: var(--logo-ground); object-fit: cover; flex: none; }
.gh-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-4); align-items: center; background: var(--logo-ground); color: var(--white); padding: var(--space-4) var(--space-4); margin: 0 0 var(--space-5); border-bottom: 3px solid var(--ro-yellow); }
.gh-hero .gh-hero-img { width: 100%; max-width: 560px; height: auto; justify-self: center; }
.gh-hero .gh-hero-text .gh-eyebrow { color: var(--ro-yellow); }
.gh-hero h1 { color: var(--white); margin-bottom: var(--space-2); }
.gh-hero p { max-width: 48ch; }
@media (max-width: 720px) { .gh-hero { grid-template-columns: 1fr; } }
@media print { .gh-hero { background: #071540 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---- v1.1.0: the Romanian tricolour (blue | yellow | red) as the site's signature stripe, and the site-index affordances ---- */
body.gh::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--ro-blue) 0 33.333%, var(--ro-yellow) 33.333% 66.666%, var(--ro-red) 66.666% 100%); border-bottom: 1px solid var(--deep); }
.gh-tricolor { display: inline-flex; width: 2.2rem; height: .7rem; border: 1px solid var(--rule-blue); vertical-align: middle; }
.gh-tricolor i { flex: 1; } .gh-tricolor i:nth-child(1) { background: var(--ro-blue); } .gh-tricolor i:nth-child(2) { background: var(--ro-yellow); } .gh-tricolor i:nth-child(3) { background: var(--ro-red); }
.gh-index-group { margin: var(--space-5) 0 0; }
.gh-index-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; border-top: 1px solid var(--border-soft); }
.gh-index-list li { display: flex; flex-wrap: wrap; gap: .35rem .8rem; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.gh-index-list a { font-family: var(--font-ui); font-weight: 600; }
.gh-index-list .d { flex: 1 1 22rem; color: var(--fg-muted); font-size: .95rem; }
.gh-index-list .u { font-family: var(--font-mono); font-size: .8rem; color: var(--fg-muted); overflow-wrap: anywhere; }
.gh-footer-index { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 3px solid var(--ro-red); font-family: var(--font-ui); font-size: .95rem; color: var(--fg-muted); }
