/* ==========================================================================
   MONAMEDIA — US LICENSE INTERACTIF
   Vanilla CSS, no framework. Sections are ordered to mirror the JS file:
   tokens/reset -> layout shell -> hub -> chapter shell -> widgets -> HUD
   -> responsive breakpoints.
   ========================================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  --bg: #f3f2f2;
  --bg-alt: #eae9e9;
  --ink: #201e1d;
  --accent: #ec3013;
  --accent-hover: #dd2b0f;
  --accent-tint: #ffe0d9;
  --muted: #7d7979;
  --muted-dark: #605d5d;
  --border: #201e1d;
  --green: #2e7d32;
  --green-bg: #eaf6ec;

  --max-width: 1200px;
  --section-pad: 64px;
  /* Single source of truth for .hub-main/.chapter-main's horizontal gutter.
     .hero reads this same token to cancel it (full-bleed background trick),
     so the two stay in sync automatically at every breakpoint. */
  --gutter: 32px;
}

/* ---------- 2. RESET ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--ink); }
table { border-collapse: collapse; width: 100%; }

/* Sharp-edged brand aesthetic: no rounded corners anywhere in the system. */
*, *::before, *::after { border-radius: 0 !important; }

/* Visible focus states everywhere, per accessibility requirement. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 3. ROUTER (show/hide via data-route + .is-active) ---------- */
.route-view { display: none; }
.route-view.is-active { display: block; }

/* ---------- 4. TYPOGRAPHY HELPERS ---------- */
.kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin: 0 0 12px;
}
.kicker-accent { color: var(--accent); }
.text-accent { color: var(--accent); }

h1, h2, h3 { font-weight: 900; letter-spacing: -0.02em; margin: 0 0 16px; }
h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05; }
h2.chapter-title { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.03em; position: relative; z-index: 1; }
h3 { font-size: 20px; margin-top: 40px; }
p { margin: 0 0 16px; color: var(--ink); }
.disclaimer, .section-note { color: var(--muted-dark); font-size: 14px; }

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-block;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 24px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent-tint); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-lg { padding: 18px 32px; font-size: 13px; }

/* ---------- 6. LAYOUT SHELL ---------- */
.hub-main, .chapter-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 7. HUB: HEADER ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  height: 40px;
  width: auto;
  /* Blends the JPG's white background onto the page's light background. */
  mix-blend-mode: multiply;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-word { font-weight: 900; font-size: 18px; letter-spacing: -0.01em; }
.brand-tagline { font-size: 12px; color: var(--muted-dark); font-weight: 500; }
.header-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- 8. HUB: HERO ---------- */
.hero {
  position: relative; /* positioning context for the ::before background photo */
  overflow: hidden; /* clip the cover-sized photo to the section bounds */
  padding: var(--section-pad) 0 48px;
  /* Full-bleed-inside-a-padded-parent trick: cancel .hub-main's own left/
     right padding with a matching negative margin so .hero's box spans the
     parent's full content width edge-to-edge (this is what .hero::before's
     inset:0 photo layer then bleeds into). Re-adding the same amount as
     padding keeps .hero-inner's text at the exact same horizontal position
     it had before — only the box (and therefore the photo) moved, not the
     copy. Reads the same --gutter token as .hub-main so both stay in sync
     at every breakpoint. */
  margin-left: calc(var(--gutter) * -1);
  margin-right: calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
/* Monaco harbor photo behind the hero copy, painted as a background-image
   stack on a pseudo-element rather than an <img>: no HTML change needed,
   and stacking above/below the text is guaranteed by z-index alone.
   filter: grayscale keeps it strictly black & white (brand requirement).
   The radial-gradient on top is the "fondu": it stays semi-transparent at
   its center (photo still readable as a photo) but ramps up to fully
   opaque --bg at the edges/bottom, so the image fades into the page
   instead of ending in a hard rectangle, and every pixel is at least
   55% tinted with the page background, which keeps --ink text legible
   over the whole photo regardless of its local brightness. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 75% at 50% 32%,
      color-mix(in srgb, var(--bg) 55%, transparent) 0%,
      color-mix(in srgb, var(--bg) 85%, transparent) 60%,
      var(--bg) 100%),
    url("hero-monaco.jpg");
  background-repeat: no-repeat;
  background-position: center, center 38%;
  background-size: 100% 100%, cover;
  filter: grayscale(1);
}
/* Hero copy needs its own stacking context above the ::before photo layer. */
.hero-inner { position: relative; z-index: 1; max-width: 900px; }
.hero-sub { font-size: 18px; color: var(--muted-dark); max-width: 720px; }

/* ---------- 9. HUB: EXPLORE STRIP ---------- */
.explore-strip {
  background: var(--bg-alt);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 28px 0;
  margin: 32px 0;
}
.explore-strip-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.explore-strip-inner .kicker { margin: 0; }
.explore-progress { display: flex; align-items: center; gap: 16px; }
.explore-count { font-weight: 700; font-size: 14px; }
.progress-dots { display: flex; gap: 8px; }
.progress-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  background: transparent;
}
.progress-dot.is-visited { background: var(--accent); border-color: var(--accent); }

