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

:root {
  --paper: #f1f0e8;
  --white: #fbfaf6;
  --ink: #1b2522;
  --ink-soft: #34433e;
  --muted: #68756f;
  --line: #d8dbd2;
  --orange: #d86137;
  --orange-dark: #b94e2b;
  --teal: #367c70;
  --forest: #172521;
  --forest-soft: #233630;
  --mono: "DM Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body.project-page { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
body.project-page::before { display: none; }
.project-page a { color: inherit; }
.project-page :focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.project-page ::selection { color: var(--white); background: var(--teal); }

.site-header { height: 74px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; gap: 48px; position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(27,37,34,.12); background: rgba(241,240,232,.94); backdrop-filter: blur(14px); }
.site-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; text-decoration: none; white-space: nowrap; }
.site-brand small { display: block; margin-top: 4px; color: var(--muted); font: 9px/1 var(--mono); font-weight: 400; letter-spacing: .02em; }
.brand-glyph { width: 27px; display: grid; gap: 4px; }
.brand-glyph i { height: 3px; border-radius: 4px; background: var(--orange); }
.brand-glyph i:nth-child(1) { width: 13px; }
.brand-glyph i:nth-child(2) { width: 26px; }
.brand-glyph i:nth-child(3) { width: 18px; }
.site-nav { display: flex; gap: 30px; }
.site-nav a, .nav-link { color: var(--muted); font-size: 12px; font-weight: 650; text-decoration: none; transition: color .15s ease; }
.site-nav a:hover, .nav-link:hover, .site-footer a:hover { color: var(--orange-dark); }
.nav-link { margin-left: auto; padding: 8px 0 8px 15px; color: var(--ink); }
.nav-link span { margin-left: 4px; color: var(--orange); }

