/* PULSE — ChristCode field dossier. Tokens per christcode-buildout. */
:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d6;
  --ink: #241f18;
  --ink-soft: #5b5344;
  --ink-faint: #8a8069;
  --gold: #b08428;
  --gold-pale: #e7d3a3;
  --line: #d8cdb4;
  --doc: #4a6b4a;
  --inf: #8a6d2f;
  --hyp: #9a5b3c;
  --cover: #241f18;
  --cover-2: #2e2820;
  --gold-bright: #f4c430;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, 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(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold-pale); color: var(--ink); }

.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--line) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
  mix-blend-mode: multiply; opacity: .5;
}

/* ---------- rail ---------- */
.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 50; display: flex; flex-direction: column; gap: 14px; }
.rail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; transition: background .3s, transform .3s; }
.rail-dot.on { background: var(--gold); transform: scale(1.5); }
@media (max-width: 1220px) { .rail { display: none; } }

/* ---------- masthead ---------- */
.masthead {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 6vw; border-bottom: 1px solid var(--line);
}
.masthead-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.masthead-logo { width: 34px; height: 34px; object-fit: contain; }
.masthead-word { font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: .01em; }
.masthead-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--ink-faint); text-transform: uppercase; }

/* ---------- modules ---------- */
main { position: relative; z-index: 1; }
.module {
  max-width: 1100px; margin: 0 auto; padding: 96px 6vw;
  position: relative;
}
.module::before {
  content: attr(data-num);
  position: absolute; top: 40px; right: 4vw;
  font-family: var(--serif); font-size: 120px; font-weight: 500;
  color: var(--gold); opacity: .08; line-height: 1;
  pointer-events: none;
}
.kicker {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 34px;
}
.kicker-line { flex: 1; height: 1px; background: var(--line); }
.kicker.dark { color: var(--gold-pale); }
.kicker.dark .kicker-line { background: #4a4436; }

h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(44px, 7vw, 84px);
  line-height: 1.04; letter-spacing: -.01em; margin-bottom: 30px;
}
h1 em { font-style: italic; color: var(--gold); }
h2 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08; letter-spacing: -.01em; margin-bottom: 26px;
}
h2 em { font-style: italic; color: var(--gold); }
.sub { font-size: 19px; color: var(--ink-soft); max-width: 620px; margin-bottom: 40px; }
.module p { max-width: 680px; margin-bottom: 18px; color: var(--ink-soft); }
.module p strong, .module p b { color: var(--ink); font-weight: 500; }
.src { color: var(--ink); font-weight: 400; font-style: italic; }
em { font-style: italic; }

.lane {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  padding: 4px 10px; border: 1px solid; white-space: nowrap;
}
.lane-doc { color: var(--doc); border-color: color-mix(in srgb, var(--doc) 40%, transparent); }
.lane-inf { color: var(--inf); border-color: color-mix(in srgb, var(--inf) 40%, transparent); }
.lane-hyp { color: var(--hyp); border-color: color-mix(in srgb, var(--hyp) 40%, transparent); }

/* practice accordion */
.practice { max-width: 680px; margin-top: 30px; border-top: 1px solid var(--line); }
.practice summary {
  list-style: none; cursor: pointer; padding: 16px 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: var(--gold);
}
.practice summary::-webkit-details-marker { display: none; }
.practice summary::after { content: '+'; float: right; color: var(--ink-faint); }
.practice[open] summary::after { content: '–'; }
.practice p { padding-bottom: 20px; }

/* figure */
.figure { position: relative; margin: 48px 0 40px; }
.figure img { width: 100%; aspect-ratio: 21/9; object-fit: cover; display: block; }
.tick { position: absolute; width: 22px; height: 22px; border: 1px solid var(--gold); }
.tick.tl { top: -5px; left: -5px; border-right: none; border-bottom: none; }
.tick.tr { top: -5px; right: -5px; border-left: none; border-bottom: none; }
.tick.bl { bottom: -5px; left: -5px; border-right: none; border-top: none; }
.tick.br { bottom: -5px; right: -5px; border-left: none; border-top: none; }
.figure figcaption {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  color: var(--ink-faint); text-transform: uppercase; margin-top: 14px;
}

.cta {
  display: inline-block; margin-top: 12px; padding: 15px 34px;
  border: 1px solid var(--gold); color: var(--ink); text-decoration: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  transition: background .25s, color .25s;
}
.cta:hover { background: var(--gold); color: var(--paper); }

