/*
 * Spokly design system.
 * Tokens first, then base styles, then components. Shared by every page;
 * page-only styles live in that page's own <style> block.
 */

/* ============================================================ Tokens */
:root {
  --bg:            #FFFFFF;
  --bg-subtle:     #FAFAF9;
  --surface:       #FFFFFF;
  --field:         #F5F5F4;
  --hover:         #F5F5F4;
  --border:        #E7E5E4;
  --border-strong: #D6D3D1;
  --text:          #0C0A09;
  --text-2:        #57534E;
  --text-3:        #A8A29E;
  --primary:       #0C0A09;
  --primary-ink:   #FFFFFF;
  --accent-1:      #A78BFA;
  --accent-2:      #7DD3FC;
  --accent-3:      #FDBA74;
  --success:       #16A34A;
  --success-ink:   #15803D;   /* green text that passes AA on white */
  --danger:        #DC2626;
  --focus:         #0C0A09;

  --thumb:         #FFFFFF;   /* segmented-control thumb */
  --nav-bg:        rgba(255, 255, 255, .8);
  --overlay:       rgba(12, 10, 9, .32);
  --tile-ink:      #1C1917;
  --orb-opacity:   .45;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow:    0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .04), 0 12px 40px rgba(0, 0, 0, .08);

  --r-pill: 999px;
  --r-card: 16px;
  --r-input: 12px;
  --r-sm: 8px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 64px;
  --gutter: 24px;

  /* One soft gradient per tool category (icon tiles) */
  --grad-free:    linear-gradient(135deg, #BBF7D0, var(--accent-2));
  --grad-source:  linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --grad-write:   linear-gradient(135deg, var(--accent-2), #C4B5FD);
  --grad-social:  linear-gradient(135deg, var(--accent-3), var(--accent-1));
  --grad-publish: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  --grad-video:   linear-gradient(135deg, var(--accent-1), var(--accent-3));
  --grad-audio:   linear-gradient(135deg, var(--accent-3), var(--accent-2));

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0C0A09; --bg-subtle: #141210; --surface: #1C1917; --field: #1C1917; --hover: #292524;
  --border: #292524; --border-strong: #44403C; --text: #FAFAF9; --text-2: #A8A29E; --text-3: #78716C;
  --primary: #FAFAF9; --primary-ink: #0C0A09; --focus: #FAFAF9;
  --success-ink: #4ADE80;
  --thumb: #44403C;
  --nav-bg: rgba(12, 10, 9, .8);
  --overlay: rgba(0, 0, 0, .6);
  --orb-opacity: .3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ============================================================ Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body > main { flex: 1 0 auto; }
body.is-locked { overflow: hidden; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent-1) 35%, transparent); }

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

.icon { width: 16px; height: 16px; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 300;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--primary); color: var(--primary-ink); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ============================================================ Typography */
.display { font-size: clamp(40px, 6.4vw, 64px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.h2 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.app-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.lead { font-size: 18px; line-height: 1.55; color: var(--text-2); }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.small { font-size: 13px; color: var(--text-2); }
@media (max-width: 640px) { .lead { font-size: 16px; } }

/* ============================================================ Layout */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 800px; }
.section { position: relative; padding-block: 96px; }
.section-subtle { background: var(--bg-subtle); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 720px) { .section { padding-block: 64px; } .section-head { margin-bottom: 32px; } }

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }

/* Hero (marketing) */
.hero { position: relative; overflow: clip; padding: 88px 0 72px; text-align: center; }
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero .lead { max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
@media (max-width: 640px) { .hero { padding: 56px 0 48px; } }

/* ============================================================ Orbs */
.orb {
  position: absolute; z-index: 0; pointer-events: none;
  width: var(--orb-size, 480px); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 35%, var(--accent-1), transparent 58%),
    radial-gradient(circle at 70% 35%, var(--accent-2), transparent 58%),
    radial-gradient(circle at 50% 72%, var(--accent-3), transparent 58%);
  filter: blur(60px); opacity: var(--orb-opacity);
  animation: orb-drift 18s ease-in-out infinite alternate;
}
.orb-center { left: 50%; translate: -50% 0; }
@keyframes orb-drift {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(40deg) scale(1.08); }
}

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  font: 500 14px/1 var(--font); text-decoration: none; white-space: nowrap; user-select: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 84%, var(--bg)); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; color: var(--text); }
.link-arrow .icon { transition: transform .15s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ============================================================ Form fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-2); }
.field-error { font-size: 13px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-width: 0;
  background: var(--field); color: var(--text);
  border: 1px solid transparent; border-radius: var(--r-input);
  font: 400 15px/1.5 var(--font); padding: 9px 14px;
  transition: border-color .15s, background-color .15s;
}
.input, .select { height: 40px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--border-strong); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.7; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* ============================================================ Cards */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
@media (max-width: 640px) { .card-pad { padding: 18px; } }

