/* PaidExtension marketing site. One stylesheet for every page; colors and
   fonts come from base.css. */
body { background: var(--paper); color: var(--ink); line-height: 1.6; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

header.top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--ink); font-size: 17px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--ink); }
nav a.buy { color: var(--accent); font-weight: 600; }
#theme-toggle {
  background: transparent; border: 1px solid var(--kraft); color: var(--muted);
  border-radius: 999px; width: 34px; height: 34px; cursor: pointer;
}
#theme-toggle .moon { display: none; }
:root[data-theme='dark'] #theme-toggle .sun { display: none; }
:root[data-theme='dark'] #theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) #theme-toggle .sun { display: none; }
  :root:not([data-theme='light']) #theme-toggle .moon { display: inline; }
}

/* Hero */
.hero { text-align: center; padding: 56px 0 32px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; text-align: left; }
.hero-grid .cta-row { justify-content: flex-start; }
.hero-grid .lede { margin-left: 0; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-grid .cta-row { justify-content: center; }
  .hero-grid .lede { margin: 0 auto 30px; }
}
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--kraft); border-radius: 999px; padding: 4px 12px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(34px, 5.5vw, 60px); line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 30px; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; text-decoration: none; padding: 14px 26px; border-radius: 10px; font-weight: 600; font-size: 16px; }
.cta:hover { background: var(--accent-d); }
.cta.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.cta.secondary:hover { background: var(--kraft); }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .note { font-size: 13px; color: var(--muted); margin-top: 16px; }
.hero .note code { font-size: 12px; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--kraft); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
pre {
  background: light-dark(#0F1117, #05060A); color: #E5E7EB; padding: 18px 20px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; overflow-x: auto; text-align: left;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.terminal { max-width: 640px; margin: 0 auto; }
.terminal .comment { color: #8B93A7; }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 40px 0 8px; text-align: center; }
.stat b { display: block; font-size: 30px; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }

/* Sections */
section { padding: 56px 0; }
section h2 { font-size: clamp(26px, 3.4vw, 36px); text-align: center; margin-bottom: 10px; letter-spacing: -0.02em; line-height: 1.15; }
section .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 36px; font-size: 17px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.grid.stack { margin-top: 16px; }
.card {
  background: light-dark(#fff, #181B25); border: 1px solid var(--kraft); border-radius: 14px; padding: 22px;
}
.card h3 { font-size: 17px; margin-bottom: 6px; }
.card p, .card li { font-size: 14.5px; color: var(--muted); }
.card ul { margin: 8px 0 0 18px; }
.card .tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* Architecture diagram */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: stretch; }
.flow .card { text-align: center; }
.flow .card h3 { font-size: 15px; }
.flow .card .where { display: block; font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }

/* Comparison table */
.table-wrap { overflow-x: auto; border: 1px solid var(--kraft); border-radius: 14px; background: light-dark(#fff, #181B25); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--kraft); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.yes { color: light-dark(#15803D, #4ADE80); font-weight: 600; }
td.no { color: var(--muted); }
td.us { background: light-dark(#EEF2FF, #1E2340); font-weight: 600; }
th.us { color: var(--accent); }
.tiny { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 12px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 960px; margin: 0 auto; align-items: start; }
.plan { position: relative; text-align: center; padding: 30px 26px; }
.plan .badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.plan .price { font-size: 44px; font-weight: 700; margin: 6px 0 0; letter-spacing: -0.02em; }
.plan .price s { font-size: 22px; color: var(--muted); font-weight: 500; margin-right: 8px; }
.plan .period { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.plan ul { list-style: none; text-align: left; margin: 0 0 22px; font-size: 14.5px; color: var(--muted); }
.plan li { padding: 5px 0 5px 24px; position: relative; }
.plan li::before { content: '\2713'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan .cta { width: 100%; justify-content: center; }
.guarantee { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 20px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--kraft); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.faq p { color: var(--muted); font-size: 15px; margin-top: 10px; }

/* Text pages */
.doc { padding: 40px 0 64px; }
.doc h1 { font-size: 34px; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.15; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; text-align: left; letter-spacing: -0.01em; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; }
.doc p, .doc li { font-size: 15.5px; color: var(--muted); margin-bottom: 12px; }
.doc li { margin-bottom: 6px; }
.doc ul, .doc ol { margin: 0 0 16px 24px; }
.doc a { color: var(--accent); }
.doc pre { margin: 12px 0 20px; }
.doc .updated { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.doc table { font-size: 14px; }
.doc .table-wrap { margin: 12px 0 24px; }
.doc .callout { border-left: 3px solid var(--accent); background: light-dark(#EEF2FF, #1E2340); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0 24px; }
.doc .callout p { margin: 0; color: var(--ink); }

/* Live licensing demo */
.hero-demo { display: grid; gap: 10px; }
.popup {
  background: light-dark(#fff, #181B25); border: 1px solid var(--kraft); border-radius: 14px; padding: 14px 16px 12px;
  box-shadow: 0 18px 50px -24px rgba(15, 17, 23, 0.45); text-align: left; font-size: 14px;
}
.popup-bar { display: flex; align-items: center; gap: 10px; }
.popup-icon { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-d)); flex: none; }
.popup-title { font-weight: 700; flex: 1; }
.demo-tier { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--kraft); color: var(--muted); transition: background 0.25s, color 0.25s; }
.demo-tier.trial { background: light-dark(#FEF3C7, #3B2F0B); color: light-dark(#92400E, #FCD34D); }
.demo-tier.pro { background: light-dark(#DCFCE7, #0B3B23); color: light-dark(#15803D, #4ADE80); }
.popup-plan { color: var(--muted); font-size: 12.5px; margin: 6px 0 10px; min-height: 1.2em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.features { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; }
.features li { position: relative; padding: 6px 8px 6px 28px; border: 1px solid var(--kraft); border-radius: 8px; color: var(--muted); font-size: 13px; transition: color 0.25s, border-color 0.25s, background 0.25s; }
.features li::before { content: ''; position: absolute; left: 9px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 1.5px solid var(--kraft); transition: all 0.25s; }
.features li.on { color: var(--ink); border-color: light-dark(#BBF7D0, #14532D); background: light-dark(#F0FDF4, #0B3B23); }
.features li.on::before { border-color: transparent; background: light-dark(#16A34A, #4ADE80); }
.features li.on::after { content: ''; position: absolute; left: 12.5px; top: 50%; width: 3px; height: 6px; margin-top: -4.5px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.popup-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.popup-actions button {
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 11px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--kraft); transition: transform 0.15s, background 0.15s;
}
.popup-actions button:hover:not(:disabled) { background: var(--kraft); transform: translateY(-1px); }
.popup-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.popup-actions button.primary:hover:not(:disabled) { background: var(--accent-d); }
.popup-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.popup-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.popup-meta [data-server].down { color: light-dark(#B91C1C, #FCA5A5); font-weight: 700; }
.demo-log {
  background: light-dark(#0F1117, #05060A); color: #E5E7EB; border-radius: 12px; padding: 12px 14px; min-height: 150px; max-height: 200px; overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; text-align: left;
}
.demo-line { display: flex; gap: 8px; animation: demo-in 0.3s ease both; }
.demo-line .who { flex: none; width: 74px; text-align: right; color: #8B93A7; }
.demo-line.worker .who { color: #F59E0B; }
.demo-line.paddle .who { color: #A78BFA; }
.demo-line.ext .who { color: #60A5FA; }
.demo-line.error .who, .demo-line.error span { color: #FCA5A5; }
.demo-line .mono { word-break: break-all; }
@keyframes demo-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.demo-note, .demo-unsupported { font-size: 12px; color: var(--muted); margin: 0; text-align: left; }
.demo-unsupported { display: none; }
.hero-demo.unsupported .popup, .hero-demo.unsupported .demo-log, .hero-demo.unsupported .demo-note { display: none; }
.hero-demo.unsupported .demo-unsupported { display: block; }

/* Tabs (code explorer + config preview) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--kraft); margin-bottom: 16px; }
.tabs [role='tab'] {
  font: inherit; font-size: 13.5px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 12px; margin-bottom: -1px; cursor: pointer;
}
.tabs [role='tab']:hover { color: var(--ink); }
.tabs [role='tab'][aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.explorer .panel { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.explorer .panel[hidden], [role='tabpanel'][hidden] { display: none; }
@media (max-width: 880px) { .explorer .panel { grid-template-columns: 1fr; } }
.snippet { margin: 0; min-width: 0; }
.snippet figcaption { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 6px; }
.snippet pre { margin: 0; font-size: 12.5px; max-height: 420px; overflow: auto; }
.tk-c { color: #8B93A7; font-style: italic; }
.tk-s { color: #A5D6A7; }
.tk-k { color: #C792EA; }
.tk-n { color: #F78C6C; }
.tk-f { color: #82AAFF; }
.tk-p { color: #FFCB6B; }

/* Config → output preview */
.configure { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
@media (max-width: 880px) { .configure { grid-template-columns: 1fr; } }
.configure-form, .calc-form { display: grid; gap: 12px; background: light-dark(#fff, #181B25); border: 1px solid var(--kraft); border-radius: 14px; padding: 20px; }
.configure-form label, .calc-form label, .assumptions label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.configure-form input, .assumptions input {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--kraft); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
.configure-form input:focus, .assumptions input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.configure-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.configure-out { min-width: 0; }
.configure-out .tabs { margin-bottom: 12px; }
.gen { margin: 0; font-size: 12.5px; max-height: 460px; overflow: auto; }
.popup.preview { max-width: 360px; margin: 8px auto 0; }
.plan-list { list-style: none; margin: 0 0 12px; display: grid; gap: 6px; }
.plan-list li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--kraft); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.plan-list li b { flex: 1; }
.plan-list .p-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.plan-list .p-price { color: var(--muted); }
.plan-list .p-empty { color: var(--muted); justify-content: center; border-style: dashed; }
.p-cta { width: 100%; font: inherit; font-weight: 600; font-size: 14px; padding: 10px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; }
.popup-foot { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Cost calculator */
.calc { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; } }
.calc-form label b { color: var(--ink); font-size: 15px; font-weight: 700; }
.calc-form input[type='range'] { width: 100%; accent-color: var(--accent); }
.tiny.left { text-align: left; margin: 0; }
.assumptions { border-top: 1px solid var(--kraft); padding-top: 10px; display: grid; gap: 10px; }
.assumptions summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.calc-out { display: grid; gap: 12px; }
.gross { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; padding: 0 4px; }
.gross b { color: var(--ink); font-size: 18px; }
.stack-row { background: light-dark(#fff, #181B25); border: 1px solid var(--kraft); border-radius: 14px; padding: 16px 18px; }
.stack-row.us { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stack-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; font-size: 14px; }
.stack-head span { color: var(--muted); font-size: 12.5px; }
.bar { height: 10px; border-radius: 999px; background: var(--kraft); overflow: hidden; margin-bottom: 10px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--muted); transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.stack-row.us .bar i { background: linear-gradient(90deg, var(--accent), var(--accent-d)); }
.stack-row dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 10px; font-size: 13px; }
.stack-row dt { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; grid-row: 1; }
.stack-row dd { font-weight: 600; grid-row: 2; font-variant-numeric: tabular-nums; }
.stack-row dd.keep { color: var(--accent); font-size: 16px; }
@media (max-width: 520px) { .stack-row dl { grid-template-columns: repeat(2, 1fr); } .stack-row dt, .stack-row dd { grid-row: auto; } }
.delta { text-align: center; font-weight: 600; font-size: 15px; margin-top: 4px; }

/* Launch counter */
.plan .launch { font-size: 13px; color: var(--muted); margin: -10px 0 14px; }
.plan .launch b { color: var(--accent); }
:root.launch-over .plan .badge, :root.launch-over .plan .launch, :root.launch-over .plan .price s { display: none; }

/* Motion — only when motion.js adds .motion to <html> */
.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .card, .motion .stack-row { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.6s ease; }
.motion .card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -26px rgba(15, 17, 23, 0.5); border-color: light-dark(#C7CBE0, #3A4058); }
.motion .plan:hover { transform: translateY(-6px); }
.motion .reveal.card:hover { transform: translateY(-4px); }
.motion .terminal .cursor { display: inline-block; width: 8px; height: 1.05em; background: #E5E7EB; vertical-align: text-bottom; margin-left: 1px; animation: blink 1s steps(1) infinite; }
.motion .terminal.typed .cursor { animation: none; opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }
.motion .flow .card { position: relative; }
.motion .flow .card .where { transition: color 0.3s; }
.motion .flow .card::after { content: ''; position: absolute; inset: 0; border-radius: 14px; border: 1.5px solid var(--accent); opacity: 0; transform: scale(0.97); transition: opacity 0.4s, transform 0.4s; pointer-events: none; }
.motion .flow .card.lit::after { opacity: 1; transform: none; animation: lit-fade 1.6s ease 0.4s forwards; }
.motion .flow .card.lit h3::before { content: '\2713\00a0'; color: light-dark(#16A34A, #4ADE80); }
@keyframes lit-fade { to { opacity: 0.35; } }

footer { border-top: 1px solid var(--kraft); padding: 28px 0 40px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; margin-top: 24px; }
footer a { color: var(--muted); text-decoration: none; margin-right: 16px; }
footer a:hover { color: var(--ink); }
