/* =====================================================================
   EL LEGADO · Familia Alvarado · shared visual system
   Source of truth: this file. Single-app, multi-page.
   Visual language: apps/wealth-dashboard/ adapted for family readability.
   Phase 0 tuned May 13, 2026: bigger type, higher contrast, no italic body.
   ===================================================================== */

:root {
  --bg: #05050a;
  --s1: #0a0a12;
  --s2: #0f0f18;
  --border: #18182a;
  --border2: #22223a;
  --g: #00e5a0;
  --g2: #00e5a018;
  --g3: #00e5a040;
  --y: #f0c040;
  --y2: #f0c04018;
  --y3: #f0c04040;
  --r: #ff3d5a;
  --b: #3d8aff;
  --o: #ff7a3d;
  --text: #d4d4e2;       /* slightly brighter for readability */
  --muted: #7a7a92;      /* MUCH brighter than old #42425a — was 3:1, now ~5.5:1 */
  --muted2: #5e5e72;     /* darker muted for true secondary info */
  --white: #ededf8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 16px;          /* was 13px — Phase 0 bump for readability */
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ATMOSPHERE */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 50% at 80% -10%, #00e5a009 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at -10% 80%, #3d8aff07 0%, transparent 55%),
    radial-gradient(ellipse 60% 30% at 50% 110%, #ff3d5a06 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* PRIVACY STRIP — top of every page */
.privacy-strip {
  position: relative;
  z-index: 2;
  background: rgba(240, 192, 64, 0.08);
  border-bottom: 1px solid rgba(240, 192, 64, 0.25);
  color: var(--y);
  text-align: center;
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.privacy-strip strong { font-weight: 500; }

.app {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* FONTS */
.font-bebas { font-family: 'Bebas Neue', sans-serif; }
.font-mono { font-family: 'DM Mono', monospace; }
.font-serif { font-family: 'Instrument Serif', serif; }

/* HEADER */
.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.header a {
  text-decoration: none;
  color: inherit;
}
.header-right { text-align: right; }
.header-label {
  font-size: 10px;
  letter-spacing: 0.2em;       /* was 0.4em — easier to read */
  color: var(--g);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 58px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1;
  font-weight: 400;
}
.header h1 span { color: var(--g); }
.header-date {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.header-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* STATUS BANNER — between header and nav */
.status-banner {
  background: var(--s2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--y);
  padding: 12px 18px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.status-banner .lbl {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--y);
  font-weight: 500;
}
.status-banner .txt {
  color: var(--text);
}

/* NAV */
nav.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 32px;
  padding: 16px 18px;
  background: var(--s1);
  border: 1px solid var(--border);
  font-size: 12px;            /* was 10px */
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
nav.toc a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
}
nav.toc a:hover { color: var(--g); }
nav.toc a.active { color: var(--white); }
nav.toc a.active .num { color: var(--g); }
nav.toc .num {
  color: var(--border2);
  font-variant-numeric: tabular-nums;
}

/* STATUS DOT (used in nav and elsewhere) */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.s-green  { background: var(--g); box-shadow: 0 0 6px var(--g3); }
.dot.s-amber  { background: var(--y); }
.dot.s-grey   { background: var(--muted2); }

/* SECTION */
section { margin-top: 8px; }

.section-hdr {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.section-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  color: var(--g);
  letter-spacing: 0.15em;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;             /* slightly larger */
  color: var(--white);
  letter-spacing: 0.04em;
  line-height: 1;
}
.section-title-es {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-left: 4px;
}
.section-lede {
  /* Phase 0: was Instrument Serif italic — now regular DM Mono for readability */
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  max-width: 800px;
  line-height: 1.65;
}

h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  color: var(--g);
  text-transform: uppercase;
  letter-spacing: 0.18em;      /* was 0.25em */
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
h3::after {
  content: '';
  display: block;
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* STAT ROW */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px;
  margin-bottom: 18px;
}
.stat {
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  animation: riseUp 0.5s ease both;
}
.stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ac, var(--g));
  opacity: 0.7;
}
.stat.ac-r { --ac: var(--r); }
.stat.ac-y { --ac: var(--y); }
.stat.ac-b { --ac: var(--b); }
.stat.ac-g { --ac: var(--g); }
.stat.empty { opacity: 0.85; }    /* slight demotion for empty stats */
.stat.empty::after { opacity: 0.35; }

.stat-label {
  font-size: 11px;             /* was 8px */
  letter-spacing: 0.14em;      /* was 0.3em */
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.stat-value.tbd {
  /* Phase 0: demoted — was a giant italic placeholder */
  color: var(--muted2);
  font-family: 'Bebas Neue', sans-serif;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 0.05em;
}
.stat-unit {
  font-size: 11px;             /* was 9px */
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat-context {
  font-size: 13px;             /* was 10px */
  margin-top: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.5;
}
.stat-owner {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  background: rgba(122, 122, 146, 0.1);
  border: 1px solid var(--border2);
  color: var(--muted);
  text-transform: uppercase;
  border-radius: 2px;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2px;
}

/* PANEL */
.panel {
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 24px;
  position: relative;
  overflow: hidden;
  animation: riseUp 0.55s ease both;
}
.panel.ac-r::after,
.panel.ac-g::after,
.panel.ac-y::after,
.panel.ac-b::after,
.panel.ac-o::after,
.panel.ac-grey::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.7;
}
.panel.ac-r::after { background: var(--r); }
.panel.ac-g::after { background: var(--g); }
.panel.ac-y::after { background: var(--y); }
.panel.ac-b::after { background: var(--b); }
.panel.ac-o::after { background: var(--o); }
.panel.ac-grey::after { background: var(--muted); }
.panel.placeholder {
  border-style: dashed;
  border-color: var(--border2);
  opacity: 0.7;
}

.panel-hdr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-title {
  font-family: 'DM Mono', monospace;
  font-size: 14px;             /* was 12px */
  color: var(--white);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.panel-badge {
  font-size: 10px;             /* was 8px */
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--g2);
  border: 1px solid var(--g3);
  color: var(--g);
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 500;
}
.panel-badge.r { background: rgba(255, 61, 90, 0.08); border-color: rgba(255, 61, 90, 0.3); color: var(--r); }
.panel-badge.y { background: rgba(240, 192, 64, 0.08); border-color: rgba(240, 192, 64, 0.3); color: var(--y); }
.panel-badge.b { background: rgba(61, 138, 255, 0.08); border-color: rgba(61, 138, 255, 0.3); color: var(--b); }
.panel-badge.grey { background: rgba(122, 122, 146, 0.1); border-color: var(--border2); color: var(--muted); }

.amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;             /* was 28px */
  color: var(--white);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.amount.struck { text-decoration: line-through; color: var(--muted); }
.amount.tbd {
  /* Phase 0: was 22px italic serif — demoted */
  color: var(--muted2);
  font-family: 'Bebas Neue', sans-serif;
  font-style: normal;
  font-size: 18px;
  letter-spacing: 0.05em;
}
.amount-sub {
  font-size: 12px;             /* was 10px */
  color: var(--muted);
  letter-spacing: 0.04em;
}

.meta {
  font-size: 14px;             /* was 11px */
  color: var(--text);
  line-height: 1.7;
}
.meta strong {
  color: var(--white);
  font-weight: 500;
}
.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.meta-line .k {
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: 12px;
  text-transform: uppercase;
}
.source {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11px;             /* was 9px */
  color: var(--muted);
  letter-spacing: 0.04em;
  font-family: 'DM Mono', monospace;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}
th {
  font-size: 11px;             /* was 9px */
  letter-spacing: 0.1em;       /* was 0.2em */
  color: var(--muted);
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  text-transform: uppercase;
}
th.right, td.right { text-align: right; }
th.num, td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'DM Mono', monospace;
}
td {
  padding: 14px 10px;
  font-size: 14px;             /* was 12px */
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
td.tbd { color: var(--muted); }
tr.total td {
  font-weight: 500;
  color: var(--white);
  border-top: 1px solid var(--border2);
  border-bottom: none;
}
tr.total td .v {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
}

/* POUR (waterfall rules) */
.pour {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 14px;
  align-items: start;
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 16px 18px;
  margin-bottom: 2px;
}
.pour.placeholder { border-style: dashed; border-color: var(--border2); opacity: 0.7; }
.pour-order {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--g);
  line-height: 1;
  letter-spacing: 0.05em;
}
.pour-what {
  font-size: 14px;             /* was 12px */
  color: var(--white);
  font-weight: 500;
  margin-bottom: 6px;
}
.pour-cond {
  /* Phase 0: was italic serif — now regular for readability */
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-size: 13px;             /* was 12px */
  color: var(--text);
  line-height: 1.55;
}
.pour-amt {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--white);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* LEDGER */
.ledger-row {
  display: grid;
  grid-template-columns: 110px 1fr 160px;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row .date {
  color: var(--g);
  font-size: 12px;             /* was 10px */
  letter-spacing: 0.08em;
  font-family: 'DM Mono', monospace;
}
.ledger-row .what {
  font-size: 14px;             /* was 12px */
  color: var(--text);
  line-height: 1.6;
}
.ledger-row .who {
  color: var(--muted);
  font-size: 11px;             /* was 10px */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
}
.ledger-row.placeholder { opacity: 0.5; }
.ledger-row.placeholder .what { color: var(--muted); }

/* NOTE BOX */
.note {
  background: var(--s2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--b);
  padding: 16px 18px;
  margin: 18px 0;
  /* Phase 0: was italic serif — now regular DM Mono for readability */
  font-family: 'DM Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 14px;             /* was 13px */
  color: var(--text);
  line-height: 1.65;
}
.note.warn { border-left-color: var(--y); }
.note.danger { border-left-color: var(--r); }
.note strong {
  color: var(--white);
  font-weight: 500;
  font-style: normal;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.note em {
  /* When italic emphasis is needed inside a note */
  font-style: italic;
  color: var(--text);
}

/* LEGEND */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;             /* was 9px */
  color: var(--muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.r::before { background: var(--r); }
.legend-dot.g::before { background: var(--g); }
.legend-dot.y::before { background: var(--y); }
.legend-dot.b::before { background: var(--b); }
.legend-dot.grey::before { background: var(--muted); }

/* BULLETS */
ul.bullets {
  list-style: none;
  padding: 0;
}
ul.bullets li {
  padding: 10px 0 10px 20px;
  position: relative;
  font-size: 14px;             /* was 12px */
  color: var(--text);
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}
ul.bullets li:last-child { border-bottom: none; }
ul.bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--g);
}

/* MARKERS */
.call-marker {
  display: inline-block;
  font-size: 10px;             /* was 8px */
  padding: 3px 8px;
  background: rgba(240, 192, 64, 0.08);
  border: 1px solid rgba(240, 192, 64, 0.3);
  color: var(--y);
  text-transform: uppercase;
  letter-spacing: 0.1em;       /* was 0.2em */
  margin: 0 2px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
}
.ref {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

/* ANIMATION */
@keyframes riseUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat:nth-child(1) { animation-delay: 0.04s; }
.stat:nth-child(2) { animation-delay: 0.08s; }
.stat:nth-child(3) { animation-delay: 0.12s; }
.stat:nth-child(4) { animation-delay: 0.16s; }
.panel:nth-child(1) { animation-delay: 0.04s; }
.panel:nth-child(2) { animation-delay: 0.08s; }
.panel:nth-child(3) { animation-delay: 0.12s; }
.panel:nth-child(4) { animation-delay: 0.16s; }

/* HOME QUICK-LINKS (landing page) */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2px;
  margin-top: 24px;
}
.quicklink {
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  display: block;
  position: relative;
  animation: riseUp 0.5s ease both;
}
.quicklink:hover {
  border-color: var(--g3);
  background: var(--s2);
}
.quicklink::after {
  content: '→';
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}
.quicklink:hover::after {
  color: var(--g);
  transform: translateX(3px);
}
.quicklink .ql-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;             /* was 11px */
  color: var(--g);
  letter-spacing: 0.15em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quicklink .ql-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;             /* was 22px */
  color: var(--white);
  letter-spacing: 0.03em;
  line-height: 1.05;
  margin-bottom: 8px;
}
.quicklink .ql-sub {
  /* Phase 0: was italic serif — now regular for readability */
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.quicklink .ql-status {
  display: inline-block;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  margin-top: 12px;
}
.quicklink .ql-status.s-green { background: var(--g2); color: var(--g); border: 1px solid var(--g3); }
.quicklink .ql-status.s-amber { background: rgba(240, 192, 64, 0.1); color: var(--y); border: 1px solid rgba(240, 192, 64, 0.3); }
.quicklink .ql-status.s-grey  { background: rgba(122, 122, 146, 0.08); color: var(--muted); border: 1px solid var(--border2); }

/* PAGER (prev/next at bottom of each section page) */
.pager {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.pager a {
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.pager a:hover {
  border-color: var(--g3);
  background: var(--s2);
}
.pager .pager-label {
  font-size: 11px;             /* was 9px */
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pager .pager-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;             /* was 20px */
  color: var(--white);
  letter-spacing: 0.03em;
}
.pager .next { text-align: right; }
.pager .stub {
  background: transparent;
  border: 1px dashed var(--border2);
  opacity: 0.45;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 20px 22px;
}

/* FOOTER */
footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;             /* was 9px */
  letter-spacing: 0.1em;       /* was 0.2em */
  text-transform: uppercase;
  text-align: center;
  line-height: 1.6;
}

/* RESPONSIVE */
@media (max-width: 880px) {
  body { font-size: 15px; }
  .header { grid-template-columns: 1fr; gap: 12px; }
  .header-right { text-align: left; }
  .header h1 { font-size: 44px; }
  .section-title { font-size: 26px; }
  .stat-value { font-size: 36px; }
  .stat-value.tbd { font-size: 18px; }
  .ledger-row { grid-template-columns: 1fr; gap: 4px; }
  .ledger-row .who { text-align: left; }
  .pour { grid-template-columns: 28px 1fr; }
  .pour-amt { grid-column: 2; margin-top: 4px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .privacy-strip { font-size: 10px; letter-spacing: 0.1em; padding: 7px 12px; }
}
