:root {
  --ink: #132238;
  --ink-soft: #46556a;
  --teal: #277a78;
  --teal-deep: #155e5d;
  --teal-pale: #dff1ed;
  --coral: #d45b3f;
  --coral-pale: #f9e6dd;
  --paper: #f6f4ef;
  --surface: #fffefb;
  --line: #dcd8cf;
  --code: #101a2b;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(25, 37, 52, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }

.reading-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--coral);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  border-bottom: 1px solid rgba(19, 34, 56, 0.1);
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand b { color: var(--coral); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 5px;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 12px rgba(19, 34, 56, 0.18);
}

.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.topbar-actions { display: flex; align-items: center; gap: 26px; }
.status-dot { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #3a9b6d; box-shadow: 0 0 0 4px rgba(58,155,109,.12); }
.text-link { color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--coral); }
.powered-by { display: inline-flex; align-items: center; gap: 5px; color: #7a8491; font-size: 10px; font-weight: 600; letter-spacing: 0; text-decoration: none; text-transform: none; transition: color 160ms ease; }
.powered-logo { display: grid; place-items: center; width: 24px; height: 24px; padding: 3px; border-radius: 7px; background: var(--ink); box-shadow: 0 3px 10px rgba(19,34,56,.16); }
.powered-logo img { width: 100%; height: 100%; object-fit: contain; }
.powered-by b { color: var(--ink); font-size: 11px; font-weight: 800; }
.powered-by:hover, .powered-by:hover b { color: #000; }
.header-divider { width: 1px; height: 18px; background: var(--line); }

.page-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 46px;
  padding: 0 48px;
}

.side-index {
  position: sticky;
  top: 112px;
  align-self: start;
  height: calc(100vh - 145px);
  padding: 18px 0 26px;
  display: flex;
  flex-direction: column;
}

.side-label,
.side-source span {
  margin: 0 0 16px;
  color: #89919b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-index nav { display: grid; gap: 3px; }

.side-index nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 11px;
  border-radius: 8px;
  color: #737e8e;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: 180ms ease;
}

.side-index nav a::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: transparent;
}

.side-index nav a span { width: 20px; font-size: 9px; letter-spacing: 0.1em; opacity: .62; }
.side-index nav a:hover,
.side-index nav a.active { color: var(--ink); background: rgba(255,255,255,.65); }
.side-index nav a.active::before { background: var(--coral); }
.side-index nav a.active span { color: var(--coral); opacity: 1; }

.side-source {
  margin-top: auto;
  padding: 20px 14px;
  border-top: 1px solid var(--line);
}

.side-source span { display: block; margin-bottom: 3px; }
.side-source a { color: var(--teal-deep); font-size: 12px; font-weight: 700; text-decoration: none; }

main { min-width: 0; border-left: 1px solid var(--line); }
.section-anchor { scroll-margin-top: 100px; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 690px;
  margin-left: -1px;
  padding: 92px 62px 0;
  color: white;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -180px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(39,122,120,.18);
  filter: blur(2px);
}

.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 35px; }

