:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #191919;
  --text: #37352f;
  --muted: #6f6f6b;
  --line: #e9e9e7;
  --line-strong: #d7d7d3;
  --accent: #191919;
  --accent-ink: #37352f;
  --soft: #f7f7f5;
  --radius: 14px;
  --shell: min(1120px, calc(100% - 64px));
  --doc: min(720px, 100%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Variable", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  display: block;
  max-width: 100%;
}

/* Shared shell: matches landing page width */
.site-shell {
  width: var(--shell);
  margin: 0 auto;
}

/* Legacy narrow measure (kept for nested content if needed) */
.doc-page {
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
}

/* —— Nav —— */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.site-nav {
  min-height: 50px;
  padding: 0;
}

.site-nav .brand {
  font-size: 18px;
}

.site-nav .brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-nav .button {
  min-height: 36px;
  padding-inline: 15px;
}

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

.brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a[aria-current="page"] {
  color: var(--muted);
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
}

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

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

.button.primary:hover {
  background: #37352f;
}

/* —— Doc main —— */
.doc-main {
  border-top: 1px solid var(--line);
}

.doc {
  width: var(--doc);
  margin: 0 auto;
  padding: 48px 0 80px;
}

.doc-hero {
  margin-bottom: 36px;
}

.doc h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
}

.lead {
  max-width: 56ch;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 18px;
  text-wrap: pretty;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.updated {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.notice {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--text);
  font-size: 15px;
  text-wrap: pretty;
}

.doc .section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.doc .section:first-of-type {
  margin-top: 32px;
}

.doc .section h2,
.release h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.doc .section p,
.doc .section li,
.release li {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

.doc .section p + p {
  margin-top: 10px;
}

.doc .section ul,
.doc .section ol,
.release ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 1.2em;
}

.doc .section ol {
  gap: 10px;
}

.doc .section a,
.release a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.doc .section a:hover,
.release a:hover {
  color: var(--accent-ink);
}

/* —— Pricing page —— */
.pricing-page-layout {
  display: grid;
  gap: 40px;
}

.pricing-page-layout .doc-hero {
  margin-bottom: 0;
}

.pricing-panel {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.pricing-card {
  position: relative;
  display: grid;
  justify-items: stretch;
  width: min(100%, 360px);
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(20 20 20 / 0.04), 0 10px 28px rgb(20 20 20 / 0.05);
  color: var(--text);
  text-align: left;
}

.pricing-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pricing-card-top strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.pricing-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 48px;
  height: 48px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(12deg);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
}

.pricing-amount {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 40px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.pricing-was {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: line-through;
}

.pricing-scope {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.pricing-features {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.pricing-features li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.pricing-features li::before {
  content: "✓";
  margin-top: -1px;
  color: #2f9e54;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.pricing-cta {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.pricing-cta:hover {
  background: #37352f;
  color: #ffffff;
}

.pricing-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.pricing-foot {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  justify-items: start;
}

.pricing-foot a {
  color: var(--muted);
  font-size: 12.5px;
  text-underline-offset: 0.2em;
}

.pricing-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.checkout-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 42ch;
}

.pricing-details {
  display: grid;
  gap: 0;
}

.pricing-details .section {
  margin-top: 0;
}

/* —— Thanks page —— */
.thanks-hero {
  margin-bottom: 8px;
}

.thanks-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, #2f9e54 12%, var(--surface));
  color: #2f9e54;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.thanks-steps {
  counter-reset: thanks-step;
  list-style: none;
  padding-left: 0;
  gap: 12px;
}

.thanks-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding-left: 0;
  color: var(--text);
}

.thanks-steps li::before {
  counter-increment: thanks-step;
  content: counter(thanks-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.thanks-note {
  margin-top: 14px;
}

/* —— Changelog —— */
.changelog-doc {
  padding-bottom: 84px;
}

.release {
  position: relative;
  padding: 23px 0 25px;
  border-top: 1px solid var(--line);
}

.release-latest {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(20 20 20 / 0.04);
}

.release + .release {
  margin-top: 0;
}

.release header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.release header h2 {
  margin: 0;
}

.release-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 650;
}

.release-section + .release-section {
  margin-top: 18px;
}

.release-section h3 {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.release-section:first-of-type h3 {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent-ink);
}

.release ul {
  list-style: none;
  padding-left: 0;
}

.release li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.55;
}

.release li::before {
  position: absolute;
  top: 0.72em;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 72%, var(--accent-ink));
  content: "";
}

.release-section + .release-section li::before {
  background: var(--line-strong);
}

/* —— Footer (shared multi-column, matches landing) —— */
.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  display: block;
  padding: 48px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) repeat(3, minmax(100px, 0.7fr)) minmax(180px, 1.1fr);
  gap: 32px 40px;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 220px;
}

.footer-brand-link {
  font-size: 16px;
}

.footer-brand-link img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.footer-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: pretty;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-footer .footer-social-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--soft);
}

.footer-social-link svg {
  width: 15px;
  height: 15px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-heading {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.footer-col a {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--muted);
}

.footer-loop {
  max-width: 240px;
}

.footer-loop-copy {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  text-wrap: pretty;
}

.footer-follow {
  margin-top: 4px;
  min-height: 40px;
  padding-inline: 18px;
  border-radius: 999px;
}

.footer-meta {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* Legacy single-row footer links (unused on refreshed pages) */
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .footer-loop {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .site-nav .nav-links a:not(.button) {
    display: none;
  }

  .site-nav .nav-links {
    gap: 10px;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: min(100% - 32px, 1120px);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .doc-page {
    width: min(100% - 32px, 720px);
  }

  .doc {
    padding-top: 38px;
    padding-bottom: 64px;
  }

  .doc-actions .button {
    width: 100%;
  }

  .release-latest {
    padding: 20px;
  }

  .nav {
    padding: 16px 0;
  }

  .site-footer {
    padding: 36px 0 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-meta {
    margin-top: 28px;
  }

  .pricing-card {
    width: 100%;
  }
}

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