/* antimanipulation.ai — shared styles. Editorial brand carried over from the
   original single-page site (warm paper, ink, terracotta accent). */
:root {
  --ink: #1a1a1a;
  --warm: #f7f5f0;
  --accent: #c45d3e;
  --accent-soft: rgba(196, 93, 62, 0.08);
  --stone: #8a8578;
  --light-stone: #d4d0c8;
  --cream: #faf8f4;
  --deep: #2c2826;
  --high: #b23b2e;
  --med: #c9852f;
  --low: #5f7d5a;
  --line: rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--warm);
  color: var(--ink);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
em { font-style: italic; color: var(--accent); }

.serif { font-family: 'Cormorant Garamond', Georgia, serif; }

/* === NAV === */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 8vw;
  background: rgba(247, 245, 240, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; font-weight: 500; letter-spacing: 0.12em;
  color: var(--ink); text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--stone); text-decoration: none; transition: color 0.3s;
}
.nav-links a:hover { color: var(--accent); }
.lang-switch {
  font-size: 0.72rem; letter-spacing: 0.08em; color: var(--stone);
  cursor: pointer; border: 1px solid var(--light-stone); background: transparent;
  padding: 0.3rem 0.75rem; border-radius: 2px; transition: all 0.3s; font-family: inherit;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* === BUTTONS === */
.btn {
  display: inline-block; cursor: pointer; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.95rem 2.4rem; background: var(--deep); color: var(--cream);
  transition: background 0.3s, transform 0.2s; text-decoration: none;
}
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent); color: var(--cream); }

/* === LAYOUT === */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 8vw; }
.section-label {
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 0.8rem;
}

/* === HERO === */
.hero {
  min-height: 84vh; display: flex; flex-direction: column; justify-content: center;
  padding: 4rem 8vw; position: relative;
}
.hero::after {
  content: ''; position: absolute; top: 0; right: 0; width: 45%; height: 100%;
  background: radial-gradient(ellipse at 75% 45%, rgba(196,93,62,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 300; line-height: 1.12;
  max-width: 15ch; margin-bottom: 1.8rem;
}
.hero-sub { font-size: 1.1rem; color: var(--stone); max-width: 46ch; margin-bottom: 2.4rem; }
.hero-actions { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.hero-note { font-size: 0.8rem; color: var(--stone); }

/* === SELF-SCREEN FORM === */
.screen-head { padding: 3rem 0 1rem; }
.screen-head h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; line-height: 1.15; }
.screen-head p { color: var(--stone); max-width: 52ch; margin-top: 0.8rem; }

.progress { height: 3px; background: var(--light-stone); border-radius: 2px; margin: 2rem 0 0; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 0.4s ease; }

.step { display: none; padding: 2.5rem 0 1rem; animation: fade 0.4s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.q { margin-bottom: 2.4rem; }
.q-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 500; margin-bottom: 0.3rem; }
.q-hint { font-size: 0.82rem; color: var(--stone); margin-bottom: 1rem; }

.options { display: flex; flex-direction: column; gap: 0.6rem; }
.options.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.opt {
  display: flex; align-items: center; gap: 0.7rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--cream);
  padding: 0.85rem 1.1rem; transition: all 0.2s; font-size: 0.92rem;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
/* build-spec item 5: the whole .opt block is the click target; the native
   control is purely visual so clicks never land on it / double-fire. */
.opt input { accent-color: var(--accent); width: 16px; height: 16px; pointer-events: none; flex: none; }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* build-spec item 7: required-question asterisk. */
.req { color: var(--high); margin-left: 0.25rem; font-weight: 600; }

.field { margin-bottom: 1.3rem; }
.field label { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); margin-bottom: 0.4rem; }
.field input {
  width: 100%; padding: 0.75rem 0; border: none; border-bottom: 1px solid var(--light-stone);
  background: transparent; font-family: inherit; font-size: 0.95rem; color: var(--ink); outline: none;
  transition: border-color 0.3s;
}
.field input:focus { border-bottom-color: var(--accent); }

.step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; gap: 1rem; }
.step-nav .err { color: var(--high); font-size: 0.85rem; }
.link-back { background: none; border: none; color: var(--stone); cursor: pointer; font-size: 0.85rem; letter-spacing: 0.05em; }
.link-back:hover { color: var(--accent); }

.gate-note { font-size: 0.82rem; color: var(--stone); margin-top: 0.5rem; }

