/* Path to Production — shared styles */
:root {
  --ink: #1c1a17;
  --ink-soft: #4b463f;
  --ink-faint: #857c70;
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --card: #fffdf8;
  --line: #ddd2bf;
  --accent: #b6472b;      /* terracotta */
  --accent-2: #1f5c4d;    /* deep pine */
  --gold: #a9781f;
  --shadow: 0 1px 2px rgba(28,26,23,.06), 0 10px 30px rgba(28,26,23,.07);
  --radius: 16px;
  --maxw: 1000px;
}
html[data-theme="dark"] {
  --ink: #f0e9dc; --ink-soft: #c3baa9; --ink-faint: #8f8674;
  --paper: #17150f; --paper-2: #1e1b13; --card: #232016; --line: #3a3427;
  --accent: #e0724f; --accent-2: #6bbfa5; --gold: #d6a640;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 34px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *{ animation: none !important; transition: none !important; } }
body {
  margin: 0; font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--paper); color: var(--ink); line-height: 1.6;
  -webkit-font-smoothing: antialiased; font-size: 17px;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
h1, h2, h3, .display { font-family: "Fraunces", Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
a { color: var(--accent); }

/* Nav */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-family: "Fraunces", serif; font-weight: 600; font-size: 18px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft); text-decoration: none;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-links a.active { color: var(--accent); }
.top-actions { display: flex; gap: 8px; align-items: center; }
button.btn, a.btn {
  font-family: "Inter", sans-serif; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; transition: border-color .15s, transform .1s;
}
button.btn:hover, a.btn:hover { border-color: var(--accent); }
button.btn:active, a.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* Hero */
.hero { padding: 78px 0 30px; }
.eyebrow {
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 22px;
}
.hero h1 { font-size: clamp(38px, 6.2vw, 68px); line-height: 1.01; margin: 0 0 24px; max-width: 17ch; }
.hero .lede { font-size: clamp(18px, 2.4vw, 23px); color: var(--ink-soft); max-width: 58ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.byline { margin-top: 30px; font-size: 14px; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; align-items:center; }
.byline a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.byline a:hover { color: var(--accent); border-color: var(--accent); }

/* Sections */
section { padding: 34px 0; }
.section-head { margin-bottom: 8px; }
.section-head .kicker {
  font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-2); margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(27px, 3.6vw, 40px); margin: 0 0 12px; max-width: 20ch; }
.section-head p { color: var(--ink-soft); max-width: 62ch; margin: 0; font-size: 18px; }

/* The shift — three quick observations */
.shift { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
@media (max-width: 760px) { .shift { grid-template-columns: 1fr; } }
.shift .item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.shift .big { font-family: "Fraunces", serif; font-size: 40px; font-weight: 600; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.shift .item p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* Funnel */
.funnel-wrap { margin: 20px 0 6px; text-align: center; }
.funnel-wrap svg { max-width: 100%; height: auto; }
.funnel-caption { color: var(--ink-faint); font-size: 15px; margin-top: 10px; font-style: italic; }

/* Three moves */
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
@media (max-width: 820px) { .moves { grid-template-columns: 1fr; } }
.move {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.move::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--accent); }
.move.pine::before { background: var(--accent-2); }
.move.gold::before { background: var(--gold); }
.move .step { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.move h3 { font-size: 30px; margin: 0 0 6px; }
.move .promise { font-size: 16px; color: var(--ink); font-weight: 500; margin-bottom: 14px; font-style: italic; }
.move .promise::before { content: "“"; color: var(--accent); }
.move .promise::after { content: "”"; color: var(--accent); }
.move.pine .promise::before, .move.pine .promise::after { color: var(--accent-2); }
.move.gold .promise::before, .move.gold .promise::after { color: var(--gold); }
.move p.desc { margin: 0 0 16px; color: var(--ink-soft); font-size: 15px; }
.move .kills { margin-top: auto; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 13.5px; color: var(--ink-faint); }
.move .kills b { color: var(--ink-soft); font-weight: 600; display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }

/* Big principle pull-quote */
.principle {
  background: var(--accent-2); color: #f4efe4; border-radius: var(--radius);
  padding: 48px 40px; margin: 20px 0; text-align: center;
}
html[data-theme="dark"] .principle { color: #0f0d08; }
.principle .label { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; margin-bottom: 18px; }
.principle blockquote { font-family: "Fraunces", serif; font-size: clamp(24px, 3.6vw, 38px); line-height: 1.2; margin: 0 auto; max-width: 22ch; font-weight: 500; }
.principle .sub { margin-top: 18px; font-size: 16px; opacity: .9; max-width: 52ch; margin-left: auto; margin-right: auto; }

/* Callout */
.callout {
  background: var(--paper-2); border: 1px solid var(--line); border-left: 5px solid var(--accent-2);
  border-radius: 12px; padding: 22px 26px; margin: 24px 0; color: var(--ink-soft); font-size: 16px;
}
.callout b { color: var(--ink); }

/* Act blocks (framework page) */
.act { margin-top: 34px; }
.act-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.act-head .idx { font-family: "Fraunces", serif; font-size: 46px; font-weight: 600; color: var(--accent); line-height: 1; }
.act.pine .act-head .idx { color: var(--accent-2); }
.act.gold .act-head .idx { color: var(--gold); }
.act-head h2 { font-size: 30px; margin: 0; }
.act-head .promise { color: var(--ink-faint); font-style: italic; font-size: 16px; width: 100%; margin-top: 2px; }
.stagelist { display: grid; gap: 12px; margin-top: 18px; }
.srow {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow); display: grid;
  grid-template-columns: 200px 1fr auto; gap: 18px; align-items: center;
}
@media (max-width: 760px) { .srow { grid-template-columns: 1fr; gap: 8px; } }
.srow .name { font-family: "Fraunces", serif; font-size: 19px; font-weight: 600; }
.srow .name small { display: block; font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--ink-faint); font-weight: 400; margin-top: 3px; letter-spacing: .04em; }
.srow .what { color: var(--ink-soft); font-size: 15px; }
.srow .tag { font-size: 12px; color: var(--accent-2); font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--accent-2) 12%, transparent); padding: 6px 12px; border-radius: 999px; }
@media (max-width: 760px){ .srow .tag { justify-self: start; } }

