/* ==========================================================================
   site.css — the public storefront (html served by app/site.py)
   Loaded after fonts/tw/skin/custom; every colour comes from the same tokens
   as the panel, so light and dark both work from one rule set. No inline
   style anywhere: the pages share the panel's CSP (style-src 'self').
   ========================================================================== */

/* --- brand ---------------------------------------------------------------- */

/* app.css carries these for the panel; the storefront does not load app.css,
   so the wordmark's three-colour split is repeated here. */
.brand-wordmark { letter-spacing: -0.015em; white-space: nowrap; }
.brand-wordmark .b-a { color: hsl(18.4 52.9% 50%); }
.brand-wordmark .b-mix { color: hsl(214.7 19.4% 51%); }
.brand-wordmark .b-b { color: hsl(205 90% 52%); }
.dark .brand-wordmark .b-a { color: hsl(17.1 62.7% 60%); }
.dark .brand-wordmark .b-mix { color: hsl(208.7 16.3% 62.2%); }
.dark .brand-wordmark .b-b { color: hsl(200 95% 65%); }

/* --- page frame ----------------------------------------------------------- */

.site-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-inter), ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
}

.site-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-radius: 0 0 0.5rem 0;
  z-index: 60;
}
.site-skip:focus { left: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.86);
  backdrop-filter: blur(10px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 1.1rem;
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
}

.site-nav-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav-link:hover { color: hsl(var(--foreground)); }
.site-nav-link[aria-current="page"] {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--primary));
}

.site-actions {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}

.site-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.875rem;
}
.site-link:hover { color: hsl(var(--foreground)); }

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem;
  display: flow-root;
}

/* --- type ----------------------------------------------------------------- */

.site-eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  font-weight: 600;
}

.site-h1 {
  margin: 0 0 1rem;
  font-family: var(--v7-font-display, var(--font-space-grotesk), var(--font-inter)), ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
  max-width: 22ch;
}

.site-h2 {
  margin: 0 0 1rem;
  font-family: var(--v7-font-display, var(--font-space-grotesk), var(--font-inter)), ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.site-lead {
  margin: 0 0 1.6rem;
  max-width: 62ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: hsl(var(--muted-foreground));
}

.site-prose {
  max-width: 70ch;
  margin: 0 0 0.9rem;
  color: hsl(var(--muted-foreground));
}
.site-prose p { margin: 0 0 0.9rem; }
.site-prose strong { color: hsl(var(--foreground)); font-weight: 600; }
.site-prose:last-child { margin-bottom: 0; }

.site-small { font-size: 0.8rem; }

.site-legal p { max-width: 72ch; }

.site-handle {
  font-family: var(--v7-font-mono, ui-monospace, monospace);
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

/* --- hero ----------------------------------------------------------------- */

.site-hero {
  position: relative;
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.6rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}
.site-hero::before {
  content: "";
  position: absolute;
  inset: -25% -12% auto -12%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(60% 60% at 18% 0%, hsl(var(--primary) / 0.16) 0, transparent 70%),
    radial-gradient(45% 50% at 85% 8%, hsl(160 60% 45% / 0.1) 0, transparent 75%);
  pointer-events: none;
}
.site-hero .site-h1 { max-width: 24ch; }
.site-hero .site-lead { margin-bottom: 1.8rem; }

.site-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.4rem 0 0;
  padding: 0;
}

/* --- buttons -------------------------------------------------------------- */

a.site-cta,
.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: hsl(var(--primary-foreground));
  background-color: hsl(var(--primary));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.08);
  transition: transform 0.12s ease, filter 0.15s ease, background-color 0.15s ease;
}
.site-cta:hover { filter: brightness(1.06); }
.site-cta:active { transform: translateY(1px); }

.site-cta.is-quiet {
  color: hsl(var(--foreground));
  background-color: transparent;
  border-color: hsl(var(--border));
  box-shadow: none;
}
.site-cta.is-quiet:hover {
  background-color: hsl(var(--muted));
  filter: none;
}

.site-cta-block { width: 100%; margin-top: auto; }