/* ---------- instrument (dark) ---------- */
.instrument { background: var(--cover); margin: 96px auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.instrument::before { color: var(--gold-bright); opacity: .07; }
.instrument h2 { color: var(--paper); }
.intro-dark { color: var(--gold-pale) !important; max-width: 560px !important; }
.mono-faint { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); }
.instrument .mono-faint { color: #9a9080; }
.step { margin-top: 56px; }
.step-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.step-head h3 { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--paper); }
.h3-small { font-size: 22px; }
.prose-dark { color: #b3a892 !important; }
.prose-dark.small { font-size: 15px; }

/* forms */
.form-dark label, .form-dark input, .form-dark textarea { display: block; width: 100%; }
.form-dark label { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #9a9080; margin-bottom: 18px; }
.form-dark input, .form-dark textarea, .row-form input {
  background: var(--cover-2); border: 1px solid #4a4436; color: var(--paper);
  font-family: var(--sans); font-weight: 300; font-size: 17px;
  padding: 13px 15px; margin-top: 8px; width: 100%;
}
.form-dark input:focus, .form-dark textarea:focus, .row-form input:focus { outline: none; border-color: var(--gold); }
.form-dark input::placeholder, .form-dark textarea::placeholder, .row-form input::placeholder { color: #6d6557; }
.helper { display: block; font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; color: #6d6557; margin-top: 8px; }
.amount-wrap { position: relative; display: block; }
.dollar { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #6d6557; z-index: 2; }
.amount-wrap input { padding-left: 30px; }

.btn-gold {
  background: var(--gold-bright); color: var(--cover); border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  padding: 15px 30px; margin-top: 6px; transition: opacity .2s;
}
.btn-gold:hover { opacity: .85; }
.btn-gold.small { padding: 11px 20px; font-size: 10px; }
.btn-gold:disabled { opacity: .4; cursor: default; }
.btn-ghost {
  background: transparent; color: var(--gold-pale); border: 1px solid #4a4436; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  padding: 11px 20px; transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-ghost.small { padding: 9px 14px; font-size: 9.5px; }

.row-form { display: flex; gap: 10px; margin-top: 8px; }
.row-form input { flex: 1; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.rejoin { margin-bottom: 10px; }
.rejoin p { margin-bottom: 6px; }

/* intention card (set field) */
.intention-card {
  border: 1px solid #4a4436; background: var(--cover-2);
  padding: 20px 24px; margin-bottom: 8px; max-width: 720px;
}
.intention-card .ic-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: #9a9080; display: block; margin-bottom: 8px; }
.intention-card p { color: #cfc4ac; margin-bottom: 0; font-size: 15.5px; }
.intention-card .ic-amount { font-family: var(--serif); font-size: 30px; color: var(--gold-bright); font-weight: 500; }

/* live panel */
.live-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin-top: 8px; }
@media (max-width: 820px) { .live-grid { grid-template-columns: 1fr; } }
.big-count { font-family: var(--serif); font-weight: 500; font-size: clamp(56px, 8vw, 96px); line-height: 1; color: var(--gold-bright); display: flex; align-items: baseline; gap: 14px; margin: 10px 0 18px; }
.big-unit { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: #9a9080; }
.live-line { min-height: 34px; color: var(--paper); font-family: var(--serif); font-size: 21px; font-style: italic; }
.live-line span { transition: opacity .6s; display: inline-block; }

.live-trace { background: #1d1913; border: 1px solid #4a4436; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.ecg { width: 100%; height: 80px; display: block; }
.ecg path { fill: none; stroke: var(--gold-bright); stroke-width: 1.5; stroke-dasharray: 1400; animation: ecg-flow 4s linear infinite; opacity: .9; }
@keyframes ecg-flow { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
.beat-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.beat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-bright); animation: beat 1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: .6; } 12% { transform: scale(1.8); opacity: 1; } 24% { transform: scale(1); opacity: .6; } }

.meter-row { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.gate-meter { display: flex; gap: 9px; }
.gate-dot { width: 9px; height: 9px; border-radius: 50%; background: #4a4436; transition: background .3s, box-shadow .3s; }
.gate-dot.g4, .gate-dot.g8 { background: color-mix(in srgb, var(--gold) 55%, #4a4436); }
.gate-dot.g12 { background: color-mix(in srgb, var(--gold) 75%, #4a4436); }
.gate-dot.lit { background: var(--gold-bright); box-shadow: 0 0 8px color-mix(in srgb, var(--gold-bright) 60%, transparent); }

.window-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.window-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em;
  border: 1px solid var(--gold); color: var(--gold-bright); padding: 8px 16px;
}

/* signal cards */
.signal-card, .signal-read { border-left: 2px solid var(--gold); background: var(--cover-2); padding: 20px 24px; margin-top: 22px; max-width: 720px; }
.signal-card p.sig-line, .signal-read p.read-line { font-family: var(--serif); font-size: 19px; color: var(--paper); margin-bottom: 10px; line-height: 1.5; }
.signal-card p.sig-line:last-child, .signal-read p.read-line:last-child { margin-bottom: 0; }
.verdict { display: inline-block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; border: 1px solid; padding: 4px 10px; margin-bottom: 14px; }
.verdict.resonance { color: var(--gold-bright); border-color: color-mix(in srgb, var(--gold-bright) 50%, transparent); }
.verdict.interference { color: #cc5733; border-color: color-mix(in srgb, #cc5733 50%, transparent); }
.verdict.neutral { color: #9a9080; border-color: #4a4436; }

/* coherence */
.coherence { margin-top: 44px; border-top: 1px solid #4a4436; padding-top: 30px; }
.rungs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 720px; margin-top: 14px; }
@media (max-width: 700px) { .rungs { grid-template-columns: 1fr; } }
.rung { border: 1px solid #4a4436; padding: 18px 20px; transition: border-color .3s, background .3s; }
.rung.earned { border-color: var(--gold); background: color-mix(in srgb, var(--gold-bright) 6%, transparent); }
.rung .rung-label { font-family: var(--serif); font-size: 34px; font-weight: 500; color: #6d6557; display: block; }
.rung.earned .rung-label { color: var(--gold-bright); }
.rung .rung-name { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #9a9080; }
.rung.current .rung-name::after { content: ' · NOW'; color: var(--gold-bright); }
.coherence-next { margin-top: 18px; max-width: 720px; color: #b3a892 !important; font-size: 15px; }

/* two col */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 44px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.pair-block, .log-block { border-top: 1px solid #4a4436; padding-top: 22px; }
.code-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 20px; }
.field-code { font-family: var(--mono); font-size: 26px; letter-spacing: .3em; color: var(--gold-bright); }
.partner-info { margin-top: 14px; color: #cfc4ac !important; font-size: 15px; }
.small-form input, .small-form textarea { font-size: 15px; }

.honest-note { margin-top: 40px; max-width: 720px; color: #6d6557 !important; font-size: 13.5px; border-top: 1px solid #4a4436; padding-top: 18px; }
.instrument-status { min-height: 24px; margin-top: 26px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--gold-bright); }
.instrument-status.err { color: #cc5733; }

/* breathing */
.breath-wrap { display: flex; align-items: center; gap: 34px; margin-top: 26px; flex-wrap: wrap; }
.breath-circle {
  width: 150px; height: 150px; border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex: 0 0 auto;
}
.breath-circle::before {
  content: ''; position: absolute; inset: 18px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
.breath-circle .phase {
  font-family: var(--mono); font-size: 12px; letter-spacing: .3em; color: var(--gold-bright); text-transform: uppercase;
}
.breath-circle.breathing { animation: breathe 12s ease-in-out infinite; }
@keyframes breathe {
  0% { transform: scale(1); }
  33.333% { transform: scale(1.3); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.breath-done { margin-top: 20px; font-family: var(--serif); font-size: 24px; font-style: italic; color: var(--gold-bright); }

/* loop cards */
.loop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 40px; }
@media (max-width: 820px) { .loop-grid { grid-template-columns: 1fr; } }
.loop-card { background: var(--paper); padding: 28px; }
.loop-num { font-family: var(--serif); font-size: 15px; color: var(--gold); font-weight: 600; display: block; margin-bottom: 10px; }
.loop-card h4 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); margin-bottom: 12px; }
.loop-card p { font-size: 15px; margin-bottom: 0; }

/* close */
.close { text-align: center; padding: 90px 6vw 70px; border-top: 1px solid var(--line); }
.signoff { font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); font-style: italic; color: var(--ink); margin-bottom: 30px; }
.foot-line { margin-top: 34px; font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); }

/* reveals (JS only) */
html.js .module { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
html.js .module.in { opacity: 1; transform: none; }
