/* ════════════════════════════════════════════════════════════════════
   THE CLAWFILES — ATLAS LAYER (v2 evidence-room system)
   Loads AFTER style.css. New surfaces only: homepage atlas, case hub,
   money trails. Scoped prefixes: .atlas-, .aqx-, .case-, .mt-.
   One theme (dark, locked). One accent (lobster red, locked).
   Motion: CSS-driven, IntersectionObserver reveal, reduced-motion safe.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --atlas-ink-0: #060504;
  --atlas-ink-1: #0b0a08;
  --atlas-ink-2: #141210;
  --atlas-line: rgba(247, 242, 232, 0.09);
  --atlas-line-soft: rgba(247, 242, 232, 0.05);
  --atlas-accent: #e04a42;
  --atlas-accent-dim: rgba(224, 74, 66, 0.32);
  --atlas-accent-wash: rgba(224, 74, 66, 0.07);
  --atlas-glass: rgba(20, 18, 16, 0.66);
  --atlas-glass-edge: rgba(247, 242, 232, 0.12);
  --atlas-glass-hi: inset 0 1px 0 rgba(247, 242, 232, 0.08);
  --atlas-shadow: 0 24px 70px rgba(3, 2, 1, 0.55);
  --atlas-display: clamp(2.4rem, 1.2rem + 4.2vw, 4.6rem);
  --atlas-display-2: clamp(1.7rem, 1rem + 2.4vw, 2.8rem);
}

/* ── Evidence-grain texture: fixed overlay, zero scroll repaints ───── */
.atlas-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.35;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(247, 242, 232, 0.012) 2px 3px
  );
}

/* ── Reveal choreography ───────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal],
  [data-trail-step] {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--step-i, 0) * 90ms);
  }
  [data-reveal].is-in,
  [data-trail-step].is-in {
    opacity: 1;
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ATLAS HERO — the aquifer is the spine
   ════════════════════════════════════════════════════════════════════ */
.atlas-hero {
  position: relative;
  overflow: clip;
  padding: clamp(3rem, 7vh, 5.5rem) var(--gut) clamp(3rem, 6vh, 4.5rem);
  background:
    radial-gradient(120% 90% at 78% 10%, rgba(224, 74, 66, 0.05), transparent 55%),
    linear-gradient(180deg, var(--atlas-ink-1), var(--atlas-ink-0));
  border-bottom: 1px solid var(--atlas-line);
}
.atlas-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.atlas-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-mute);
  border: 1px solid var(--atlas-line);
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.9rem;
  background: var(--atlas-glass);
}
.atlas-status .live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--atlas-accent);
}
@media (prefers-reduced-motion: no-preference) {
  .atlas-status .live-dot { animation: aqx-pulse 2.6s ease-in-out infinite; }
}
.atlas-h1 {
  font-family: var(--serif);
  font-size: var(--atlas-display);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--paper);
  margin: 1.1rem 0 0.9rem;
  text-wrap: balance;
}
.atlas-h1 em {
  font-style: italic;
  color: var(--atlas-accent-hi, #ff6b63);
  padding-bottom: 0.06em;
}
.atlas-lede {
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--paper-2);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}
.atlas-cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.atlas-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--atlas-ink-0);
  background: var(--atlas-accent);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.78rem 1.5rem;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.atlas-cta:hover { background: #ff6b63; }
.atlas-cta:active { transform: translateY(1px) scale(0.985); }
.atlas-cta-ghost {
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--atlas-glass-edge);
}
.atlas-cta-ghost:hover { background: rgba(247, 242, 232, 0.06); }

