:root {
  --ink: #07182a;
  --paper: #f4f7fb;
  --card: #ffffff;
  --muted: #5e7186;
  --line: #d6e1ec;
  --acid: #2db4e8;
  --teal: #176ed3;
  --orange: #8fd2f1;
  --blue: #5aa6e6;
  --violet: #89b9e8;
  --max: 1240px;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
  --mono: "DM Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.skip-link { position: fixed; left: 12px; top: -70px; z-index: 100; padding: 10px 14px; background: var(--acid); border: 1px solid var(--ink); font-weight: 800; }
.skip-link:focus { top: 12px; }

.utility { height: 34px; display: flex; align-items: center; background: var(--ink); color: white; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.utility .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.status { display: flex; align-items: center; gap: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px #2db4e826; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--ink); background: rgba(244, 242, 233, .96); backdrop-filter: blur(12px); }
.nav { min-height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; }
.brand { width: max-content; font-size: 25px; font-weight: 700; letter-spacing: -.06em; }
.brand b { margin-left: 2px; padding: 1px 5px; background: var(--acid); }
.navlinks { display: flex; justify-content: center; gap: clamp(18px, 2.4vw, 31px); font-size: 13px; font-weight: 700; }
.navlinks a { padding-block: 5px; border-bottom: 2px solid transparent; }
.navlinks a:hover, .navlinks a[aria-current="page"] { border-color: var(--teal); }
.nav-action { justify-self: end; display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--ink); font-size: 12px; font-weight: 800; }
.nav-action:hover { background: var(--ink); color: white; }

.eyebrow { color: var(--teal); font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.meta { display: flex; flex-wrap: wrap; gap: 13px; font: 10px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.text-link { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid currentColor; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 1px solid var(--ink); background: var(--ink); color: white; font-size: 12px; font-weight: 800; }
.button:hover { background: var(--teal); }
.button.light { background: var(--acid); color: var(--ink); }
.button.light:hover { background: white; }

.page-hero { border-bottom: 1px solid var(--ink); padding: 24px 0 22px; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .55fr); gap: clamp(24px, 4vw, 52px); align-items: end; }
.page-hero h1 { max-width: 900px; margin: 7px 0 0; font: 600 clamp(38px, 5vw, 60px) / .96 var(--serif); letter-spacing: -.045em; }
.page-hero h1 em { color: var(--teal); font-style: italic; }
.page-intro { margin: 0; color: #40566c; font-size: 18px; }
.hero-aside { padding: 14px 16px; border: 1px solid var(--ink); background: var(--acid); }
.hero-aside strong { display: block; margin: 5px 0; font: 600 22px/1.05 var(--serif); }
.hero-aside p { margin: 0; font-size: 12px; line-height: 1.45; }

.section { padding: 40px 0 56px; }
.section + .section { border-top: 1px solid var(--ink); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.section-head h2 { margin: 6px 0 0; font: 600 clamp(35px, 5vw, 52px)/1 var(--serif); letter-spacing: -.035em; }
.section-head p { max-width: 460px; margin: 0; color: var(--muted); font-size: 13px; }
.article-search { display: grid; grid-template-columns: 1fr auto; margin: 0 0 22px; border: 1px solid var(--ink); background: var(--card); }
.article-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.article-search input { min-width: 0; height: 54px; padding: 0 17px; border: 0; background: transparent; color: var(--ink); outline: 0; }
.article-search input:focus { box-shadow: inset 0 0 0 3px var(--acid); }
.search-count { display: flex; align-items: center; padding: 0 17px; border-left: 1px solid var(--ink); background: var(--acid); font: 500 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.no-results { margin: 0 0 22px; padding: 26px; border: 1px solid var(--ink); background: var(--orange); font: 600 25px/1.1 var(--serif); }

.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.story-card { min-height: 270px; display: grid; grid-template-columns: 132px 1fr; border: 1px solid var(--ink); background: var(--card); transition: transform .18s, box-shadow .18s; }
.story-card:hover { transform: translateY(-3px); box-shadow: 5px 5px 0 var(--ink); }
.story-index { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border-right: 1px solid var(--ink); background: var(--acid); font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.story-index strong { font: 500 34px/1 var(--mono); letter-spacing: -.08em; }
.story-index::after { content: ""; position: absolute; right: -57px; bottom: 24px; width: 108px; height: 108px; border: 16px solid var(--ink); border-radius: 50%; opacity: .9; }
.story-card:nth-child(4n + 2) .story-index { background: var(--orange); }
.story-card:nth-child(4n + 2) .story-index::after { border-radius: 0; transform: rotate(34deg); }
.story-card:nth-child(4n + 3) .story-index { background: var(--teal); color: white; }
.story-card:nth-child(4n + 3) .story-index::after { border-color: var(--acid); border-radius: 0; width: 72px; height: 86px; right: -31px; transform: rotate(12deg); }
.story-card:nth-child(4n + 4) .story-index { background: var(--blue); }
.story-card:nth-child(4n + 4) .story-index::after { border-width: 9px; border-radius: 0; transform: rotate(-8deg); box-shadow: -14px 14px 0 var(--blue), -20px 20px 0 var(--ink); }
.story-copy { display: flex; flex-direction: column; padding: 23px; }
.story-copy h2, .story-copy h3 { margin: 10px 0 12px; font: 600 clamp(25px, 3vw, 31px)/1.07 var(--serif); letter-spacing: -.025em; }
.story-copy p { margin: 0 0 21px; color: var(--muted); font-size: 13px; }
.story-copy .meta { margin-top: auto; }

.topic-band { padding: 42px 0; background: var(--ink); color: white; }
.topic-band-grid { display: grid; grid-template-columns: .8fr repeat(3, 1fr); border: 1px solid #ffffff3d; }
.topic-band-intro, .topic-link { min-height: 145px; padding: 22px; }
.topic-band-intro { display: flex; flex-direction: column; justify-content: center; background: var(--acid); color: var(--ink); }
.topic-band-intro strong { margin-top: 6px; font: 600 29px/1 var(--serif); }
.topic-link { display: flex; flex-direction: column; justify-content: space-between; border-left: 1px solid #ffffff3d; }
.topic-link:hover { color: var(--acid); }
.topic-link strong { font: 600 23px/1.08 var(--serif); }
.topic-link span { color: #9fb4c8; font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.resource-card { display: flex; flex-direction: column; min-height: 220px; padding: 18px; border: 1px solid var(--ink); background: var(--card); transition: transform .18s, box-shadow .18s; }
.resource-card:hover, .resource-card:focus-within { transform: translateY(-3px); box-shadow: 5px 5px 0 var(--ink); }
.resource-card.featured { background: var(--teal); color: white; }
.resource-card h2 { margin: 8px 0; font: 600 clamp(25px, 3vw, 31px)/1.02 var(--serif); letter-spacing: -.025em; }
.resource-card p { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.resource-card.featured p { color: #dbeeff; }
.resource-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; }
.resource-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--ink); background: var(--acid); color: var(--ink); font-size: 10px; font-weight: 800; }
.resource-links a:hover { background: var(--ink); color: white; }
.resource-card.featured .resource-links a:hover { border-color: white; }
.resource-card.has-preview { display: grid; grid-template-columns: minmax(165px, .72fr) minmax(0, 1.28fr); gap: 16px; min-height: 0; padding: 14px; }
.resource-preview { align-self: start; min-height: 0; aspect-ratio: 2 / 1; overflow: hidden; border: 1px solid currentColor; background: var(--ink); }
.resource-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.resource-terminal { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 13px; background: var(--ink); color: var(--acid); font-family: var(--mono); }
.resource-terminal span { color: #9eb0aa; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.resource-terminal strong { color: #fff; font-size: 11px; line-height: 1.35; }
.resource-terminal code { font-size: 8px; line-height: 1.55; white-space: normal; }
.resource-terminal code span { display: block; color: inherit; font: inherit; letter-spacing: 0; text-transform: none; }
.resource-copy { min-width: 0; display: flex; flex-direction: column; }
.bundle { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 25px; padding: 28px; border: 1px solid var(--ink); background: var(--orange); }
.bundle h2 { margin: 0; font: 600 34px/1.05 var(--serif); }
.bundle p { margin: 7px 0 0; font-size: 13px; }

.about-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .55fr); gap: clamp(42px, 8vw, 100px); }
.prose h2 { margin: 48px 0 15px; font: 600 clamp(31px, 4vw, 43px)/1.05 var(--serif); letter-spacing: -.025em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 20px; color: #40566c; font-size: 17px; line-height: 1.75; }
.principles { border-top: 1px solid var(--ink); }
.principle { padding: 20px 0; border-bottom: 1px solid var(--line); }
.principle span { display: block; color: var(--teal); font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.principle strong { display: block; margin-top: 7px; font: 600 24px/1.1 var(--serif); }

.category-lead { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .65fr); border: 1px solid var(--ink); background: var(--card); }
.category-lead-copy { display: flex; flex-direction: column; justify-content: center; min-height: 390px; padding: clamp(28px, 6vw, 62px); }
.category-lead h2 { margin: 12px 0 16px; font: 600 clamp(39px, 6vw, 64px)/.98 var(--serif); letter-spacing: -.04em; }
.category-lead p { max-width: 650px; margin: 0 0 28px; color: var(--muted); }
.category-art { position: relative; overflow: hidden; min-height: 300px; border-left: 1px solid var(--ink); background: var(--acid); }
.category-art::before, .category-art::after { content: ""; position: absolute; border: 22px solid var(--ink); }
.category-art::before { width: 195px; height: 195px; right: -65px; top: 34px; border-radius: 50%; }
.category-art::after { width: 118px; height: 165px; left: 18%; bottom: -74px; transform: rotate(23deg); }
.category-art.security { background: var(--orange); }
.category-art.security::before { border-radius: 0; transform: rotate(13deg); }
.category-art.engineering { background: var(--blue); }
.category-art.engineering::after { border-radius: 50%; width: 180px; height: 48px; bottom: 70px; left: 18%; transform: rotate(-15deg); }

.detector-intro { padding: 45px 0 0; }
.detector-note { max-width: 760px; color: var(--muted); }
.detector-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .75fr); gap: 18px; padding: 30px 0 70px; }
.panel { padding: clamp(24px, 4vw, 36px); border: 1px solid var(--ink); background: var(--card); }
.panel h2 { margin: 0; font: 600 34px/1 var(--serif); }
.panel-lead { margin: 10px 0 24px; color: var(--muted); font-size: 13px; }
.label { display: block; margin: 0 0 8px; font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.text-box { width: 100%; min-height: 330px; resize: vertical; padding: 17px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); line-height: 1.6; outline: none; }
.text-box:focus { box-shadow: 0 0 0 3px var(--acid); }
.drop-zone { margin-top: 12px; padding: 15px; border: 1px dashed var(--teal); background: #176ed30c; color: #40566c; font-size: 12px; text-align: center; }
.drop-zone.drag { background: var(--acid); border-style: solid; }
.drop-zone button { padding: 0; border: 0; background: transparent; color: var(--teal); font-weight: 800; text-decoration: underline; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.button-row button { min-height: 44px; padding: 0 15px; border: 1px solid var(--ink); border-radius: 0; font-size: 12px; font-weight: 800; cursor: pointer; }
.button-row .primary { background: var(--ink); color: white; }
.button-row .primary:hover { background: var(--teal); }
.button-row .secondary { background: transparent; color: var(--ink); }
.button-row .secondary:hover { background: var(--acid); }
.privacy { margin: 14px 0 0; color: var(--muted); font: 10px var(--mono); }
.empty { display: grid; min-height: 430px; place-items: center; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.score-ring { --score: 0; width: 210px; aspect-ratio: 1; display: grid; place-items: center; margin: 24px auto; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--score) * 1%), #e2e4dc 0); position: relative; }
.score-ring::after { content: ""; position: absolute; inset: 18px; border: 1px solid var(--ink); border-radius: 50%; background: var(--card); }
.score-value { position: relative; z-index: 1; text-align: center; }
.score-value strong { display: block; font: 600 68px/.9 var(--serif); }
.score-value span { font: 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.result-label { font: 600 29px/1.05 var(--serif); text-align: center; }
.meter-note { color: var(--muted); font-size: 13px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 24px 0; border: 1px solid var(--ink); }
.stat { min-width: 0; padding: 12px 8px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--ink); }
.stat strong { display: block; font: 600 20px var(--serif); }
.stat span { display: block; color: var(--muted); font: 8px var(--mono); line-height: 1.25; text-transform: uppercase; }
.findings { border-top: 1px solid var(--ink); }
.finding { padding: 14px 0; border-bottom: 1px solid var(--line); }
.finding-title { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; font-weight: 800; }
.finding-title span:last-child { color: var(--orange); font-family: var(--mono); }
.finding p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.disclaimer { margin-top: 20px; padding: 16px; border: 1px solid var(--ink); border-left: 7px solid var(--acid); font-size: 12px; }

.error-page { min-height: calc(100vh - 250px); display: grid; place-items: center; padding: 60px 0; }
.error-grid { display: grid; grid-template-columns: .6fr 1fr; border: 1px solid var(--ink); background: var(--card); }
.error-code { display: grid; place-items: center; min-height: 430px; overflow: hidden; position: relative; border-right: 1px solid var(--ink); background: var(--orange); font: 500 clamp(85px, 14vw, 180px)/1 var(--mono); letter-spacing: -.12em; }
.error-code::after { content: ""; position: absolute; width: 220px; height: 220px; right: -125px; bottom: -50px; border: 24px solid var(--ink); border-radius: 50%; }
.error-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 7vw, 75px); }
.error-copy h1 { margin: 10px 0 14px; font: 600 clamp(44px, 7vw, 76px)/.96 var(--serif); letter-spacing: -.045em; }
.error-copy p { max-width: 560px; margin: 0 0 25px; color: var(--muted); }

.site-footer { padding: 38px 0 28px; border-top: 1px solid var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 35px; }
.footer-brand { font: 600 38px var(--serif); }
.footer-note { max-width: 410px; color: var(--muted); font-size: 13px; }
.footer-label { margin-bottom: 12px; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
.footer-links { display: grid; gap: 8px; font-size: 12px; }
.footer-links a:hover { color: var(--teal); }
.copyright { display: flex; justify-content: space-between; gap: 15px; margin-top: 35px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); }

@media (max-width: 900px) {
  .nav { min-height: 74px; grid-template-columns: 1fr auto; }
  .navlinks { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; width: 100%; padding-bottom: 10px; white-space: nowrap; }
  .nav-action { grid-column: 2; grid-row: 1; }
  .page-hero-grid, .about-layout, .detector-grid { grid-template-columns: 1fr; }
  .topic-band-grid { grid-template-columns: 1fr 1fr; }
  .topic-link { border-top: 1px solid #ffffff3d; }
  .topic-link:nth-child(odd) { border-left: 0; }
  .category-lead { grid-template-columns: 1fr; }
  .category-art { min-height: 220px; border-left: 0; border-top: 1px solid var(--ink); }
  .resource-card.has-preview { grid-template-columns: 1fr; }
  .resource-preview { aspect-ratio: 2 / 1; }
}

@media (max-width: 650px) {
  .wrap { width: min(calc(100% - 26px), var(--max)); }
  .utility .utility-note { display: none; }
  .nav { gap: 12px; }
  .brand { font-size: 22px; }
  .nav-action { padding-inline: 10px; font-size: 10px; }
  .page-hero { padding: 20px 0; }
  .page-hero h1 { font-size: 40px; }
  .section { padding: 34px 0 44px; }
  .section-head { display: block; }
  .section-head p { margin-top: 12px; }
  .article-search { grid-template-columns: 1fr; }
  .search-count { min-height: 38px; border-left: 0; border-top: 1px solid var(--ink); }
  .story-grid, .resource-grid { grid-template-columns: 1fr; }
  .story-card { min-height: 0; grid-template-columns: 1fr; }
  .story-index { height: 92px; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--ink); }
  .story-index::after { right: -35px; bottom: -58px; }
  .topic-band-grid { grid-template-columns: 1fr; }
  .topic-link { min-height: 110px; border-left: 0; }
  .bundle { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--ink); }
  .stat:nth-child(4) { border-top: 1px solid var(--ink); }
  .error-grid { grid-template-columns: 1fr; }
  .error-code { min-height: 230px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .copyright { display: block; }
  .copyright span { display: block; margin-top: 6px; }
}