/* ---------- 10. HUB: CHAPTER GRID / TILES ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3x2 = 6 tiles, must divide evenly (no leftover cell) */
  gap: 2px;
  background: var(--border);
  border: 2px solid var(--border);
  margin-bottom: var(--section-pad);
}
.chapter-tile {
  background: var(--bg);
  border: none;
  text-align: left;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  color: var(--ink);
  transition: background-color 0.15s ease;
}
.chapter-tile:hover { background: var(--accent-tint); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-number { font-size: 28px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; }
.tile-state {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.tile-state.is-visited { color: var(--accent); }
.tile-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.tile-desc { font-size: 13px; color: var(--muted-dark); flex-grow: 1; margin: 0; }
.tile-badge {
  align-self: flex-start;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--border);
  padding: 4px 8px;
}

/* ---------- 11. HUB: FOOTER (shared by hub and chapter 5) ---------- */
.site-footer {
  border-top: 2px solid var(--border);
  padding: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.footer-confidential { font-size: 12px; color: var(--muted-dark); max-width: 700px; margin: 0 auto 8px; }
.footer-contact { font-size: 12px; color: var(--muted-dark); margin: 0; }
.footer-contact a { text-decoration: underline; }
.chapter-footer { margin-top: 56px; border-top: 2px solid var(--border); }

/* ---------- 12. CHAPTER SHELL: STICKY TOPBAR ---------- */
.chapter-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  flex-wrap: wrap;
}
.topbar-title { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; flex-grow: 1; text-align: center; }
.topbar-title .topbar-num { color: var(--accent); margin-right: 6px; }
.topbar-nav-group { display: flex; gap: 8px; }
.btn-topbar {
  border: 2px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
}
.btn-topbar:hover { background: var(--accent-tint); }

/* ---------- 13. CHAPTER SHELL: CONTENT + WATERMARK ---------- */
.chapter-main { position: relative; padding: 48px 32px 80px; }
.chapter-watermark {
  position: absolute;
  top: 20px;
  right: 16px;
  font-size: clamp(120px, 20vw, 260px);
  font-weight: 900;
  color: var(--bg-alt);
  z-index: 0;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
.chapter-main > * { position: relative; z-index: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--border); border: 2px solid var(--border); margin: 24px 0; }
.stat-card { background: var(--bg); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--muted-dark); }

.numbered-list, .check-list { padding-left: 0; margin: 0 0 16px; list-style: none; }
.numbered-list { counter-reset: num; }
.numbered-list li {
  counter-increment: num;
  position: relative;
  padding-left: 34px;
  margin-bottom: 12px;
}
.numbered-list li::before {
  content: counter(num);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.check-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
}

.data-table { margin: 16px 0 24px; font-size: 14px; border: 2px solid var(--border); }
.table-caption { text-align: left; font-size: 12px; color: var(--muted-dark); padding: 8px 12px; caption-side: top; }
.data-table th, .data-table td { border-bottom: 1px solid var(--bg-alt); padding: 10px 12px; text-align: left; }
.data-table thead th { background: var(--bg-alt); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid var(--border); }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: none; }
.table-total th, .table-total td { font-weight: 800; background: var(--accent-tint); }

