/* ai-security.strategicsecurity.cc
   Shares the main site's v4 palette and type so the two read as one house. */

:root {
  --night:        #0A0908;
  --ink:          #14110C;
  --ink-soft:     #2B251D;
  --ink-mute:     #6E6151;
  --cream:        #F3EEE2;
  --cream-soft:   #F8F4EB;
  --parchment:    #EAE2CF;
  --parchment-d:  #DED3BC;
  --twilight:     #14171F;
  --twilight-soft:#1C2029;
  --terracotta:   #C25A36;
  --terracotta-d: #9C4526;
  --apricot:      #E8B493;
  --apricot-l:    #F4D6BE;
  --gold:         #C9A24B;
  --rule:         #D8CDB6;
  --rule-dark:    rgba(243, 238, 226, 0.14);
  --cream-dim:    rgba(243, 238, 226, 0.72);

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif:   "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-display: clamp(2.5rem, 5.6vw + 0.5rem, 5.8rem);
  --fs-h2:      clamp(2rem, 3.6vw + 0.4rem, 3.6rem);
  --fs-lede:    clamp(1.1rem, 1.4vw, 1.35rem);
  --fs-prose:   clamp(1.05rem, 1.2vw, 1.2rem);
  --fs-small:   clamp(0.8rem, 0.9vw, 0.88rem);

  --max:     1280px;
  --measure: 66ch;
  --gutter:  clamp(1rem, 4vw, 4rem);
  --band:    clamp(4.5rem, 9vw, 8.5rem);
  --nav-h:   4rem;
  --radius:  18px;
  --ease:    cubic-bezier(0.22, 0.61, 0.21, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-prose);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--terracotta); }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 4px; }
