/* Fonts */
@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/InterTight.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Theme Variables */
:root {
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --text: #21201c;
  --text-muted: #67645d;
  --border: #e6e1d6;
  --border-subtle: #ede9e1;
  --code-bg: color-mix(in srgb, var(--text) 5%, var(--bg));
  --shadow-plan: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-plan-featured: 0 4px 14px rgba(0, 0, 0, 0.08);

  /* Derived accent palette */
  --tint: color-mix(in srgb, var(--accent) 9%, var(--bg));
  --tint-2: color-mix(in srgb, var(--accent) 16%, var(--bg));
  --accent-ink: color-mix(in srgb, var(--accent) 72%, var(--text));

  /* Font stacks */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Inter Tight", var(--font-sans);
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --bg-card: #1f1e1a;
    --text: #eeeae3;
    --text-muted: #9e9a91;
    --border: #2e2d27;
    --border-subtle: #252420;
    --code-bg: color-mix(in srgb, var(--text) 7%, var(--bg));
    --shadow-plan: 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow-plan-featured: 0 4px 14px rgba(0, 0, 0, 0.38);

    --tint: color-mix(in srgb, var(--accent) 12%, var(--bg));
    --tint-2: color-mix(in srgb, var(--accent) 22%, var(--bg));
    --accent-ink: color-mix(in srgb, var(--accent) 70%, var(--text));
  }
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

::selection {
  background-color: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Typography */
h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.75rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 36px 0 12px;
  color: var(--text);
}

h2 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 38px 0 14px;
  color: var(--text);
}

h3 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 28px 0 10px;
  color: var(--text);
}

p {
  margin: 0 0 16px;
}

strong {
  font-weight: 600;
  color: var(--text);
}

.lede {
  font-size: 1.18rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.meta {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: -4px 0 16px;
}

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

a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Layout */
.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  background-color: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Header & Nav */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  flex-shrink: 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-header nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-header nav a:hover {
  color: var(--text);
  background-color: var(--tint);
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background-color: var(--tint-2);
}

/* Hero Band */
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 26px;
  padding: 44px 0 48px;
  margin: 0 0 44px;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background-color: var(--tint);
  border-bottom: 1px solid var(--border);
  z-index: -1;
}

.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  flex-shrink: 0;
  display: block;
  border: 1px solid var(--border-subtle);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-text h1 {
  margin: 0 0 10px;
  font-size: 2.5rem;
  line-height: 1.1;
}

.hero-text .lede {
  margin: 0 0 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Buttons & CTAs */
.cta,
button.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--on-accent);
  background-color: var(--accent);
  border: 1px solid var(--accent);
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.cta:hover,
button.cta:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

.cta.ghost {
  background-color: transparent;
  color: var(--accent-ink);
  border: 1px solid var(--accent-ink);
}

.cta.ghost:hover {
  background-color: var(--tint);
  filter: none;
}

/* Features */
.features {
  list-style: none;
  counter-reset: feature-counter;
  padding: 0;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.features li {
  counter-increment: feature-counter;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.5;
}

.features li::before {
  content: counter(feature-counter, decimal-leading-zero);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--tint);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  line-height: 1.35;
}

/* Fact Blocks */
.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 32px 0;
}

@media (min-width: 560px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}

.fact {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
}

.fact h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.fact p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
  background-color: var(--tint-2);
  color: var(--text);
  border: 1px solid var(--border);
  line-height: 1.3;
}

.badge.pro {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* Plans */
.plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 36px 0;
}

@media (min-width: 560px) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plan {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-plan);
}

.plan.featured {
  background-color: var(--tint);
  border-color: var(--border);
  border-top-color: var(--accent);
  box-shadow: var(--shadow-plan-featured);
}

.plan.featured::before {
  content: "Best value";
  position: absolute;
  top: -13px;
  right: 20px;
  background-color: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 9999px;
}

.plan h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.plan p {
  margin: 0 0 16px;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.plan-price {
  font-family: var(--font-ui);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 16px 0 20px !important;
}

.plan p:last-child {
  margin-top: auto;
  margin-bottom: 0;
}

.plan .cta {
  width: 100%;
}

/* Notes, TOC & Columns */
.note {
  border-left: 3px solid var(--accent);
  background-color: var(--tint);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
}

.note p {
  margin: 0 0 8px;
}

.note p:last-child {
  margin-bottom: 0;
}

.toc {
  background-color: var(--tint);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 28px 0;
}

.toc p:first-child,
.toc h3:first-child,
.toc .toc-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  color: var(--text);
}

.toc ul,
.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin: 5px 0;
  font-size: 0.92rem;
}

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 28px 0;
}

@media (min-width: 600px) {
  .cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* Lists & Tables */
ul:not(.features) li::marker,
ol li::marker {
  color: var(--accent);
}

ul:not(.features),
ol {
  margin: 16px 0;
  padding-left: 22px;
}

li {
  margin: 6px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

table th,
table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table th {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  background-color: var(--tint);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 5px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 24px 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Forms */
button {
  font: inherit;
}

input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--tint-2);
}

textarea.key {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  tab-size: 2;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-row > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-row .brand-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer .disclaimer {
  margin: 16px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Mobile Refinements */
@media (max-width: 580px) {
  .hero {
    flex-direction: column;
    gap: 20px;
    padding: 36px 0 40px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .site-header nav {
    width: 100%;
    justify-content: flex-start;
  }

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

/* Plan price override */
.plan .plan-price { font-family: "Inter Tight", sans-serif; font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin: 14px 0 16px; line-height: 1; }
.plan .plan-price .meta { font-size: 0.9375rem; font-weight: 500; color: var(--text-muted, var(--muted)); margin: 0 4px; }
