/* Goroshi LLC — ATC Sales · Apple-neutral palette, locked per feedback_public_aesthetic_neutral_only.md
 * Sister of dad-packet/style.css — same tokens, same letter-spacing grades, same mobile tiers.
 * Adds: data-table styling, sticky table header, card-grid for nav, SVG cash-bar.
 * Constraints: Apple-neutral B&W palette · system font stack · vanilla CSS · <200 lines core. */

:root {
  --bg:        #FFFFFF;
  --bg-soft:   #F5F5F7;
  --ink:       #1D1D1F;
  --ink-soft:  #424245;
  --muted:     #6E6E73;
  --faint:     #86868B;
  --hairline:  rgba(0,0,0,0.08);
  --hairline-faint: rgba(0,0,0,0.04);
  --hairline-strong: rgba(0,0,0,0.16);
  --link:      #0066CC;
}

html { color-scheme: light; scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern","liga","calt","tnum";
}

body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

main {
  flex: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: max(80px, env(safe-area-inset-top) + 48px) 32px max(64px, env(safe-area-inset-bottom) + 32px);
  width: 100%;
}

/* =======================================================================
 * HEADER — minimal — month label only (per-page surface, no nav-overload).
 * ======================================================================= */
.site-header {
  /* WHY: top:44px reserves the cross-site nav strip (sticky, z-index:200).
     z-index:100 keeps this site-header above page content but BELOW the
     cross-site strip. Original top:0 hid the strip on scroll. */
  position: fixed; top: 44px; left: 0; right: 0;
  background: rgba(255,255,255,0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline-faint);
  z-index: 100;
}
.site-header-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-logo {
  font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none;
  letter-spacing: -0.003em;
}
.site-logo-suffix { color: var(--muted); font-weight: 400; }
.site-nav { display: flex; gap: 20px; list-style: none; }
.site-nav a {
  font-size: 13px; color: var(--muted); text-decoration: none; letter-spacing: -0.003em;
  /* WHY: ≥44pt tap target for mobile — pad invisibly to clear Apple HIG */
  padding: 12px 4px;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
@media (max-width: 640px) {
  .site-header-inner { padding: 12px 20px; flex-wrap: wrap; }
  .site-nav { gap: 14px; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .site-nav a { padding: 8px 0; font-size: 12px; white-space: nowrap; }
}

/* =======================================================================
 * HERO — graded letter-spacing, fluid h1, balanced text-wrap (dad-packet match).
 * ======================================================================= */
.hero { text-align: left; margin-bottom: 48px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.015) 100%);
  padding: 24px 0 32px; border-radius: 12px;
}
.hero h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(28px, calc(2vw + 22px), 56px);
  line-height: 1.05; letter-spacing: -0.025em; font-weight: 500;
  color: var(--ink); margin: 8px 0 16px; text-wrap: balance;
}
.hero .lede {
  font-size: 19px; line-height: 1.42; color: var(--muted);
  font-weight: 400; letter-spacing: -0.005em; max-width: 60ch;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.rule { width: 48px; height: 1px; background: var(--hairline); border: none; margin: 32px 0 0; }
.rule-faint { width: 100%; height: 1px; background: var(--hairline-faint); border: none; margin: 56px 0; }

/* =======================================================================
 * STATS — 5-up row on desktop, 2-up on tablet, 1-up on phone.
 * Tabular nums + nowrap to prevent column-wrap on tight viewports.
 * ======================================================================= */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
  margin: 0; padding: 32px 0;
}
.stats.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .stats, .stats.stats-4, .stats.stats-3 { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (max-width: 480px) { .stats, .stats.stats-4, .stats.stats-3 { grid-template-columns: 1fr; gap: 24px; padding: 24px 0; } }

.stat { text-align: left; }
.stat-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.stat-value {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: clamp(22px, calc(1.2vw + 14px), 28px);
  font-weight: 500; letter-spacing: -0.025em;
  color: var(--ink); line-height: 1.1; margin-bottom: 4px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 480px) { .stat-value { white-space: normal; font-size: 22px; letter-spacing: -0.022em; } }
.stat-foot { font-size: 12px; color: var(--muted); }

/* =======================================================================
 * BLOCKS / KICKERS / H2 — mirrors dad-packet for visual continuity.
 * ======================================================================= */
.block { margin: 0; scroll-margin-top: 80px; }
.kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.block h2 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 28px; line-height: 1.12; letter-spacing: -0.009em;
  font-weight: 500; color: var(--ink); margin-bottom: 16px;
  text-wrap: balance; scroll-margin-top: 80px;
}
@media (max-width: 640px) { .block h2 { font-size: 22px; } }

