/* ============================================================
   Deal of the Century — campaign page
   Tokens → base → page. Tokens are lifted verbatim from the CES
   Design System (existentialsafety.org family) so this page sits
   on the same ivory paper, treaty blue and seal gold as the rest.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap");

/* ---------------------------- Tokens ---------------------------- */
:root {
  --blue-50:  #eef4fb;
  --blue-100: #d8e6f5;
  --blue-200: #b0cbe9;
  --blue-300: #81b1df;
  --blue-400: #5189c4;
  --blue-500: #2f679f;
  --blue-600: #134e85;
  --blue-700: #023c72;
  --blue-800: #062e55;
  --blue-900: #07223d;
  --blue-950: #04162a;

  --paper-0:   #ffffff;
  --paper-50:  #fbfaf6;
  --paper-100: #f6f3ec;
  --paper-200: #efeae0;
  --sand-300:  #e3ddd0;
  --sand-400:  #d3ccba;

  --ink-900: #0b1623;
  --ink-700: #233247;
  --ink-550: #4c5a70;
  --ink-400: #6b7689;
  --ink-300: #9aa3b2;

  --gold-200: #ecdcb6;
  --gold-300: #d9c084;
  --gold-400: #c5a35a;
  --gold-500: #a4853f;
  --gold-600: #836a32;

  --red-500: #b23a38;

  --bg:                 var(--paper-100);
  --surface:            var(--paper-0);
  --surface-sunk:       var(--paper-50);
  --surface-dark:       var(--blue-950);
  --surface-dark-panel: #0a2444;

  --text:           var(--ink-900);
  --text-secondary: var(--ink-550);
  --text-muted:     var(--ink-400);

  --on-dark:           #eaf1f8;
  --on-dark-secondary: #b8c8dc;
  --on-dark-muted:     #7e92ac;

  --brand:        var(--blue-700);
  --brand-strong: var(--blue-800);
  --link:         var(--blue-600);
  --accent:       var(--gold-400);

  --border:         var(--sand-300);
  --border-strong:  var(--sand-400);
  --border-on-dark: rgba(178, 203, 233, 0.18);
  --ring: color-mix(in oklch, var(--blue-500) 55%, transparent);

  --font-serif: "Spectral", Georgia, "Times New Roman", serif;
  --font-sans:  "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-sm: 4px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(7, 34, 61, 0.08), 0 1px 2px rgba(7, 34, 61, 0.05);
  --shadow-photo: 0 30px 60px -20px rgba(2, 20, 50, 0.7);

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 140ms;

  /* Page-level rhythm — one container, one gutter, one section padding. */
  --container: 1280px;
  --gutter: clamp(20px, 5vw, 72px);
  --section-pad: clamp(48px, 7vw, 96px);
  --stack-gap: clamp(28px, 4vw, 48px);
  --col-gap: clamp(32px, 5vw, 72px);
  --title-size: clamp(34px, 4.2vw, 56px);
  --card-title-size: clamp(24px, 2vw, 30px);
}

/* ----------------------------- Base ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--blue-950);
  color: var(--on-dark);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-strong); }
::selection { background: var(--gold-200); color: var(--ink-900); }
:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 3px var(--ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; }
}

/* --------------------------- Layout ---------------------------- */
.container { max-width: var(--container); margin-inline: auto; }
.section { padding: var(--section-pad) var(--gutter); }
.section--light { background: var(--paper-100); color: var(--text); }
.section--dark  { background: var(--blue-950); color: var(--on-dark); }
.stack { display: flex; flex-direction: column; gap: var(--stack-gap); }

.section__head { display: flex; flex-direction: column; gap: 14px; max-width: 60ch; }
.section__head--wide { max-width: none; }
.section__title { font-size: var(--title-size); line-height: 1.05; text-wrap: balance; }
.section__title--oneline { font-size: clamp(22px, 4vw, 56px); white-space: nowrap; text-wrap: initial; }
.section__lead { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.6; color: var(--text-secondary); max-width: 60ch; }
.section__lead--80 { max-width: 80ch; }
.section--dark .section__lead { color: var(--on-dark-secondary); }

