@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --paper: #f6f4ed;
  --paper-deep: #ece9df;
  --surface: #fffdf8;
  --ink: #172520;
  --muted: #637069;
  --line: #d8ddd5;
  --green: #123f35;
  --green-2: #1d6252;
  --green-soft: #dfe9df;
  --orange: #d9683c;
  --orange-soft: #f4dfd1;
  --yellow: #d8b852;
  --shadow: 0 18px 55px rgba(23, 37, 32, .08);
  --radius: 18px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
a { color: var(--green-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange); }
button, input, select { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--yellow); color: var(--ink); }

.skip-link {
  position: fixed; top: -100px; left: 20px; z-index: 1000;
  padding: 10px 16px; background: var(--ink); color: white; border-radius: 6px;
}
.skip-link:focus { top: 10px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header {
  height: var(--header-height); padding: 0 clamp(20px, 4vw, 64px);
  display: flex; align-items: center; gap: 32px;
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 244, 237, .93); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23, 37, 32, .1);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; line-height: 1.05; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50% 50% 50% 12%; background: var(--green); color: white;
  font-family: Manrope, sans-serif; font-size: 12px; font-weight: 800; letter-spacing: -.03em;
}
.brand strong { display: block; font-family: Manrope, sans-serif; font-size: 15px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.top-nav { display: flex; align-items: center; gap: 25px; margin-left: auto; }
.top-nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.top-nav a:hover { color: var(--green); }
.search-button {
  display: flex; align-items: center; gap: 16px; padding: 7px 9px 7px 13px;
  background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  color: var(--muted); font-size: 12px;
}
kbd { padding: 0 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-family: inherit; }
.menu-button { display: none; margin-left: auto; background: none; border: 0; font-weight: 700; }

.page-shell {
  max-width: 1600px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px);
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(36px, 6vw, 100px);
}
.sidebar { padding-top: 90px; position: sticky; top: calc(var(--header-height) + 20px); align-self: start; }
.sidebar > * { position: static; }
.side-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 22px; }
.side-nav a { padding: 7px 0; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; }
.side-nav a:hover, .side-nav a.active { color: var(--green); border-color: var(--green); }
.sidebar-note { margin-top: 70px; padding-top: 20px; border-top: 1px solid var(--line); }
.sidebar-note p { margin: 8px 0 0; font-family: Manrope, sans-serif; font-size: 17px; line-height: 1.45; font-weight: 600; }
.small-label { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

main { min-width: 0; }
.hero { padding: clamp(75px, 10vw, 140px) 0 90px; position: relative; }
.hero::after {
  content: ""; position: absolute; right: 1%; top: 14%; width: 180px; height: 180px;
  border: 1px solid var(--line); border-radius: 50%; z-index: -1;
  box-shadow: 40px 40px 0 var(--green-soft), 80px 80px 0 var(--orange-soft);
  opacity: .75;
}
.eyebrow, .section-number {
  margin: 0 0 18px; color: var(--green-2); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
h1, h2, h3, h4 { font-family: Manrope, sans-serif; line-height: 1.15; letter-spacing: -.035em; }
h1 { max-width: 900px; margin: 0; font-size: clamp(52px, 7.2vw, 106px); font-weight: 800; line-height: .98; }
h1 em { color: var(--orange); font-style: normal; }
h2 { margin: 0 0 18px; font-size: clamp(35px, 4vw, 58px); font-weight: 750; }
h3 { margin: 0 0 15px; font-size: clamp(24px, 2.5vw, 33px); font-weight: 700; }
h4 { margin: 20px 0 10px; font-size: 18px; font-weight: 700; }
.hero-copy { max-width: 690px; margin: 32px 0; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 45px;
  padding: 11px 19px; border: 1px solid var(--green); border-radius: 7px;
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-2); }
.button.secondary { background: transparent; color: var(--green); }
.button.secondary:hover { background: var(--green); color: white; }
.hero-quote { margin-top: 65px; padding-left: 20px; border-left: 3px solid var(--orange); }
.hero-quote blockquote { margin: 0 0 8px; font-family: Manrope, sans-serif; font-size: 19px; font-weight: 600; }
.hero-quote a { color: var(--muted); font-size: 12px; }

.content-section { padding: 90px 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 850px; margin-bottom: 55px; }
.section-heading > p:not(.section-number) { color: var(--muted); font-size: 18px; }
.section-number { margin-bottom: 15px; }
.source-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 25px; font-size: 11px; }
.source-row span { margin-right: 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.source-row a { padding: 5px 9px; background: var(--green-soft); border-radius: 4px; text-decoration: none; }
.source-note { margin-top: 18px; color: var(--muted); font-size: 13px; }
.lead { font-size: 19px; line-height: 1.65; }
.wiki-block { padding: 40px 0; }
.wiki-block + .wiki-block { border-top: 1px dashed var(--line); }
.wiki-block > p { max-width: 920px; }
.wiki-block > p:last-child { margin-bottom: 0; }

.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.path-card {
  min-height: 255px; padding: 26px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.path-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green-2); color: var(--ink); }