.tool-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  color: inherit; text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tool-card h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tool-card p { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.tool-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Gradient icon tiles */
.tile {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; color: var(--tile-ink);
  background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .6), transparent 62%), var(--tile-grad, var(--grad-source));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.tile .icon { width: 20px; height: 20px; }
.tile-sm { width: 32px; height: 32px; border-radius: 10px; }
.tile-sm .icon { width: 16px; height: 16px; }
.tile-lg { width: 48px; height: 48px; border-radius: 14px; }
.tile-lg .icon { width: 24px; height: 24px; }
.tile-free    { --tile-grad: var(--grad-free); }
.tile-source  { --tile-grad: var(--grad-source); }
.tile-write   { --tile-grad: var(--grad-write); }
.tile-social  { --tile-grad: var(--grad-social); }
.tile-publish { --tile-grad: var(--grad-publish); }
.tile-video   { --tile-grad: var(--grad-video); }
.tile-audio   { --tile-grad: var(--grad-audio); }

/* ============================================================ Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface);
  font: 500 13px/1 var(--font); color: var(--text); white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--hover); border-color: var(--border-strong); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: var(--hover); color: var(--text-2);
  font: 500 12px/1 var(--font); white-space: nowrap;
}
.badge-free { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success-ink); }
.badge-outline { background: transparent; border: 1px solid var(--border); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* "Soon": AI tools before paid plans launch (PAID_FEATURES off) */
.badge-soon { height: 20px; padding: 0 7px; font-size: 11px; background: transparent; border: 1px solid var(--border); color: var(--text-2); vertical-align: 1px; }

/* ============================================================ Segmented control */
.segmented {
  position: relative; isolation: isolate; display: inline-flex; gap: 2px; padding: 4px;
  border-radius: var(--r-pill); background: var(--field); max-width: 100%;
}
.segmented > [role="radio"] {
  position: relative; z-index: 1; flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent;
  font: 500 14px/1 var(--font); color: var(--text-2); white-space: nowrap;
  transition: color .15s;
}
.segmented > [role="radio"]:hover { color: var(--text); }
.segmented > [role="radio"][aria-checked="true"] { color: var(--text); }
.segmented > [role="radio"]:disabled { opacity: .4; cursor: not-allowed; }
.segmented-thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0;
  border-radius: var(--r-pill); background: var(--thumb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .06);
}
.segmented.is-ready .segmented-thumb { transition: transform .28s var(--ease), width .28s var(--ease); }
/* Without JS the checked option gets the thumb background itself */
.segmented:not(.is-ready) > [role="radio"][aria-checked="true"] { background: var(--thumb); box-shadow: var(--shadow-sm); }
.segmented-block { display: flex; width: 100%; }
.segmented-lg > [role="radio"] { height: 40px; padding: 0 20px; font-size: 15px; }

/* ============================================================ Progress & spinner */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--field); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--primary); transition: width .3s var(--ease); }
.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none; vertical-align: -2px;
  border: 2px solid var(--border-strong); border-top-color: var(--text); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ Empty state */
.empty-state {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 56px 24px; text-align: center;
}
.empty-state > .orb { --orb-size: 260px; top: 50%; left: 50%; translate: -50% -60%; z-index: -1; }
.empty-state p { max-width: 38ch; color: var(--text-2); }

/* ============================================================ Accordion */
.accordion { border-top: 1px solid var(--border); }
.accordion details { border-bottom: 1px solid var(--border); }
.accordion summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; font-size: 16px; font-weight: 500; cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ""; width: 16px; height: 16px; flex: none; background: var(--text-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s var(--ease);
}
.accordion details[open] > summary::after { transform: rotate(45deg); }
.accordion-body { padding: 0 0 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 10px; }

/* ============================================================ Overlays: modal & drawer */
.overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fade-in .18s var(--ease);
}
.modal {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 28px; animation: pop-in .2s var(--ease);
}
.modal-close { position: absolute; top: 12px; right: 12px; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: slide-in-right .24s var(--ease);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide-in-right { from { transform: translateX(100%); } }

/* ============================================================ Toasts */
.toasts {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1100;
  transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lg);
  font: 500 14px/1.4 var(--font); animation: toast-in .22s var(--ease);
}
.toast.is-error { background: var(--danger); color: #FFFFFF; }
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================ Navbar */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 600 19px/1 var(--font); letter-spacing: -0.03em; flex: none; }
.logo-mark { width: 22px; height: 22px; }