@media (max-width: 720px) {
  .section__title--oneline { white-space: normal; font-size: var(--title-size); text-wrap: balance; }
}

/* --------------------------- Eyebrow --------------------------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font: 500 12px/1 var(--font-sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-600);
}
.eyebrow__rule { display: inline-block; width: 28px; height: 1px; background: currentColor; }
.eyebrow--ondark { color: var(--gold-400); }

/* --------------------------- Buttons --------------------------- */
/* Mirrors CESDesignSystem.Button: md 44px / lg 54px, 1.5px border, 4px radius. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  height: 44px; padding: 0 18px;
  font: 600 15px/1 var(--font-sans);
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn--gold { background: var(--gold-400); color: #231a07; }
.btn--gold:hover { background: var(--gold-500); color: #231a07; }
.btn--primary { background: var(--blue-700); color: #fff; }
.btn--primary:hover { background: var(--blue-800); color: #fff; }
.btn--secondary { background: transparent; color: var(--blue-700); border-color: var(--sand-400); }
.btn--secondary:hover { background: var(--blue-50); color: var(--blue-700); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.is-done { pointer-events: none; }

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: var(--section-pad) var(--gutter);
  background:
    radial-gradient(900px 600px at 15% 0%, rgba(81, 137, 196, 0.22), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(2, 60, 114, 0.45), transparent 60%),
    var(--blue-950);
}
.hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: var(--col-gap);
  align-items: stretch; /* the photo runs from the eyebrow's top to the button's bottom */
}
.hero__copy { display: flex; flex-direction: column; gap: clamp(20px, 2.5vw, 32px); }
.hero__title { font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04; color: var(--on-dark); text-wrap: balance; }
.hero__gold { color: var(--gold-300); }
.hero__lead { max-width: 60ch; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.6; color: var(--on-dark-secondary); }
.hero__lead strong { color: var(--on-dark); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero__photo { margin: 0; width: 100%; display: flex; }
.hero__frame {
  position: relative; flex: 1; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 6px; background: var(--surface-dark-panel);
  box-shadow: var(--shadow-photo);
}
.hero__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.45) contrast(0.95); }
.hero__scrim { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, rgba(4, 22, 42, 0.4), transparent); pointer-events: none; }
.hero__caption {
  position: absolute; inset: auto 0 0 0; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  font: 500 11px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--on-dark); opacity: 0.7; pointer-events: none;
}
.hero__caption span:last-child { text-align: right; }

@media (min-width: 881px) {
  /* Two columns: the frame takes the copy column's height and the photo covers it. */
  .hero__frame { aspect-ratio: auto; min-height: 380px; }
}