.price-callout {
  border: 2px solid var(--border);
  background: var(--bg-alt);
  padding: 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.price-value { font-size: 40px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; }
.price-caption { font-size: 13px; color: var(--muted-dark); }

/* ---------- 14. WIDGETS: SHARED SHELL ---------- */
.widget {
  border: 2px solid var(--border);
  background: var(--bg-alt);
  padding: 32px;
  margin: 32px 0;
}
.widget-title { margin-top: 0; }

/* ---------- 16. WIDGET: ECOSYSTEM BLOCKS (chapter 2) ---------- */
/* A bordered vertical list, not a multi-column grid: with 7 items there is
   no column count that divides evenly, and the grid-with-dark-background
   trick used elsewhere would leave an empty, unstyled cell in the last row.
   Each row uses its own border-bottom instead, so there is structurally no
   leftover cell regardless of how many blocks exist. */
.block-steps { border: 2px solid var(--border); margin: 20px 0 40px; }
.block-step { display: flex; gap: 20px; background: var(--bg); padding: 20px; border-bottom: 2px solid var(--border); }
.block-step:last-child { border-bottom: none; }
.block-step-num { flex: 0 0 32px; font-size: 15px; font-weight: 800; color: var(--accent); }
.block-step-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.block-step-title { font-size: 15px; font-weight: 800; margin: 0; }
.block-step-desc { font-size: 13px; color: var(--muted-dark); margin: 0; }
.block-step.is-planned { background: var(--bg-alt); }
.block-step-planned-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-dark); border: 2px solid var(--muted-dark); padding: 2px 6px; align-self: flex-start; }

/* ---------- 17. WIDGET: WATERFALL (chapter 2) ---------- */
.waterfall-bar { display: flex; width: 100%; height: 56px; border: 2px solid var(--border); overflow: hidden; margin: 20px 0; }
.waterfall-segment { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; border-right: 2px solid var(--border); white-space: nowrap; overflow: hidden; }
.waterfall-segment:last-child { border-right: none; }
.waterfall-legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.legend-row { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.legend-swatch { width: 14px; height: 14px; border: 2px solid var(--border); flex-shrink: 0; }
.legend-label { flex-grow: 1; }
.legend-value { font-weight: 800; white-space: nowrap; }

/* ---------- 18. WIDGET: PASSIVE/ACTIVE TOGGLE (chapter 3) ---------- */
.toggle-switch { display: inline-flex; border: 2px solid var(--border); margin-bottom: 20px; }
.toggle-option { border: none; background: var(--bg); color: var(--ink); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 20px; }
.toggle-option + .toggle-option { border-left: 2px solid var(--border); }
.toggle-option[aria-pressed="true"] { background: var(--accent); color: #fff; }
.toggle-result { border-top: 2px solid var(--border); padding-top: 20px; }
.toggle-percent { font-size: 44px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; display: block; }
.toggle-explain { color: var(--muted-dark); max-width: 640px; }

/* ---------- 19. WIDGET: ROI CALCULATOR (chapter 4) ---------- */
.calc-label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.calc-slider { width: 100%; accent-color: var(--accent); margin-bottom: 8px; }
.calc-value { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 24px; }
.calc-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.calc-result-card { background: var(--bg); border: 2px solid var(--border); padding: 20px; }
.calc-result-label { font-size: 12px; font-weight: 700; color: var(--muted-dark); margin: 0 0 6px; }
.calc-result-value { font-size: 24px; font-weight: 900; margin: 0 0 14px; }
.progress-track { height: 12px; border: 2px solid var(--border); background: var(--bg-alt); }
.progress-fill { height: 100%; background: var(--muted-dark); }
.progress-fill-accent { background: var(--accent); }
.progress-caption { font-size: 12px; color: var(--muted-dark); margin: 8px 0 0; }

/* ---------- 20. FRAMEWORK STEPS (chapter 4, section 9) ---------- */
.framework-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--border); border: 2px solid var(--border); margin: 20px 0 40px; }
.framework-step { background: var(--bg); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.framework-step-label { font-size: 13px; font-weight: 800; }
.framework-step-desc { font-size: 12px; color: var(--muted-dark); margin: 0; }
.framework-step[data-band="1"] .framework-step-label { color: var(--green); }
.framework-step[data-band="4"] { background: var(--accent-tint); }

/* ---------- 21. PRICING GRID (chapter 5) ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--border); border: 2px solid var(--border); margin: 20px 0 40px; }
.pricing-card { background: var(--bg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.pricing-card.is-featured { background: var(--accent-tint); }
.pricing-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.pricing-name { font-size: 17px; font-weight: 800; margin: 0; }
.pricing-price { font-size: 22px; font-weight: 900; margin: 0; }
.pricing-desc { font-size: 13px; color: var(--muted-dark); margin: 0; flex-grow: 1; }

/* ---------- 22. NEXT STEPS TIMELINE (chapter 5) ---------- */
.timeline { list-style: none; padding: 0; margin: 20px 0 40px; counter-reset: step; }
.timeline-step { position: relative; padding: 0 0 24px 44px; border-left: 2px solid var(--border); margin-left: 12px; }
.timeline-step:last-child { border-left: 2px solid transparent; padding-bottom: 0; }
.timeline-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -13px;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-step-title { font-weight: 800; margin: 0 0 4px; }
.timeline-step-desc { font-size: 13px; color: var(--muted-dark); margin: 0; }

/* ---------- 23. CLOSING BOX + LINE (chapter 5) ---------- */
.closing-box { border: 2px solid var(--border); background: var(--bg-alt); padding: 28px; margin: 32px 0; }
.closing-list { list-style: none; padding: 0; margin: 0; }
.closing-list li { margin-bottom: 8px; font-size: 15px; }
.closing-hud-line { font-size: 15px; color: var(--muted-dark); border-top: 2px solid var(--border); padding-top: 20px; }
.closing-hud-line strong { color: var(--accent); }

/* ---------- 24. LIVE HUD WIDGET (fixed, all routes) ---------- */
.hud {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  box-shadow: 4px 4px 0 var(--accent);
}
.hud-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex-shrink: 0;
  animation: hud-pulse 1.4s ease-in-out infinite;
}
@keyframes hud-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hud-text { font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.hud-sep { margin: 0 4px; opacity: 0.6; }
.hud-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }

