:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --paper-strong: #ece7db;
  --ink: #10151f;
  --muted: #62706f;
  --surface: #ffffff;
  --surface-soft: #f1f5f2;
  --line: #d8ded9;
  --teal: #0f766e;
  --green: #2f855a;
  --amber: #b7791f;
  --coral: #d95d39;
  --blue: #2563eb;
  --shadow: 0 24px 60px rgba(16, 21, 31, 0.13);
  --header-height: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10151f;
  --paper-strong: #162027;
  --ink: #f4f0e6;
  --muted: #a8b7b1;
  --surface: #182029;
  --surface-soft: #1f2a2c;
  --line: #344241;
  --teal: #41b3a7;
  --green: #69b982;
  --amber: #e0a43b;
  --coral: #f0724d;
  --blue: #70a7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.09), transparent 35%),
    linear-gradient(320deg, rgba(217, 93, 57, 0.08), transparent 38%),
    radial-gradient(circle at 50% 0%, rgba(183, 121, 31, 0.10), transparent 32%);
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  line-height: 1.72;
}

button,
input,
textarea {
  font: inherit;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--coral));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 0 32px;
  border-bottom: 1px solid rgba(216, 222, 217, 0.78);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line));
  border-radius: 8px;
  background: linear-gradient(145deg, var(--teal), var(--green));
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.main-nav a {
  min-width: 62px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  text-align: center;
  transition: background 180ms ease, color 180ms ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  background: var(--ink);
  color: var(--paper);
}

.header-actions {
  display: inline-flex;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.icon-button:hover,
.button:hover,
.case-tab:hover,
.template-chip:hover,
.flow-node:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
}

.nav-toggle {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(78vh - var(--header-height));
  align-items: end;
  overflow: hidden;
  background-image: var(--hero-image);
  background-position: center;
  background-size: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 13, 23, 0.90) 0%, rgba(8, 13, 23, 0.70) 36%, rgba(8, 13, 23, 0.26) 72%),
    linear-gradient(0deg, rgba(8, 13, 23, 0.68) 0%, transparent 46%);
}

.hero-content {
  position: relative;
  width: min(980px, calc(100% - 48px));
  padding: 86px 0 74px;
  margin: 0 auto;
  color: #fff;
}

.hero-content h1,
.page-hero h1 {
  max-width: 900px;
  margin: 10px 0 20px;
  font-size: 4.6rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-content .lede {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.86);
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #9be2d2;
}

.hero-actions,
.header-actions,
.template-picker,
.case-tabs {
  flex-wrap: wrap;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 740;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button.primary {
  border-color: color-mix(in srgb, var(--teal) 70%, #fff);
  background: linear-gradient(135deg, var(--teal), var(--green));
  color: #fff;
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  backdrop-filter: blur(10px);
}

.content-band,
.quote-band,
.page-hero,
.workflow-stage,
.case-lab,
.risk-tool,
.studio-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.content-band {
  padding: 92px 0;
}

.content-band.compact {
  padding-top: 24px;
}

.intro-band {
  padding-top: 74px;
}

.section-heading {
  max-width: 770px;
  margin-bottom: 30px;
}

.section-heading h2,
.quote-copy h2,
.stage-panel h2,
.case-panel h2,
.risk-meter h2,
.response-panel h2,
.split-layout h2 {
  margin: 8px 0 10px;
  font-size: 2.35rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p:last-child,
.quote-copy p,
.stage-panel p,
.case-panel p,
.risk-meter p,
.split-layout p {
  color: var(--muted);
}

.insight-grid,
.page-grid,
.audience-grid,
.control-grid,
.takeaway-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.insight-card,
.page-card,
.audience-card,
.control-card,
.takeaway-card {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: 0 16px 34px rgba(16, 21, 31, 0.06);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.page-card:hover,
.insight-card:hover,
.audience-card:hover,
.control-card:hover,
.takeaway-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--teal) 46%, var(--line));
  box-shadow: var(--shadow);
}

.metric {
  display: inline-flex;
  color: var(--amber);
  font-weight: 850;
}

.insight-card h3,
.page-card h3,
.audience-card h3,
.control-card h3,
.takeaway-card h3 {
  margin: 18px 0 8px;
  font-size: 1.2rem;
}

.insight-card p,
.page-card p,
.audience-card p,
.control-card p,
.takeaway-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.page-card,
.audience-card,
.control-card,
.takeaway-card {
  display: block;
}

.page-card svg,
.audience-card svg,
.control-card svg,
.takeaway-card svg {
  color: var(--teal);
}

.quote-band {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
  padding: 66px 0;
}

.quote-copy {
  padding: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
}

.quote-copy blockquote {
  max-width: 780px;
  margin: 16px 0 18px;
  font-size: 2.35rem;
  line-height: 1.12;
}

.quote-copy p {
  color: color-mix(in srgb, var(--paper) 72%, transparent);
}

.mini-dashboard {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.dash-row strong {
  color: var(--ink);
}

.dash-graph {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: end;
  min-height: 160px;
  margin-top: 16px;
}

.dash-graph span {
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--teal), var(--amber));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1160px, calc(100% - 48px));
  padding: 34px 0 48px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer a {
  color: var(--teal);
  font-weight: 760;
}