/* ------------------------ Deal / No deal ------------------------ */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.compare__col { padding: 8px var(--col-gap) 8px 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.compare__col--no { padding: 8px 0 8px var(--col-gap); border-right: 0; }
.compare__label { font: 400 clamp(32px, 3vw, 44px)/1 var(--font-serif); color: var(--text); }
.compare__label--muted { color: var(--text-muted); }
.compare__list { display: flex; flex-direction: column; gap: 12px; font-size: 17px; line-height: 1.5; color: var(--text); }
.compare__list--muted { color: var(--text-secondary); }
.compare__list--muted strong { color: var(--text); }
.compare__list li { display: flex; gap: 12px; }
.compare__mark { flex: none; color: var(--text-muted); }
.compare__mark--yes { color: var(--gold-600); }

@media (max-width: 720px) {
  .compare { grid-template-columns: 1fr; }
  .compare__col { padding: 0 0 28px; border-right: 0; border-bottom: 1px solid var(--border); }
  .compare__col--no { padding: 28px 0 0; border-bottom: 0; }
}

/* ---------------------------- Clauses --------------------------- */
.clauses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(320px, 45%)), 1fr)); grid-auto-rows: 1fr; gap: 16px; }
.clause {
  background: var(--paper-100); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px, 2vw, 28px);
  display: flex; flex-direction: column; gap: 10px;
}
.clause__num { font: 400 14px/1 var(--font-mono); color: var(--text-muted); }
.clause__title { font-size: var(--card-title-size); line-height: 1.12; color: var(--text); }
.clause p { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.clause sup { font-size: 0.7em; line-height: 0; position: relative; top: -0.5em; vertical-align: baseline; }
.footnote { padding-top: 16px; border-top: 1px solid var(--border-on-dark); font-size: 14px; line-height: 1.6; color: var(--on-dark-muted); }

/* --------------------------- Three asks ------------------------- */
.asks { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 0; }
.ask { padding: 8px clamp(24px, 4vw, 48px); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.ask:first-child { padding-left: 0; }
.ask:last-child { padding-right: 0; border-right: 0; }
.ask__num { font: 400 14px/1 var(--font-mono); color: var(--text-muted); }
.ask__title { font-size: var(--card-title-size); line-height: 1.12; }
.ask__body { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.ask__note { font-size: 12px; line-height: 1.5; color: var(--text); opacity: 0.65; }
.ask__quote { margin: 0; border-left: 3px solid var(--gold-400); padding: 4px 0 4px 18px; font: 400 17px/1.55 var(--font-serif); color: var(--text); }
.ask__actions { padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.ask__actions--stack { flex-direction: column; align-items: flex-start; }

@media (max-width: 840px) {
  .asks { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .ask, .ask:first-child, .ask:last-child { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .ask:first-child { padding-top: 0; }
  .ask:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* -------------------------- Sign pop-up ------------------------- */
.modal {
  width: min(560px, calc(100% - 32px)); max-width: none; margin: auto; padding: 0;
  background: var(--paper-100); color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--gold-400);
  border-radius: var(--radius-lg); box-shadow: 0 30px 70px rgba(4, 22, 42, 0.45);
}
.modal::backdrop { background: rgba(4, 22, 42, 0.72); backdrop-filter: blur(2px); }
.modal[open] { display: flex; flex-direction: column; gap: 22px; padding: clamp(24px, 4vw, 40px); }
.modal__close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted);
  font: 400 18px/1 var(--font-sans); cursor: pointer;
}
.modal__close:hover { background: var(--paper-200); color: var(--text); }
body.modal-open { overflow: hidden; }
.sign__head { display: flex; flex-direction: column; gap: 12px; padding-right: 32px; }
.sign__title { font-size: clamp(28px, 3vw, 38px); line-height: 1.08; text-wrap: balance; }
.sign__lead { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.sign__count { font: 400 16px/1.5 var(--font-serif); color: var(--gold-600); }
.sign__form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font: 600 13px/1 var(--font-sans); letter-spacing: 0.02em; color: var(--ink-700); }
.field__input {
  height: 48px; padding: 0 14px;
  font: 400 16px/1 var(--font-sans); color: var(--text);
  background: var(--paper-0); border: 1px solid var(--sand-400); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field__input::placeholder { color: var(--ink-300); }
.field__input:focus { border-color: var(--blue-500); }
.field__input[aria-invalid="true"] { border-color: var(--red-500); }
.field--hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sign__error { font-size: 14px; line-height: 1.5; color: var(--red-500); }
.sign__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.sign__fine { font-size: 12px; line-height: 1.5; color: var(--text); opacity: 0.65; }
.sign__done { display: flex; flex-direction: column; gap: 12px; }
.sign__check { font: 400 32px/1 var(--font-serif); color: var(--gold-600); }
.sign__done-title { font-size: var(--card-title-size); line-height: 1.12; }
.sign__done-body { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }

/* ---------------------------- Footer ---------------------------- */
.footer { background: var(--blue-950); color: var(--on-dark-muted); padding: 0 var(--gutter); }
.footer__bar {
  border-top: 1px solid var(--border-on-dark); padding: 28px 0;
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  font-size: 13px; line-height: 1.5;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--on-dark); }
