:root {
  color-scheme: light dark;
  --page: #eef0ee;
  --surface: #f8f9f7;
  --surface-raised: #ffffff;
  --ink: #202326;
  --muted: #62686c;
  --faint: #858c90;
  --line: #cdd1cf;
  --line-strong: #aeb4b1;
  --accent: #b94f24;
  --accent-strong: #8f3514;
  --accent-soft: #f0d7ca;
  --success: #2e6b4d;
  --danger: #a33131;
  --warning: #8a5b16;
  --diagram: #171a1d;
  --diagram-line: #3b4146;
  --radius: 12px;
  --shadow: 0 18px 55px rgb(40 49 45 / 0.1);
  font-family: "Segoe UI Variable", "Aptos", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111315;
    --surface: #171a1d;
    --surface-raised: #1e2225;
    --ink: #eef0ef;
    --muted: #adb4b7;
    --faint: #858d91;
    --line: #353b3f;
    --line-strong: #50575c;
    --accent: #e47843;
    --accent-strong: #f18d59;
    --accent-soft: #43291e;
    --success: #75c39c;
    --danger: #ff9189;
    --warning: #e6b160;
    --shadow: 0 20px 65px rgb(0 0 0 / 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgb(91 101 96 / 0.045) 50%, transparent 50.1%),
    var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

button,
textarea,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 10;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
}

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

.site-nav,
main,
footer {
  width: min(1400px, calc(100% - 48px));
  margin-inline: auto;
}

.site-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font: 800 11px/1 ui-monospace, "Cascadia Code", monospace;
}

.site-nav nav,
footer > div:last-child {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav nav a,
footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.site-nav nav a:hover,
footer a:hover,
.text-link:hover {
  color: var(--accent);
}

.hero {
  min-height: calc(100dvh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(540px, 1.18fr);
  align-items: center;
  gap: clamp(42px, 7vw, 108px);
  padding-block: clamp(54px, 8vh, 88px);
}

.hero-copy {
  align-self: center;
  max-width: 620px;
}

.eyebrow,
.panel-label,
.visual-head span {
  color: var(--accent);
  font: 760 11px/1.2 ui-monospace, "Cascadia Code", monospace;
  letter-spacing: 0.14em;
}

.eyebrow {
  margin: 0 0 20px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 690px;
  font-size: clamp(46px, 5.4vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 730;
}

.hero-summary {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
}

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

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--accent);
  color: #fff9f5;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--accent);
}

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

.hero-visual {
  align-self: center;
  min-width: 0;
  border: 1px solid var(--diagram-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--diagram);
  color: #eef1f2;
  box-shadow: var(--shadow);
}

.visual-head,
.visual-foot {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
}

.visual-head {
  border-bottom: 1px solid var(--diagram-line);
}

.visual-head strong {
  color: #f08a56;
  font: 800 12px/1 ui-monospace, "Cascadia Code", monospace;
}

.visual-head strong.fail {
  color: #ff9189;
}

.visual-foot {
  border-top: 1px solid var(--diagram-line);
  color: #aeb5ba;
  font: 600 11px/1 ui-monospace, "Cascadia Code", monospace;
}

.hero-diagram {
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-diagram svg {
  width: 112%;
  margin-inline: -6%;
}

.loading-state,
.empty-state {
  color: var(--faint);
  text-align: center;
}

.problem-strip {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1.15fr 0.85fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.problem-strip article {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.problem-strip article:nth-child(2) {
  background: var(--accent-soft);
}

.problem-strip article:last-child {
  border-right: 0;
  background: var(--surface);
}

.problem-strip strong {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.problem-strip span {
  color: var(--muted);
  font-size: 14px;
}

.workbench {
  padding-block: clamp(88px, 12vw, 160px);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 38px;
}

.section-heading h2,
.how-it-works h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.section-heading p,
.method-copy p {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(380px, 0.8fr) minmax(0, 1.2fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.editor-panel,
.result-panel {
  min-width: 0;
  padding: clamp(20px, 3vw, 34px);
}

.editor-panel {
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.panel-head,
.result-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-head > div,
.result-summary > div {
  display: grid;
  gap: 7px;
}

.panel-head strong {
  font-size: 16px;
}

.file-control {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.sample-controls {
  display: flex;
  gap: 8px;
  margin: 22px 0 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sample-controls button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.sample-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.editor-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

textarea {
  width: 100%;
  min-height: 560px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  padding: 16px;
  font: 12px/1.6 ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  tab-size: 2;
}

textarea::placeholder {
  color: var(--faint);
}

.result-summary h3 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.status {
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 7px 9px;
  font: 800 12px/1 ui-monospace, "Cascadia Code", monospace;
}

.status.pass {
  color: var(--success);
}

.status.fail {
  color: var(--danger);
}

.status.neutral {
  color: var(--muted);
}

.result-copy {
  margin: 16px 0 24px;
  color: var(--muted);
}

.diagram {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px solid var(--diagram-line);
  border-radius: 10px;
  overflow: auto;
  background: var(--diagram);
}

.diagram svg {
  min-width: 720px;
}

.diagnostics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.diagnostic {
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  padding: 12px 14px;
}

.diagnostic.error {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.diagnostic strong {
  display: block;
  font: 750 11px/1.3 ui-monospace, "Cascadia Code", monospace;
}

.diagnostic p,
.diagnostic small {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.capacity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.capacity-item {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  background: var(--surface);
  padding: 12px;
}

.capacity-item strong {
  font-size: 13px;
}

.capacity-item span {
  color: var(--muted);
  font: 650 11px/1.4 ui-monospace, "Cascadia Code", monospace;
}

.how-it-works {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(48px, 9vw, 150px);
  padding-bottom: clamp(90px, 12vw, 160px);
}

.text-link {
  display: inline-block;
  margin-top: 26px;
  color: var(--accent);
  font-weight: 750;
  text-underline-offset: 4px;
}

.method-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-list li {
  counter-increment: method;
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.method-list li::before {
  content: "0" counter(method);
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--accent);
  font: 750 13px/1.4 ui-monospace, "Cascadia Code", monospace;
}

.method-list strong {
  grid-column: 2;
  font-size: 24px;
}

.method-list span {
  grid-column: 2;
  color: var(--muted);
}

footer {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line);
}

footer > div:first-child {
  display: grid;
  gap: 5px;
}

footer span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 48px;
    padding-block: 72px;
  }

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

  .hero-visual {
    width: 100%;
  }

  .problem-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .problem-strip article:nth-child(2) {
    border-right: 0;
  }

  .problem-strip article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .tool-shell {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .site-nav,
  main,
  footer {
    width: min(100% - 28px, 1400px);
  }

  .site-nav nav {
    gap: 16px;
  }

  .site-nav nav a:nth-child(2) {
    display: none;
  }

  .hero {
    padding-block: 52px 64px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-summary {
    font-size: 17px;
  }

  .hero-actions,
  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-diagram {
    min-height: 270px;
  }

  .problem-strip {
    grid-template-columns: 1fr;
  }

  .problem-strip article {
    min-height: 130px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .problem-strip article:last-child {
    border-bottom: 0;
  }

  .panel-head,
  .result-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .file-control {
    justify-content: center;
  }

  textarea {
    min-height: 430px;
  }

  .diagnostics,
  .capacity-grid {
    grid-template-columns: 1fr;
  }

  .how-it-works {
    grid-template-columns: 1fr;
  }

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

  footer > div:last-child {
    flex-wrap: wrap;
    gap: 14px 22px;
  }
}

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

  .button {
    transition: none;
  }
}
