:root {
  color-scheme: light dark;
  --bg: #f3f0e8;
  --surface: #fbfaf6;
  --surface-strong: #fffdf8;
  --text: #23211d;
  --muted: #6f6a60;
  --line: #ded7ca;
  --accent: #b5532d;
  --accent-strong: #7f341d;
  --accent-soft: #f0d1be;
  --radius: 18px;
  --shadow: 0 24px 70px rgb(76 55 33 / 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --surface: #211f1a;
    --surface-strong: #2b2721;
    --text: #f0eadf;
    --muted: #b8ad9d;
    --line: #423b32;
    --accent: #d77549;
    --accent-strong: #f0a174;
    --accent-soft: #4d2b1f;
    --shadow: 0 24px 70px rgb(0 0 0 / 0.32);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgb(181 83 45 / 0.14), transparent 28rem),
    linear-gradient(135deg, var(--bg), var(--surface));
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 10%);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.field small,
.check-list small,
.copy-feedback {
  color: var(--muted);
  font-size: 13px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  transition: background 180ms ease, color 180ms ease;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.hero {
  display: grid;
  min-height: calc(100dvh - 108px);
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.68fr);
  align-items: center;
  gap: 42px;
  padding: 68px 10px 44px;
}

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

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 9em;
  margin-bottom: 22px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-text {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 720;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

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

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

.button.secondary {
  background: var(--surface-strong);
  color: var(--text);
}

.button.full {
  width: 100%;
}

.run-panel,
.config-card,
.check-card,
.command-card,
.tree-card,
.notes-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong), transparent 6%);
  box-shadow: var(--shadow);
}

.run-panel {
  padding: 24px;
  transform: translateY(24px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.panel-head strong {
  color: var(--text);
}

.progress-rail {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.progress-rail span {
  display: block;
  width: var(--w);
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

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

.quick-stats div {
  min-width: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft), transparent 35%);
  padding: 14px;
}

.quick-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.quick-stats dd {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 780;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 20px;
  padding: 16px 0 72px;
}

.config-card,
.check-card,
.command-card,
.notes-card {
  padding: 24px;
}

.section-heading h2 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.04;
  letter-spacing: 0;
}

.section-heading.compact h2 {
  font-size: 25px;
}

.field,
.field-grid {
  display: grid;
  gap: 10px;
}

.field {
  margin-bottom: 18px;
}

.field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 76%);
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 6px 0 22px;
}

.switch-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0 12px;
  font-weight: 700;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-field span {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line);
  transition: background 160ms ease;
}

.switch-field span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-strong);
  content: "";
  transition: transform 160ms ease;
}

.switch-field input:checked + span {
  background: var(--accent);
}

.switch-field input:checked + span::after {
  transform: translateX(18px);
}

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

.side-stack {
  display: grid;
  gap: 20px;
}

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

.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
}

.check-index {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

pre {
  overflow: auto;
  margin: 0 0 16px;
  border-radius: 14px;
  background: #242019;
  color: #f8efe4;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
}

.copy-feedback {
  min-height: 18px;
  margin: 10px 0 0;
}

.output-section {
  padding: 20px 0 76px;
}

.output-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 20px;
}

.tree-card {
  padding: 14px;
}

.tree-card pre {
  min-height: 100%;
  margin: 0;
}

.notes-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .run-panel,
  .config-card,
  .side-stack,
  .output-section {
    animation: enter 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .run-panel {
    animation-delay: 90ms;
  }

  .config-card {
    animation-delay: 150ms;
  }

  .side-stack {
    animation-delay: 210ms;
  }

  .output-section {
    animation-delay: 260ms;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero,
  .workspace,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 44px;
  }

  h1 {
    max-width: 13ch;
    font-size: clamp(42px, 13vw, 68px);
  }

  .run-panel {
    transform: none;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-links {
    display: none;
  }

  h1 {
    max-width: 4.8em;
    font-size: clamp(42px, 13vw, 54px);
  }

  .hero-text {
    max-width: 19em;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .workspace,
  .output-section {
    padding-left: 0;
    padding-right: 0;
  }

  .field-grid,
  .toggle-row,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .config-card,
  .check-card,
  .command-card,
  .notes-card {
    padding: 18px;
  }
}
