/* =====================================================================
   PROMPT ENGINES — "Engine Room" design system (shared)
   Used by every page except the homepage (which inlines the same rules)
   and /pantheon (its own lapis system). See /assets/engine/README.md.
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,300..900&display=swap");

:root {
  --red:        #D0103A;
  --red-deep:   #7E0A22;
  --red-ink:    #A30D2E;
  --red-tint:   #FCE9ED;
  --ink:        #15171C;
  --ink-2:      #3A3F4A;
  --steel:      #5B6170;
  --steel-2:    #8A909C;
  --paper:      #FFFFFF;
  --mist:       #F2F3F5;
  --rule:       #E2E4E8;
  --rule-2:     #CDD1D8;
  --surface:    #FFFFFF;
  --lapis:      #0A1240;
  --pyrite:     #D4B062;
  --ok:         #1F8A5B;

  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1240px;
  --wrap-text: 760px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(80px, 10vw, 136px);
  --r: 14px;
  --r-lg: 18px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}
html[data-theme="dark"] {
  --ink:     #EEF0F4;
  --ink-2:   #C9CDD6;
  --steel:   #9AA1AE;
  --steel-2: #7B8290;
  --paper:   #121419;
  --mist:    #181B21;
  --rule:    #262A32;
  --rule-2:  #353A44;
  --surface: #1B1E25;
  --red-tint: rgba(208, 16, 58, 0.16);
  --red-ink: #FF5A78;
  --ok:      #4FD99A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
button { font: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.page-hero :focus-visible, .band-red :focus-visible, .site-header:not(.scrolled) :focus-visible { outline-color: #fff; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { width: 100%; max-width: calc(var(--wrap-text) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
.display { font-stretch: 118%; font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; }
.h1 { font-stretch: 114%; font-weight: 800; font-size: clamp(2.5rem, 5.6vw, 4.8rem); letter-spacing: -0.032em; line-height: 1; text-wrap: balance; }
.h2, .section h2 { font-stretch: 112%; font-weight: 750; font-size: clamp(2rem, 4.2vw, 3.3rem); letter-spacing: -0.028em; line-height: 1.04; text-wrap: balance; }
.h3 { font-stretch: 106%; font-weight: 700; font-size: clamp(1.35rem, 2vw, 1.7rem); letter-spacing: -0.015em; line-height: 1.15; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 600; color: var(--red-ink);
  margin-bottom: 18px;
}
.kicker::before { content: ""; width: 10px; height: 10px; background: currentColor; border-radius: 2px; flex: none; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--steel); max-width: 62ch; }
.muted { color: var(--steel); }
.section-head { max-width: 860px; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head > * + .lede { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { opacity: .9; }
.btn-outline { border-color: var(--rule-2); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); }
.btn-white { background: #fff; color: var(--red-deep); }
.btn-white:hover { background: #FFE3E9; }
.btn-line { border-color: rgba(255, 255, 255, 0.45); color: #fff; background: transparent; }
.btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.text-link { color: var(--red-ink); font-weight: 650; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 550; color: var(--ink-2);
  padding: 4px 11px; border-radius: 999px; background: var(--mist); border: 1px solid var(--rule);
}
.chip-red { background: var(--red-tint); border-color: transparent; color: var(--red-ink); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: 0.76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--red); color: #fff; }

/* =====================================================================
   Header (identical markup on every page — see README)
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--red-deep); color: #fff;
  transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--rule);
}
.nav { height: 72px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark svg { width: 100%; height: 100%; }
.site-header.scrolled .brand-mark { color: var(--red); }
.brand-name { font-weight: 800; font-stretch: 112%; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.82rem; opacity: .7; padding-left: 11px; border-left: 1px solid currentColor; }
.nav-links { display: flex; gap: 26px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav-links a { text-decoration: none; font-weight: 550; font-size: 0.95rem; opacity: .82; transition: opacity .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; }
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.nav-links a[data-external]::after { content: "↗"; font-size: .8em; margin-left: 3px; opacity: .7; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .nav-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: transparent; color: inherit; cursor: pointer; padding: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform .25s, opacity .25s; }
.menu-open .nav-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* =====================================================================
   Red surfaces: page hero + full-bleed bands
   ===================================================================== */