.band-night :focus-visible, .hero :focus-visible, .nav :focus-visible, .footer :focus-visible { outline-color: var(--apricot); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: var(--fs-h2); margin-bottom: 1rem; font-variation-settings: "opsz" 144, "SOFT" 50; }
h3 { font-size: clamp(1.25rem, 1.5vw, 1.45rem); line-height: 1.2; font-variation-settings: "opsz" 48; }
p { margin: 0 0 1rem; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--cream); color: var(--ink); padding: 0.6rem 1rem; border-radius: 8px;
  font-family: var(--mono); font-size: var(--fs-small);
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.eyebrow, .label, .num, .nav-index, .fw-meta, .tag, .chip, .filter, .reviewed, .hero-meta, .print-btn, .toc summary, .small {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.eyebrow { font-size: var(--fs-small); text-transform: uppercase; color: var(--terracotta); margin-bottom: 1rem; }
.label { display: block; font-size: 0.72rem; text-transform: uppercase; color: var(--ink-mute); margin: 1.25rem 0 0.5rem; }

/* --- Navigation ------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 var(--gutter);
  background: rgba(10, 9, 8, 0.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--cream);
  border-bottom: 1px solid var(--rule-dark);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; min-width: 0; }
.brand:hover { color: var(--apricot-l); }
.brand-mark { color: var(--apricot); flex: none; }
.brand-name { font-family: var(--display); font-size: 1.1rem; white-space: nowrap; }
.brand-sub { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--apricot); margin-left: 0.4rem; }
.nav-links { display: flex; gap: clamp(0.8rem, 1.6vw, 1.6rem); }
.nav-links a, .toc nav a {
  font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; color: var(--cream-dim); white-space: nowrap;
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--cream); }
.nav-index { color: var(--apricot); margin-right: 0.35rem; font-size: 0.68rem; }

.toc { display: none; position: relative; }
.toc summary {
  list-style: none; cursor: pointer; font-size: 0.78rem; text-transform: uppercase;
  padding: 0.45rem 0.85rem; border: 1px solid var(--rule-dark); border-radius: 999px; color: var(--cream);
}
.toc summary::-webkit-details-marker { display: none; }
.toc[open] summary { background: var(--cream); color: var(--ink); }
.toc nav {
  position: absolute; right: 0; top: calc(100% + 0.6rem);
  display: grid; gap: 0.2rem; padding: 0.6rem; min-width: 13rem;
  background: var(--twilight); border: 1px solid var(--rule-dark); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.toc nav a { padding: 0.55rem 0.6rem; border-radius: 8px; }
.toc nav a:hover { background: var(--twilight-soft); color: var(--cream); }

@media (max-width: 1000px) {
  .nav-links { display: none; }
  .toc { display: block; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
}

/* --- Hero ------------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 72% 45%, #2A2118 0%, var(--night) 62%);
  color: var(--cream);
  min-height: clamp(34rem, calc(100vh - var(--nav-h)), 56rem);
  display: flex; align-items: center;
}
.hero-art { position: absolute; inset: 0 -12% 0 38%; opacity: 0.95; }
.hero-art svg { width: 100%; height: 100%; }
.beam { transform-origin: 300px 300px; animation: sweep 16s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.rings circle { vector-effect: non-scaling-stroke; }
.hero-inner { position: relative; max-width: var(--max); width: 100%; margin: 0 auto; padding: 5rem var(--gutter); }
.hero h1 { font-size: var(--fs-display); max-width: 14ch; font-variation-settings: "opsz" 144, "SOFT" 30; }
.hero h1 em { display: block; font-style: italic; color: var(--apricot); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.hero .eyebrow { color: var(--apricot); }
.lede { font-size: var(--fs-lede); max-width: 46ch; color: var(--cream-dim); margin: 1.6rem 0 2rem; }
.hero-meta { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; font-size: 0.82rem; text-transform: uppercase; color: var(--cream-dim); }
.hero-meta strong { font-family: var(--display); font-size: 1.6rem; font-weight: 400; color: var(--cream); margin-right: 0.35rem; text-transform: none; }
.reviewed { font-size: 0.75rem; color: rgba(243, 238, 226, 0.5); text-transform: uppercase; margin: 0; }

@media (max-width: 760px) {
  .hero-art { inset: auto -40% -10% 10%; height: 75%; opacity: 0.45; }
  .hero-inner { padding: 3.5rem var(--gutter) 4rem; }
}

/* --- Bands ----------------------------------------------------------------- */
.band { padding: var(--band) 0; }
.band-cream { background: var(--cream); }
.band-parchment { background: var(--parchment); }
.band-night { background: var(--twilight); color: var(--cream); }
.band-night .eyebrow { color: var(--apricot); }
.band-night .label { color: rgba(243, 238, 226, 0.55); }
.section-head { max-width: 52rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head p:last-child { color: var(--ink-soft); margin: 0; }
.band-night .section-head p:last-child { color: var(--cream-dim); }
.prose-lead { font-size: var(--fs-lede); font-family: var(--display); font-variation-settings: "opsz" 36; line-height: 1.45; }

/* --- Cards ----------------------------------------------------------------- */
.cards {
  display: grid; gap: clamp(1rem, 1.6vw, 1.5rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}
.principle, .framework {
  background: var(--cream-soft); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(1.3rem, 2vw, 1.9rem);
  font-size: 1rem; line-height: 1.6;
}
.principle:target, .threat:target { box-shadow: 0 0 0 2px var(--terracotta); }
.num { font-size: 0.78rem; color: var(--terracotta); margin: 0 0 0.6rem; }
.principle h3 { margin-bottom: 0.6rem; }
.principle-line { font-family: var(--display); font-style: italic; font-variation-settings: "opsz" 24, "SOFT" 100; color: var(--terracotta-d); font-size: 1.08rem; line-height: 1.45; }
.practice { margin: 0; padding-left: 1.1rem; }
.practice li { margin-bottom: 0.4rem; }
.practice li::marker { color: var(--terracotta); }
.sources { font-size: 0.92rem; margin-top: 1rem; }
.sources .label { display: inline; margin: 0 0.4rem 0 0; }

.chips, .tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-block; font-size: 0.72rem; text-decoration: none; line-height: 1.3;
  padding: 0.32rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft);
  background: var(--cream);
}
.chip:hover { border-color: var(--terracotta); color: var(--terracotta); }

.threat {
  background: var(--twilight-soft); border: 1px solid var(--rule-dark); border-radius: var(--radius);
  padding: clamp(1.3rem, 2vw, 1.9rem); font-size: 1rem; line-height: 1.6;
}
.threat[hidden] { display: none; }
.threat .num { color: var(--apricot); }
.threat h3 { margin-bottom: 0.8rem; color: var(--cream); }
.threat p { color: var(--cream-dim); }
.threat .tags { margin-bottom: 1rem; }
.tag { font-size: 0.68rem; text-transform: uppercase; padding: 0.22rem 0.55rem; border-radius: 6px; border: 1px solid var(--rule-dark); color: var(--cream-dim); }
.tag-owasp { border-color: rgba(201, 162, 75, 0.6); color: var(--gold); text-transform: none; }
.looks .label, .case .label { margin-top: 0; }
.case { border-left: 2px solid var(--apricot); padding-left: 0.9rem; font-size: 0.95rem; }
.case strong { color: var(--cream); font-weight: 600; }
.case a, .threat a { color: var(--apricot-l); }
.case a:hover { color: var(--cream); }
.threat .chip { background: transparent; border-color: var(--rule-dark); color: var(--cream-dim); }
.threat .chip:hover { border-color: var(--apricot); color: var(--cream); }

.filters { display: none; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.js .filters { display: flex; }
.filter {
  font-size: 0.75rem; text-transform: uppercase; cursor: pointer;
  padding: 0.5rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--rule-dark); background: transparent; color: var(--cream-dim);
}
.filter:hover { color: var(--cream); border-color: var(--apricot); }
.filter[aria-pressed="true"] { background: var(--apricot); border-color: var(--apricot); color: var(--ink); }

.framework h3 { margin-bottom: 0.7rem; }
.framework h3 a { text-decoration: none; }
.framework h3 a:hover { text-decoration: underline; }
.fw-meta { font-size: 0.72rem; text-transform: uppercase; color: var(--terracotta); margin-bottom: 0.6rem; }
.fw-status { font-size: 0.9rem; color: var(--ink-mute); margin: 0; border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.fw-more { font-size: 0.92rem; }

/* --- Grid ------------------------------------------------------------------ */
.grid-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--cream-soft);
}
.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 52rem; font-size: 0.9rem; }
.grid th, .grid td { border-bottom: 1px solid var(--rule); padding: 0.55rem 0.4rem; text-align: center; }
.grid tbody tr:last-child th, .grid tbody tr:last-child td { border-bottom: 0; }
.grid thead th { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--ink-mute); }
.grid thead th a { text-decoration: none; }
.grid th[scope="row"] {
  position: sticky; left: 0; z-index: 1; background: var(--cream-soft);
  text-align: left; font-weight: 400; white-space: nowrap; padding-left: 1rem; padding-right: 1rem;
  border-right: 1px solid var(--rule);
}
.grid th[scope="row"] a { font-family: var(--mono); font-size: 0.72rem; color: var(--terracotta); text-decoration: none; margin-right: 0.3rem; }
.grid .corner { position: sticky; left: 0; z-index: 2; background: var(--cream-soft); text-align: left; padding-left: 1rem; border-right: 1px solid var(--rule); text-transform: uppercase; }
.dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--terracotta); vertical-align: middle; }
.grid tbody tr:hover th[scope="row"], .grid tbody tr:hover td { background: var(--parchment); }
.grid .is-col { background: var(--parchment); }
.grid-legend {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: grid; gap: 0.3rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  font-size: 0.92rem;
}
.grid-legend a { text-decoration: none; }
.num-inline { font-family: var(--mono); font-size: 0.72rem; color: var(--terracotta); margin-right: 0.3rem; }

