:root {
  color-scheme: light;
  --ink: #112d30;
  --ink-soft: #395154;
  --paper: #f4efe5;
  --panel: #fffdf8;
  --line: #d7d0c2;
  --line-dark: #9da8a5;
  --orange: #c94b1c;
  --orange-dark: #b63e15;
  --teal: #0a716d;
  --teal-light: #d7ebe6;
  --danger: #b7352c;
  --danger-light: #fae5df;
  --shadow: 0 18px 50px rgba(17, 45, 48, 0.09);
  --radius: 18px;
  font-family: "Segoe UI", Aptos, system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17, 45, 48, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 45, 48, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid #ffb18d;
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid rgba(17, 45, 48, 0.14);
  background: rgba(244, 239, 229, 0.92);
}

.header-inner,
.footer-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.brand svg {
  width: 36px;
  height: 36px;
}

.release-mark,
.format-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signal-dot {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(10, 113, 109, 0.14);
}

.hero {
  min-height: 670px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  align-items: center;
  gap: clamp(42px, 7vw, 100px);
  padding-block: 80px 96px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange-dark);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 720px;
  margin-bottom: 24px;
  font-size: clamp(3.25rem, 7vw, 6.7rem);
  line-height: 0.93;
}

.hero-lede {
  max-width: 630px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange-dark);
  box-shadow: 0 8px 0 #a93812;
}

.button-primary:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #a93812;
}

.button-secondary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.button-quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-dark);
}

.button-wide {
  width: 100%;
  margin-top: 18px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 34px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  list-style: none;
}

.trust-row li::before {
  content: "✓";
  margin-right: 7px;
  color: var(--teal);
  font-weight: 800;
}

.hero-diagram {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid #071b1d;
  border-radius: 28px 28px 28px 6px;
  box-shadow: 24px 24px 0 rgba(10, 113, 109, 0.12), var(--shadow);
}

.hero-diagram figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 0;
  color: #f7f1e5;
}

.hero-diagram figcaption span {
  color: #9dcac2;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.hero-diagram figcaption strong {
  font-size: 0.9rem;
}

.hero-diagram > svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-grid path {
  fill: none;
  stroke: rgba(247, 241, 229, 0.16);
  stroke-width: 1;
}

.diagram-fan,
.diagram-system {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.diagram-fan {
  stroke: #69c5ba;
}

.diagram-system {
  stroke: #ef6a32;
}

.diagram-point-ring {
  fill: rgba(247, 241, 229, 0.13);
  stroke: #f7f1e5;
  stroke-width: 1;
}

.diagram-point {
  fill: #f7f1e5;
}

.diagram-guide {
  fill: none;
  stroke: rgba(247, 241, 229, 0.45);
  stroke-dasharray: 5 6;
}

.diagram-labels {
  fill: #dce7e2;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
}

.diagram-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  color: #dce7e2;
  background: #0a2427;
  border-top: 1px solid rgba(247, 241, 229, 0.12);
  font-size: 0.78rem;
  line-height: 1.4;
}

.diagram-note span,
.step-number {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.diagram-note span {
  color: #ff8d5e;
}

.step-number {
  color: var(--orange);
}

.workbench {
  padding-block: 74px 110px;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 430px);
  align-items: end;
  gap: 36px;
  margin-bottom: 32px;
}

.section-heading h2,
.method-grid h2 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  line-height: 1;
}

.section-heading > p {
  margin-bottom: 6px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.38fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 18px;
}

.panel-heading,
.panel-heading > div,
.route-overview,
.curve-heading,
.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading > div {
  justify-content: flex-start;
}

.panel-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
}

.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0 18px;
}

.editor-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.editor-label span,
.field-hint {
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-weight: 400;
}

#project-editor {
  width: 100%;
  min-height: 450px;
  resize: vertical;
  padding: 16px;
  color: #deebe7;
  background: #102c2f;
  border: 1px solid #071b1d;
  border-radius: 10px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  tab-size: 2;
}