.body {
  font-size: 17px; line-height: 1.52; color: var(--ink-soft);
  max-width: 60ch; margin-bottom: 12px; text-wrap: pretty;
}
.body strong { color: var(--ink); font-weight: 600; }
.small-note { font-size: 14px; color: var(--muted); }

/* =======================================================================
 * CARD GRID — 4-card hub on overview page.
 * ======================================================================= */
.card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px;
}
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; gap: 12px; } }

.card {
  display: block; padding: 24px; border-radius: 12px;
  background: var(--bg-soft); color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  transition: transform 0.18s cubic-bezier(0.16,1,0.3,1), box-shadow 0.18s ease;
  /* WHY: 44pt+ tap target — padding clears Apple HIG floor */
  min-height: 88px;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  text-decoration: none;
}
.card .kicker { color: var(--muted); margin-bottom: 8px; }
.card h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 18px; font-weight: 500; letter-spacing: -0.006em;
  color: var(--ink); margin-bottom: 6px; line-height: 1.2;
}
.card p { font-size: 14px; color: var(--muted); line-height: 1.46; margin-bottom: 8px; }
.card-meta { font-size: 11px; font-weight: 500; color: var(--link); letter-spacing: 0; }

/* =======================================================================
 * CTA LIST — single-line "read the source" link convention.
 * ======================================================================= */
.cta-list { list-style: none; margin: 16px 0 0; }
.cta-list li {
  padding: 16px 0; border-bottom: 1px solid var(--hairline-faint);
  display: flex; align-items: baseline; gap: 16px;
}
.cta-list li:last-child { border-bottom: none; }
.cta-list a {
  color: var(--link); font-size: 17px; font-weight: 500;
  flex-shrink: 0; transition: transform 0.15s ease;
  /* WHY: 44pt tap target on phone */
  display: inline-flex; align-items: center; min-height: 44px;
}
.cta-list a:hover { transform: translateY(-1px); text-decoration: underline; }
.cta-list .meta { font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }
@media (max-width: 640px) {
  .cta-list li { flex-wrap: wrap; gap: 8px; padding: 14px 0; }
  .cta-list .meta { margin-left: 0; width: 100%; text-align: left; }
}

/* =======================================================================
 * DATA TABLE — sticky header, hairline rows, right-aligned currency.
 * Color-blind-friendly: variance shown as text "+12% vs avg" in muted color, never red/green.
 * Mobile: shrink to 4 critical columns, tap any row to expand to brand split.
 * ======================================================================= */
.data-table-wrap {
  margin-top: 24px;
  /* WHY: prevent body overflow on narrow screens — table scrolls horizontally if needed */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* WHY: subtle gradient fade at right edge tells the user the table scrolls */
  background:
    linear-gradient(to right, var(--bg) 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), var(--bg) 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.08), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.08), rgba(0,0,0,0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}