.path-index { display: block; margin-bottom: 34px; color: var(--orange); font-family: Manrope, sans-serif; font-size: 12px; font-weight: 800; }
.path-card h3 { max-width: 340px; font-size: 23px; }
.path-card p { color: var(--muted); font-size: 14px; }
.text-link { position: absolute; bottom: 22px; color: var(--green-2); font-size: 12px; font-weight: 700; }
.principles-panel {
  display: grid; grid-template-columns: .7fr 1.3fr; gap: 45px; margin-top: 45px; padding: clamp(25px, 4vw, 45px);
  background: var(--green); color: white; border-radius: var(--radius);
}
.principles-panel .eyebrow { color: #a7cbbb; }
.principles-panel h3 { margin-top: 0; }
.principle-list { margin: 0; padding-left: 22px; }
.principle-list li { padding: 8px 0 8px 6px; color: #cbd9d1; font-size: 14px; }
.principle-list strong { color: white; }

.flow-diagram { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 35px 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.flow-diagram > div { min-height: 170px; padding: 18px; background: var(--surface); }
.flow-diagram span { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 22px; background: var(--orange-soft); color: var(--orange); border-radius: 50%; font-size: 11px; font-weight: 800; }
.flow-diagram strong { display: block; font-family: Manrope, sans-serif; font-size: 14px; line-height: 1.3; }
.flow-diagram small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.callout { margin: 24px 0; padding: 20px 22px; background: var(--green-soft); border-left: 3px solid var(--green-2); border-radius: 0 8px 8px 0; font-size: 14px; }
.callout.warning { background: var(--orange-soft); border-color: var(--orange); }
.callout a { font-weight: 600; }
.table-wrap { margin: 25px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
th { padding: 14px 16px; background: var(--green); color: white; text-align: left; font-family: Manrope, sans-serif; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td[rowspan] { background: var(--paper-deep); color: var(--green); font-family: Manrope, sans-serif; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; margin: 25px 0; }
.two-column > div:not(.decision-card) { padding: 5px 0; }
.two-column ul { margin: 0; padding-left: 19px; }
.two-column li { margin: 9px 0; color: var(--muted); font-size: 14px; }
.decision-card { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.decision-card.build { border-top: 3px solid var(--orange); }
.decision-card.buy { border-top: 3px solid var(--green-2); }
.decision-card h4 { margin-top: 0; }
.decision-card ul { margin-bottom: 0; padding-left: 18px; }
.decision-card li { margin: 9px 0; color: var(--muted); font-size: 14px; }
.checklist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.checklist-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checklist-grid label { padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; cursor: pointer; }
.checklist-grid label:has(input:checked) { background: var(--green-soft); border-color: var(--green-2); }
.checklist-grid input { margin-right: 7px; accent-color: var(--green-2); }
.rich-list { margin: 25px 0; padding: 0; list-style: none; }
.rich-list li { position: relative; margin: 13px 0; padding-left: 23px; }
.rich-list li::before { content: "↳"; position: absolute; left: 0; color: var(--orange); font-weight: 700; }

.risk-triangle { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 28px 0; }
.risk-triangle > div { padding: 25px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.risk-triangle > div:nth-child(2) { transform: translateY(20px); }
.risk-triangle span { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.risk-triangle strong { display: block; margin-top: 10px; font-family: Manrope, sans-serif; font-size: 18px; line-height: 1.35; }
.risk-triangle p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.numbered-playbook { margin: 30px 0; padding: 0; list-style: none; counter-reset: playbook; }
.numbered-playbook > li { position: relative; padding: 0 0 27px 58px; counter-increment: playbook; }
.numbered-playbook > li::before {
  content: counter(playbook, decimal-leading-zero); position: absolute; left: 0; top: 0;
  color: var(--orange); font-family: Manrope, sans-serif; font-size: 13px; font-weight: 800;
}
.numbered-playbook > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 27px; bottom: 5px; width: 1px; background: var(--line); }
.numbered-playbook strong { font-family: Manrope, sans-serif; font-size: 18px; }
.numbered-playbook p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.numbered-playbook.compact > li { padding-bottom: 19px; }
.failure-lab { margin: 35px 0; padding: 35px; background: #1f2a26; color: #f0f2ec; border-radius: var(--radius); }
.failure-lab .eyebrow { color: #a7cbbb; }
.case-study { margin: 25px 0; padding-top: 25px; border-top: 1px solid #43514b; }
.case-study h4 { margin-top: 8px; font-size: 23px; }
.case-study > p { color: #bec9c2; }
.case-study > a { color: #a7cbbb; font-size: 12px; }
.case-tag { padding: 4px 8px; background: #493c32; color: #f2ba91; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.lesson { padding: 16px 18px; background: #2b3933; border-radius: 8px; }
.lesson strong { color: #a7cbbb; }
.lesson p { margin: 5px 0 0; color: #d3ded6; font-size: 13px; }
.question-list { padding-left: 22px; }
.question-list li { margin: 17px 0; padding-left: 7px; }
.question-list strong { color: var(--green); }
.prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 25px 0; }
.prompt-card { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.prompt-card > span { color: var(--orange); font-size: 11px; font-weight: 800; }
.prompt-card h4 { margin: 9px 0; }
.prompt-card p { margin: 0; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.65; }
.quote-card { margin: 25px 0; padding: clamp(24px, 4vw, 40px); background: var(--orange-soft); border-radius: 12px; }
.quote-card blockquote { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(20px, 2.5vw, 27px); font-weight: 600; line-height: 1.45; letter-spacing: -.025em; }
.quote-card p { margin-bottom: 0; color: #715343; font-size: 13px; }
.principles-inline { display: flex; flex-wrap: wrap; gap: 8px; margin: 25px 0; }
.principles-inline span { padding: 8px 13px; background: var(--green); color: white; border-radius: 30px; font-size: 12px; font-weight: 600; }
.timeline-list { position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 106px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.timeline-item { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 45px; position: relative; padding: 0 0 45px; }
.timeline-item::before { content: ""; position: absolute; left: 101px; top: 7px; width: 9px; height: 9px; background: var(--orange); border: 3px solid var(--paper); border-radius: 50%; }
.timeline-item time { color: var(--green-2); font-family: Manrope, sans-serif; font-size: 13px; font-weight: 800; }
.timeline-item h3 { margin: 0 0 9px; font-size: 23px; }
.timeline-item p { max-width: 750px; margin: 0 0 7px; color: var(--muted); }
.timeline-item a { font-size: 12px; }

.library-controls { display: flex; gap: 12px; align-items: end; }
.library-search { flex: 1; }
.library-search input, .library-sort select, .search-dialog input {
  width: 100%; padding: 14px 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.library-search input:focus, .library-sort select:focus, .search-dialog input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px var(--green-soft); }
.library-sort { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.library-sort select { min-width: 160px; font-size: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.filter-chip { padding: 7px 12px; background: transparent; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.filter-chip:hover, .filter-chip.active { background: var(--green); border-color: var(--green); color: white; }
.library-count { color: var(--muted); font-size: 12px; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.video-card { display: flex; flex-direction: column; min-height: 230px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.video-card:hover { border-color: var(--green-2); transform: translateY(-2px); color: var(--ink); }
.video-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.video-card h3 { margin: 17px 0 12px; font-size: 16px; line-height: 1.35; letter-spacing: -.02em; }
.video-channel { margin: auto 0 12px; color: var(--muted); font-size: 11px; }
.video-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10px; }
.video-topic { color: var(--green-2); font-weight: 700; }
.video-arrow { color: var(--orange); font-size: 16px; }
.load-more { display: flex; margin: 25px auto 0; }
.load-more[hidden] { display: none; }
.closing-section { margin: 70px 0 90px; padding: clamp(35px, 6vw, 70px); background: var(--green); color: white; border-radius: var(--radius); }
.closing-section .eyebrow { color: #a7cbbb; }
.closing-section h2 { font-size: clamp(36px, 5vw, 64px); }
.closing-section p:not(.eyebrow) { max-width: 700px; color: #cbd9d1; font-size: 18px; }
.closing-section .button { margin-top: 20px; background: white; color: var(--green); border-color: white; }
.site-footer { max-width: 1600px; margin: 0 auto; padding: 35px clamp(20px, 4vw, 64px) 45px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer p { margin: 4px 0; }

.search-dialog { width: min(700px, calc(100% - 32px)); max-height: 80vh; padding: 25px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.search-dialog::backdrop { background: rgba(14, 27, 23, .7); backdrop-filter: blur(4px); }
.search-dialog-form { position: absolute; right: 13px; top: 8px; }
.search-dialog-form button { background: none; border: 0; font-size: 28px; cursor: pointer; }
.search-results { margin-top: 20px; overflow-y: auto; max-height: 55vh; }
.search-result { display: block; padding: 15px 5px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-result strong { display: block; font-family: Manrope, sans-serif; font-size: 15px; }
.search-result span { color: var(--muted); font-size: 12px; }
.search-empty { padding: 25px 0; color: var(--muted); text-align: center; }

@media (min-width: 1200px) {
  .content-section, .hero { max-width: 1100px; }
}
@media (max-width: 1150px) {
  .top-nav { gap: 15px; }
  .top-nav a { font-size: 11px; }
  .page-shell { grid-template-columns: 170px minmax(0, 1fr); gap: 45px; }
  .flow-diagram { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --header-height: 62px; }
  .site-header { gap: 15px; }
  .menu-button { display: block; }
  .top-nav {
    display: none; position: fixed; inset: var(--header-height) 0 0; padding: 30px;
    background: var(--paper); flex-direction: column; align-items: flex-start; gap: 20px;
  }
  .top-nav.open { display: flex; }
  .top-nav a { font-size: 20px; }
  .search-button span { display: none; }
  .search-button { margin-left: auto; }
  .menu-button + .top-nav + .search-button { margin-left: 0; }
  .page-shell { display: block; }
  .sidebar { display: none; }
  .hero { padding-top: 75px; }
  .hero::after { width: 100px; height: 100px; opacity: .4; }
  .principles-panel { grid-template-columns: 1fr; gap: 10px; }
  .checklist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  body { font-size: 15px; }
  .site-header { padding: 0 16px; }
  .page-shell { padding: 0 18px; }
  .brand small { display: none; }
  .hero { padding: 60px 0 65px; }
  h1 { font-size: clamp(46px, 14vw, 70px); }
  h2 { font-size: 36px; }
  .hero-copy { font-size: 18px; }
  .hero-quote { margin-top: 45px; }
  .content-section { padding: 65px 0; }
  .section-heading { margin-bottom: 35px; }
  .section-heading > p:not(.section-number) { font-size: 16px; }
  .path-grid, .two-column, .prompt-grid, .risk-triangle { grid-template-columns: 1fr; }
  .path-card { min-height: 240px; }
  .principles-panel { padding: 25px; }
  .flow-diagram { grid-template-columns: 1fr; }
  .flow-diagram > div { min-height: auto; }
  .flow-diagram span { margin-bottom: 10px; }
  .checklist-grid, .checklist-grid.two-col { grid-template-columns: 1fr; }
  .risk-triangle > div:nth-child(2) { transform: none; }
  .failure-lab { padding: 25px; margin-left: -5px; margin-right: -5px; }
  .timeline-list::before { left: 5px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 28px; }
  .timeline-item::before { left: 0; }
  .library-controls { align-items: stretch; flex-direction: column; }
  .library-sort select { width: 100%; }
  .video-grid { grid-template-columns: 1fr; }
  .video-card { min-height: 205px; }
  .closing-section { padding: 30px; }
  .wiki-block { padding: 30px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .sidebar, .library-controls, .filter-row, .load-more, .search-dialog, .hero-actions { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .page-shell { display: block; padding: 0; }
  .hero, .content-section { max-width: none; padding: 35px 0; }
  .wiki-block, .path-card, .decision-card, .prompt-card { break-inside: avoid; }
  a { color: black; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