.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav-inner { position: relative; height: var(--nav-h); display: flex; align-items: center; gap: 8px; }
.nav-links { flex: 1; display: flex; justify-content: center; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: transparent;
  font: 500 14px/1 var(--font); color: var(--text-2); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--text); background: var(--hover); }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link .icon { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.nav-link[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-burger { display: none; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

@media (max-width: 900px) {
  .nav-links, .nav-signin { display: none; }
  .nav-burger { display: inline-grid; }
}
@media (max-width: 400px) {
  .nav-cta { height: 36px; padding: 0 14px; font-size: 13px; }
  .nav-actions { gap: 2px; }
}

/* Product mega-menu */
.mega {
  position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  width: min(800px, calc(100vw - 48px));
  display: grid; grid-template-columns: 250px 1fr; gap: 8px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: pop-in .18s var(--ease);
}
.mega-feature {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  min-height: 230px; padding: 20px; border-radius: 14px;
  background: var(--bg-subtle); color: var(--text); text-decoration: none;
}
.mega-feature .orb { --orb-size: 260px; top: -110px; left: -50px; z-index: -1; }
.mega-feature strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.mega-feature-desc { font-size: 13px; color: var(--text-2); }
.mega-feature .link-arrow { margin-top: 6px; font-size: 13px; }
.mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-content: start; }
.mega-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background-color .15s; }
.mega-item:hover, .mega-item:focus-visible { background: var(--hover); }
.mega-item strong { display: block; font-size: 14px; font-weight: 500; }
.mega-item small { display: block; font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 2px; }

/* Mobile full-screen menu */
.menu-sheet {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  animation: fade-in .18s var(--ease);
}
.menu-sheet-head { position: sticky; top: 0; z-index: 1; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
.menu-sheet-body { flex: 1; display: flex; flex-direction: column; gap: 24px; padding-block: 12px 24px; }
.menu-group-label { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 4px; padding-inline: 8px; }
.menu-link { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none; }
.menu-link:hover { background: var(--hover); }
.menu-link small { display: block; font-size: 13px; font-weight: 400; color: var(--text-2); }
.menu-sheet-foot { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding-block: 16px max(16px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }

/* ============================================================ Footer */
.footer { margin-top: auto; background: var(--bg-subtle); border-top: 1px solid var(--border); padding: 64px 0 48px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.footer-brand p { max-width: 300px; color: var(--text-2); line-height: 1.6; }
.footer-brand small { font-size: 13px; color: var(--text-2); }
.footer-h { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 12px; letter-spacing: 0; }
.footer-col a { display: block; width: fit-content; padding: 5px 0; color: var(--text-2); text-decoration: none; transition: color .15s; }
.footer-col a:hover { color: var(--text); }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================ Free-tool pieces (studio + landing) */
.status { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--text-2); }
.status.is-error { color: var(--danger); }
.cost-hint { margin: 0; font-size: 13px; color: var(--text-2); }
.cost-hint button, .cost-hint a { font: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; cursor: pointer; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.opts-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.opts-row > .field { flex: 1 1 220px; }
.opts-row > .field:has(.segmented) { flex: 0 1 auto; }

.dropzone {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 240px; padding: 32px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 20px; background: var(--bg-subtle);
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--text-2); background: var(--hover); }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.dropzone .orb { --orb-size: 320px; top: 50%; left: 50%; translate: -50% -50%; z-index: -1; opacity: calc(var(--orb-opacity) * .6); }
.dropzone strong { font-size: 16px; font-weight: 600; }
.dropzone .tile { margin-bottom: 4px; }
.dropzone.is-off { cursor: default; opacity: .7; }
.dropzone.is-off input { pointer-events: none; }
.file-chip { max-width: 100%; height: auto; min-height: 24px; padding: 4px 10px; white-space: normal; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); }
.live-text { max-height: 160px; overflow: auto; padding: 12px 14px; border-radius: 12px; background: var(--bg-subtle); font-size: 14px; color: var(--text-2); white-space: pre-wrap; }

.rec-btn {
  position: relative; display: grid; place-items: center; width: 88px; height: 88px; border: 0; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lg);
  transition: transform .15s var(--ease), background-color .2s;
}
.rec-btn:hover { transform: scale(1.04); }
.rec-btn .rec-mic { width: 32px; height: 32px; }
.rec-btn[aria-pressed="true"] { background: var(--danger); color: #FFFFFF; }
.rec-btn[aria-pressed="true"]::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--danger); animation: rec-pulse 1.4s ease-out infinite; }
.rec-dot { position: absolute; top: 16px; right: 18px; width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; opacity: 0; }
.rec-btn[aria-pressed="true"] .rec-dot { opacity: 1; animation: rec-blink 1s infinite; }
.rec-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
@keyframes rec-pulse { from { transform: scale(.92); opacity: .8; } to { transform: scale(1.3); opacity: 0; } }
@keyframes rec-blink { 50% { opacity: .2; } }
.dictate-state { font-size: 14px; color: var(--text-2); }

