:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdfa;
  --surface-2: #ebe3d6;
  --ink: #161b1d;
  --muted: #626b70;
  --line: #ddd2c2;
  --accent: #0e665f;
  --accent-hover: #0a4e49;
  --accent-soft: #d9eeeb;
  --warn: #c25d2b;
  --shadow: 0 22px 54px -34px rgba(22, 27, 29, 0.48);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.88) 0, rgba(247, 244, 238, 0) 420px),
    repeating-linear-gradient(90deg, rgba(14, 102, 95, 0.045) 0 1px, transparent 1px 96px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-underline-offset: 3px; }

.page {
  min-height: 100vh;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.topbar-inner,
.hero,
.section,
.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.hero {
  padding-top: 34px;
  padding-bottom: 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1.28fr);
  gap: 28px;
  align-items: start;
}

.intro {
  padding-top: 22px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.94;
}

h2 {
  font-size: 26px;
  line-height: 1.15;
}

h3 {
  font-size: 17px;
}

.lede {
  margin: 22px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 19px;
}

.proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.proof div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.proof strong {
  display: block;
  font-size: 20px;
}

.proof span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.tool::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--warn));
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbf7ef;
}

.usage {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tool-body {
  padding: 18px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

button,
.button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button[aria-pressed="true"],
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

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

label {
  display: block;
  margin: 16px 0 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  padding: 13px;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.formula-input {
  display: none;
}

body[data-mode="explain"] .formula-input,
body[data-mode="fix"] .formula-input {
  display: block;
}

body[data-mode="explain"] .generate-input,
body[data-mode="fix"] .generate-input {
  display: none;
}

.run-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.result {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #f8f1e6;
  border-radius: 8px;
  overflow: hidden;
}

.result-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  word-break: break-word;
}

.result-copy {
  min-width: 72px;
}

.result-detail {
  padding: 14px;
}

.result-detail p {
  margin: 0 0 10px;
  color: var(--muted);
}

.result-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.paywall {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
}

.paywall p {
  margin: 6px 0 14px;
  color: var(--muted);
}

.section {
  padding-top: 20px;
  padding-bottom: 54px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 17px;
  min-height: 142px;
}

.mini p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.pricing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: stretch;
}

.pricing-copy,
.price-box {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 22px;
}

.price {
  font-size: 44px;
  font-weight: 900;
  margin: 12px 0 4px;
}

.footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: 32px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}

.plain {
  max-width: 760px;
  padding-top: 42px;
  padding-bottom: 64px;
}

.plain p,
.plain li {
  color: var(--muted);
}

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

  .intro {
    padding-top: 0;
  }

  h1 {
    max-width: 13ch;
  }

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

@media (max-width: 620px) {
  .topbar-inner,
  .hero,
  .section,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    gap: 8px;
    font-size: 13px;
  }

  .hero {
    padding-top: 28px;
  }

  .tool-head,
  .run-row,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

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