/* ---------- 25. RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 1080px) {
  /* 5 items have no clean divisor besides 1 and 5, so any fixed 2- or
     3-column step here would leave an empty, unstyled dark cell in the
     last row (the same bug class fixed for .block-steps). Collapse
     straight to 1 column instead; it stays in effect down to 480px too,
     since narrower media queries below don't re-declare this property. */
  .chapter-grid, .stat-grid { grid-template-columns: 1fr; }
  .framework-steps, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  /* Override the token (not a literal 20px): .hero's negative-margin
     compensation reads --gutter too, so this single change keeps both
     .hub-main's padding and .hero's full-bleed math in sync automatically.
     .chapter-main still needs its own explicit rule below: section 13
     ("CHAPTER SHELL") declares a later, more specific padding shorthand
     (48px 32px 80px) that a token change alone can't override — this
     keeps that pre-existing mobile behavior (0 top/bottom, gutter sides)
     unchanged, same as before this refactor. */
  :root { --gutter: 20px; }
  .chapter-main { padding: 0 var(--gutter); }
  .framework-steps, .pricing-grid { grid-template-columns: 1fr; }
  .calc-results { grid-template-columns: 1fr; }
  .waterfall-legend { grid-template-columns: 1fr; }
  .chapter-topbar { padding: 12px 16px; }
  .topbar-title { order: -1; width: 100%; text-align: left; }
  .site-header-inner { padding: 16px 20px; }
  .explore-strip-inner { padding: 0 20px; flex-direction: column; align-items: flex-start; }
  .hud { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; }
}

@media (max-width: 480px) {
  .chapter-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .block-step { flex-direction: column; gap: 8px; }
  .price-value { font-size: 32px; }
  .toggle-percent { font-size: 34px; }
}
