/* ════════════════════════════════════════════════════════════════
   THE FIELD INDEX — Instrument 002
   Post-Consensus Field Guide · shared ritual/talisman aesthetic

   This is not a stylesheet. It is a tuning. It diverges from the
   Layerbound Lab's dry observatory: ache-gold leads, emerald becomes
   bloom/transmission, and the field is allowed to hum.
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Architects+Daughter&display=swap');

:root {
  --void:        #050403;   /* warm-black base */
  --void-2:      #0a0807;
  --panel:       #0d0b08;   /* secondary surfaces */
  --panel-edge:  rgba(201,166,107,0.10);

  --ache:        #c9a66b;   /* gold — primary, the ache */
  --ache-bright: #d4af37;
  --ache-dim:    #8a7240;

  --bloom:       #34d399;   /* emerald — transmission / bloom, secondary */
  --bloom-deep:  #10b981;

  --rupture:     #b4541f;   /* ember — ache vectors, rupture lines */
  --rupture-dim: #6b3514;

  --ink:         #c4b59a;   /* primary text, warm */
  --ink-2:       #8f8470;   /* secondary */
  --ink-3:       #5e5645;   /* tertiary */
  --ink-4:       #3a352a;   /* faintest */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Mono', monospace;
  background: radial-gradient(120% 80% at 50% -10%, #0c0a07 0%, var(--void) 55%) fixed;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* gold-tinted scanline — connective tissue back to the Lab */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(201,166,107,0.012) 3px,
    rgba(201,166,107,0.012) 4px
  );
  pointer-events: none;
  z-index: 100;
}
/* faint breathing vignette — the instrument is warm, alive */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(140% 120% at 50% 50%, transparent 60%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 99;
}

.title { font-family: 'Space Grotesk', sans-serif; }
.hand  { font-family: 'Architects Daughter', cursive; }

a { color: inherit; }

/* ── shell ─────────────────────────────────────────────────────── */
.shell { max-width: 940px; margin: 0 auto; padding: 0 2.5rem; }
.shell-wide { max-width: 1180px; margin: 0 auto; padding: 0 2.5rem; }

/* ── sub-navigation (the Field Index's own threshold strip) ─────── */
.fg-nav {
  border-bottom: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, rgba(10,8,7,0.9), transparent);
  backdrop-filter: blur(2px);
  position: sticky;
  top: 0;
  z-index: 80;
}
.fg-nav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 1.15rem 2.5rem;
  display: flex; align-items: center; gap: 2.4rem; flex-wrap: wrap;
}
.fg-back {
  font-size: 0.55rem; letter-spacing: 0.22em; color: var(--ink-3);
  text-decoration: none; transition: color 0.25s; white-space: nowrap;
}
.fg-back:hover { color: var(--ache); }
.fg-sigil {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 0.7rem; letter-spacing: 0.34em; color: var(--ache);
  text-decoration: none; white-space: nowrap;
}
.fg-links { display: flex; gap: 1.7rem; flex-wrap: wrap; margin-left: auto; }
.fg-link {
  font-size: 0.62rem; letter-spacing: 0.16em; color: var(--ink-3);
  text-decoration: none; transition: color 0.25s; position: relative;
}
.fg-link:hover { color: var(--ink); }
.fg-link.active { color: var(--ache); }
.fg-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
  background: linear-gradient(to right, var(--ache), transparent);
  box-shadow: 0 0 7px var(--ache);
}

/* ── page header / kickers ─────────────────────────────────────── */
.kicker {
  font-size: 0.6rem; letter-spacing: 0.26em; color: var(--ache-dim);
  text-transform: uppercase; margin-bottom: 1.2rem;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  color: #e7ddca; letter-spacing: -0.01em; line-height: 1.05;
  font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 1.4rem;
}
.lede {
  color: var(--ink-2); font-size: 0.86rem; line-height: 1.95; max-width: 60ch;
}
.lede em { color: var(--ache); font-style: normal; }

/* ── voltage line — the incantatory pull-quote ─────────────────── */
.voltage {
  font-family: 'Architects Daughter', cursive;
  color: var(--ache-bright);
  font-size: 1.15rem; line-height: 1.6;
  border-left: 2px solid var(--ache-dim);
  padding: 0.2rem 0 0.2rem 1.2rem; margin: 1.6rem 0;
  text-shadow: 0 0 18px rgba(212,175,55,0.18);
}
.voltage::before { content: '“'; }
.voltage::after  { content: '”'; }

