/* Shared, framework-free styles for ui_kits/marketing-site/*.html.
   Plain CSS classes over the design system's custom properties — matches the
   real technical constraint (static HTML/CSS + minimal vanilla JS, no framework). */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--surface-canvas); color: var(--text-primary); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }

.nav { position: sticky; top: 0; z-index: 10; height: 64px; display: flex; align-items: center; gap: 32px; padding: 0 clamp(20px, 5vw, 64px); border-bottom: 1px solid var(--border-default); background: var(--surface-primary); }
.wordmark { font: 600 19px/1 var(--font-mono); color: var(--text-primary); letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 24px; font: var(--text-body-s); color: var(--text-secondary); }
.nav-links a { color: var(--text-secondary); }
.nav-links a.current { color: var(--text-primary); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-signin { font: var(--text-body-s); color: var(--text-muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 550 14px/1 var(--font-sans); height: 40px; padding: 0 20px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-secondary); color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--surface-tertiary); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-secondary); }

.badge { display: inline-flex; align-items: center; gap: 6px; font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-full); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); }
.badge-amber { background: var(--accent-amber-subtle); color: var(--accent-amber); }
.badge-neutral { background: var(--surface-tertiary); color: var(--text-secondary); }

.card { background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--space-5); }
.card h3 { font: var(--text-heading-s); margin: 0 0 8px; color: var(--text-primary); }
.card p { font: var(--text-body-m); color: var(--text-secondary); margin: 0; }

.eyebrow { font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
h1.hero-title { font: var(--text-display-l); margin: 0 0 16px; }
h2.section-title { font: var(--text-heading-l); margin: 0; color: var(--text-primary); }
p.lede { font: var(--text-body-l); color: var(--text-secondary); }

table.compare { width: 100%; border-collapse: collapse; font: var(--text-body-m); }
table.compare th, table.compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
table.compare th { font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
table.compare td.yes::before { content: "✓ "; color: var(--success); font-weight: 700; }
table.compare td.no::before { content: "— "; color: var(--text-muted); }
/* Pricing's plan comparison. Icons carry the yes/no, with the words kept for
   screen readers (.sr-only); Pro's column is tinted as the one most people pick. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.plans-table-wrap { border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-primary); }
table.plans-table { width: 100%; border-collapse: collapse; font: var(--text-body-m); }
table.plans-table th, table.plans-table td { padding: 14px 20px; border-bottom: 1px solid var(--border-subtle); }
table.plans-table thead th { font: var(--text-heading-s); color: var(--text-primary); text-align: center; padding-top: 22px; padding-bottom: 18px; background: var(--surface-secondary); }
table.plans-table thead th:first-child { text-align: left; font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); vertical-align: bottom; }
table.plans-table th[scope="row"] { text-align: left; font-weight: 400; color: var(--text-primary); }
table.plans-table .detail { color: var(--text-muted); }
table.plans-table tr.group th { text-align: left; font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); padding-top: 26px; padding-bottom: 10px; background: none; }
table.plans-table tbody tr:not(.group):hover { background: var(--surface-secondary); }
table.plans-table tbody:last-child tr:last-child > * { border-bottom: 0; }
table.plans-table td { width: 15%; text-align: center; }
table.plans-table th:nth-child(3), table.plans-table td:nth-child(3) { background: color-mix(in srgb, var(--accent) 7%, transparent); }
table.plans-table thead th:nth-child(3) { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
table.plans-table td.yes::before { content: ""; display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
table.plans-table td.no::before { content: ""; display: inline-block; width: 12px; height: 2px; border-radius: 1px; vertical-align: middle; background: var(--text-muted); opacity: 0.5; }
@media (max-width: 600px) {
  table.plans-table th, table.plans-table td { padding: 12px 8px; }
  table.plans-table thead th { font: var(--text-body-s); font-weight: 600; }
  table.plans-table td { width: 17%; }
  table.plans-table td.yes::before { width: 18px; height: 18px; background-size: 11px; }
}


.footer { border-top: 1px solid var(--border-default); padding: 48px clamp(20px, 5vw, 64px); }
.footer-cols { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
/* Narrower than one row: the brand takes its own row and the four link columns go 2x2, never 4+1 or 3+2. */
@media (max-width: 860px) { .footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-cols > :first-child { grid-column: 1 / -1; } }
.footer-col h4 { font: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; }
.footer-col a, .footer-col span { display: block; font: var(--text-body-s); color: var(--text-secondary); margin-bottom: 6px; }
.footer-legal { font: var(--text-body-s); color: var(--text-muted); margin-top: 24px; text-align: center; }

code, .mono { font-family: var(--font-mono); }

/* Brand lockup */
.wordmark-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.wordmark-lockup:hover { text-decoration: none; }
.nav-mark-icon { width: 26px; height: 26px; display: block; flex-shrink: 0; }
.footer-mark-icon { width: 22px; height: 22px; display: block; flex-shrink: 0; }

/* Product Screenshots */
.hero-screenshot { width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-default); box-shadow: 0 20px 40px rgba(0,0,0,0.18); display: block; }
.feature-screenshot { width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--border-default); box-shadow: var(--shadow-md); display: block; }
.screenshot-card { display: flex; flex-direction: column; gap: 8px; }
.screenshot-caption { font: var(--text-body-s); color: var(--text-muted); line-height: 1.4; }
.platform-badge-img { height: 48px; width: auto; display: block; }