.page-hero, .band-red {
  position: relative; isolation: isolate; overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1000px 640px at 80% 75%, rgba(255, 64, 100, 0.42), transparent 65%),
    linear-gradient(170deg, var(--red-deep) 0%, #A50E2E 48%, var(--red) 100%);
}
.page-hero::before, .band-red::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 65% 45%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse at 65% 45%, #000 25%, transparent 85%);
}
.page-hero { padding: clamp(56px, 7vw, 104px) 0 clamp(64px, 8vw, 112px); }
.page-hero .kicker { color: #fff; opacity: .92; }
.page-hero .lede, .band-red .lede { color: rgba(255, 255, 255, 0.86); }
.page-hero h1 { margin-bottom: 22px; max-width: 18ch; }
.page-hero .btn-row { margin-top: 32px; }
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.page-hero--compact { padding: clamp(48px, 6vw, 80px) 0 clamp(48px, 6vw, 80px); }

/* Circuit art: <canvas data-circuit data-seed="7"> anywhere on a red surface */
.circuit-art {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: rgba(60, 0, 14, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 80px -40px rgba(40, 0, 10, 0.6);
  aspect-ratio: 5 / 4;
}
.circuit-art canvas { width: 100%; height: 100%; }
.circuit-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .75; }
.circuit-bg canvas { width: 100%; height: 100%; }

/* =====================================================================
   Sections & content blocks
   ===================================================================== */
.section { padding: var(--section-y) 0; }
.section.mist { background: var(--mist); }
.section.tight { padding: clamp(56px, 7vw, 88px) 0; }

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px);
}
.card-red {
  background: linear-gradient(160deg, var(--red-deep), var(--red));
  color: #fff; border-color: transparent;
}
.card-red .muted, .card-red p { color: rgba(255, 255, 255, 0.86); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* Register: label column + content column, hairline rows */
.register { border-top: 2px solid var(--ink); }
.register-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 48px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.register-row > :first-child { font-weight: 700; }

/* Ticked list */
.ticks { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.ticks li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.ticks li::before {
  content: ""; width: 14px; height: 14px; margin-top: 5px; border-radius: 4px;
  background: var(--red-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='%23D0103A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.card-red .ticks li::before, .band-red .ticks li::before, .page-hero .ticks li::before {
  background-color: rgba(255, 255, 255, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Big numbered steps (only for real sequences) */
.step-num { font-stretch: 125%; font-weight: 800; font-size: 3.6rem; line-height: .85; letter-spacing: -0.04em; color: var(--red); }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background:
    linear-gradient(var(--red), var(--red)) center / 12px 2px no-repeat,
    linear-gradient(var(--red), var(--red)) center / 2px 12px no-repeat,
    var(--red-tint);
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { padding-bottom: 22px; color: var(--steel); max-width: 68ch; }

/* Prose (articles, long-form) */
.prose { font-size: 1.08rem; line-height: 1.75; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-stretch: 110%; font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); margin-top: 2em; }
.prose h3 { font-stretch: 106%; font-size: 1.3rem; color: var(--ink); margin-top: 1.6em; }
.prose a { color: var(--red-ink); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--red); color: var(--ink); font-size: 1.15rem; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--mist); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: #14161B; color: #E8EAF0; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: .9rem; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.88rem; font-weight: 650; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border-radius: 10px;
  background: var(--mist); border: 1px solid var(--rule);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23D0103A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--red); background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent);
}
.form-status { font-size: 0.92rem; font-weight: 600; color: var(--red-ink); }
.form-status.ok { color: var(--ok); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* =====================================================================
   Footer (identical markup on every page — see README)
   ===================================================================== */
.site-footer { background: #14161B; color: #A3A9B5; padding: 80px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 40px; }
.footer-brand .footer-name { color: #fff; font-size: 1.6rem; font-stretch: 118%; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.footer-brand .footer-name svg { width: 24px; height: 24px; color: var(--red); }
.footer-brand p { max-width: 38ch; font-size: 0.96rem; }
.footer-col h3 { color: #fff; font-size: 0.9rem; font-weight: 650; margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.footer-col a { text-decoration: none; font-size: 0.95rem; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-base {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid #2A2E36;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.86rem;
}

/* =====================================================================
   Motion — one orchestrated entrance on the hero only
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .page-hero .kicker, .page-hero h1, .page-hero .lede, .page-hero .btn-row { animation: pe-fade .9s var(--ease) both; }
  .page-hero h1 { animation-delay: .06s; }
  .page-hero .lede { animation-delay: .18s; }
  .page-hero .btn-row { animation-delay: .28s; }
  .page-hero .circuit-art { animation: pe-fade 1.2s var(--ease) .15s both; }
}
@keyframes pe-fade { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =====================================================================
   Responsive — overrides after base rules. Breakpoints: 1080 / 900 / 680
   ===================================================================== */
@media (max-width: 1080px) {
  .nav-links { gap: 18px; }
  .brand-sub { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--paper); color: var(--ink);
    border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .menu-open .nav-links { display: flex; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1.05rem; opacity: 1; border-bottom: 1px solid var(--rule); }
  .nav-right { margin-left: auto; }
  .page-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .register-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav { height: 64px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-hero .btn-row .btn { flex: 1 1 auto; }
}