/* ── section divider ───────────────────────────────────────────── */
.rule {
  border: none; height: 1px; margin: 3.5rem 0;
  background: linear-gradient(to right, var(--ache-dim), transparent 70%);
  opacity: 0.5;
}

/* ── glyph card (used by the Glyph Index engine) ───────────────── */
.glyph-card {
  border: 1px solid rgba(201,166,107,0.07);
  border-left: 2px solid var(--ink-4);
  background: rgba(255,255,255,0.012);
  padding: 1.4rem 1.5rem;
  transition: background 0.2s, box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}
.glyph-card:hover {
  background: rgba(201,166,107,0.022);
  transform: translateX(2px);
}
.glyph-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 0.92rem; color: #ece2cf; letter-spacing: 0.02em;
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
}
.glyph-def { font-size: 0.74rem; line-height: 1.85; color: var(--ink-2); margin-top: 0.6rem; }
.glyph-usage {
  font-size: 0.68rem; line-height: 1.7; color: var(--ink-3); margin-top: 0.7rem;
}
.glyph-usage b { color: var(--ache-dim); font-weight: 500; letter-spacing: 0.08em; }
.glyph-voltage {
  font-family: 'Architects Daughter', cursive; color: var(--ache);
  font-size: 0.95rem; margin-top: 0.8rem; line-height: 1.5;
}
.glyph-related {
  margin-top: 0.85rem; font-size: 0.56rem; color: var(--ink-4);
  letter-spacing: 0.07em; line-height: 1.7;
}
.glyph-related span { color: var(--ink-3); }