/* Tiers table */
.tiers { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 15px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.tiers th, .tiers td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tiers th { background: var(--paper-2); font-family: "Inter", sans-serif; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.tiers td:first-child { font-weight: 600; color: var(--ink); font-family: "Fraunces", serif; font-size: 16px; }
.tiers tr:last-child td { border-bottom: 0; }

/* Checklist */
.checklist { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 8px 14px; margin-top: 26px; }
.check-group { padding: 16px 18px; }
.check-group h4 { font-family: "Inter", sans-serif; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; font-weight: 600; }
.check-row { display: flex; gap: 14px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row .box { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 6px; flex: 0 0 auto; margin-top: 2px; display: grid; place-items: center; font-size: 14px; color: transparent; cursor: pointer; user-select: none; transition: border-color .12s; }
.check-row .box.checked { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.check-row .box.checked::after { content: "✓"; }
.check-row .q { font-size: 16px; color: var(--ink); }
.check-row .q small { display: block; color: var(--ink-faint); font-size: 14px; margin-top: 2px; }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 18px 6px; }
@media (max-width: 640px) { .verdict { grid-template-columns: 1fr; } }
.verdict div { border-radius: 12px; padding: 16px 18px; font-size: 15px; }
.verdict .low { background: color-mix(in srgb, var(--accent-2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent); }
.verdict .high { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.verdict b { display:block; margin-bottom: 6px; }

/* Decision flowchart (lovable page) — proper SVG flowchart */
.flowchart-svg { display: block; width: 100%; max-width: 720px; height: auto; margin: 26px auto 0; }
.flowchart-svg text { font-family: "Inter", sans-serif; }
.fc-end { fill: #f4efe4; }
html[data-theme="dark"] .fc-end { fill: #0f0d08; }
.flow-legend { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-top: 20px; font-size: 13px; color: var(--ink-faint); }
.flow-legend .li { display: flex; align-items: center; gap: 9px; }
.flow-legend .sw { width: 30px; height: 18px; border: 1.5px solid var(--ink-faint); background: var(--card); box-sizing: border-box; flex: 0 0 auto; }
.flow-legend .sw.term { border-radius: 9px; }
.flow-legend .sw.proc { border-radius: 3px; }
.flow-legend .sw.dec { width: 16px; height: 16px; transform: rotate(45deg); border-color: var(--accent); }
@media print { .flowchart-svg { break-inside: avoid; max-width: 580px; } }

/* Findings list (lovable page — what usually arrives) */
.findings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
@media (max-width: 700px) { .findings { grid-template-columns: 1fr; } }
.finding { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); font-size: 15px; color: var(--ink-soft); }
.finding b { color: var(--ink); font-weight: 600; }

/* Numbered step badge in srow */
.srow .name .step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-family: "Inter", sans-serif; font-size: 13px; font-weight: 600; margin-right: 8px; vertical-align: middle; }
.act.pine .srow .name .step-n { background: var(--accent-2); }

/* Scenario banner */
.scenario { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-top: 26px; box-shadow: var(--shadow); }
.scenario .tag { font-family: "JetBrains Mono", monospace; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.scenario p { margin: 0; font-size: 17px; color: var(--ink-soft); }
.scenario p b { color: var(--ink); }

/* Tier detail cards (match-the-size page) */
.tiergrid { display: grid; gap: 18px; margin-top: 30px; }
.tcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 26px; position: relative; overflow: hidden;
}
.tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent-2); }
.tcard.t2::before { background: var(--gold); }
.tcard.t3::before { background: var(--accent); }
.tcard.t4::before { background: var(--accent); box-shadow: 0 0 0 100vmax rgba(0,0,0,0) ; }
.tcard.t4 { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tcard-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.tcard .level { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.tcard .dots { letter-spacing: 3px; }
.tcard h3 { font-size: 26px; margin: 2px 0 0; }
.tcard .when { color: var(--ink-soft); font-style: italic; width: 100%; margin-top: 2px; font-size: 15.5px; }
.tcard .meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.tcard .chip { font-size: 12.5px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft); border-radius: 999px; padding: 5px 12px; }
.tcard .chip b { color: var(--ink); font-weight: 600; }
.tcard .ex { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.tcard .ex h5 { font-family: "Inter", sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin: 0 0 10px; font-weight: 600; }
.tcard .ex ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.tcard .ex li { position: relative; padding-left: 20px; font-size: 15px; color: var(--ink-soft); }
.tcard .ex li::before { content: "•"; position: absolute; left: 4px; color: var(--accent-2); font-weight: 700; }
.tcard.t2 .ex li::before { color: var(--gold); }
.tcard.t3 .ex li::before, .tcard.t4 .ex li::before { color: var(--accent); }

/* Upgrade path */
.upgrade { display: flex; align-items: stretch; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.upgrade .u { flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.upgrade .u .un { font-family: "Fraunces", serif; font-weight: 600; font-size: 16px; }
.upgrade .u .ud { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
.upgrade .arrow { align-self: center; color: var(--ink-faint); font-size: 20px; }
@media (max-width: 760px) { .upgrade .arrow { transform: rotate(90deg); } }

/* Ownership four */
.owns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 760px) { .owns { grid-template-columns: 1fr 1fr; } }
.own { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.own .w { font-family: "Fraunces", serif; font-size: 19px; font-weight: 600; color: var(--accent-2); margin-bottom: 6px; }
.own p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Next-page pager */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; flex-wrap: wrap; }
.pager a { text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; background: var(--card); box-shadow: var(--shadow); min-width: 200px; flex: 1; }
.pager a:hover { border-color: var(--accent); }
.pager .lbl { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.pager .ttl { font-family: "Fraunces", serif; font-size: 20px; font-weight: 600; margin-top: 4px; }
.pager .next { text-align: right; }

/* Footer */
footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 34px 0 70px; color: var(--ink-faint); font-size: 14px; }
footer a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
footer a:hover { color: var(--accent); }
.foot-note { max-width: 62ch; }

/* Print */
@media print {
  @page { margin: 12mm 12mm; }
  :root { --paper:#fff; --paper-2:#f5f2ea; --card:#fff; --ink:#111; --ink-soft:#333; --ink-faint:#666; --line:#c4c4c4; --shadow:none; }
  .topbar, .top-actions, .nav-links, .print-hide, .hero-cta, .pager { display: none !important; }
  body { font-size: 10pt; line-height: 1.44; }
  .wrap { max-width: 100%; padding: 0; }
  .hero { padding: 0 0 5mm; }
  .hero h1 { font-size: 26pt; max-width: none; margin-bottom: 10px; }
  .hero .lede { font-size: 12pt; }
  section { padding: 5mm 0 2mm; break-inside: avoid; }
  .section-head h2 { font-size: 17pt; }
  .section-head p { font-size: 10pt; }
  .shift { grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
  .shift .item { padding: 12px; break-inside: avoid; }
  .shift .big { font-size: 26pt; }
  .funnel-wrap svg { max-height: 72mm; }
  .moves { grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
  .move { padding: 14px; break-inside: avoid; }
  .move h3 { font-size: 19pt; }
  .principle { padding: 22px; margin: 12px 0; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .principle blockquote { font-size: 20pt; }
  .callout, .srow, .checklist, .tiers, .own, .act { break-inside: avoid; box-shadow: none; }
  .act-head .idx { font-size: 30pt; }
  footer { margin-top: 12px; padding: 10px 0 0; }
  a { color: #111; border: 0; }
}