.site-header .site-cta { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* Dark theme: the primary token is a light blue, so button text is dark. */
.dark .site-cta { color: hsl(210 40% 8%); }

/* --- sections and cards --------------------------------------------------- */

.site-section {
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid hsl(var(--border));
}
.site-section:first-of-type { border-top: 0; }
.site-section.site-end {
  text-align: center;
  padding-bottom: 0;
  border-top: 0;
}

.site-section-body { margin-top: 0.4rem; }

.site-more { margin: 1rem 0 0; font-size: 0.85rem; }
.site-more a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
}
.site-more a:hover { text-decoration: underline; }

.site-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.85rem;
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.site-card:hover {
  border-color: hsl(var(--primary) / 0.45);
  transform: translateY(-2px);
}

.site-card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.site-card-body {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.site-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-bottom: 0.35rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--v7-font-mono, ui-monospace, monospace);
  color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.12);
  border: 1px solid hsl(var(--primary) / 0.3);
}

/* --- families list -------------------------------------------------------- */

.site-family-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.site-family-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  font-size: 0.82rem;
}
.site-family-list span { color: hsl(var(--muted-foreground)); }

/* --- plans ---------------------------------------------------------------- */

.site-plans {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-top: 1.2rem;
}

.site-plan {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.9rem;
  background-color: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.05);
}

.site-plan-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.site-plan-note {
  margin: 0;
  font-size: 0.83rem;
  color: hsl(var(--muted-foreground));
}

.site-plan-facts {
  display: grid;
  gap: 0;
  margin: 0.2rem 0 0.4rem;
}
.site-plan-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.42rem 0;
  border-top: 1px dashed hsl(var(--border));
  font-size: 0.84rem;
}
.site-plan-row:first-child { border-top: 0; }
.site-plan-row dt { color: hsl(var(--muted-foreground)); }
.site-plan-row dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-plan-stock {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--primary));
}
.site-plan-closed {
  display: inline-flex;
  justify-content: center;
  padding: 0.6rem 1rem;
  margin-top: auto;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--muted));
}

.site-credit-facts {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin: 1rem 0 1.2rem;
}
.site-credit-facts > div {
  padding: 0.9rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.7rem;
  background-color: hsl(var(--card));
}
.site-credit-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.site-credit-facts dd {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* --- models --------------------------------------------------------------- */

.site-model {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.8rem;
  background-color: hsl(var(--card));
}

.site-model-link {
  color: inherit;
  text-decoration: none;
}
.site-model-link:hover { color: hsl(var(--primary)); text-decoration: underline; }

/* --- one model's page ----------------------------------------------------- */

.site-breadcrumb { margin: 0 0 0.6rem; font-size: 0.82rem; }
.site-breadcrumb a { color: hsl(var(--muted-foreground)); text-decoration: none; }
.site-breadcrumb a:hover { color: hsl(var(--primary)); }

.site-inline-code {
  font-family: var(--v7-font-mono, ui-monospace, monospace);
  font-size: 0.82em;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}

.site-code {
  max-width: 72ch;
  margin: 0.8rem 0 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 0.7rem;
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  font-family: var(--v7-font-mono, ui-monospace, monospace);
  font-size: 0.82rem;
  line-height: 1.5;
}

.site-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.2rem 0 0;
}

.site-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: hsl(160 60% 26%);
  background-color: hsl(160 55% 92%);
  border: 1px solid hsl(160 45% 80%);
}
.dark .site-badge {
  color: hsl(150 60% 70%);
  background-color: hsl(150 30% 14%);
  border-color: hsl(150 30% 24%);
}

/* --- notice, empty, faq --------------------------------------------------- */

.site-notice {
  margin: 1.2rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: 0.7rem;
  border: 1px solid hsl(38 70% 45% / 0.35);
  background-color: hsl(38 80% 50% / 0.1);
  color: hsl(var(--foreground));
  font-size: 0.88rem;
}