.eyebrow,
.section-number {
  margin: 0 0 18px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow span { color: #79c8c2; }
.eyebrow span::after { content: "/"; margin: 0 10px; color: rgba(255,255,255,.35); }

.hero h1 {
  max-width: 740px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 5.5vw, 78px);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.045em;
}

.hero h1 em { color: #7ed0c8; font-weight: 400; }

.hero-intro {
  max-width: 650px;
  margin: 30px 0 0;
  color: #b7c1cf;
  font-size: 16px;
  line-height: 1.78;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 19px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { background: var(--coral); border-color: var(--coral); color: white; }
.button-primary:hover { background: #e16749; }
.button-secondary { background: rgba(255,255,255,.05); color: #e7edf5; }
.button-secondary:hover { background: rgba(255,255,255,.1); }

.hero-visual { position: relative; min-height: 410px; }

.heart-line { position: absolute; top: 74px; left: -25px; z-index: 2; width: 112%; overflow: visible; }
.heart-line path { fill: none; stroke: #e56f52; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.heart-line .heart-shape { fill: rgba(212,91,63,.08); stroke: #77c9c2; stroke-width: 3; }

.pulse-ring { position: absolute; border: 1px solid rgba(118,204,196,.18); border-radius: 50%; }
.ring-one { width: 340px; height: 340px; right: 3px; top: 12px; }
.ring-two { width: 245px; height: 245px; right: 50px; top: 60px; border-color: rgba(212,91,63,.2); }

.visual-label {
  position: absolute;
  z-index: 3;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(14,28,46,.78);
  color: #d7dee7;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.label-a { top: 56px; right: 2px; }
.label-b { top: 252px; right: 24px; }
.label-c { top: 323px; left: 50px; }

.metric-strip {
  position: absolute;
  z-index: 3;
  left: 62px;
  right: 62px;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,.13);
}

.metric-strip div { padding: 24px 25px 24px 0; }
.metric-strip div + div { padding-left: 25px; border-left: 1px solid rgba(255,255,255,.13); }
.metric-strip strong { display: block; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.metric-strip span { color: #8e9aac; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.content-section { padding: 100px 62px; border-bottom: 1px solid var(--line); }

.section-heading {
  display: grid;
  grid-template-columns: minmax(310px, .9fr) minmax(300px, .72fr);
  justify-content: space-between;
  gap: 60px;
  align-items: end;
  margin-bottom: 38px;
}

.section-heading .section-number { margin-bottom: 12px; }
.section-heading h2,
.conclusion h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3.3vw, 50px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -.035em;
}

.section-heading > p { max-width: 510px; margin: 0 0 3px; color: var(--ink-soft); font-size: 14px; }
.section-heading code,
.note code { padding: 2px 5px; border-radius: 5px; background: rgba(19,34,56,.07); color: var(--ink); font: 600 12px ui-monospace, monospace; }

.code-card { overflow: hidden; border-radius: 14px; background: var(--code); box-shadow: 0 14px 35px rgba(16,26,43,.13); }

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 13px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #8290a3;
}

.code-toolbar > span { display: flex; align-items: center; gap: 6px; }
.code-toolbar i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #37465a; }
.code-toolbar i:first-child { background: #d45b3f; }
.code-toolbar i:nth-child(2) { background: #dfac54; }
.code-toolbar i:nth-child(3) { background: #54a575; }
.code-toolbar b { margin-left: 8px; font: 700 9px/1 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }

.copy-button { border: 0; background: transparent; color: #8d9aae; cursor: pointer; font-size: 10px; font-weight: 700; }
.copy-button:hover { color: white; }
.copy-button.copied { color: #75c7b4; }

.code-card pre,
.terminal-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 24px;
  color: #dce5f0;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
}

.code-card code { font: inherit; }
.code-card .kw { color: #cf8ce8; }
.code-card .str { color: #91d2aa; }
.code-card .num { color: #f0aa73; }
.code-card .comment { color: #72839a; font-style: italic; }
.compact-code pre { padding-block: 19px; }

.result-card { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }

.result-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 18px; }
.result-heading h3 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.result-kicker { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.result-badge { padding: 6px 10px; border-radius: 99px; background: var(--teal-pale); color: var(--teal-deep); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.table-scroll { overflow-x: auto; scrollbar-color: #bdc3c7 transparent; scrollbar-width: thin; }

.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 11px; }
.data-table th,
.data-table td { padding: 11px 13px; border-top: 1px solid #ebe8e1; text-align: right; font-variant-numeric: tabular-nums; }
.data-table thead th { background: #f5f2ec; color: #606b79; font-size: 9px; font-weight: 800; letter-spacing: .045em; }
.data-table th:first-child,
.data-table td:first-child { position: sticky; left: 0; z-index: 1; background: #f5f2ec; color: #9098a2; text-align: center; }
.data-table td b { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--teal-pale); color: var(--teal-deep); }
.data-table tbody tr:hover td { background: #fdf9f3; }
.data-table tbody tr:hover td:first-child { background: #f5f2ec; }

.note { display: flex; align-items: flex-start; gap: 15px; margin-top: 22px; padding: 18px 21px; border-radius: 12px; }
.note-teal { background: var(--teal-pale); }
.note-coral { background: var(--coral-pale); }
.note-icon { flex: 0 0 auto; display: grid; place-items: center; width: 25px; height: 25px; margin-top: 1px; border-radius: 50%; background: var(--teal); color: white; font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.note-coral .note-icon { background: var(--coral); }
.note p { margin: 0; color: #3c5260; font-size: 12px; }
.note p strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }

.split-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }

.shape-output { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 192px; margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.shape-output div { text-align: center; }
.shape-output span { display: block; color: #8e97a2; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.shape-output strong { display: block; font-family: Georgia, serif; font-size: 48px; font-weight: 400; line-height: 1.2; }
.shape-output .shape-x { color: var(--coral); font-family: Georgia, serif; font-size: 25px; font-weight: 400; }

.terminal-card { overflow: hidden; border: 1px solid #243247; border-radius: 14px; background: #18253a; box-shadow: 0 14px 35px rgba(16,26,43,.13); }
.terminal-title { display: flex; align-items: center; justify-content: space-between; min-height: 43px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.09); color: #96a4b6; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.terminal-title b { color: #8bd0ad; }
.terminal-card pre { color: #b9c6d6; font-size: 10px; line-height: 1.52; padding: 20px 22px; }

.stats-card { margin-top: 18px; }
.stats-table th:first-child { color: var(--ink); font-weight: 800; text-align: left; }

.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.insight-grid article { position: relative; min-height: 128px; padding: 20px 21px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); }
.insight-grid article > span { position: absolute; right: 14px; top: 9px; color: rgba(19,34,56,.08); font-family: Georgia, serif; font-size: 44px; }
.insight-grid strong { display: block; color: var(--teal-deep); font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.insight-grid p { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; }

.chart-section { padding-block: 108px; }
.analysis-grid { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(420px, 1.18fr); gap: 28px; align-items: start; }
.analysis-grid-reverse { grid-template-columns: minmax(420px, 1.18fr) minmax(280px, .82fr); }
.analysis-grid .code-card pre { font-size: 11px; line-height: 1.75; padding: 20px; }

.chart-card { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.chart-card::before { content: ""; position: absolute; inset: 40px 0 auto; height: 1px; background: #ebe8e1; }
.figure-top { display: flex; align-items: center; justify-content: space-between; height: 41px; padding: 0 17px; color: #818b98; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.chart-card img { width: 100%; aspect-ratio: 1.62/1; object-fit: contain; padding: 13px 12px 0; }
.chart-card figcaption { padding: 14px 18px 17px; color: var(--ink-soft); font-size: 10px; border-top: 1px solid #ebe8e1; }

.finding { margin-top: 15px; padding: 20px 21px; border-radius: 14px; background: var(--teal-pale); }
.finding > span { display: block; color: var(--teal-deep); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.finding strong { display: block; margin-top: 4px; color: var(--teal-deep); font-family: Georgia, serif; font-size: 37px; font-weight: 400; line-height: 1.25; }
.finding p { margin: 3px 0 0; color: #41615f; font-size: 10px; line-height: 1.55; }

.comparison-finding { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 15px; padding: 17px; border: 1px solid #b8d8d3; border-radius: 14px; background: #f2faf8; }
.comparison-finding div { text-align: center; }
.comparison-finding span { display: block; color: #65767d; font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.comparison-finding strong { color: var(--teal-deep); font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.comparison-finding small { font: 600 7px ui-sans-serif, sans-serif; }
.comparison-finding > b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: white; font-size: 9px; }
.coral-finding { border-color: #efc7b8; background: #fdf6f2; }
.coral-finding strong { color: #a64732; }
.coral-finding > b { background: var(--coral); }

.chart-legend { display: flex; justify-content: center; gap: 18px; margin-top: -6px; padding-bottom: 8px; color: #65717f; font-size: 8px; font-weight: 700; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { display: block; width: 8px; height: 8px; border-radius: 50%; }
.legend-blue { background: #6478d1; }
.legend-red { background: #d24b65; }

.conclusion { margin-left: -1px; padding: 98px 62px; color: white; background: var(--teal-deep); }
.conclusion .section-number { color: #99d8d1; }
.conclusion h2 { max-width: 650px; }
.conclusion > p:not(.section-number) { max-width: 780px; margin: 25px 0 0; color: #c4dfdc; font-size: 14px; }
.conclusion-actions { display: flex; flex-wrap: wrap; gap: 35px; margin-top: 35px; }
.conclusion-actions a { display: inline-flex; align-items: center; gap: 13px; color: white; font-size: 11px; font-weight: 800; text-decoration: none; }
.conclusion-actions a span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; transition: 160ms ease; }
.conclusion-actions a:hover span { background: white; color: var(--teal-deep); }

footer { display: flex; align-items: center; justify-content: space-between; padding: 28px 62px; color: #717c89; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
footer p { margin: 0; }
footer a { text-decoration: none; }
footer a:hover { color: var(--coral); }
footer .footer-powered-by { color: #7a8491; }
footer .footer-powered-by b { color: var(--ink); }
footer .footer-powered-by:hover, footer .footer-powered-by:hover b { color: #000; }

@media (max-width: 1120px) {
  .page-shell { grid-template-columns: 160px minmax(0, 1fr); gap: 25px; padding: 0 24px; }
  .hero, .content-section, .conclusion { padding-left: 42px; padding-right: 42px; }
  .metric-strip { left: 42px; right: 42px; }
  .hero-visual { opacity: .75; }
  .analysis-grid, .analysis-grid-reverse { grid-template-columns: 1fr; }
  .analysis-grid-reverse .chart-card { order: 2; }
  .analysis-grid-reverse .analysis-code { order: 1; }
  .analysis-code { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
  .analysis-code .finding, .analysis-code .comparison-finding { margin-top: 0; align-self: stretch; }
}

@media (max-width: 820px) {
  .topbar { height: 62px; padding: 0 18px; }
  .status-dot { display: none; }
  .page-shell { display: block; padding: 0; }
  .side-index { display: none; }
  main { border-left: 0; }
  .hero { min-height: auto; padding: 72px 24px 0; }
  .hero-grid { display: block; }
  .hero-visual { position: absolute; inset: 30px -100px auto 50%; width: 430px; opacity: .23; }
  .hero-copy { position: relative; z-index: 4; }
  .hero h1 { font-size: clamp(47px, 14vw, 68px); }
  .metric-strip { position: relative; left: auto; right: auto; margin-top: 68px; grid-template-columns: repeat(2, 1fr); }
  .metric-strip div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.13); }
  .metric-strip div:nth-child(4) { border-top: 1px solid rgba(255,255,255,.13); }
  .content-section, .conclusion { padding: 74px 24px; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
  .split-layout { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .analysis-code { display: block; }
  .analysis-code .finding, .analysis-code .comparison-finding { margin-top: 15px; }
  footer { padding: 24px; }
}

@media (max-width: 520px) {
  .topbar-actions { gap: 9px; }
  .topbar .powered-by span, .header-divider { display: none; }
  .text-link { font-size: 11px; }
  .hero { padding-top: 54px; }
  .hero-intro { font-size: 14px; }
  .hero-actions { display: grid; }
  .button { justify-content: center; }
  .metric-strip div { padding: 18px 12px 18px 0; }
  .metric-strip div + div { padding-left: 13px; }
  .section-heading h2, .conclusion h2 { font-size: 36px; }
  .content-section { padding-block: 64px; }
  .code-card pre { padding: 18px; font-size: 10px; }
  .analysis-grid .code-card pre { font-size: 9.5px; padding: 16px; }
  .chart-card img { padding-inline: 4px; }
  .comparison-finding { gap: 6px; padding: 13px 7px; }
  .comparison-finding strong { font-size: 17px; }
  .conclusion-actions { display: grid; gap: 17px; }
  footer { align-items: flex-start; gap: 16px; flex-direction: column; }
}

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