/* File picker (Translate) */
.file-pick {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--bg-subtle);
  transition: border-color .15s, background-color .15s;
}
.file-pick:hover { border-color: var(--text-2); background: var(--hover); }
.file-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-pick-text { min-width: 0; }
.file-pick-text strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.file-pick-text small { display: block; font-size: 12px; color: var(--text-2); }
.file-info { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.file-info strong { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.file-info.is-error { color: var(--danger); }

/* Ad slots */
.ad { display: flex; align-items: center; justify-content: center; min-height: 90px; border-radius: 12px; overflow: hidden; }
.ad:empty { display: none; }   /* nothing reserved until an ad (or a dev placeholder) fills it */
.ad.placeholder { border: 1px dashed var(--border-strong); background: var(--bg-subtle); color: var(--text-2); font-size: 12px; }
.ad ins { display: block; width: 100%; }

/* ============================================================ Plan cards */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 780px) { .plans { grid-template-columns: 1fr; } }
.plan-card { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); text-align: left; }
.plan-card.is-popular { border-color: var(--text); }
.plan-card .orb { --orb-size: 260px; top: -150px; right: -110px; z-index: -1; }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-top strong { font-size: 16px; font-weight: 600; }
.plan-price { font-size: 32px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.plan-price small { font-size: 14px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.plan-credits { font-size: 14px; }
.plan-best { font-size: 13px; color: var(--text-2); flex: 1; }

/* "How credits work" box (pricing page, studio, help) */
.how-credits { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.how-credits > p { font-size: 14px; }
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.credits-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.credits-table th, .credits-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.credits-table th { font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--bg-subtle); }
.credits-table tr:last-child td { border-bottom: 0; }
.how-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }

/* ============================================================ Waitlist ("Notify me") */
.notify { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 440px; }
.notify-row { display: flex; gap: 8px; }
.notify-row .input { flex: 1; min-width: 0; }
.notify-row .btn { flex: none; }
@media (max-width: 420px) { .notify-row { flex-direction: column; } }
.notify-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notify-msg { margin: 0; font-size: 14px; }
.notify-msg:empty { display: none; }
.notify-msg.is-ok { color: var(--success-ink); }
.notify-msg.is-error { color: var(--danger); }
.notify-note { margin: 0; font-size: 12px; color: var(--text-2); }
.notify-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.notify.is-done .notify-row, .notify.is-done .notify-note { display: none; }

/* "AI tools coming soon" strip (landing, pricing, help) */
.soon-strip { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; padding: 24px; }
.soon-strip > .orb { --orb-size: 320px; top: -200px; right: -120px; z-index: -1; }
.soon-strip h2, .soon-strip h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.soon-strip p { color: var(--text-2); font-size: 15px; margin-top: 4px; max-width: 46ch; }
.soon-strip .notify { flex: 1 1 320px; }

/* ============================================================ Long-form pages (About, Privacy, Terms, Refund) */
.policy { padding-block: 8px 96px; }
.policy h2 { margin-top: 36px; margin-bottom: 10px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; scroll-margin-top: calc(var(--nav-h) + 16px); }
.policy h3 { margin-top: 20px; margin-bottom: 6px; font-size: 16px; font-weight: 600; }
.policy p, .policy li { color: var(--text-2); }
.policy p + p { margin-top: 12px; }
.policy ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.policy strong { color: var(--text); font-weight: 600; }
.policy a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.policy .updated { font-size: 13px; color: var(--text-2); }
.policy .summary-card { margin-top: 8px; padding: 20px 22px; }
.policy .summary-card ul { gap: 6px; margin: 0; }
.policy .later { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-subtle); font-size: 14px; }

/* ============================================================ Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* PAID_FEATURES (set on <html data-paid> at build time): parts that exist only with paid plans on, or only before. */
html[data-paid="off"] [data-paid-only] { display: none !important; }
html[data-paid="on"] [data-soon-only] { display: none !important; }