/* ── Aquifer panel (data graphic, not decoration) ──────────────────── */
.aqx-panel {
  position: relative;
  border: 1px solid var(--atlas-glass-edge);
  border-radius: var(--radius-lg);
  background: var(--atlas-glass);
  box-shadow: var(--atlas-glass-hi), var(--atlas-shadow);
  padding: 1rem;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
@media (prefers-reduced-transparency: reduce) {
  .aqx-panel { background: var(--atlas-ink-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.aqx-map { display: block; width: 100%; height: auto; }
.aqx-contour {
  fill: none;
  stroke: rgba(247, 242, 232, 0.10);
  stroke-width: 1;
}
.aqx-contour.is-deep { stroke: rgba(224, 74, 66, 0.22); }
.aqx-water {
  fill: rgba(224, 74, 66, 0.045);
  stroke: var(--atlas-accent-dim);
  stroke-width: 1.2;
}
@media (prefers-reduced-motion: no-preference) {
  .aqx-water { animation: aqx-breathe 9s ease-in-out infinite; transform-origin: center; }
}
.aqx-site circle {
  fill: var(--atlas-accent);
  stroke: var(--atlas-ink-0);
  stroke-width: 1.4;
}
.aqx-site text {
  font-family: var(--mono);
  font-size: 8.4px;
  letter-spacing: 0.06em;
  fill: var(--paper-2);
}
.aqx-site .aqx-halo {
  fill: none;
  stroke: var(--atlas-accent-dim);
  stroke-width: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .aqx-site .aqx-halo { animation: aqx-halo 3.4s ease-out infinite; animation-delay: calc(var(--halo-i, 0) * 0.7s); }
}
.aqx-legend {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.4rem 0.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-mute);
}

@keyframes aqx-pulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes aqx-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@keyframes aqx-halo {
  0%   { r: 4;  opacity: 0.8; }
  100% { r: 16; opacity: 0; }
}

/* ════════════════════════════════════════════════════════════════════
   EVIDENCE STRIP — documented numbers, mono discipline
   ════════════════════════════════════════════════════════════════════ */
.atlas-strip {
  border-bottom: 1px solid var(--atlas-line);
  background: var(--atlas-ink-1);
}
.atlas-strip-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.4rem var(--gut);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.atlas-stat { border-left: 1px solid var(--atlas-line); padding-left: 1rem; }
.atlas-stat:first-child { border-left: 0; padding-left: 0; }
.atlas-stat b {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.15rem, 0.9rem + 1vw, 1.6rem);
  color: var(--paper);
}
.atlas-stat span {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--paper-mute);
}

/* ════════════════════════════════════════════════════════════════════
   CASE GRID
   ════════════════════════════════════════════════════════════════════ */
.atlas-section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.8rem, 6vh, 4.5rem) var(--gut);
}
.atlas-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.atlas-h2 {
  font-family: var(--serif);
  font-size: var(--atlas-display-2);
  line-height: 1.08;
  color: var(--paper);
  margin: 0;
  letter-spacing: -0.01em;
}
.atlas-section-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--paper-2);
  text-decoration: none;
  border-bottom: 1px solid var(--atlas-accent-dim);
  padding-bottom: 2px;
  white-space: nowrap;
}
.atlas-section-link:hover { color: var(--paper); border-bottom-color: var(--atlas-accent); }

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid var(--atlas-line);
  border-radius: var(--radius-md);
  background: linear-gradient(170deg, var(--atlas-ink-2), var(--atlas-ink-1) 70%);
  padding: 1.25rem 1.25rem 1.15rem;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.case-card:hover { border-color: var(--atlas-accent-dim); transform: translateY(-2px); }
.case-card.is-hot { border-color: var(--atlas-accent-dim); background:
  linear-gradient(170deg, rgba(224,74,66,0.08), var(--atlas-ink-1) 62%); }
.case-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-2);
  border: 1px solid var(--atlas-line);
  border-radius: var(--radius-pill);
  padding: 0.24rem 0.7rem;
}
.case-card.is-hot .case-status { color: #ff8f88; border-color: var(--atlas-accent-dim); }
.case-name {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.2;
  color: var(--paper);
  margin: 0;
}
.case-line {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--paper-mute);
  margin: 0;
}
.case-foot {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--atlas-line-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--paper-mute);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ════════════════════════════════════════════════════════════════════
   MONEY TRAIL — the signature component
   ════════════════════════════════════════════════════════════════════ */
.mt-trail {
  margin: 0;
  border: 1px solid var(--atlas-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 60% at 50% 0%, var(--atlas-accent-wash), transparent 60%),
    var(--atlas-ink-1);
  padding: clamp(1.4rem, 3vw, 2.6rem);
  overflow: clip;
}
.mt-head { max-width: 46rem; margin-bottom: 2.2rem; }
.mt-kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8f88;
}
.mt-title {
  font-family: var(--serif);
  font-size: var(--atlas-display-2);
  line-height: 1.08;
  color: var(--paper);
  margin: 0.5rem 0 0.6rem;
}
.mt-summary { font-size: 1rem; line-height: 1.55; color: var(--paper-2); margin: 0; }