/* Callouts & Alerts */
.callout { background: var(--surface-secondary); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 16px 20px; margin: 20px 0; }
.callout p { margin: 0; font: var(--text-body-m); color: var(--text-primary); }
.alert-error { background: var(--accent-subtle, rgba(239, 68, 68, 0.1)); border: 1px solid var(--error, #ef4444); border-radius: var(--radius-sm); padding: 14px 18px; color: var(--error, #ef4444); font: var(--text-body-m); margin: 16px 0; }
.alert-success { background: var(--accent-subtle, rgba(16, 185, 129, 0.1)); border: 1px solid var(--success, #10b981); border-radius: var(--radius-sm); padding: 14px 18px; color: var(--success, #10b981); font: var(--text-body-m); margin: 16px 0; }
.break-all { word-break: break-all; overflow-wrap: anywhere; }

/* ── Themes gallery (themes.html, themes.js) ─────────────────────────────── */
.theme-steps { font: var(--text-body-m); color: var(--text-secondary); line-height: 1.6; margin: 32px 0 8px; padding-left: 24px; }
.theme-steps li { margin-bottom: 4px; }
.theme-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px 0 20px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-full); }
.seg-btn { font: 550 13px/1 var(--font-sans); height: 30px; padding: 0 16px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-secondary); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 72px; }
/* Even grids: every row holds the same number of items at every width, so a
   row never ends with one card on its own. Four items go 4, then 2x2, then 1;
   three go 3, then 1. Use these instead of auto-fit for a fixed set of cards. */
.grid-even-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-even-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-even-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-even-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .grid-even-4 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }
.theme-status { font: var(--text-body-m); color: var(--text-secondary); margin: -48px 0 72px; }
.theme-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.theme-body { padding: 16px 20px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.theme-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-head h3 { margin: 0; }
.theme-by { font: var(--text-body-s); color: var(--text-muted); margin: -6px 0 0; }
.theme-row { display: flex; gap: 8px; }
.theme-string { flex: 1; min-width: 0; height: 32px; padding: 0 10px; font: 400 12px/1 var(--font-mono); color: var(--text-secondary); background: var(--surface-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); text-overflow: ellipsis; }
.theme-copy { min-width: 72px; }

/* Theme submission form (Task 2) */
.theme-submit-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; margin-top: 24px; }
@media (max-width: 840px) { .theme-submit-wrap { grid-template-columns: 1fr; } }
.theme-form { display: flex; flex-direction: column; gap: 16px; }
.theme-field-label { display: block; font: var(--text-body-s); font-weight: 550; color: var(--text-primary); margin-bottom: 6px; }
.theme-field-hint { display: block; font: var(--text-body-s); color: var(--text-muted); margin-top: 4px; }
.theme-input { width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px; font: 400 14px/1 var(--font-sans); color: var(--text-primary); background: var(--surface-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.theme-input:focus, .theme-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-textarea { width: 100%; box-sizing: border-box; min-height: 100px; padding: 10px 12px; font: 400 12px/1.4 var(--font-mono); color: var(--text-primary); background: var(--surface-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-sm); resize: vertical; }
.theme-submit-footnote { font: var(--text-body-s); color: var(--text-muted); line-height: 1.5; margin: 4px 0 0; }
.theme-submit-status { font: var(--text-body-s); padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 8px; line-height: 1.4; }
.theme-submit-status.is-error { background: rgba(239, 68, 68, 0.1); color: var(--error); border: 1px solid var(--error); }
.theme-submit-status.is-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.theme-submit-status.is-pending { background: var(--surface-secondary); color: var(--text-secondary); border: 1px solid var(--border-default); }
.theme-preview-sticky { position: sticky; top: 24px; }

/* The preview is a miniature of the app, drawn from the theme's 17 colours.
   One unit (--u) is 1/80 of the window width; every size is a whole multiple
   of it, so the drawing scales together from 280 px to 420 px. The stage
   reserves the 16:10 box before the script runs, so cards never shift. */
.pv-stage { position: relative; aspect-ratio: 16 / 10; background: var(--surface-secondary); border-bottom: 1px solid var(--border-subtle); }
.pv-win { --u: calc(100cqw / 80); container-type: inline-size; position: absolute; left: 5%; top: 50%; transform: translateY(-50%); width: 90%; aspect-ratio: 8 / 5; display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; border: 1px solid var(--t-border); background: var(--t-editor-bg); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.22); }
.pv-title { flex: none; height: calc(var(--u) * 6); display: flex; align-items: center; gap: calc(var(--u) * 1.5); padding: 0 calc(var(--u) * 3); background: var(--t-bg3); border-bottom: 1px solid var(--t-border); }
.pv-dot { flex: none; width: calc(var(--u) * 2); height: calc(var(--u) * 2); border-radius: 50%; }
.pv-title .pv-bar { margin: 0 auto; }
.pv-body { flex: 1; min-height: 0; display: flex; }
.pv-side { flex: none; width: calc(var(--u) * 20); background: var(--t-bg2); border-right: 1px solid var(--t-divider); padding: calc(var(--u) * 3) calc(var(--u) * 2); display: flex; flex-direction: column; gap: var(--u); }
.pv-edit { flex: 1; min-width: 0; background: var(--t-editor-bg); padding: calc(var(--u) * 2) 0; display: flex; flex-direction: column; }
.pv-prev { flex: none; width: calc(var(--u) * 24); background: var(--t-bg1); border-left: 1px solid var(--t-divider); padding: calc(var(--u) * 3); display: flex; flex-direction: column; gap: calc(var(--u) * 2); }
.pv-row { flex: none; height: calc(var(--u) * 4); display: flex; align-items: center; gap: var(--u); padding: 0 calc(var(--u) * 3); }
.pv-row.is-head { height: calc(var(--u) * 5); }
.pv-row.is-hl { background: var(--t-hl); position: relative; }
.pv-side .pv-row { padding: 0 calc(var(--u) * 1.5); border-radius: calc(var(--u) * 1); }
.pv-side .pv-row.is-active { position: relative; background: var(--t-bg1); }
.pv-side .pv-row.is-active::before { content: ""; position: absolute; left: 0; top: var(--u); bottom: var(--u); width: calc(var(--u) * 0.5); border-radius: 0 calc(var(--u) * 0.25) calc(var(--u) * 0.25) 0; background: var(--t-accent); }
.pv-bar { flex: none; height: calc(var(--u) * 2); border-radius: calc(var(--u) * 1); background: var(--t-text); }
.pv-bar.is-head { height: calc(var(--u) * 3); border-radius: calc(var(--u) * 1.5); }
.pv-bar.is-small { height: calc(var(--u) * 1.5); border-radius: calc(var(--u) * 0.75); }
.pv-caret { flex: none; width: 2px; height: calc(var(--u) * 3); background: var(--t-cursor); margin-left: calc(var(--u) * -0.5); }
.pv-sel { flex: none; height: calc(var(--u) * 3); display: flex; align-items: center; padding: 0 calc(var(--u) * 0.5); background: var(--t-sel); border-radius: calc(var(--u) * 0.5); }
.pv-prev .pv-bar { height: calc(var(--u) * 1.5); border-radius: calc(var(--u) * 0.75); }

/* Phone-width nav: the links scroll sideways inside the bar instead of
   widening the page (six links no longer fit beside the wordmark and button). */
@media (max-width: 700px) {
  .nav { gap: 16px; }
  .nav-links { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-right { margin-left: 0; flex: none; }
  .nav-signin { display: none; }
}

/* ── Home-page film & hero teaser ───────────────────────────────────────── */
.hero-film-cta {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

dialog.film-dialog {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-primary);
  color: var(--text-primary);
  padding: 0;
  max-width: min(92vw, 1040px);
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

dialog.film-dialog::backdrop {
  background: rgba(11, 12, 15, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.film-dialog-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.film-dialog-close {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.film-dialog-close:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.film-dialog-body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.film-dialog-body video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  #hero-teaser {
    animation: none !important;
  }
}