/* --- Questions ------------------------------------------------------------- */
.questions { list-style: none; counter-reset: q; padding: 0; margin: 2rem 0; }
.questions li {
  counter-increment: q; position: relative;
  padding: 1rem 0 1rem 3.4rem; border-top: 1px solid var(--rule);
}
.questions li:last-child { border-bottom: 1px solid var(--rule); }
.questions li::before {
  content: counter(q, decimal-leading-zero);
  position: absolute; left: 0; top: 0.85rem;
  font-family: var(--display); font-style: italic; font-size: 1.5rem; line-height: 1.2;
  color: var(--terracotta); font-variation-settings: "SOFT" 100, "WONK" 1;
}
.print-btn {
  font-size: 0.78rem; text-transform: uppercase; cursor: pointer;
  padding: 0.7rem 1.2rem; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.print-btn:hover { background: var(--ink); color: var(--cream); }

/* --- Footer ---------------------------------------------------------------- */
.footer { background: var(--night); color: var(--cream-dim); padding: 4rem 0 3rem; font-size: 1rem; }
.footer-brand { font-family: var(--display); font-size: 1.4rem; color: var(--cream); }
.footer a { color: var(--apricot-l); }
.footer a:hover { color: var(--cream); }
.small { font-size: 0.75rem; text-transform: uppercase; color: rgba(243, 238, 226, 0.5); margin-top: 2rem; }

/* --- Motion and print ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .beam { animation: none; transform: rotate(-20deg); }
}

@media print {
  .nav, .hero, .filters, .print-btn, .skip { display: none !important; }
  body, .band, .band-night, .threat, .footer { background: #fff !important; color: #000 !important; }
  .threat p, .threat h3, .threat .chip, .tag { color: #000 !important; }
  .band { padding: 1.5rem 0; }
  .cards { display: block; }
  .principle, .threat, .framework { break-inside: avoid; border: 1px solid #999; margin-bottom: 0.8rem; }
  a { color: #000; }
  body.print-questions main > section:not(#questions), body.print-questions .footer { display: none !important; }
}