.field-hint {
  margin: 9px 0 0;
  line-height: 1.5;
}

.input-status {
  min-height: 20px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.input-status.error {
  color: var(--danger);
  font-weight: 700;
}

.summary-badge,
.route-verdict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: #ebe7dd;
  border-radius: 999px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-badge.pass,
.route-verdict.pass {
  color: #075550;
  background: var(--teal-light);
}

.summary-badge.fail,
.route-verdict.fail {
  color: #852920;
  background: var(--danger-light);
}

.summary-copy {
  margin: 22px 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.route-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.route-tabs:empty {
  display: none;
}

.route-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
}

.route-tab[aria-selected="true"] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.route-detail {
  padding-top: 24px;
}

.route-overview {
  align-items: flex-start;
}

.route-overview h4 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
}

.route-constraint {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.metric {
  min-width: 0;
  padding: 15px;
  background: #f2eee6;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.metric dt {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric dd {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 800;
}

.metric dd span {
  color: var(--ink-soft);
  font-size: 0.7em;
  font-weight: 500;
}

.curve-card {
  padding: 18px;
  background: #112d30;
  border-radius: 13px;
}

.curve-heading h5 {
  margin: 0;
  color: #f7f1e5;
  font-size: 0.88rem;
}

.legend {
  display: flex;
  gap: 13px;
  color: #c6d5d0;
  font-size: 0.7rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 17px;
  height: 3px;
  display: inline-block;
  border-radius: 2px;
}

.legend-fan {
  background: #6dd0c4;
}

.legend-system {
  background: #ff7841;
}

.curve-plot svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.route-issues {
  margin-top: 18px;
  padding: 14px 16px;
  color: #7f271f;
  background: var(--danger-light);
  border: 1px solid #e9b7ae;
  border-radius: 10px;
  font-size: 0.82rem;
}

.route-issues strong {
  display: block;
  margin-bottom: 6px;
}

.route-issues ul {
  margin: 0;
  padding-left: 20px;
}

.segment-table-wrap {
  overflow-x: auto;
  margin-top: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

caption {
  margin-bottom: 10px;
  text-align: left;
  font-weight: 800;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
  white-space: normal;
}

th {
  color: var(--ink-soft);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.download-row {
  justify-content: flex-end;
  margin-top: 24px;
}

.method-band {
  color: #f7f1e5;
  background: var(--ink);
}

.method-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  padding-block: 90px;
}

.method-grid .eyebrow {
  color: #ff9a70;
}

.method-grid ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: rgba(247, 241, 229, 0.15);
  list-style: none;
}

.method-grid li {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  color: #d9e5e0;
  background: var(--ink);
  line-height: 1.45;
}

.method-grid li span {
  color: #ff8d5e;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.7rem;
}

.site-footer {
  background: #091e20;
  color: #d9e5e0;
  border-top: 1px solid rgba(247, 241, 229, 0.1);
}

.footer-inner {
  min-height: 98px;
}

.footer-inner strong {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.footer-inner p {
  max-width: 620px;
  margin: 0;
  text-align: right;
  font-size: 0.76rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-diagram {
    width: min(700px, 100%);
  }

  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  #project-editor {
    min-height: 360px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-block: 58px 72px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .section-heading,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 14px;
  }

  .method-grid {
    gap: 42px;
  }

  .panel {
    padding: 20px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .metric dt {
    margin: 0;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 24px;
  }

  .footer-inner p {
    text-align: left;
  }
}

@media (max-width: 470px) {
  .release-mark {
    font-size: 0;
  }

  .signal-dot {
    width: 10px;
    height: 10px;
  }

  .hero-diagram figcaption {
    align-items: flex-start;
    flex-direction: column;
  }

  .method-grid ol {
    grid-template-columns: 1fr;
  }

  .method-grid li {
    min-height: 100px;
  }

  .panel-heading.result-heading,
  .route-overview,
  .download-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-row .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }
}
