:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #ece6dc;
  --surface: #fbf8f2;
  --surface-strong: #fffdf8;
  --ink: #20211e;
  --ink-soft: #363732;
  --muted: #686861;
  --line: #d7d0c4;
  --line-strong: #bdb4a7;
  --copper: #a65f3f;
  --copper-dark: #7b412b;
  --green: #5d7265;
  --green-soft: #dfe7df;
  --shadow: 0 18px 48px rgba(54, 45, 34, 0.09);
  font: 100%/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 4%, rgba(166, 95, 63, 0.09), transparent 24rem),
    linear-gradient(180deg, var(--paper) 0%, #f7f4ed 52%, var(--paper) 100%);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  color: var(--surface-strong);
  background: var(--ink);
}

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

.site-header,
.shell,
footer {
  width: min(72rem, calc(100vw - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid rgba(123, 65, 43, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(123, 65, 43, 0.28);
  border-radius: 50%;
  color: var(--copper-dark);
  background: rgba(255, 253, 248, 0.62);
  font-weight: 700;
}

.site-header nav,
footer div {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-header nav a,
footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 650;
}

.site-header nav a:hover,
footer a:hover {
  color: var(--copper-dark);
}

.shell {
  padding-block: clamp(3.75rem, 8vw, 7rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.65fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.hero-main {
  max-width: 48rem;
}

.eyebrow {
  margin: 0;
  color: var(--copper-dark);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-optical-sizing: auto;
}

h1 {
  margin: 0.8rem 0 1.25rem;
  max-width: 44rem;
  font-size: clamp(3rem, 6.8vw, 6.25rem);
  line-height: 0.94;
  letter-spacing: -0.062em;
  font-weight: 710;
}

h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 690;
}

h3 {
  margin: 0.55rem 0 0.55rem;
  font-size: 1.05rem;
  letter-spacing: -0.018em;
}

.hero-copy {
  margin: 0;
  max-width: 45rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  line-height: 1.72;
}

.hero-copy-zh {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.65rem;
}

.button,
button,
.sample-link {
  min-height: 2.75rem;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform 120ms ease-out, color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1rem;
  text-decoration: none;
}

.primary,
.primary-action {
  border: 1px solid var(--ink);
  color: var(--surface-strong);
  background: var(--ink);
}

.secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.56);
}

.button:hover,
button:hover,
.sample-link:hover {
  border-color: var(--copper);
}

.button:active,
button:active,
.sample-link:active {
  transform: scale(0.98);
  transition-duration: 70ms;
}

.principle-card {
  padding: 1.35rem;
  border-top: 3px solid var(--copper);
  background: rgba(255, 253, 248, 0.54);
  box-shadow: var(--shadow);
}

.principle-card blockquote {
  margin: 0.75rem 0 1.4rem;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.035em;
  font-weight: 650;
}

.principle-card dl {
  margin: 0;
}

.principle-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.62rem;
  border-top: 1px solid var(--line);
}

.principle-card dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.principle-card dd {
  margin: 0;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: clamp(3.5rem, 7vw, 6rem) 0 0;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.pipeline li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  padding: 1.15rem 1rem;
  border-right: 1px solid var(--line);
}

.pipeline li:last-child {
  border-right: 0;
}

.pipeline span {
  grid-row: 1 / span 2;
  color: var(--copper);
  font-size: 0.7rem;
  font-weight: 780;
}

.pipeline strong {
  font-size: 0.87rem;
}

.pipeline small {
  color: var(--muted);
  font-size: 0.74rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.35rem;
  padding: 0.85rem 1rem;
  color: var(--muted);
  background: rgba(223, 231, 223, 0.54);
  font-size: 0.78rem;
  font-weight: 650;
}

.trust-strip span,
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.trust-strip i,
.status i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--green);
}

.demo-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.7fr);
  gap: 2rem;
  align-items: end;
  margin-top: clamp(4rem, 8vw, 7rem);
}

.demo-intro > p,
.panel-heading > p,
.method-heading + .cards p {
  color: var(--muted);
}

.demo-intro > p {
  margin: 0;
  max-width: 36rem;
  line-height: 1.72;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(19rem, 0.88fr) minmax(22rem, 1.12fr);
  gap: 1rem;
  align-items: stretch;
  margin-top: 1.6rem;
  scroll-margin-top: 1.5rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(251, 248, 242, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(115%);
}

.panel-heading > p:last-child {
  margin: 0.65rem 0 1.3rem;
  font-size: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.42rem;
  margin: 0.9rem 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0.72rem;
  padding: 0.72rem 0.8rem;
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.55;
}

input:hover,
textarea:hover {
  border-color: #9e9588;
}

:focus-visible {
  outline: 3px solid rgba(166, 95, 63, 0.28);
  outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible {
  border-color: var(--copper);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(166, 95, 63, 0.16);
}

button {
  border: 1px solid var(--line-strong);
  padding: 0.67rem 0.9rem;
  color: var(--ink-soft);
  background: var(--surface-strong);
}

.primary-action {
  width: 100%;
  margin-top: 0.4rem;
}

.fineprint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.output-panel {
  background: rgba(255, 253, 248, 0.86);
}

.output-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.status {
  flex: 0 0 auto;
  margin-top: 0.1rem;
  padding: 0.35rem 0.58rem;
  border: 1px solid #c8d4ca;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.report {
  min-height: 25rem;
  margin-top: 1.3rem;
  border-top: 1px solid var(--line-strong);
}

.report-lead {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.report-lead p {
  margin: 0;
  color: var(--copper-dark);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.report-lead h3 {
  max-width: 35rem;
  margin-top: 0.45rem;
  font-size: 1.25rem;
  line-height: 1.35;
}

.report dl {
  margin: 0;
}

.report dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.36fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.report dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 690;
}

.report dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.report-boundary {
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border-left: 3px solid var(--green);
  color: var(--green);
  background: rgba(223, 231, 223, 0.5);
  font-size: 0.78rem;
  font-weight: 650;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.sample-link {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.8rem;
  color: var(--copper-dark);
  text-decoration: none;
}

.action-status {
  min-height: 1.35rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.action-status[data-tone="success"] {
  color: var(--green);
}

.action-status[data-tone="error"] {
  color: #8f3c35;
}

.method {
  margin-top: clamp(4.5rem, 9vw, 8rem);
  scroll-margin-top: 1.5rem;
}

.method-heading {
  max-width: 43rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.7rem;
}

.cards article {
  min-height: 14rem;
  padding: 1.3rem;
  border-top: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, 0.42);
}

.cards p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.68;
}

.card-index {
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 780;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.5rem 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer p {
  margin: 0;
  font-size: 0.75rem;
}

@media (max-width: 54rem) {
  .hero,
  .demo-intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  .principle-card {
    max-width: 32rem;
  }

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

  .pipeline li:nth-child(2) {
    border-right: 0;
  }

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

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

  .cards article {
    min-height: 0;
  }
}

@media (max-width: 38rem) {
  .site-header nav a:first-child {
    display: none;
  }

  .shell {
    padding-top: 3.5rem;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.2rem);
  }

  .field-row,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .pipeline li,
  .pipeline li:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pipeline li:last-child {
    border-bottom: 0;
  }

  .report dl div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .actions button,
  .sample-link {
    width: 100%;
    justify-content: center;
  }

  footer {
    display: grid;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .panel {
    background: var(--surface);
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #8f887d;
    --line-strong: #4d4943;
  }

  .panel,
  .principle-card {
    background: var(--surface-strong);
  }
}