.page-hero {
  padding: 86px 0 44px;
}

.page-hero h1 {
  color: var(--ink);
}

.page-hero .lede {
  max-width: 790px;
}

.workflow-stage {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 22px;
  align-items: stretch;
  padding-bottom: 46px;
}

.flow-rail {
  display: grid;
  gap: 12px;
}

.flow-node,
.case-tab,
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 740;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.flow-node {
  justify-content: flex-start;
  min-height: 72px;
  padding: 0 20px;
  text-align: left;
}

.flow-node.is-active,
.case-tab.is-active,
.template-chip.is-active {
  border-color: color-mix(in srgb, var(--teal) 58%, var(--line));
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
  color: var(--teal);
}

.stage-panel,
.case-panel,
.risk-tool,
.studio-shell,
.code-window,
.system-map,
.impact-ticker,
.risk-matrix {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(16, 21, 31, 0.08);
}

.stage-panel {
  min-height: 420px;
  padding: 38px;
}

.check-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 26px 0 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
}

.check-list li::before {
  position: absolute;
  top: 0.28em;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--green);
  content: "";
}

.system-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 280px;
  padding: 28px;
  overflow: hidden;
}

.system-map::before {
  position: absolute;
  right: 10%;
  left: 10%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--amber), transparent);
  content: "";
}

.system-chip,
.system-core {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
  font-weight: 760;
}

.system-core {
  min-height: 150px;
  background: linear-gradient(145deg, var(--ink), #22322f);
  color: #fff;
}

.system-core span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
}

.split-layout {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 24px;
  align-items: center;
}

.code-window {
  overflow: hidden;
  background: #111820;
  color: #d7f6e7;
}

.window-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d95d39;
}

.window-bar span:nth-child(2) {
  background: #e0a43b;
}

.window-bar span:nth-child(3) {
  background: #41b3a7;
}

pre {
  margin: 0;
  padding: 26px;
  overflow-x: auto;
  font-size: 0.96rem;
  line-height: 1.7;
}

.case-lab {
  padding-bottom: 52px;
}

.case-tabs,
.template-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.case-tab,
.template-chip {
  min-height: 46px;
  padding: 0 14px;
}

.case-panel {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 24px;
  align-items: center;
  min-height: 330px;
  padding: 34px;
}

.output-strip {
  display: grid;
  gap: 12px;
}

.output-strip span {
  display: block;
  padding: 16px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 720;
}

.audience-grid,
.control-grid,
.takeaway-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control-grid,
.takeaway-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.impact-ticker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.impact-ticker div {
  min-height: 124px;
  padding: 24px;
  background: var(--surface);
}

.impact-ticker strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.38rem;
}

.impact-ticker span {
  color: var(--muted);
}

.risk-tool {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 28px;
  padding: 34px;
}

.risk-controls {
  display: grid;
  gap: 26px;
}

.risk-controls label {
  display: grid;
  gap: 12px;
  color: var(--ink);
  font-weight: 760;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.risk-meter {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.meter-ring {
  --risk-color: var(--amber);
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--surface) 56%, transparent 57%),
    conic-gradient(var(--risk-color) calc(var(--risk-value, 58) * 1%), color-mix(in srgb, var(--line) 76%, transparent) 0);
}