.mt-flow { display: flex; flex-direction: column; }
.mt-step {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "from note"
    "edge note"
    "to   note";
  column-gap: clamp(1.2rem, 3vw, 2.6rem);
}
.mt-step + .mt-step { margin-top: 1.1rem; }

.mt-node {
  border: 1px solid var(--atlas-glass-edge);
  border-radius: var(--radius-md);
  background: var(--atlas-glass);
  box-shadow: var(--atlas-glass-hi);
  padding: 0.95rem 1.15rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@media (prefers-reduced-transparency: reduce) {
  .mt-node { background: var(--atlas-ink-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.mt-node-from { grid-area: from; }
.mt-node-to   { grid-area: to; }
.mt-node-actor {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--paper);
}
.mt-node-role {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--paper-mute);
}

.mt-edge {
  grid-area: edge;
  position: relative;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  min-height: 110px;
  margin: 0.35rem 0;
}
.mt-edge-svg { width: 60px; height: 100%; min-height: 110px; display: block; }
.mt-edge-track { stroke: var(--atlas-line); stroke-width: 1.6; }
.mt-edge-flow {
  stroke: var(--atlas-accent);
  stroke-width: 1.6;
  stroke-dasharray: 7 9;
}
@media (prefers-reduced-motion: no-preference) {
  .mt-edge-flow { animation: mt-flowdash 1.6s linear infinite; }
}
.mt-edge-tip { fill: var(--atlas-accent); }
@keyframes mt-flowdash { to { stroke-dashoffset: -32; } }

.mt-edge-chip {
  justify-self: start;
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  border: 1px solid var(--atlas-accent-dim);
  border-radius: var(--radius-sm);
  background: rgba(224, 74, 66, 0.10);
  padding: 0.55rem 0.9rem;
  max-width: 26rem;
}
.mt-amount {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.18rem;
  color: #ffb1ab;
  letter-spacing: 0.01em;
}
.mt-edge-verb { font-size: 0.82rem; color: var(--paper-2); line-height: 1.4; }
.mt-edge-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-mute);
}
.mt-edge-chip.is-estimate { border-style: dashed; }
.mt-grade-flag {
  align-self: flex-start;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-mute);
  border: 1px dashed var(--atlas-line);
  border-radius: var(--radius-pill);
  padding: 0.12rem 0.5rem;
}

.mt-note {
  grid-area: note;
  align-self: center;
  border-left: 2px solid var(--atlas-accent-dim);
  padding: 0.4rem 0 0.4rem 1.1rem;
  position: relative;
}
.mt-note p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--paper-2); }
.mt-note-source {
  margin-top: 0.5rem !important;
  font-family: var(--mono);
  font-size: 0.68rem !important;
  letter-spacing: 0.05em;
  color: var(--paper-mute) !important;
}

.mt-why {
  margin-top: 2.2rem;
  border: 1px solid var(--atlas-accent-dim);
  border-radius: var(--radius-md);
  background: var(--atlas-accent-wash);
  padding: 1.2rem 1.4rem;
}
.mt-why-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8f88;
  margin-bottom: 0.45rem;
}
.mt-why p { margin: 0; font-size: 0.98rem; line-height: 1.65; color: var(--paper); }

.mt-sources { margin-top: 1.1rem; }
.mt-sources summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--paper-mute);
}
.mt-sources ul { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.mt-sources li { font-size: 0.82rem; color: var(--paper-2); line-height: 1.6; }

/* ── Mobile collapse ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .atlas-hero-inner { grid-template-columns: 1fr; }
  .atlas-strip-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.2rem; }
  .atlas-stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .case-grid { grid-template-columns: 1fr; }
  .mt-step {
    grid-template-columns: 1fr;
    grid-template-areas: "from" "edge" "note" "to";
  }
  .mt-note { margin: 0.3rem 0 0.6rem; align-self: start; }
  .mt-edge { min-height: 84px; }
  .mt-edge-svg { min-height: 84px; }
}
