main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 32px clamp(32px, 5vw, 72px);
  align-items: end;
  padding: clamp(28px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.lede {
  margin: 0;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.6;
}

.hero-install {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.install code {
  flex: 1;
  min-width: 0;
  padding: 0;
  overflow-x: auto;
  background: none;
  white-space: nowrap;
  font-size: 14.5px;
  color: var(--ink);
  scrollbar-width: none;
}

.prompt {
  color: var(--ink-3);
  user-select: none;
}

.hero-install .code {
  font-size: 12.5px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 14px;
}

/* Demo form */

.demo {
  scroll-margin-top: 16px;
  padding-bottom: 24px;
}

.reader {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.field {
  position: relative;
  flex: 1 1 380px;
}

.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.4;
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 500 17px var(--sans);
  caret-color: var(--accent);
  box-shadow: 0 1px 2px rgba(22, 19, 15, 0.04);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.field input::placeholder {
  color: #756c60;
  font-weight: 400;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 98, 0, 0.16);
}

.segmented {
  display: flex;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
}

.segmented label {
  position: relative;
  display: flex;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.segmented label:hover span {
  color: var(--ink);
}

.segmented input:checked + span {
  background: var(--ink);
  color: #fff;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.segmented.small {
  padding: 3px;
  border-radius: 10px;
}

.segmented.small span {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
}

.primary {
  position: relative;
  min-width: 136px;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--ink);
  font: 600 16px var(--sans);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 19, 15, 0.18), 0 6px 14px -8px rgba(22, 19, 15, 0.35);
  transition: background-color 160ms ease-out, transform 120ms ease-out;
}

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

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

.primary:disabled {
  cursor: progress;
}

.primary .spinner {
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid rgba(22, 19, 15, 0.25);
  border-top-color: var(--ink);
  border-radius: 50%;
  opacity: 0;
}

.primary.busy .label {
  opacity: 0;
}

.primary.busy .spinner {
  opacity: 1;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 14px;
}

.examples button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--sans);
  cursor: pointer;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.examples button:hover {
  border-color: var(--line-strong);
  background: #fffdfa;
}

.examples em {
  color: var(--ink-3);
  font-style: normal;
  font-weight: 400;
}

.paste-wrap {
  margin-top: 12px;
  font-size: 14px;
}

.paste-wrap summary {
  display: inline-block;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.paste-wrap summary::-webkit-details-marker {
  display: none;
}

.paste {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 12px;
  align-items: end;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.paste label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-weight: 500;
}

.paste em {
  color: var(--ink-3);
  font-style: normal;
  font-weight: 400;
}

.paste-html {
  grid-row: span 2;
}

.paste textarea,
.paste input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 13px/1.5 var(--mono);
}

.paste textarea {
  resize: vertical;
  min-height: 132px;
}

.paste textarea:focus,
.paste input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 98, 0, 0.16);
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  min-height: 26px;
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

.notice {
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid #f3c9a6;
  border-radius: 12px;
  background: var(--accent-wash);
  color: #6b2c00;
  font-size: 15px;
}

/* Results */

.results {
  margin-top: 16px;
  scroll-margin-top: 16px;
}

.summary {
  margin-bottom: 14px;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.page-meta {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.results[data-device='phone'] .workbench {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.pane-head h3 {
  margin: 0 auto 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stats {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.outline-pane .stats {
  flex-basis: 100%;
}

.stage-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--paper-2);
  overflow: hidden;
}

.results[data-device='phone'] .stage-wrap {
  padding: 16px 0;
}

.stage {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.results[data-device='phone'] .stage {
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 12px 30px -16px rgba(22, 19, 15, 0.35);
}

.stage iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}

.results.loading .stage iframe,
.results.loading .outline {
  opacity: 0.45;
  transition: opacity 200ms ease-out;
}

.pane-foot {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  margin: 0;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.swatch {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--added);
  box-shadow: inset 0 0 0 1px #f5c79f;
}

/* The preview sets the row height; the outline scrolls within it. */
.outline-pane {
  min-height: 0;
}

.outline {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 10px 0;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.outline .line {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 16px 0 calc(16px + var(--indent, 0ch));
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.outline button.line {
  cursor: pointer;
}

.outline button.line:hover {
  background: #faf6f0;
}

.outline .added,
.outline button.added:hover {
  background: var(--added);
}

.outline button.line:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 0;
}

.outline .flash {
  animation: flash 1.6s ease-out;
}

@keyframes flash {
  0%,
  30% {
    background: #ffd9b8;
  }
}

.how {
  max-width: 82ch;
  margin: 16px 0 0;
  color: var(--ink-3);
  font-size: 14px;
}

.how strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* Sections */

.section {
  padding: clamp(56px, 8vw, 104px) 0 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 650;
}

.section-head p {
  margin: 0;
  max-width: 66ch;
  color: var(--ink-2);
  font-size: 17px;
}

.features {
  border-bottom: 1px solid var(--line);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px clamp(24px, 5vw, 64px);
  align-items: start;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.feature p {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-2);
}

.snippet,
.snippet [data-outline] {
  margin: 0;
}

pre.snippet,
.snippet [data-outline] {
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

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

.snippet figure {
  min-width: 0;
  margin: 0;
}

.snippet figcaption {
  margin: 0 0 6px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.table-snippet table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.table-snippet caption {
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.table-snippet th,
.table-snippet td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.table-snippet th {
  background: var(--paper);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.table-snippet tr > :first-child {
  text-align: left;
}

.table-snippet tbody tr:last-child td {
  border-bottom: 0;
}

/* Evidence */

.compare {
  width: 100%;
  max-width: 860px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.compare th,
.compare td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.compare thead th {
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
}

.compare tbody th {
  font-weight: 600;
}

.compare td {
  color: var(--ink-2);
  font-size: 17px;
}

.compare .with {
  background: var(--accent-wash);
}

.compare .with td {
  color: var(--ink);
}

.compare strong {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* Quick start */

.start-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px clamp(24px, 5vw, 64px);
  align-items: start;
}

.steps {
  display: grid;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 44px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: 600 13px var(--mono);
}

.steps h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

.section-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 32px 0 0;
}

/* Bookmarklet */

.bookmarklet-section {
  padding-bottom: clamp(56px, 8vw, 104px);
}

.bookmarklet-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.bookmarklet {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: grab;
  box-shadow: 0 8px 18px -10px rgba(22, 19, 15, 0.6);
  transition: transform 160ms ease-out;
}

.bookmarklet:hover {
  color: #fff;
  transform: translateY(-1px);
}

.bookmarklet:active {
  cursor: grabbing;
}

.bookmarklet .mark {
  width: 24px;
  height: 24px;
}

.bookmarklet-row p {
  flex: 1 1 320px;
  margin: 0;
  color: var(--ink-2);
}

/* Narrower screens */

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-install {
    max-width: 720px;
  }

  .workbench,
  .results[data-device='phone'] .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .outline {
    height: min(70vh, 640px);
    flex: none;
  }

  .feature,
  .start-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .reader .primary {
    flex: 1 1 100%;
  }

  .reader .segmented {
    flex: 1 1 auto;
  }

  .reader .segmented label {
    flex: 1;
  }

  .reader .segmented span {
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

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

  .paste-html {
    grid-row: auto;
  }

  .compare th,
  .compare td {
    padding: 12px 10px;
  }

  .compare td {
    font-size: 15px;
  }

  .compare strong {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary.busy .spinner {
    animation-duration: 2.4s !important;
    animation-iteration-count: infinite !important;
  }
}