/* === RESULT PAGE === */
.result-hero { padding: 3rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.band {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.9rem;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #fff;
  border-radius: 2px; font-weight: 500;
}
.band.Critical { background: #7a1d16; }
.band.High { background: var(--high); }
.band.Medium { background: var(--med); }
.band.Low { background: var(--low); }
.result-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 300; margin: 1rem 0 0.4rem; }
.result-hero .sub { color: var(--stone); }

/* === VERDICT (build-spec item 1) === */
.verdict-redlines { font-size: 1.15rem; color: var(--ink); margin-top: 0.3rem; }
.verdict-redlines b { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; color: var(--high); font-weight: 600; }
.verdict-peer { font-size: 0.9rem; color: var(--stone); margin-top: 0.5rem; max-width: 60ch; }

/* === RED-LINE DISTANCE GAUGES === */
.gauges { display: grid; gap: 1.1rem; }
.gauge-row { display: grid; grid-template-columns: minmax(140px, 16rem) 1fr auto; gap: 1rem; align-items: center; }
.gauge {
  position: relative; height: 10px; border-radius: 6px;
  background: linear-gradient(to right, var(--low) 0%, var(--med) 50%, var(--high) 78%, #7a1d16 100%);
  opacity: 0.85;
}
.gauge-marker {
  position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid var(--warm); box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.gauge-marker.triggered { background: #7a1d16; }
.gauge-marker.latent { background: var(--med); }
.gauge-label { font-size: 0.92rem; }
.gauge-status { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.gauge-status.triggered { color: #7a1d16; font-weight: 600; }
.gauge-status.latent { color: var(--med); }

/* auxiliary-section tag (demoted radar) */
.aux-tag { display: inline-block; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stone); border: 1px solid var(--line); padding: 0.15rem 0.5rem; border-radius: 2px; margin-bottom: 0.6rem; }

.narrative {
  font-size: 1.08rem; line-height: 1.85; color: var(--deep);
  border-left: 2px solid var(--accent); padding: 0.2rem 0 0.2rem 1.6rem; margin: 2.5rem 0;
  max-width: 64ch; white-space: pre-wrap;
}

.rcard { padding: 2.2rem 0; border-bottom: 1px solid var(--line); }
.rcard h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 500; margin-bottom: 0.4rem; }
.rcard .lead { color: var(--stone); font-size: 0.9rem; margin-bottom: 1.4rem; max-width: 60ch; }

.radar-row { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.78rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line);
  background: var(--cream); border-radius: 2px;
}
.chip b { color: var(--accent); font-weight: 600; }
.chip.stage { background: var(--accent-soft); border-color: rgba(196,93,62,0.25); }

.mh-list { display: flex; flex-direction: column; gap: 0.9rem; }
.mh-item { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; align-items: baseline; }
.mh-item .code { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; color: var(--accent); font-weight: 600; }
.mh-item .name { font-weight: 500; }
.mh-item .def { font-size: 0.85rem; color: var(--stone); }

.reglist { display: grid; gap: 0.8rem; }
.reg {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  border: 1px solid var(--line); background: var(--cream); padding: 1rem 1.2rem;
}
.reg .meta { font-size: 0.75rem; color: var(--stone); letter-spacing: 0.04em; }
.reg a { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

.cases { display: grid; gap: 1rem; }
.case {
  border: 1px solid var(--line); background: var(--cream); padding: 1.3rem 1.4rem;
  transition: border-color 0.2s;
}
.case:hover { border-color: var(--accent); }
.case .top { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.72rem; color: var(--stone); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.case .type { color: var(--accent); }
.case h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 500; line-height: 1.35; }
.case .tags { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.case .tag { font-size: 0.68rem; padding: 0.15rem 0.5rem; background: var(--warm); border: 1px solid var(--line); }

.redlines { display: grid; gap: 0.7rem; }
.redline { display: flex; align-items: center; gap: 0.8rem; font-size: 0.95rem; }
.redline .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.redline.on .dot { background: var(--high); }
.redline.off .dot { background: var(--low); }
.redline.on { color: var(--ink); }
.redline.off { color: var(--stone); }

.cta-block { padding: 3rem 0; }
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.cta-card { border: 1px solid var(--line); background: var(--cream); padding: 2rem; }
.cta-card h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 500; margin-bottom: 0.5rem; }
.cta-card p { font-size: 0.9rem; color: var(--stone); margin-bottom: 1.4rem; }

/* === FRAMEWORK === */
.act-block { margin-bottom: 2rem; }
.act-head {
  font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 500;
  color: var(--accent); margin-bottom: 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line);
}
.act-head .act-zh { font-family: 'Noto Serif SC', serif; margin-right: 0.3rem; }
.mh-item .def { font-family: 'Noto Serif SC', serif; }

/* === TIMELINE === */
.tl-filters { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 0.5rem 0 0; border-bottom: 1px solid var(--line); }
.tl-acts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tl-chip {
  font-size: 0.78rem; padding: 0.4rem 0.85rem; cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: var(--cream); color: var(--stone); transition: all 0.2s;
}
.tl-chip:hover { border-color: var(--accent); color: var(--accent); }
.tl-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tl-selects { display: flex; gap: 0.6rem; }
.tl-selects select {
  font-family: inherit; font-size: 0.82rem; color: var(--ink); padding: 0.45rem 0.7rem;
  border: 1px solid var(--line); background: var(--cream); cursor: pointer;
}
.tl-stream { border-left: 2px solid var(--line); margin-left: 0.5rem; }
.tl-row { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding: 1.4rem 0 1.4rem 1.5rem; position: relative; border-bottom: 1px solid var(--line); }
.tl-row::before { content: ''; position: absolute; left: -7px; top: 1.8rem; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--warm); }
.tl-date { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--stone); }
.tl-body .top { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.tl-body .type { color: var(--accent); }
.tl-body h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 500; line-height: 1.35; margin-bottom: 0.5rem; }
.tl-body .tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tl-body .tag { font-size: 0.66rem; padding: 0.12rem 0.45rem; background: var(--cream); border: 1px solid var(--line); }

/* === HERO LINK + WAITLIST === */
.hero-link { font-size: 0.85rem; color: var(--stone); text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.hero-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.waitlist-section { padding: 3.5rem 8vw; background: var(--cream); border-top: 1px solid var(--line); }
.waitlist-section h2 { font-size: 1.7rem; font-weight: 500; margin: 0.4rem 0 0.6rem; }
.wl-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; max-width: 620px; margin-top: 1.8rem; }
.wl-form .field { margin-bottom: 0; }
.wl-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.5rem; }
.wl-msg { font-size: 0.85rem; }
.wl-msg.ok { color: var(--low); }
.wl-msg.err { color: var(--high); }

