/* ============================================================
   Constatia Design Tokens — tokens.css v1.0
   Source of truth for all web/product UI colour variables.
   Machine-readable: referenced by Claude Code agents via
   brand/tokens.json. Human-readable: used in Astro, React.
   
   IMPORTANT: Do NOT hardcode colours in adaptive UI contexts.
   Use these variables for any surface that adapts to dark mode.
   Exception: brand elements on hardcoded brand backgrounds
   (e.g. text inside the hero div with background:#182640)
   must use explicit rgba(255,255,255,x) values — CSS variables
   will not resolve correctly inside hardcoded dark containers.
   ============================================================ */

:root {
  /* --- Brand core (never change) --- */
  --brand-midnight:       #182640;
  --brand-gold:           #C8972A;
  --brand-slate:          #3D5473;
  --brand-mist:           #F5F7FA;

  /* --- Navy ramp --- */
  --navy-50:  #EBF0F7;
  --navy-100: #C4D0E5;
  --navy-200: #9DB0D3;
  --navy-300: #6B8CB8;
  --navy-400: #3D5473;
  --navy-600: #2A3F5E;
  --navy-700: #1C2E4A;
  --navy-900: #182640;

  /* --- Gold ramp --- */
  --gold-50:  #FBF0DC;
  --gold-100: #F5D89E;
  --gold-200: #EEC062;
  --gold-400: #DDA830;
  --gold-500: #C8972A;
  --gold-700: #8F6419;
  --gold-900: #5C3E0A;

  /* --- Surfaces (light mode) --- */
  --surface-page:          #F5F7FA;
  --surface-card:          #FFFFFF;
  --surface-inset:         #ECEEF2;
  --surface-brand:         #182640;
  --surface-brand-subtle:  #EBF0F7;

  /* --- Text (light mode) --- */
  --text-primary:          #182640;
  --text-secondary:        #3D5473;
  --text-tertiary:         #6B8CB8;
  --text-on-brand:         #FFFFFF;
  --text-datum:            #C8972A;

  /* --- Borders (light mode) --- */
  --border-default:        #DCE3EC;
  --border-emphasis:       #9DB0D3;
  --border-brand:          #182640;

  /* --- Interactive (light mode) --- */
  --interactive-primary:          #182640;
  --interactive-primary-hover:    #1E3050;
  --interactive-accent:           #C8972A;
  --interactive-accent-hover:     #B8871A;
  --interactive-ghost-border:     #182640;
  --interactive-ghost-text:       #182640;

  /* --- Compliance states --- */
  --status-pass-bg:        #EAF7F0;
  --status-pass-text:      #0A4D2A;
  --status-pass-border:    #A8D5BC;
  --status-flag-bg:        #FBF0DC;   /* gold family — intentional brand tie */
  --status-flag-text:      #8F6419;
  --status-flag-border:    #E4B848;
  --status-fail-bg:        #FEF0F0;
  --status-fail-text:      #7A1A1A;
  --status-fail-border:    #E8A0A0;
  --status-pending-bg:     #EBF0F7;
  --status-pending-text:   #2A3F5E;
  --status-pending-border: #9DB0D3;

  /* --- Typography --- */
  --font-primary:   'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --font-email:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Calibri, 'Gill Sans', 'Trebuchet MS', Arial, sans-serif;

  /* --- Type scale --- */
  --text-display:  36px;
  --text-h1:       26px;
  --text-h2:       18px;
  --text-h3:       14px;
  --text-body:     13px;
  --text-caption:  11px;

  /* --- Spacing --- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 40px;

  /* --- Radii --- */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-pill: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-page:         #0F1A28;
    --surface-card:         #1A2332;
    --surface-inset:        #0A1220;
    --surface-brand-subtle: #1E3050;

    --text-primary:         #E8EDF4;
    --text-secondary:       #8CA4C0;
    --text-tertiary:        #4A6A8C;
    --text-datum:           #E4B84A;

    --border-default:       #2A3F5E;
    --border-emphasis:      #3D5473;
    --border-brand:         #C8972A;

    /* Dark mode CTA flips to gold — navy btn on navy bg loses contrast */
    --interactive-primary:       #C8972A;
    --interactive-primary-hover: #B8871A;
    --interactive-ghost-border:  #4A6A8C;
    --interactive-ghost-text:    #E8EDF4;
  }
}

/* ============================================================
   constatia.com site styles
   Everything above this line is copied verbatim from
   brand/tokens.css v1.0. Re-copy it if the tokens change.
   Navy bands (.band) have a hardcoded #182640 background, so
   text inside them uses explicit rgba(255,255,255,x) values,
   never adaptive variables (brand-guidelines.md 3.4 and 3.5).
   ============================================================ */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/PlusJakartaSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 12px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: #FFFFFF; color: #182640; padding: 8px 14px;
  border-radius: var(--radius-md); font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- Navy bands: header, hero, page title, footer ---------- */
