/* THE PLASMA-HIGGS SEAM — field dossier (ChristCode brand, not Singulariti)
   Tokens per christcode-buildout: paper/ink/gold/line + three epistemic lanes. */

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d6;
  --ink: #241f18;
  --ink-soft: #5b5344;
  --ink-faint: #8a8069;
  --gold: #b08428;
  --gold-pale: #e7d3a3;
  --line: #d8cdb4;
  --lane-doc: #4a6b4a;
  --lane-inf: #8a6d2f;
  --lane-hyp: #9a5b3c;
  --display: 'Cormorant Garamond', Georgia, serif;
  --body: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* fixed grain overlay: 0.5px dot grid on 4px, multiply, opacity .5 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  background-image: radial-gradient(circle, rgba(36, 31, 24, 0.5) 0.5px, transparent 0.6px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

::selection { background: var(--gold-pale); color: var(--ink); }

a { color: var(--gold); }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}

.masthead a.brand { display: inline-block; }

.masthead img.brand-logo { height: 30px; display: block; }

.masthead .mast-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- layout ---------- */

.main { max-width: 880px; margin: 0 auto; padding: 0 28px; }

.module {
  position: relative;
  padding: 96px 0 40px;
  border-bottom: 1px solid var(--line);
}

.module:last-of-type { border-bottom: none; }

/* huge ghost number, serif, gold, opacity .08, top-right */
.module::before {
  content: attr(data-num);
  position: absolute;
  top: 18px;
  right: 0;
  font-family: var(--display);
  font-size: clamp(90px, 14vw, 170px);
  line-height: 1;
  color: var(--gold);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.module-inner { position: relative; z-index: 1; }

.kicker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}

.k-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.k-rule { flex: 1; height: 1px; background: var(--line); }

h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}

h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.12;
  margin-bottom: 26px;
}

h1 em, h2 em { font-style: italic; color: var(--gold); }

.subhead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 20px;
}

.stats-line {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.module p { margin-bottom: 20px; max-width: 720px; }

.module p strong { font-weight: 500; color: var(--ink); }

.pull {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.3;
  color: var(--ink);
  border-left: 2px solid var(--gold);
  padding-left: 26px;
  margin: 44px 0;
  max-width: 700px;
}

/* ---------- figures ---------- */

.fig { position: relative; margin: 44px 0 12px; }

.fig .fig-frame { position: relative; }

.fig img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
}

.ticks i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold);
  pointer-events: none;
}

.ticks .tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ticks .tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.ticks .bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.ticks .br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.fig figcaption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 14px;
  max-width: 720px;
  line-height: 1.7;
}

/* ---------- epistemic lanes ---------- */

.lane {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  margin-right: 12px;
  border: 1px solid;
  vertical-align: 2px;
  white-space: nowrap;
}

.lane.doc { color: var(--lane-doc); border-color: var(--lane-doc); }
.lane.inf { color: var(--lane-inf); border-color: var(--lane-inf); }
.lane.hyp { color: var(--lane-hyp); border-color: var(--lane-hyp); }

p[data-lane] { border-left: 1px solid transparent; }
.lane-hidden { display: none; }

.lane-filters {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lane-filters .lf-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 6px;
}

.lane-filter {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lane-filter:hover { border-color: var(--gold); }

.lane-filter.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.lane-filter .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border: 1px solid currentColor;
}

.lane-filter[data-filter="doc"] .swatch { color: var(--lane-doc); }
.lane-filter[data-filter="inf"] .swatch { color: var(--lane-inf); }
.lane-filter[data-filter="hyp"] .swatch { color: var(--lane-hyp); }

/* ---------- right dot rail ---------- */

#rail {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 30;
}

.rail-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  border: 0;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 0.25s ease, transform 0.25s ease;
}

.rail-dot:hover { background: var(--gold-pale); }

.rail-dot.active { background: var(--gold); transform: scale(1.35); }

.rail-dot.active::after {
  content: attr(data-num);
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  white-space: nowrap;
}

@media (max-width: 1220px) { #rail { display: none; } }

/* ---------- scroll reveal (gated on html.js) ---------- */

html.js .module .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .module.in .rv { opacity: 1; transform: none; }
html.js .module.in .rv:nth-child(2) { transition-delay: 0.07s; }
html.js .module.in .rv:nth-child(3) { transition-delay: 0.14s; }
html.js .module.in .rv:nth-child(4) { transition-delay: 0.21s; }
html.js .module.in .rv:nth-child(5) { transition-delay: 0.28s; }
html.js .module.in .rv:nth-child(6) { transition-delay: 0.35s; }
html.js .module.in .rv:nth-child(7) { transition-delay: 0.42s; }
html.js .module.in .rv:nth-child(8) { transition-delay: 0.49s; }
html.js .module.in .rv:nth-child(n+9) { transition-delay: 0.56s; }

/* ---------- practice / accordion cards ---------- */

.acc {
  border: 1px solid var(--line);
  background: var(--paper-2);
  margin-top: 30px;
  max-width: 720px;
}

.acc-head {
  width: 100%;
  text-align: left;
  padding: 17px 22px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.acc-head .acc-plus { color: var(--gold); font-size: 15px; line-height: 1; }

.acc-body { display: none; padding: 4px 22px 22px; }

.acc.open .acc-body { display: block; }

.acc-body p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 12px; max-width: 660px; }
.acc-body p:last-child { margin-bottom: 0; }

/* ---------- reframe tool ---------- */

.reframe {
  border: 1px solid var(--gold);
  background: var(--paper-2);
  padding: 26px;
  margin: 40px 0;
  max-width: 720px;
}

.reframe-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.reframe textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.reframe textarea:focus { outline: none; border-color: var(--gold); }

.reframe button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.reframe button:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.reframe-out { margin-top: 22px; display: none; }

.reframe-out.show { display: block; }

.reframe-out .ro-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.reframe-out .ro-text {
  font-size: 16.5px;
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 680px;
}

mark.flag {
  background: var(--gold-pale);
  color: var(--ink);
  padding: 0 3px;
}

span.shift { color: var(--gold); font-weight: 500; }

.reframe-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- hedges block ---------- */

.hedges {
  border: 1px solid var(--lane-hyp);
  padding: 24px 26px;
  margin: 36px 0;
  max-width: 720px;
  background: var(--paper-2);
}

.hedges .h-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lane-hyp);
  margin-bottom: 12px;
}

.hedges p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 10px; max-width: 660px; }
.hedges p:last-child { margin-bottom: 0; }

/* ---------- appendix ---------- */

.lane-legend { max-width: 720px; margin: 28px 0; }

.lane-legend .ll-row { display: flex; gap: 14px; align-items: baseline; margin-bottom: 14px; }

.lane-legend .ll-desc { font-size: 15px; color: var(--ink-soft); }

.receipts { max-width: 720px; margin-top: 24px; }

.receipts li {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  line-height: 1.6;
  padding-left: 20px;
  text-indent: -20px;
}

.receipts a { color: var(--gold); word-break: break-all; }

.teaching-note {
  border-left: 2px solid var(--gold);
  padding-left: 22px;
  margin-top: 32px;
  max-width: 720px;
  font-size: 15.5px;
  color: var(--ink-soft);
}

/* ---------- close / CTA ---------- */

.close-mark {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(28px, 4vw, 44px);
  margin: 10px 0 34px;
}

.cta {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 18px 44px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.cta:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 34px 28px 48px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .module { padding: 72px 0 32px; }
  .masthead { padding: 16px 20px; }
  .main { padding: 0 20px; }
  .reframe { padding: 20px; }
}