.data-table {
  width: 100%; min-width: 720px; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.data-table thead {
  /* WHY: sticky header sticks to top-of-viewport when user scrolls down the table — Shellye scrolling thru 30 days on iPhone */
  position: sticky; top: 0; z-index: 2; background: var(--bg);
}
.data-table th {
  text-align: right; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  padding: 14px 12px 12px; border-bottom: 1px solid var(--hairline);
  white-space: nowrap; background: var(--bg);
}
.data-table th:first-child, .data-table th.left { text-align: left; }
.data-table tbody tr {
  border-bottom: 1px solid var(--hairline-faint);
  transition: background 0.12s ease;
}
.data-table tbody tr:hover { background: var(--bg-soft); cursor: pointer; }
.data-table tbody tr.expanded { background: var(--bg-soft); }
.data-table td {
  text-align: right; padding: 14px 12px; font-size: 14px;
  color: var(--ink-soft); white-space: nowrap; line-height: 1.4;
}
.data-table td:first-child, .data-table td.left { text-align: left; color: var(--ink); font-weight: 500; }
.data-table td.muted { color: var(--muted); font-size: 12px; }
.data-table tfoot tr { border-top: 2px solid var(--hairline-strong); border-bottom: none; }
.data-table tfoot td { padding: 16px 12px; font-weight: 600; color: var(--ink); font-size: 14px; }
.data-table .row-detail { background: var(--bg-soft); }
.data-table .row-detail td { padding: 14px 12px 18px; font-size: 12px; }
.row-detail-inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: left;
}
.row-detail-inner div { display: flex; flex-direction: column; gap: 2px; }
.row-detail-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.row-detail-value { font-size: 14px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Mobile: table shows fewer columns by default, more on tap */
@media (max-width: 640px) {
  .data-table { min-width: 0; font-size: 13px; }
  .data-table th, .data-table td { padding: 12px 8px; font-size: 13px; }
  .data-table th.hide-mobile, .data-table td.hide-mobile { display: none; }
  .row-detail-inner { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* =======================================================================
 * CASH-CHAIN HORIZONTAL BAR — inline SVG, no JS, pure ink+hairline.
 * ======================================================================= */
.cash-bar { margin: 24px 0; padding: 24px; background: var(--bg-soft); border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.cash-bar svg { width: 100%; height: auto; display: block; }
.cash-bar-labels {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px;
}
.cash-bar-label {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
}
.cash-bar-label.center { text-align: center; }
.cash-bar-label.right { text-align: right; }
.cash-bar-label-key {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.cash-bar-label-value {
  font-size: 20px; font-weight: 500; letter-spacing: -0.015em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .cash-bar { padding: 18px; }
  .cash-bar-labels { grid-template-columns: 1fr; gap: 12px; text-align: left !important; }
  .cash-bar-label, .cash-bar-label.center, .cash-bar-label.right { text-align: left; }
}

/* =======================================================================
 * LINKS / FOOTER / FOCUS / SELECTION — shared with dad-packet.
 * ======================================================================= */
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

footer {
  padding: 40px 32px max(56px, env(safe-area-inset-bottom) + 32px);
  text-align: center; border-top: 1px solid var(--hairline); margin-top: 80px;
}
footer p { font-size: 12px; color: var(--muted); max-width: 60ch; margin: 0 auto 6px; line-height: 1.5; }
.footer-small { font-size: 11px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  position: fixed; left: 24px; top: 24px;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px; font-size: 14px; z-index: 1000;
  text-decoration: none; border-radius: 6px;
}
::selection { background: #1D1D1F; color: #FFFFFF; }

/* =======================================================================
 * MOBILE LAYERS — same tier pattern as dad-packet (640/480/420/380).
 * ======================================================================= */
@media (max-width: 640px) {
  /* WHY: header on mobile is taller (logo row + nav row = ~88px); main padding-top must clear it.
   *      Was 72px (too tight) — the eyebrow was rendering UNDER the sticky header. 110px = clean clearance. */
  main { padding: max(110px, env(safe-area-inset-top) + 70px) 20px max(48px, env(safe-area-inset-bottom) + 24px); }
  /* WHY: anti-clip global guard (audit 2026-05-14) — prevent right-edge content clipping by allowing
   *      h1/h2/lede/body to wrap at any character before escaping the viewport. min-width:0 on all
   *      descendants unjams flex/grid children that defaulted to min-content sizing. */
  main *, .hero *, .block * { min-width: 0; }
  main h1, main h2, main h3, .hero h1, .hero h2, .hero .lede, .block h2, .block h3, .stat-value, .body, .small-note {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .stats { gap: 20px; padding: 24px 0; }
  .stat-value { font-size: 22px; letter-spacing: -0.022em; }
}
@media (max-width: 480px) {
  /* WHY: 480 inherits the 110px floor from 640 — same wrapped-header height regardless of viewport */
  main { padding: max(108px, env(safe-area-inset-top) + 68px) 18px max(40px, env(safe-area-inset-bottom) + 20px); }
  .hero { margin-bottom: 32px; padding: 8px 0 24px; }
  .hero .lede { font-size: 17px; line-height: 1.4; }
  .card { padding: 20px; }
  .card h3 { font-size: 17px; }
  footer { padding: 32px 20px max(40px, env(safe-area-inset-bottom) + 24px); margin-top: 56px; }
}
@media (max-width: 420px) {
  .block h2 { font-size: 19px; line-height: 1.16; }
  .stat-value { font-size: 22px; }
  .eyebrow, .kicker { letter-spacing: 0.04em; }
}
@media (max-width: 380px) {
  .eyebrow { letter-spacing: 0.03em; font-size: 11px; }
  .hero .lede { font-size: 16px; }
  .block h2 { font-size: 18px; line-height: 1.18; }
  .body { font-size: 16px; line-height: 1.5; }
  .stat-value { font-size: 21px; }
  .stat-label { font-size: 10px; letter-spacing: 0.05em; }
  .data-table th, .data-table td { padding: 10px 6px; font-size: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .card:hover, .cta-list a:hover, .data-table tbody tr:hover { transform: none !important; }
}