.project-page main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; position: static; }
.hero { min-height: 650px; padding: 70px 0 68px; display: grid; grid-template-columns: minmax(0, .94fr) minmax(530px, 1.06fr); align-items: center; gap: 48px; }
.hero-copy { padding: 6px 0 0 12px; }
.overline { margin: 0 0 16px; color: var(--teal); font: 11px/1.5 var(--mono); letter-spacing: .045em; }
.signal-dot { width: 7px; height: 7px; display: inline-block; margin: 0 8px 1px 0; border-radius: 50%; background: var(--orange); }
.hero h1 { max-width: 620px; margin: 0; color: var(--ink); font-size: clamp(43px, 5.5vw, 72px); font-weight: 700; line-height: 1.04; letter-spacing: -.075em; }
.hero-summary { max-width: 560px; margin: 24px 0 0; color: #52615b; font-size: 16px; line-height: 1.8; }
.hero-actions { margin-top: 27px; display: flex; align-items: center; gap: 23px; flex-wrap: wrap; }
.button { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 3px; font-size: 12px; font-weight: 750; text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-2px); }
.button-dark { color: var(--white)!important; background: var(--ink); }
.button-dark:hover { background: var(--forest-soft); }
.button-dark span { color: #f59874; }
.text-link { color: var(--ink); font-size: 12px; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.text-link span { padding-left: 5px; color: var(--orange); }
.hero-facts { max-width: 530px; margin: 48px 0 0; padding: 17px 0 0; display: flex; gap: 0; border-top: 1px solid var(--line); list-style: none; }
.hero-facts li { min-width: 33%; display: flex; flex-direction: column; gap: 4px; }
.hero-facts strong { color: var(--ink); font-size: 15px; letter-spacing: -.03em; }
.hero-facts span { color: var(--muted); font: 9px var(--mono); }

.route-figure { min-width: 0; margin: 0; padding: 16px 16px 0; overflow: hidden; border: 1px solid #34443e; border-radius: 8px; background: var(--forest); box-shadow: 0 26px 60px rgba(31,48,42,.13); }
.figure-topline { padding: 0 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e5ece5; font: 10px var(--mono); }
.figure-live { color: #a7b9b0; font-size: 9px; }
.figure-live i { width: 6px; height: 6px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #7fbd9f; }
.route-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.route-scroll:focus-visible { outline-color: #ef9a77; }
.route-map { width: 100%; height: auto; display: block; }
.node { fill: #202f2a; stroke: #52675d; stroke-width: 1; }
.node-gateway { fill: #28433a; stroke: #8cb5a3; }
.node-draining { fill: #342d2b; stroke: #936c5d; }
.node-label, .redis-label { fill: #edf3ed; font: 600 10px var(--mono); letter-spacing: .03em; }
.node-sub { fill: #a7b9b0; font: 8px var(--mono); }
.node-mono { fill: #e7a184; font: 8px var(--mono); }
.node-health { fill: #8dc7a8; }
.node-drain-dot { fill: #d98562; }
.route-line { fill: none; stroke: #e9784d; stroke-width: 1.4; stroke-dasharray: 4 5; }
.route-line-state { stroke: #7ca89a; stroke-dasharray: 3 4; }
.redis-node { fill: #233b34; stroke: #547a69; stroke-width: 1; }
.redis-label { font-size: 9px; }
.map-note, .map-caption { fill: #91a69b; font: 8px var(--mono); }
.map-caption { fill: #738a7e; font-size: 7px; letter-spacing: .05em; }
.health-line { fill: none; stroke: #608a78; stroke-width: 1; stroke-dasharray: 2 4; }
.route-figure figcaption { min-height: 48px; padding: 11px 4px 13px; display: flex; gap: 12px; border-top: 1px solid #34443e; color: #bac7bf; font-size: 10px; line-height: 1.55; }
.route-figure figcaption span { color: #ed9876; font: 10px var(--mono); }

.measure-row { min-height: 136px; padding: 25px 0 27px; display: grid; grid-template-columns: 1.1fr 2.9fr; gap: 45px; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.measure-intro > span { color: var(--teal); font: 10px var(--mono); }
.measure-intro p { margin: 6px 0 0; font-size: 14px; font-weight: 700; line-height: 1.45; letter-spacing: -.025em; }
.measure-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.measure-list li { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.measure-list strong { font-size: 25px; line-height: 1.2; letter-spacing: -.055em; }
.measure-list span { color: var(--muted); font: 9px var(--mono); }

.story-section { padding: 100px 0; }
.section-lead { max-width: 660px; }
.section-lead h2, .handoff-heading h2, .validation-copy h2, .closing-section h2 { margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 48px); font-weight: 700; line-height: 1.12; letter-spacing: -.065em; }
.section-lead > p:last-child { max-width: 600px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.architecture-notes { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story-card { min-height: 210px; padding: 24px 25px 25px 0; border-right: 1px solid var(--line); }
.story-card + .story-card { padding-left: 25px; }
.story-card:last-child { border-right: 0; }
.card-index { color: var(--orange-dark); font: 10px var(--mono); }
.story-card h3 { max-width: 280px; margin: 24px 0 9px; font-size: 18px; line-height: 1.25; letter-spacing: -.04em; }
.story-card p { max-width: 340px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.card-detail { display: block; margin-top: 14px; color: var(--teal); font: 9px var(--mono); }

.handoff-band { padding: 48px 50px 34px; display: grid; grid-template-columns: minmax(240px, .9fr) minmax(460px, 1.5fr); column-gap: 50px; align-items: center; position: relative; color: #f2f2e9; background: var(--forest); }
.handoff-heading .overline { color: #95b7a6; }
.handoff-heading h2 { max-width: 380px; color: #f3f3e9; font-size: clamp(29px, 3vw, 38px); }
.handoff-heading > p:last-child { max-width: 365px; margin: 16px 0 0; color: #b3c2b9; font-size: 12px; line-height: 1.8; }
.handoff-steps { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.handoff-step { min-height: 124px; padding: 0 14px 0 0; position: relative; border-top: 1px solid #50625a; }
.handoff-step:not(:last-child)::after { content: ""; width: 7px; height: 7px; position: absolute; top: -4px; right: 8px; transform: rotate(45deg); border-top: 1px solid #d77b57; border-right: 1px solid #d77b57; }
.handoff-step > span { width: 21px; height: 21px; margin-top: -11px; display: grid; place-items: center; border: 1px solid #738d80; border-radius: 50%; color: #ef9a77; background: var(--forest); font: 9px var(--mono); }
.handoff-step strong { display: block; margin-top: 17px; font-size: 12px; }
.handoff-step p { margin: 6px 0 0; color: #aabbb1; font-size: 10px; line-height: 1.65; }
.handoff-link { grid-column: 2; justify-self: end; margin-top: 9px; color: #c6d6cb!important; font-size: 10px; text-decoration: none; }
.handoff-link span { margin-left: 5px; color: #ef9a77; }

.engineering-section { padding-bottom: 78px; }
.engineering-lead { max-width: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 35px; align-items: end; }
.engineering-lead .overline { grid-column: 1 / -1; }
.engineering-lead > p:last-child { max-width: 430px; margin: 0 0 5px; }
.decision-grid { margin-top: 43px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.decision-card { min-height: 235px; padding: 24px 20px 25px 0; border-right: 1px solid var(--line); }
.decision-card + .decision-card { padding-left: 20px; }
.decision-card:last-child { border-right: 0; }
.decision-glyph { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #b9c9c1; border-radius: 50%; color: var(--teal); font: 13px var(--mono); }
.decision-card h3 { max-width: 210px; margin: 25px 0 9px; font-size: 15px; line-height: 1.35; letter-spacing: -.035em; }
.decision-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.tech-line { margin-top: 33px; display: flex; align-items: center; gap: 23px; }
.tech-line > span { color: var(--muted); font: 9px var(--mono); }
.tech-line ul { margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; list-style: none; }
.tech-line li { padding: 4px 9px; border: 1px solid #cdd3ca; border-radius: 2px; color: #485650; font: 9px var(--mono); }

.validation-section { padding: 58px 56px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; background: #e4e7dd; }
.validation-copy h2 { max-width: 410px; font-size: 39px; }
.validation-copy > p:not(.overline) { max-width: 420px; margin: 16px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.validation-list { margin: 0; padding: 0; align-self: center; list-style: none; }
.validation-list li { padding: 14px 0; display: flex; gap: 13px; border-bottom: 1px solid #cbd2c7; }
.validation-list li:first-child { border-top: 1px solid #cbd2c7; }
.check-mark { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; color: #f4f4eb; background: var(--teal); font-size: 12px; }
.validation-list strong { font-size: 12px; }
.validation-list p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.text-link-light { text-decoration: underline; }

.closing-section { padding: 92px 12px 84px; display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.closing-section h2 { max-width: 580px; font-size: 40px; }
.closing-section > div:first-child > p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.closing-actions { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
.button-orange { color: #fffaf5!important; background: var(--orange); }
.button-orange:hover { background: var(--orange-dark); }
.button-outline { border-color: #c6ccc3; color: var(--ink)!important; background: transparent; }
.button-outline:hover { border-color: var(--ink); }
.site-footer { min-height: 76px; padding: 16px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.site-footer > span, .site-footer > a:last-child { color: var(--muted); font: 9px var(--mono); text-decoration: none; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr); gap: 25px; }
  .hero-copy { padding-left: 0; }
  .hero h1 { font-size: clamp(42px, 5.4vw, 62px); }
  .handoff-band { padding: 40px 30px 30px; grid-template-columns: 1fr; row-gap: 42px; }
  .handoff-steps { grid-column: 1; }
  .handoff-link { grid-column: 1; }
  .validation-section { gap: 45px; padding-inline: 38px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 110px; }
  .site-header { height: auto; min-height: 64px; padding: 9px 18px 8px; gap: 7px 16px; flex-wrap: wrap; }
  .site-brand { order: 1; }
  .site-nav { width: 100%; order: 3; display: flex; gap: 24px; overflow-x: auto; padding: 4px 0 2px; white-space: nowrap; }
  .nav-link { order: 2; margin-left: auto; font-size: 11px; }
  .project-page main { width: min(100% - 36px, 620px); }
  .hero { min-height: 0; padding: 55px 0 44px; grid-template-columns: 1fr; gap: 37px; }
  .hero h1 { max-width: 560px; font-size: clamp(43px, 11vw, 66px); }
  .hero-summary { max-width: 570px; font-size: 14px; }
  .hero-facts { margin-top: 34px; }
  .route-figure { padding: 11px 10px 0; }
  .figure-topline { font-size: 9px; }
  .figure-live { font-size: 8px; }
  .measure-row { padding: 22px 0; grid-template-columns: 1fr; gap: 20px; }
  .measure-intro p br { display: none; }
  .measure-list li { padding-left: 12px; }
  .measure-list strong { font-size: 21px; }
  .measure-list span { max-width: 90px; font-size: 8px; line-height: 1.5; }
  .story-section { padding: 69px 0; }
  .section-lead h2, .handoff-heading h2, .closing-section h2 { font-size: 37px; }
  .architecture-notes { grid-template-columns: 1fr; }
  .story-card, .story-card + .story-card { min-height: 0; padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-card:last-child { border-bottom: 0; }
  .story-card h3 { margin-top: 13px; }
  .handoff-band { margin-inline: -18px; padding: 34px 18px 27px; }
  .handoff-steps { grid-template-columns: repeat(2, 1fr); row-gap: 27px; }
  .handoff-step { min-height: 105px; }
  .engineering-lead { display: block; }
  .engineering-lead > p:last-child { margin-top: 15px; }
  .decision-grid { grid-template-columns: repeat(2, 1fr); }
  .decision-card, .decision-card + .decision-card { min-height: 0; padding: 21px 13px 23px 0; border-bottom: 1px solid var(--line); }
  .decision-card:nth-child(2n) { padding-left: 13px; border-right: 0; }
  .decision-card:nth-last-child(-n+2) { border-bottom: 0; }
  .decision-card h3 { margin-top: 17px; }
  .tech-line { align-items: flex-start; flex-direction: column; gap: 11px; }
  .validation-section { margin-inline: -18px; padding: 37px 18px; grid-template-columns: 1fr; gap: 28px; }
  .validation-copy h2 { font-size: 35px; }
  .closing-section { padding: 66px 0; align-items: stretch; flex-direction: column; gap: 26px; }
  .closing-actions { max-width: 330px; }
  .site-footer { padding-inline: 18px; flex-wrap: wrap; }
  .site-footer > span { order: 3; width: 100%; }
}
@media (max-width: 420px) {
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 16px; }
  .figure-live { max-width: 145px; text-align: right; }
  .route-map { min-width: 560px; }
  .route-figure { padding-bottom: 0; }
  .measure-list { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .measure-list li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; }
}
