/* ACES INFOSEC — styles
   Palette: paper / ink / signal vermilion. Type: Instrument Serif, Hanken Grotesk, JetBrains Mono. */

:root {
  --paper: #eeeae1;
  --paper-2: #e5e0d4;
  --card: #fbf9f4;
  --ink: #121212;
  --ink-2: #3a3833;
  --muted: #6d695f;
  --line: rgba(18, 18, 18, .16);
  --signal: #d8391b;
  --signal-ink: #fff;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em { font-style: italic; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 200;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ============ MASTHEAD ============ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark__suit {
  display: grid; place-items: center;
  width: 34px; height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: 20px; line-height: 1;
  background: var(--card);
  transform: rotate(-6deg);
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.mark:hover .mark__suit { transform: rotate(6deg); }
.mark__name {
  font-family: var(--sans); font-weight: 600;
  letter-spacing: .14em; font-size: 15px;
}
.mark__name span { color: var(--muted); font-weight: 500; margin-left: .45em; }

.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 32px); }
.nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; position: relative; padding: 4px 0;
}
.nav a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s;
}
.nav a:not(.nav__cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  background: var(--ink); color: var(--paper) !important;
  padding: 8px 14px !important; border-radius: 999px;
}
.nav__cta:hover { background: var(--signal); }

@media (max-width: 680px) {
  .nav a:not(.nav__cta) { display: none; }
  .mark__name span { display: none; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(48px, 7vw, 96px);
  min-height: calc(100svh - 73px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(24px, 4vw, 48px);
}

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  color: var(--muted);
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}
.hero__clock { margin-left: auto; font-variant-numeric: tabular-nums; }

.hero__title {
  align-self: center;
  font-family: var(--serif);
  font-size: clamp(52px, 10.5vw, 168px);
  line-height: .92;
  letter-spacing: -.02em;
  max-width: 13ch;
}
.hero__title em { color: var(--signal); }

/* redaction bar */
.redact {
  position: relative;
  display: inline-block;
  cursor: help;
  outline: none;
}
.redact::after {
  content: "";
  position: absolute;
  left: -.06em; right: -.06em; top: .12em; bottom: .02em;
  background: var(--ink);
  transform-origin: right center;
  transition: transform .55s cubic-bezier(.7,0,.2,1);
}
.redact:hover::after,
.redact:focus::after,
.redact.is-open::after { transform: scaleX(0); }

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto;
  align-items: end;
  gap: 28px 64px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.hero__lede { max-width: 54ch; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__aside {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  color: var(--muted);
  writing-mode: vertical-rl;
  font-size: 11px;
}

@media (max-width: 860px) {
  .hero { min-height: auto; }
  .hero__foot { grid-template-columns: 1fr; }
  .hero__aside { display: none; }
  .hero__clock { margin-left: 0; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans); font-weight: 500; font-size: 16px;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--signal); border-color: var(--signal); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--wide { width: 100%; }

/* ============ TICKER ============ */
.ticker {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border-block: 1px solid var(--ink);
  transform: rotate(-1.2deg);
  margin: 8px -20px;
}
.ticker__track {
  display: flex; align-items: center; gap: 28px;
  width: max-content;
  padding: 14px 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 40px);
  white-space: nowrap;
  animation: ticker 28s linear infinite;
}
.ticker__track i { font-style: normal; color: var(--signal); font-family: var(--sans); font-size: .7em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============ SECTIONS ============ */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}
.section__head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 880px; }
.section__head h2 {
  font-family: var(--serif);
  font-size: clamp(42px, 6.4vw, 92px);
  line-height: .98;
  letter-spacing: -.015em;
}
.section__head h2 em { color: var(--muted); }
.section__intro { max-width: 56ch; color: var(--ink-2); font-size: 18px; }
.kicker { color: var(--signal); }

/* ============ DECK ============ */
.deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  perspective: 1200px;
}
.card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px 56px;
  min-height: 520px;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 0 var(--ink), 6px 6px 0 -1px var(--paper-2), 6px 6px 0 0 var(--ink);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s;
  overflow: hidden;
}
.deck .card:nth-child(1) { transform: rotate(-2.2deg) translateY(10px); }
.deck .card:nth-child(2) { transform: rotate(-.7deg); }
.deck .card:nth-child(3) { transform: rotate(.7deg); }
.deck .card:nth-child(4) { transform: rotate(2.2deg) translateY(10px); }
.deck .card:hover {
  transform: rotate(0) translateY(-10px);
  box-shadow: 0 1px 0 var(--ink), 10px 12px 0 -1px var(--paper-2), 10px 12px 0 0 var(--ink);
  z-index: 2;
}

/* big ghost suit */
.card::before {
  position: absolute;
  right: -18px; bottom: -40px;
  font-size: 220px; line-height: 1;
  color: var(--ink);
  opacity: .05;
  pointer-events: none;
  transition: opacity .4s, transform .6s;
}
.card[data-suit="spade"]::before { content: "♠"; }
.card[data-suit="heart"]::before { content: "♥"; }
.card[data-suit="diamond"]::before { content: "♦"; }
.card[data-suit="club"]::before { content: "♣"; }
.card:hover::before { opacity: .1; transform: rotate(-8deg) scale(1.05); }
.card--red::before { color: var(--signal); }

.card__corner {
  display: flex; flex-direction: column; align-items: center;
  width: max-content;
  line-height: 1;
  font-size: 13px;
}
.card__corner b { font-family: var(--serif); font-weight: 400; font-size: 34px; text-transform: none; }
.card__corner span { font-size: 20px; margin-top: 2px; }
.card--red .card__corner { color: var(--signal); }
.card__corner--flip {
  position: absolute; right: 18px; bottom: 16px;
  transform: rotate(180deg);
}