.meter-ring strong {
  font-size: 3.3rem;
  line-height: 0.9;
}

.meter-ring span {
  margin-top: -42px;
  color: var(--muted);
  font-weight: 760;
}

.risk-matrix {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 46px;
}

.matrix-cell {
  min-height: 130px;
  padding: 18px;
  border-radius: 8px;
  font-weight: 800;
}

.matrix-cell.low {
  background: color-mix(in srgb, var(--green) 15%, var(--surface));
  color: var(--green);
}

.matrix-cell.medium {
  background: color-mix(in srgb, var(--amber) 18%, var(--surface));
  color: var(--amber);
}

.matrix-cell.high {
  background: color-mix(in srgb, var(--coral) 18%, var(--surface));
  color: var(--coral);
}

.matrix-label {
  position: absolute;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
  text-transform: uppercase;
}

.matrix-label.top {
  top: 18px;
  left: 46px;
}

.matrix-label.side {
  right: 18px;
  bottom: 26px;
  transform: rotate(-90deg);
  transform-origin: right bottom;
}

.studio-shell {
  padding: 30px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.prompt-form,
.response-panel {
  display: grid;
  gap: 14px;
}

.prompt-form label {
  color: var(--muted);
  font-weight: 780;
}

textarea {
  width: 100%;
  min-height: 260px;
  padding: 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
}

textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--teal) 35%, transparent);
  outline-offset: 3px;
}

.response-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.response-list {
  display: grid;
  gap: 10px;
}

.response-list p {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.confidence-row {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 760;
}

.confidence-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.confidence-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green), var(--amber));
  transition: width 260ms ease;
}

.not-found {
  display: grid;
  width: min(680px, calc(100% - 48px));
  min-height: 100vh;
  place-content: center;
  gap: 16px;
  margin: 0 auto;
}

.not-found h1 {
  margin: 0;
  font-size: 3.6rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 18px;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    right: 18px;
    display: none;
    width: min(280px, calc(100vw - 36px));
    padding: 10px;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: grid;
  }

  .main-nav a {
    width: 100%;
    text-align: left;
  }

  .brand span:last-child {
    display: none;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: 3.2rem;
  }

  .insight-grid,
  .page-grid,
  .audience-grid,
  .control-grid,
  .takeaway-grid,
  .impact-ticker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-band,
  .workflow-stage,
  .split-layout,
  .case-panel,
  .risk-tool,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .system-map {
    grid-template-columns: 1fr;
  }

  .system-map::before {
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, transparent, var(--teal), var(--amber), transparent);
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 66px;
  }

  .site-header {
    padding: 0 14px;
  }

  .content-band,
  .quote-band,
  .page-hero,
  .workflow-stage,
  .case-lab,
  .risk-tool,
  .studio-shell,
  .site-footer {
    width: min(100% - 28px, 1160px);
  }

  .hero {
    min-height: calc(74vh - var(--header-height));
  }

  .hero-content {
    width: min(100% - 28px, 980px);
    padding: 64px 0 48px;
  }

  .hero-content h1,
  .page-hero h1 {
    font-size: 2.45rem;
    line-height: 1.02;
  }

  .lede {
    font-size: 1.02rem;
  }

  .section-heading h2,
  .quote-copy h2,
  .stage-panel h2,
  .case-panel h2,
  .risk-meter h2,
  .response-panel h2,
  .split-layout h2 {
    font-size: 1.78rem;
  }

  .content-band {
    padding: 64px 0;
  }

  .page-hero {
    padding: 58px 0 34px;
  }

  .insight-grid,
  .page-grid,
  .audience-grid,
  .control-grid,
  .takeaway-grid,
  .impact-ticker {
    grid-template-columns: 1fr;
  }

  .quote-copy,
  .stage-panel,
  .case-panel,
  .risk-tool,
  .studio-shell {
    padding: 22px;
  }

  .quote-copy blockquote {
    font-size: 1.76rem;
  }

  .site-footer {
    display: grid;
  }

  .meter-ring {
    width: 160px;
    height: 160px;
  }

  .risk-matrix {
    padding: 40px 18px 18px;
  }

  .matrix-label.side {
    display: none;
  }
}