.site-empty {
  margin: 1.2rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 0.7rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.site-faq {
  border: 1px solid hsl(var(--border));
  border-radius: 0.7rem;
  background-color: hsl(var(--card));
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.6rem;
}
.site-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.site-faq summary::-webkit-details-marker { display: none; }
.site-faq summary::after {
  content: "+";
  font-family: var(--v7-font-mono, ui-monospace, monospace);
  color: hsl(var(--primary));
  flex-shrink: 0;
}
.site-faq[open] summary::after { content: "–"; }
.site-faq p {
  margin: 0.6rem 0 0;
  font-size: 0.87rem;
  color: hsl(var(--muted-foreground));
  max-width: 70ch;
}

/* --- footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.6);
}
.site-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2rem);
}
.site-foot-brand {
  margin: 0;
  font-weight: 700;
}
.site-foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
}
.site-foot-nav a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.site-foot-nav a:hover { color: hsl(var(--foreground)); }
.site-foot-note {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 1.6rem;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
}

/* --- small screens -------------------------------------------------------- */

@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header { gap: 0.75rem; }
  .site-actions { margin-left: auto; }
}

@media (max-width: 520px) {
  .site-actions .site-link { display: none; }
  .site-h1 { max-width: none; }
  .site-hero-actions .site-cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .site-card,
  .site-cta { transition: none; }
  .site-card:hover { transform: none; }
}

/* --- checkout page (/start, start.html + start.js) ------------------------ */

.start-main {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem) 3rem;
  flex: 1;
}

.start-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.6rem clamp(1.1rem, 3vw, 1.8rem);
  border: 1px solid hsl(var(--border));
  border-radius: 0.9rem;
  background-color: hsl(var(--card));
  box-shadow: 0 12px 30px -22px hsl(var(--foreground) / 0.45);
}

.start-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  font-weight: 600;
}

.start-title { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; font-weight: 650; }
.start-lead { margin: 0; font-size: 0.9rem; color: hsl(var(--muted-foreground)); }
.start-lead:empty { display: none; }

.start-body { display: grid; gap: 1rem; }
.start-body[hidden] { display: none; }

.start-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1rem;
  margin: 0;
}
.start-facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.start-facts dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.start-field { display: grid; gap: 0.35rem; }
/* An author ``display`` beats the UA rule for the ``hidden`` attribute, so a
   field the shell hides for one mode (the plan picker in ?plan=, the amount in
   plan mode) would still show. Say it here, next to the rule that caused it. */
.start-field[hidden] { display: none; }
.start-label { font-size: 0.78rem; font-weight: 600; }
.start-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.9rem;
}
.start-input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
}
.start-input[aria-invalid="true"] { border-color: hsl(var(--destructive)); }

.start-hint { margin: 0; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.start-escape {
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  color: hsl(var(--primary));
  cursor: pointer;
  text-decoration: underline;
}
.start-error {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--destructive));
}
.start-error:empty { display: none; }

.start-submit { width: 100%; padding: 0.75rem 1rem; }
.start-submit[disabled] { opacity: 0.6; cursor: progress; }

.start-plans { display: grid; gap: 0.5rem; margin: 0.2rem 0 0; padding: 0; }
.start-plan-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.start-plan-option:has(input:checked) {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.08);
}
.start-plan-option input { accent-color: hsl(var(--primary)); }
.start-plan-option .start-plan-price {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.start-foot {
  margin: 0;
  font-size: 0.76rem;
  color: hsl(var(--muted-foreground));
}
.start-foot a { color: hsl(var(--primary)); text-decoration: none; }
.start-foot a:hover { text-decoration: underline; }

/* --- visible FAQ items + legal footer line -------------------------------- */

.site-faq-item {
  padding: 0.95rem 0;
  border-bottom: 1px solid hsl(var(--border));
}
.site-faq-item:last-child { border-bottom: 0; }

.site-faq-q {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.site-faq-a {
  margin: 0;
  max-width: 72ch;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  line-height: 1.6;
}

.site-foot-legal {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: hsl(var(--muted-foreground));
}

.site-plan-flag {
  align-self: flex-start;
  margin: 0 0 0.4rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: hsl(var(--primary-foreground, 0 0% 100%));
  background-color: hsl(var(--primary));
}