.card__body { margin-top: 28px; display: grid; gap: 14px; position: relative; }
.card h3 { font-family: var(--serif); font-size: 32px; line-height: 1.02; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card ul {
  list-style: none; padding: 0; margin: 6px 0 0;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}
.card li { padding: 8px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.card li::before { content: "—"; color: var(--muted); }

@media (max-width: 1100px) {
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .card { min-height: 460px; }
}
@media (max-width: 620px) {
  .deck { grid-template-columns: 1fr; }
  .deck .card:nth-child(n) { transform: none; }
  .card { min-height: 0; }
}

/* ============ METHOD / LEDGER ============ */
.method { border-top: 1px solid var(--line); }
.section__head--split { max-width: none; grid-template-columns: 1fr; }

.ledger { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.ledger li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 140px;
  align-items: start;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left .4s cubic-bezier(.2,.8,.2,1);
}
.ledger li::before {
  content: "";
  position: absolute; left: 0; top: -1px; bottom: -1px;
  width: 0; background: var(--signal);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
}
.ledger li:hover { padding-left: 18px; }
.ledger li:hover::before { width: 4px; }
.ledger__n { font-size: 14px; color: var(--muted); padding-top: 10px; }
.ledger h3 { font-family: var(--serif); font-size: clamp(34px, 4vw, 54px); line-height: 1; margin-bottom: 10px; }
.ledger p { max-width: 60ch; color: var(--ink-2); }
.ledger__tag {
  justify-self: end;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  margin-top: 10px;
}
@media (max-width: 720px) {
  .ledger li { grid-template-columns: 44px minmax(0, 1fr); }
  .ledger__tag { display: none; }
}

/* ============ PRINCIPLES ============ */
.principles {
  max-width: none;
  background: var(--ink);
  color: var(--paper);
  position: relative;
}
.principles__inner { max-width: calc(var(--max) - 2 * var(--gutter)); margin: 0 auto; }
.principles h2 {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 120px);
  line-height: .95;
  margin: 18px 0 clamp(40px, 6vw, 72px);
}
.principles h2 em {
  color: var(--signal);
  text-decoration: line-through;
  text-decoration-thickness: .06em;
}
.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(238, 234, 225, .2);
}
.rule {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px;
  padding: 28px 28px 28px 0;
  border-bottom: 1px solid rgba(238, 234, 225, .2);
}
.rule:nth-child(odd) { border-right: 1px solid rgba(238, 234, 225, .2); }
.rule:nth-child(even) { padding-left: 28px; }
.rule__x { color: var(--signal); font-size: 22px; line-height: 1.2; }
.rule p { color: rgba(238, 234, 225, .72); font-size: 17px; }
.rule strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 6px;
}
@media (max-width: 760px) {
  .rules { grid-template-columns: 1fr; }
  .rule:nth-child(odd) { border-right: 0; }
  .rule:nth-child(even) { padding-left: 0; }
}

/* ============ CONTACT ============ */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.brief {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px);
  display: grid; gap: 22px;
}
.brief__label { color: var(--muted); }

.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  padding: 8px 0;
  border-radius: 0;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--signal); }
.field input.is-invalid { border-bottom-color: var(--signal); }

.field--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field--chips legend { margin-bottom: 8px; padding: 0; width: 100%; }
.field--chips label { position: relative; }
.field--chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.field--chips span {
  display: inline-block;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  transition: background .2s, color .2s;
  cursor: pointer;
}
.field--chips input:checked + span { background: var(--ink); color: var(--paper); }
.field--chips input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.brief__note { min-height: 1.2em; color: var(--signal); text-transform: none; letter-spacing: 0; }

.dossier {
  border-top: 1.5px solid var(--ink);
  display: grid;
  position: relative;
}
.dossier__row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 12px 20px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.dossier__row > .mono:first-child { color: var(--muted); }
.dossier__big {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.dossier__big:hover { color: var(--signal); }
address { font-style: normal; font-size: 19px; line-height: 1.45; }
.copy, .link {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; cursor: pointer; color: var(--ink); text-decoration: none;
  font-size: 11px; white-space: nowrap;
}
.copy:hover, .link:hover { border-color: var(--ink); }

.dossier__stamp {
  justify-self: end;
  margin-top: 36px;
  width: 168px; height: 168px;
  border: 2px solid var(--signal);
  border-radius: 50%;
  color: var(--signal);
  display: grid; place-content: center; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em;
  transform: rotate(-14deg);
  opacity: .85;
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--signal);
}
.dossier__stamp span:nth-child(2) { font-size: 18px; letter-spacing: .2em; margin: 6px 0; }

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .dossier__stamp { justify-self: center; }
}
@media (max-width: 480px) {
  .dossier__row { grid-template-columns: 1fr auto; }
  .dossier__row > .mono:first-child { grid-column: 1 / -1; }
}

/* ============ FOOTER ============ */
.footer {
  border-top: 1.5px solid var(--ink);
  padding: 0 var(--gutter) 28px;
  overflow: hidden;
}
.footer__big {
  font-family: var(--serif);
  font-size: clamp(56px, 15.5vw, 250px);
  line-height: .9;
  letter-spacing: -.03em;
  white-space: nowrap;
  text-align: center;
  padding: 24px 0 18px;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--ink);
}
.footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  max-width: calc(var(--max) - 2 * var(--gutter)); margin: 0 auto;
}
.footer__row a { text-decoration: none; }
.footer__row a:hover { color: var(--signal); }

/* ============ REVEAL ON SCROLL ============ */
.js .reveal { opacity: 0; translate: 0 24px; transition: opacity .8s ease, translate .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.is-in { opacity: 1; translate: 0 0; }