/* cluster colour coding (left border + badge) */
.cl-fragment    { border-left-color: #8a7240; }
.cl-sediment    { border-left-color: #c9a66b; }
.cl-compost     { border-left-color: #34d399; }
.cl-collapse    { border-left-color: #b4541f; }
.cl-reversal    { border-left-color: #d4af37; }
.cl-silence     { border-left-color: #6b7280; }
.cl-time        { border-left-color: #818cf8; }
.cl-recursive   { border-left-color: #a78bfa; }
.cl-migration   { border-left-color: #2dd4bf; }
.cl-terrain     { border-left-color: #e07b39; }
.cl-resonance   { border-left-color: #84cc16; }

.badge {
  font-size: 0.48rem; letter-spacing: 0.14em; padding: 2px 7px;
  text-transform: uppercase; flex-shrink: 0; align-self: center;
  border: 1px solid currentColor; opacity: 0.85;
}
.bd-fragment  { color: #8a7240; }
.bd-sediment  { color: #c9a66b; }
.bd-compost   { color: #34d399; }
.bd-collapse  { color: #b4541f; }
.bd-reversal  { color: #d4af37; }
.bd-silence   { color: #8b93a1; }
.bd-time      { color: #818cf8; }
.bd-recursive { color: #a78bfa; }
.bd-migration { color: #2dd4bf; }
.bd-terrain   { color: #e07b39; }
.bd-resonance { color: #84cc16; }

/* ── controls (search + filters) ───────────────────────────────── */
.fg-search {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(201,166,107,0.12);
  color: var(--ink); font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; padding: 8px 14px; outline: none; width: 230px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fg-search:focus { border-color: rgba(201,166,107,0.4); box-shadow: 0 0 16px rgba(201,166,107,0.08); }
.fg-search::placeholder { color: var(--ink-4); }

.chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.58rem; letter-spacing: 0.12em;
  padding: 6px 12px; border: 1px solid rgba(201,166,107,0.1);
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: all 0.18s; text-transform: uppercase;
}
.chip:hover { color: var(--ink); border-color: rgba(201,166,107,0.3); }
.chip.on { color: var(--ache); border-color: rgba(201,166,107,0.5); background: rgba(201,166,107,0.06); }

/* ── threshold / hub cards ─────────────────────────────────────── */
.thr-card {
  display: block; text-decoration: none;
  border: 1px solid rgba(201,166,107,0.08);
  background: linear-gradient(160deg, rgba(13,11,8,0.8), rgba(5,4,3,0.4));
  padding: 1.6rem 1.7rem; transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative; overflow: hidden;
}
.thr-card:hover { border-color: rgba(201,166,107,0.32); box-shadow: 0 0 32px rgba(201,166,107,0.06); transform: translateY(-2px); }
.thr-num { font-size: 0.55rem; letter-spacing: 0.2em; color: var(--ache-dim); margin-bottom: 0.7rem; }
.thr-name {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1rem;
  color: #e7ddca; margin-bottom: 0.5rem; display: flex; align-items: baseline; gap: 0.5rem;
}
.thr-name .arr { color: var(--ache); opacity: 0; transform: translateX(-5px); transition: 0.25s; }
.thr-card:hover .thr-name .arr { opacity: 1; transform: translateX(0); }
.thr-desc { font-size: 0.7rem; color: var(--ink-3); line-height: 1.75; }

/* ── triad block (constellations narrative) ────────────────────── */
.triad {
  border: 1px solid rgba(201,166,107,0.08); background: rgba(13,11,8,0.5);
  padding: 1.5rem 1.6rem;
}
.triad h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem; color: var(--ache);
  letter-spacing: 0.06em; margin: 0 0 0.3rem;
}
.triad .focus { font-size: 0.64rem; color: var(--ink-3); margin-bottom: 1rem; letter-spacing: 0.04em; }
.triad-state { padding: 0.7rem 0; border-top: 1px solid rgba(201,166,107,0.06); }
.triad-state b { color: #d8cdb6; font-weight: 600; font-size: 0.78rem; font-family: 'Space Grotesk', sans-serif; }
.triad-state p { margin: 0.25rem 0 0; font-size: 0.68rem; color: var(--ink-3); line-height: 1.7; }

/* ── phase block (ritual guide) ────────────────────────────────── */
.phase { border-left: 2px solid var(--ache-dim); padding: 0.2rem 0 0.2rem 1.6rem; }
.phase .ph-no { font-size: 0.55rem; letter-spacing: 0.22em; color: var(--ache-dim); }
.phase h3 { font-family: 'Space Grotesk', sans-serif; color: #e7ddca; font-size: 1.15rem; margin: 0.4rem 0 0.7rem; }
.phase .act {
  margin-top: 0.9rem; font-size: 0.7rem; color: var(--bloom); letter-spacing: 0.05em;
}
.phase .act b { color: var(--bloom-deep); }

/* ── generative diagram frame ──────────────────────────────────── */
.diagram {
  border: 1px solid rgba(201,166,107,0.1); background: radial-gradient(120% 120% at 50% 40%, #0a0807, #050403);
  position: relative; overflow: hidden;
}
.diagram svg { display: block; width: 100%; height: auto; }
.diagram-cap {
  font-size: 0.58rem; letter-spacing: 0.1em; color: var(--ink-3);
  padding: 0.9rem 1.2rem; border-top: 1px solid rgba(201,166,107,0.07);
}

/* humming animation primitives (respect reduced motion below) */
@keyframes hum   { 0%,100%{opacity:0.85} 50%{opacity:1} }
@keyframes drift { 0%,100%{transform:translate(0,0)} 50%{transform:translate(3px,-4px)} }
@keyframes pulse { 0%,100%{opacity:0.25} 50%{opacity:0.6} }
@keyframes spin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }

.hum   { animation: hum 5.5s ease-in-out infinite; }
.dft   { animation: drift 9s ease-in-out infinite; }
.pul   { animation: pulse 4s ease-in-out infinite; }

footer.fg-foot {
  padding: 4rem 0 3rem; text-align: center;
  border-top: 1px solid rgba(201,166,107,0.06); margin-top: 5rem;
}
footer.fg-foot a { color: var(--ache-dim); font-size: 0.66rem; letter-spacing: 0.08em; text-decoration: none; }
footer.fg-foot a:hover { color: var(--ache); }
footer.fg-foot .hum-note { font-family:'Architects Daughter', cursive; color: var(--ink-3); font-size: 0.85rem; margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .hum, .dft, .pul, [class*="anim"] { animation: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 720px) {
  .shell, .shell-wide { padding: 0 1.3rem; }
  .fg-nav-inner { padding: 1rem 1.3rem; gap: 1.2rem; }
  .fg-links { gap: 1rem; width: 100%; margin-left: 0; }
}