/* === CONTENT HUB === */
.pub-list { display: grid; gap: 1.5rem; padding: 1rem 0 3rem; }
.pub-card { border: 1px solid var(--line); background: var(--cream); padding: 2rem 2.2rem; }
.pub-card h2 { font-size: 1.6rem; font-weight: 500; margin-bottom: 0.4rem; }
.pub-card > p { color: var(--stone); max-width: 64ch; margin-bottom: 1.4rem; }
.pub-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.pub-actions .btn { padding: 0.7rem 1.4rem; font-size: 0.72rem; }
.pub-cite { margin-top: 1.3rem; font-size: 0.82rem; color: var(--stone); line-height: 1.6; }
.pub-cite b { color: var(--ink); }

/* === ON-SITE PAPER === */
.paper-page { max-width: 760px; }
.paper-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; line-height: 1.15; margin: 1.2rem 0 0.3rem; }
.paper-sub { font-style: italic; color: var(--stone); font-size: 1.05rem; margin-bottom: 1rem; }
.paper-byline { font-size: 0.85rem; color: var(--stone); border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.4rem 0 2.4rem; }
.paper-actions .btn { padding: 0.7rem 1.5rem; font-size: 0.72rem; }
.paper-body { font-family: 'Cormorant Garamond', Georgia, 'Songti SC', serif; font-size: 1.18rem; line-height: 1.7; color: var(--deep); }
.paper-body h2 { font-family: 'DM Sans', sans-serif; font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 2rem 0 0.7rem; }
.paper-body p { margin: 0 0 1rem; }
.paper-body em { font-style: italic; }
.paper-body ul, .paper-body ol { margin: 0.5rem 0 1.2rem; padding-left: 1.6rem; }
.paper-body li { margin-bottom: 0.5rem; }
.paper-body table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.6rem; font-family: 'DM Sans', sans-serif; font-size: 0.92rem; }
.paper-body th, .paper-body td { border: 1px solid var(--line); padding: 0.5rem 0.8rem; text-align: left; vertical-align: top; }
.paper-body table tr:first-child td, .paper-body th { background: var(--warm); font-weight: 600; }
.paper-body a { color: var(--accent); word-break: break-word; }

/* === FOOTER === */
footer {
  padding: 2.5rem 8vw; background: var(--ink); color: rgba(250,248,244,0.35);
  display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; flex-wrap: wrap; gap: 1rem;
}
footer a { color: rgba(250,248,244,0.45); text-decoration: none; }
footer a:hover { color: var(--accent); }

.loading, .muted { color: var(--stone); font-size: 0.9rem; }
.center { text-align: center; padding: 4rem 0; }

/* === RESPONSIVE === */
@media (max-width: 760px) {
  nav { padding: 1rem 6vw; }
  .nav-links { display: none; }
  .wrap, .hero { padding-left: 6vw; padding-right: 6vw; }
  .radar-row { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .reg { flex-direction: column; }
  .tl-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .tl-filters { flex-direction: column; align-items: flex-start; }
  .gauge-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .gauge-status { justify-self: start; }
  .wl-form { grid-template-columns: 1fr; }
  .waitlist-section { padding-left: 6vw; padding-right: 6vw; }
}