.band { background: #182640; color: rgba(255,255,255,0.95); }
.band a:focus-visible { outline-color: #C8972A; }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap;
  min-height: 72px; padding-top: 12px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.lockup { display: block; height: 32px; width: auto; }
.site-nav ul {
  display: flex; flex-wrap: wrap; gap: 4px 24px;
  list-style: none; margin: 0; padding: 0;
  font-size: 15px; font-weight: 500;
}
.site-nav a { color: rgba(255,255,255,0.78); text-decoration: none; }
.site-nav a:hover { color: rgba(255,255,255,0.95); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: rgba(255,255,255,0.95); }

.hero { padding-top: 88px; padding-bottom: 96px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 46px); line-height: 1.14; font-weight: 700;
  letter-spacing: -0.015em; margin: 0 0 24px; max-width: 21ch;
  color: rgba(255,255,255,0.95);
}
.rule { width: 56px; height: 3px; background: #C8972A; border: 0; margin: 0 0 24px; }
.lede { font-size: 19px; line-height: 1.55; color: rgba(255,255,255,0.78); max-width: 52ch; margin: 0; }

.page-title { padding-top: 40px; padding-bottom: 44px; }
.page-title h1 {
  font-size: clamp(26px, 4vw, 32px); line-height: 1.2; font-weight: 700;
  letter-spacing: -0.01em; margin: 0; color: rgba(255,255,255,0.95);
}
.page-title .rule { margin: 18px 0 0; }

.site-footer { padding: 36px 0 44px; font-size: 14px; }
.site-footer .row {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 24px; margin-bottom: 14px; color: rgba(255,255,255,0.78);
}
.site-footer ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: rgba(255,255,255,0.90); }
.site-footer .tm { font-size: 13px; color: rgba(255,255,255,0.72); max-width: 72ch; margin: 0; }

/* ---------- Light body: Ledger layout ---------- */
/* Row dividers sit one step darker than --border-default so they stay visible on white */
:root { --border-row: var(--navy-100); }
@media (prefers-color-scheme: dark) { :root { --border-row: var(--border-emphasis); } }

/* Sections alternate white and Mist; no divider lines between them */
.section { padding: 96px 0; background: var(--surface-card); }
.section-alt { background: var(--surface-page); }
.section-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
.section-heading {
  font-family: var(--font-primary); font-size: 21px; font-weight: 600;
  line-height: 1.3; letter-spacing: -0.005em;
  color: var(--text-primary); margin: 0;
}
/* Decorative gold rule above each section heading, matching the hero rule */
.section-heading::before {
  content: ""; display: block; width: 32px; height: 3px;
  background: #C8972A; margin-bottom: 14px;
}
h3 { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; }
.muted { color: var(--text-secondary); }
.measure { max-width: 62ch; }

/* Apps as ledger rows */
.apps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-row); }
.apps li {
  display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 32px;
  padding: 24px 0; border-bottom: 1px solid var(--border-row);
}
.apps .working-name { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--text-secondary); margin-left: 6px; white-space: nowrap; }
.apps p { color: var(--text-secondary); margin: 0; max-width: 62ch; }

/* Status labels: findingSeverity colours, hardcoded per brand rule, used for status labels only.
   The dot is decorative gold. */
.status {
  justify-self: start; align-self: start;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; line-height: 1.35;
  padding: 5px 11px; border: 1px solid; border-radius: var(--radius-md);
}
.status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #C8972A; }
.status-pending { background: #EBF0F7; color: #2A3F5E; border-color: #9DB0D3; }
.status-flag    { background: #FBF0DC; color: #8F6419; border-color: #E4B848; }

/* Numbered principles */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; list-style: none; margin: 0; padding: 0; counter-reset: principle; }
.principles li { counter-increment: principle; }
.principles li::before {
  content: "0" counter(principle); display: block;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary);
  width: 40px; padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 2px solid var(--text-primary);
}
.principles p { color: var(--text-secondary); font-size: 15px; margin: 0; }

/* Contact cards: white fill on the Mist section */
/* Cards drop to fewer columns rather than letting an address wrap */
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; }
.contacts div { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 20px; }
.contacts dt { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.contacts dd { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; }

/* Policy text (privacy page) */
.policy h2 { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 32px 0 8px; }
.policy h2:first-of-type { margin-top: 0; }
.policy p, .policy li { color: var(--text-secondary); }
.policy ul { margin: 0 0 12px; padding-left: 20px; }
.policy li { margin-bottom: 6px; }
.policy .updated { font-size: 14px; color: var(--text-secondary); margin: 0 0 28px; }

@media (max-width: 760px) {
  .hero { padding-top: 56px; padding-bottom: 64px; }
  .lede { font-size: 17px; }
  .section { padding: 64px 0; }
  .section-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .grid-spacer { display: none; }
  .apps li { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .principles { grid-template-columns: minmax(0, 1fr); }
}
