/* ---------- design system (light) ---------- */
:root {
  --bg: oklch(0.995 0.002 60);
  --bg-2: oklch(0.975 0.003 60);
  --surface: #ffffff;
  --surface-2: oklch(0.97 0.004 60);
  --surface-3: oklch(0.93 0.005 60);
  --border: oklch(0.90 0.005 60);
  --border-strong: oklch(0.82 0.008 60);
  --text: oklch(0.18 0.008 60);
  --text-2: oklch(0.38 0.008 60);
  --text-3: oklch(0.55 0.008 60);
  --text-4: oklch(0.72 0.008 60);

  /* brand — adjustable via Tweaks */
  --brand: #E11D48;
  --brand-ink: #fff;
  --brand-soft: color-mix(in oklab, var(--brand) 10%, transparent);
  --brand-line: color-mix(in oklab, var(--brand) 25%, transparent);

  --accent: oklch(0.86 0.16 92); /* yellow */
  --green: oklch(0.62 0.16 150);
  --blue: oklch(0.55 0.16 240);
  --purple: oklch(0.55 0.18 305);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --pad: 1rem;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Geist", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(15, 15, 20, 0.04), 0 4px 12px -6px rgba(15, 15, 20, 0.06);
  --shadow-md: 0 2px 4px rgba(15, 15, 20, 0.04), 0 12px 28px -10px rgba(15, 15, 20, 0.10);
  --shadow-brand: 0 0 0 1px var(--brand-line), 0 12px 32px -10px color-mix(in oklab, var(--brand) 30%, transparent);
}

[data-density="compact"] {
  --pad: 0.75rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 8px;
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 25%, transparent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  transition: transform .06s ease, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--brand) 88%, white);
  border-color: color-mix(in oklab, var(--brand) 88%, white);
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-lg { height: 52px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* ---------- cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* ---------- inputs ---------- */
.input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
}
.input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input input { flex: 1; background: transparent; border: 0; outline: none; min-width: 0; }
.input input::placeholder { color: var(--text-3); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.chip.brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.chip.green { background: color-mix(in oklab, var(--green) 14%, transparent); border-color: color-mix(in oklab, var(--green) 35%, transparent); color: var(--green); }
.chip.yellow { background: color-mix(in oklab, var(--accent) 14%, transparent); border-color: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--accent); }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.app[data-density="compact"] { grid-template-columns: 220px 1fr; }
.main {
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .subtitle { color: var(--text-3); font-size: 13px; }
.content { padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; }
[data-density="compact"] .content { padding: 18px 22px; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.sidebar .logo .mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand);
  display: grid; place-items: center;
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 16px -4px color-mix(in oklab, var(--brand) 60%, transparent);
}
.sidebar .nav-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 14px 12px 6px;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sidebar .nav-item:hover { background: var(--surface); color: var(--text); }
.sidebar .nav-item.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.sidebar .nav-item .badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.sidebar .nav-item.active .badge { color: var(--brand); }
.sidebar .icon {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  color: var(--text-3);
}
.sidebar .nav-item.active .icon { color: var(--brand); }

.sidebar .plan-card {
  margin-top: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}
.sidebar .plan-card .name { font-weight: 600; font-size: 13px; }
.sidebar .plan-card .meter {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  margin: 10px 0 6px;
  overflow: hidden;
}
.sidebar .plan-card .meter-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.sidebar .plan-card .row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ---------- thumbnail preview component ---------- */
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111;
  user-select: none;
}
.thumb-canvas {
  position: absolute; inset: 0;
}
.thumb-bg {
  position: absolute; inset: 0;
}
.thumb-stripes::before {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 12px, transparent 12px 28px);
}
.thumb-vignette::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 70%, transparent 30%, rgba(0,0,0,0.45) 100%);
}
.thumb-text {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 2px 0 rgba(0,0,0,0.6);
  -webkit-text-stroke: 1px rgba(0,0,0,0.3);
}
.thumb-text .hl {
  background: var(--accent);
  color: #1a1a1a;
  padding: 0.06em 0.18em 0.02em;
  display: inline-block;
  -webkit-text-stroke: 0;
  text-shadow: none;
  border-radius: 3px;
  transform: rotate(-1.5deg);
}
.thumb-text .hl-red {
  background: #FF3B30;
  color: #fff;
  padding: 0.06em 0.2em 0.02em;
  display: inline-block;
  -webkit-text-stroke: 0;
  text-shadow: none;
  border-radius: 3px;
}
.thumb-avatar {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(0,0,0,0.4), 0 12px 30px -6px rgba(0,0,0,0.5);
  border: 3px solid #fff;
}
.thumb-arrow {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.35em;
  color: var(--accent);
  text-shadow: 0 3px 0 rgba(0,0,0,0.5);
}
.thumb-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
}
.thumb-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 2px 5px;
  border-radius: 3px;
}

/* avatar tile */
.avatar {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.avatar.square { border-radius: 14%; }

/* ---------- helpers ---------- */
.muted { color: var(--text-3); }
.muted-2 { color: var(--text-2); }
.row { display: flex; align-items: center; }
.row-gap { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.col-gap { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); width: 100%; }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-2);
}

/* loading ring */
.ring {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-sizing: border-box;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-brand {
  0%, 100% { box-shadow: 0 0 0 0 var(--brand-soft); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

/* toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  z-index: 100;
  box-shadow: var(--shadow-md);
  animation: toast-in .25s ease;
}
@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in .35s ease both; }

/* ---------- landing ---------- */
.landing-shell {
  background: radial-gradient(ellipse at 50% -20%, color-mix(in oklab, var(--brand) 8%, transparent), transparent 55%), var(--bg);
  min-height: 100vh;
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}
.landing-nav .links { display: flex; gap: 24px; color: var(--text-2); font-size: 13.5px; }
.landing-nav .links a:hover { color: var(--text); }
.landing-hero { max-width: 1280px; margin: 0 auto; padding: 80px 32px 40px; }
.landing-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 18px 0 22px;
  text-wrap: balance;
}
.landing-hero h1 .accent { color: var(--brand); }
.landing-hero .strike { position: relative; display: inline-block; }
.landing-hero .strike::after {
  content: ""; position: absolute;
  top: 55%; left: -2%; right: -2%; height: 6px;
  background: var(--brand);
  transform: rotate(-2deg);
}
.landing-hero p.lead {
  max-width: 580px;
  font-size: 18px;
  color: var(--text-2);
  text-wrap: pretty;
  margin: 0 0 28px;
}
.landing-hero .url-form {
  display: flex; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 8px;
  max-width: 720px;
  box-shadow: var(--shadow-md);
}
.landing-hero .url-form .input {
  flex: 1;
  border: 0;
  background: transparent;
  height: 56px;
  padding: 0 12px;
  font-size: 16px;
}
.landing-hero .url-form .input input { font-size: 16px; }
.landing-hero .url-form .btn { height: 56px; padding: 0 26px; font-size: 15px; border-radius: 10px; }
.landing-hero .trust { display: flex; gap: 18px; margin-top: 18px; color: var(--text-3); font-size: 13px; }
.landing-hero .trust span { display: flex; align-items: center; gap: 6px; }

.landing-hero .preview-strip {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* feature grid */
.features {
  max-width: 1280px;
  margin: 60px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.feature h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.feature p { color: var(--text-2); margin: 0; }
.feature .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}
.feature.span-3 { grid-column: span 3; }
.feature.span-2 { grid-column: span 2; }
.feature.span-4 { grid-column: span 4; }
.feature.span-6 { grid-column: span 6; }
.feature.dark { background: var(--bg-2); }
.feature .visual {
  margin-top: 14px;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
}

/* feature animations */
.feat-anim {
  position: relative;
  height: 180px;
  margin: -8px -8px 14px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* paste anim */
.feat-anim--paste {
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.feat-anim--paste .fa-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  width: 85%;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: var(--shadow-sm);
}
.feat-anim--paste .fa-url-text {
  flex: 1;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}
.feat-anim--paste .fa-typed {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: fa-type 5s steps(20, end) infinite;
}
@keyframes fa-type {
  0% { width: 0; }
  25%, 85% { width: 20ch; }
  90%, 100% { width: 0; }
}
.feat-anim--paste .fa-cursor {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--brand);
  margin-left: 1px;
  animation: fa-blink 0.8s steps(2) infinite;
}
@keyframes fa-blink { 50% { opacity: 0; } }
.feat-anim--paste .fa-arrow-down {
  color: var(--brand);
  opacity: 0;
  animation: fa-arrow-fade 5s ease infinite;
}
.feat-anim--paste .fa-arrow-down svg { width: 12px; height: 20px; }
@keyframes fa-arrow-fade {
  0%, 28% { opacity: 0; transform: translateY(-4px); }
  35%, 45% { opacity: 1; transform: translateY(0); }
  55%, 100% { opacity: 0; transform: translateY(4px); }
}
.feat-anim--paste .fa-thumb-frame {
  width: 110px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.feat-anim--paste .fa-thumb-skel {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.feat-anim--paste .fa-thumb-real {
  position: absolute; inset: 0;
  opacity: 0;
  animation: fa-thumb-reveal 5s ease infinite;
}
@keyframes fa-thumb-reveal {
  0%, 50% { opacity: 0; }
  60% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; }
}

/* avatar anim */
.feat-anim--avatar {
  gap: 22px;
  padding: 18px 20px;
  align-items: center;
  justify-content: center;
}
.feat-anim--avatar .fa-avatar-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  flex-shrink: 0;
}
.feat-anim--avatar .fa-avatar-anchor > div:first-child {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand), 0 8px 20px rgba(0,0,0,0.12);
}
.feat-anim--avatar .fa-anchor-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.feat-anim--avatar .fa-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
}
.feat-anim--avatar .fa-mini-grid::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 12px;
  height: 1.5px;
  background: var(--text-3);
  opacity: 0.4;
}
.feat-anim--avatar .fa-mini {
  width: 104px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(-6px);
  animation: fa-mini-in 4.5s ease infinite;
}
.feat-anim--avatar .fa-mini--1 { animation-delay: 0.3s; }
.feat-anim--avatar .fa-mini--2 { animation-delay: 0.7s; }
.feat-anim--avatar .fa-mini--3 { animation-delay: 1.1s; }
@keyframes fa-mini-in {
  0%, 5% { opacity: 0; transform: translateX(-6px); }
  18% { opacity: 1; transform: translateX(0); }
  88% { opacity: 1; transform: translateX(0); }
  98%, 100% { opacity: 0; transform: translateX(0); }
}

/* emotion anim */
.feat-anim--emotion {
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}
.feat-anim--emotion .fa-face-stage {
  position: relative;
  width: 96px;
  height: 96px;
}
.feat-anim--emotion .fa-face-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  animation: fa-face-cycle 6s ease-in-out infinite;
}
.feat-anim--emotion .fa-face-layer > div { width: 96px !important; height: 96px !important; }
.feat-anim--emotion .fa-face-0 { animation-delay: 0s; }
.feat-anim--emotion .fa-face-1 { animation-delay: 1.5s; }
.feat-anim--emotion .fa-face-2 { animation-delay: 3s; }
.feat-anim--emotion .fa-face-3 { animation-delay: 4.5s; }
@keyframes fa-face-cycle {
  0%, 2% { opacity: 0; transform: scale(0.92); }
  6%, 23% { opacity: 1; transform: scale(1); }
  27%, 100% { opacity: 0; transform: scale(0.92); }
}
.feat-anim--emotion .fa-emotion-chips {
  display: flex;
  gap: 4px;
}
.feat-anim--emotion .fa-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  animation: fa-chip-cycle 6s ease-in-out infinite;
}
.feat-anim--emotion .fa-chip-0 { animation-delay: 0s; }
.feat-anim--emotion .fa-chip-1 { animation-delay: 1.5s; }
.feat-anim--emotion .fa-chip-2 { animation-delay: 3s; }
.feat-anim--emotion .fa-chip-3 { animation-delay: 4.5s; }
@keyframes fa-chip-cycle {
  0%, 2% { background: var(--surface); color: var(--text-3); border-color: var(--border); }
  6%, 23% { background: var(--brand); color: #fff; border-color: var(--brand); }
  27%, 100% { background: var(--surface); color: var(--text-3); border-color: var(--border); }
}

/* social proof numbers */
.numbers {
  max-width: 1280px;
  margin: 60px auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.numbers .stat { padding: 28px; border-right: 1px solid var(--border); }
.numbers .stat:last-child { border-right: 0; }
.numbers .stat .n {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--brand);
  line-height: 1;
}
.numbers .stat .l { color: var(--text-2); margin-top: 8px; }

/* pricing */
.pricing-shell { max-width: 1280px; margin: 80px auto; padding: 0 32px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.plan.highlight {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
  position: relative;
}
.plan.highlight::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in oklab, var(--brand) 6%, transparent), transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}
.plan h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0; }
.plan .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.03em;
  margin: 18px 0 4px;
  line-height: 1;
}
.plan .price small { font-size: 16px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.plan ul li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.plan ul li .check { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.plan .cta { margin-top: auto; }

/* footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  color: var(--text-3);
  font-size: 13px;
}
.footer .row { max-width: 1280px; margin: 0 auto; gap: 28px; }

/* ---------- hero animation: avatar → 3 thumbs (systematic) ---------- */
.hero-anim {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1.1fr;
  gap: 24px;
  align-items: center;
}
.hero-anim .source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.hero-anim .source-avatar {
  width: 110px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}
.hero-anim .source-card .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-anim .arrow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  position: relative;
}
.hero-anim .arrow-col svg { width: 36px; height: 14px; }
.hero-anim .arrow-col .arrow-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-anim .arrow-col .pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse-travel 4.5s linear infinite;
}
@keyframes pulse-travel {
  0%, 100% { opacity: 0; transform: translateX(-12px); }
  10%, 90% { opacity: 1; }
  50% { transform: translateX(12px); }
}

.hero-anim .thumbs-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-anim .thumb-slot {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateX(12px);
  animation: thumb-appear 4.5s cubic-bezier(0.2, 0.8, 0.3, 1) infinite;
}
.hero-anim .thumb-slot.s1 { animation-delay: 0.6s; }
.hero-anim .thumb-slot.s2 { animation-delay: 1.0s; }
.hero-anim .thumb-slot.s3 { animation-delay: 1.4s; }
@keyframes thumb-appear {
  0%, 5% { opacity: 0; transform: translateX(12px); }
  18% { opacity: 1; transform: translateX(0); }
  85% { opacity: 1; transform: translateX(0); }
  95%, 100% { opacity: 0; transform: translateX(0); }
}

.hero-anim .thumb-slot .skeleton {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Public skeleton for image-loading states (gallery cards, avatar grid, etc.) */
.thumb-skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.hero-anim .thumb-slot .thumb-content {
  position: absolute; inset: 0;
  opacity: 0;
  animation: content-reveal 4.5s ease infinite;
}
.hero-anim .thumb-slot.s1 .thumb-content { animation-delay: 0.6s; }
.hero-anim .thumb-slot.s2 .thumb-content { animation-delay: 1.0s; }
.hero-anim .thumb-slot.s3 .thumb-content { animation-delay: 1.4s; }
@keyframes content-reveal {
  0%, 18% { opacity: 0; }
  28% { opacity: 1; }
  85% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .landing-hero-grid { grid-template-columns: 1fr !important; }
  .hero-anim { max-width: 420px; }
}

/* ---------- onboarding ---------- */
.onb-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px;
  display: flex; flex-direction: column; gap: 24px;
  animation: fade-in .35s ease;
}
.onb-wrap h2 { font-family: var(--font-display); font-weight: 700; font-size: 40px; letter-spacing: -0.02em; margin: 0; }
.onb-steps { display: flex; gap: 8px; }
.onb-steps-4 { gap: 12px; }
.onb-steps-4 .step {
  flex: 1;
  height: auto !important;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  position: relative;
  overflow: visible !important;
}
.onb-steps-4 .step .step-num {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-3);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  flex-shrink: 0;
}
.onb-steps-4 .step.done { color: var(--text); border-color: var(--brand); }
.onb-steps-4 .step.done .step-num { background: var(--brand); color: #fff; }
.onb-steps-4 .step.active { color: var(--text); border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent); }
.onb-steps-4 .step.active .step-num { background: var(--brand); color: #fff; animation: pulse-soft 1.4s ease infinite; }
.onb-steps-4 .step.active::after, .onb-steps-4 .step.done::after { display: none; }
@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 40%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--brand) 0%, transparent); }
}
.onb-steps:not(.onb-steps-4) .step {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.onb-steps .step.active::after,
.onb-steps .step.done::after {
  content: ""; position: absolute; inset: 0;
  background: var(--brand);
}
.onb-steps .step.active::after { animation: progress 1.6s ease infinite; transform-origin: left; }
@keyframes progress {
  0% { transform: scaleX(0); }
  60% { transform: scaleX(1); }
  100% { transform: scaleX(1); opacity: 0; }
}
.url-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.url-card .urlrow {
  display: flex; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.url-card .urlrow .input { flex: 1; border: 0; background: transparent; height: 48px; }
.url-card .urlrow .input input { font-size: 15px; }
.url-card .urlrow .btn { height: 48px; padding: 0 22px; }

.video-preview {
  display: flex;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.video-preview .thumb-mini {
  width: 200px; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}
.video-preview .thumb-mini::before {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.85);
  font-size: 28px;
}

/* avatar pick stage */
.onb-avatar-stage { display: flex; flex-direction: column; gap: 22px; }
.onb-found-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.onb-found-thumb {
  width: 84px; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #FF3B30, #8B0000);
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; flex-shrink: 0;
}
.onb-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.onb-avatar-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  font-family: inherit;
}
.onb-avatar-card:hover { border-color: var(--text-3); }
.onb-avatar-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent);
}
.onb-avatar-card .onb-av-face { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.onb-avatar-card .onb-av-face > div { width: 48px !important; height: 48px !important; }
.onb-avatar-card .onb-av-meta { min-width: 0; flex: 1; }
.onb-avatar-card .onb-av-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onb-avatar-card .onb-av-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onb-avatar-card .onb-av-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
}

/* a/b row */
.onb-ab-row {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.onb-ab-row.locked { opacity: 0.85; background: var(--bg-2); }
.onb-ab-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in oklab, var(--brand) 15%, var(--surface));
  color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.onb-switch { display: inline-flex; cursor: pointer; flex-shrink: 0; }
.onb-switch input { display: none; }
.onb-switch-track {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--surface-3); position: relative;
  transition: background .2s;
}
.onb-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .2s;
}
.onb-switch input:checked + .onb-switch-track { background: var(--brand); }
.onb-switch input:checked + .onb-switch-track .onb-switch-thumb { left: 18px; }
.onb-switch.disabled { cursor: not-allowed; opacity: 0.5; }

/* transcript peek */
.onb-transcript-peek {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 460px;
  text-align: left;
}
.onb-transcript-peek p {
  margin: 6px 0 0; font-size: 13px; line-height: 1.5;
  color: var(--text-2); font-style: italic;
}

/* loading state */
.loading-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  text-align: center;
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.loading-state .ring-lg {
  width: 56px; height: 56px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loading-tasks { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin: 0 auto; text-align: left; }
.loading-task { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; transition: color .3s; }
.loading-task.done { color: var(--text); }
.loading-task .dot {
  width: 14px; height: 14px;
  border: 2px solid var(--text-4);
  border-radius: 50%;
  flex-shrink: 0;
}
.loading-task.done .dot { background: var(--brand); border-color: var(--brand); }
.loading-task.active .dot { border-color: var(--brand); border-top-color: transparent; animation: spin 1s linear infinite; }

/* ---------- result (thumb gerada) ---------- */
.result-wrap { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.result-head { display: flex; gap: 16px; align-items: flex-start; }
.result-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); align-items: center; }
.result-meta strong { color: var(--text); font-weight: 600; }
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.result-hero-thumb {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35), 0 0 0 1px var(--border);
  position: relative;
}
.result-hero-thumb > .thumb { position: absolute; inset: 0; width: 100%; height: 100%; }
.result-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.result-cta-stack { display: flex; flex-direction: column; gap: 8px; }
.result-side .divider { height: 1px; background: var(--border); margin: 2px 0; }
.result-recipe { display: flex; flex-direction: column; gap: 12px; }
.recipe-row { display: flex; gap: 10px; align-items: flex-start; }
.recipe-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  display: grid; place-items: center; flex-shrink: 0;
}
.recipe-key { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.recipe-val { font-size: 13px; color: var(--text); margin-top: 2px; }

.result-ab { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.result-ab-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.result-ab-card {
  background: transparent; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 6px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 6px; font-family: inherit;
}
.result-ab-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent); }
.result-ab-thumb { aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; position: relative; }
.result-ab-thumb > .thumb { position: absolute; inset: 0; width: 100%; height: 100%; }
.result-ab-meta { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 4px; }
.result-ab-ctr { font-size: 11px; color: var(--brand); font-weight: 600; font-family: var(--font-mono); }

.regen-warning {
  background: color-mix(in oklab, var(--brand) 8%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--brand) 35%, var(--border));
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 4px;
  animation: fade-in .15s ease;
}
.regen-warning-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.regen-warning-head svg { color: var(--brand); flex-shrink: 0; }

@media (max-width: 880px) {
  .result-hero { grid-template-columns: 1fr; }
  .result-ab-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- editor ---------- */
.editor-shell {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 18px;
  height: calc(100vh - 60px - 56px);
  min-height: 640px;
}
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
}
.editor-panel h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
}
.editor-panel .section { margin-bottom: 22px; }

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.template-tile {
  aspect-ratio: 16/9;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #222;
  transition: border-color .15s;
}
.template-tile:hover { border-color: var(--border-strong); }
.template-tile.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

.editor-canvas {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.editor-canvas .canvas-toolbar {
  height: 44px;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.editor-canvas .canvas-stage {
  flex: 1;
  display: grid; place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 1px 1px, oklch(0.3 0.018 30 / 0.5) 1px, transparent 1.5px) 0 0/16px 16px,
    var(--bg-2);
}
.editor-canvas .stage-thumb { width: min(100%, 760px); }

.avatar-pick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.avatar-pick {
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  overflow: hidden;
}
.avatar-pick.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

.emotion-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.emotion-pill {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-3);
  transition: all .15s;
}
.emotion-pill:hover { color: var(--text); }
.emotion-pill.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.emotion-pill .face {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.emotion-pill.active .face { background: var(--brand); color: var(--brand-ink); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); }
.field textarea, .field input[type=text] {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
}
.field textarea:focus, .field input[type=text]:focus { border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 70px; font-family: var(--font-body); }

.color-swatches { display: flex; gap: 6px; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatch.active { border-color: #fff; }

.slider {
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
}

/* ---------- avatar creator ---------- */
.avatar-creator {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
.avatar-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.avatar-preview-card .big-avatar {
  width: 240px; height: 240px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 6px var(--surface-2), 0 30px 60px -10px rgba(0,0,0,0.6);
}
.avatar-form { display: flex; flex-direction: column; gap: 18px; }
.avatar-form .row-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-form .row-pick .chip-pick {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.avatar-form .row-pick .chip-pick.active {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
}

.avatar-library-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.avatar-lib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.avatar-lib-card:hover { border-color: var(--border-strong); }
.avatar-lib-card .name { font-weight: 600; font-size: 14px; }
.avatar-lib-card .meta { color: var(--text-3); font-size: 12px; font-family: var(--font-mono); }
.avatar-lib-card .lib-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}
.avatar-lib-card.add {
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-3);
}
.avatar-lib-card.add:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- gallery (history) ---------- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.gal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.gal-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.gal-card-thumb {
  border-bottom: 1px solid var(--border);
  aspect-ratio: 16/9;
  overflow: hidden;
}
.gal-card-thumb > .thumb { border-radius: 0; border: 0; width: 100%; height: 100%; }
.gal-card-body {
  padding: 12px 14px 6px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
  min-height: 0;
}
.gal-card-title {
  font-weight: 500; font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.gal-card-meta {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono);
}
.gal-card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.gal-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 12px 12px;
}
.gal-card-actions .btn { justify-content: center; height: 32px; font-size: 12px; }
.gal-avatar-picker { position: relative; grid-column: span 2; }
.gal-avatar-picker > .btn { width: 100%; }
.gal-avatar-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  z-index: 10;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}
.gal-avatar-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border: 0; background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
}
.gal-avatar-opt:hover { background: var(--surface); }
.gal-avatar-opt.active { background: var(--brand-soft); color: var(--brand); }

/* ---------- account ---------- */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.usage-card { padding: 24px; }
.usage-card .meter-big {
  height: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  margin: 16px 0;
  overflow: hidden;
}
.usage-card .meter-big .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), color-mix(in oklab, var(--brand) 50%, var(--accent)));
  border-radius: 999px;
}
.usage-card .big-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ---------- checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.checkout-form { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; }
.checkout-form h3 { font-family: var(--font-display); margin: 0 0 18px; font-size: 22px; }
.checkout-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; position: sticky; top: 80px; }
.summary-card h3 { font-family: var(--font-display); margin: 0 0 18px; font-size: 22px; }
.summary-card .line { display: flex; justify-content: space-between; padding: 10px 0; }
.summary-card .line.total { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 8px; font-size: 18px; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .feature.span-3, .feature.span-4 { grid-column: span 3; }
  .editor-shell { grid-template-columns: 240px 1fr 280px; }
}

/* Tablet (≤1024px) — 2-col fallbacks where 3-col gets cramped, and
   stack the editor side panel below the canvas. */
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .plan.highlight { grid-column: span 2; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: 1fr !important; }
  .checkout-grid { grid-template-columns: 1fr !important; }
  .editor-shell { grid-template-columns: 1fr !important; height: auto !important; }
}

/* Mobile (≤768px) — sidebar becomes a bottom bar, grids collapse to 1
   column, paddings shrink. Most rules use !important because several
   layouts set gridTemplateColumns inline from JSX. */
@media (max-width: 768px) {
  /* App shell: sidebar → bottom nav strip. !important on position so the
     default position:sticky from the desktop rule can't win the cascade
     on browsers that re-apply earlier specificity. */
  .app, .app[data-density="compact"] { grid-template-columns: 1fr !important; }
  .sidebar {
    position: fixed !important;
    bottom: 0 !important; left: 0; right: 0;
    top: auto !important; height: auto !important;
    border-right: 0;
    border-top: 1px solid var(--border);
    padding: 6px 8px env(safe-area-inset-bottom, 6px);
    flex-direction: row;
    align-items: center;
    gap: 4px;
    z-index: 30;
    background: var(--bg-2);
  }
  .sidebar .logo,
  .sidebar .nav-section,
  .sidebar .plan-card { display: none; }
  .sidebar .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 8px 4px;
    justify-content: center;
    font-size: 10px;
    text-align: center;
  }
  .sidebar .nav-item .badge { display: none; }
  .sidebar > div[style*="flex: 1"] { display: none; }
  .main { padding-bottom: 72px; } /* clear the bottom nav */

  /* Topbar */
  .topbar { padding: 0 14px; gap: 8px; height: 56px; }
  .topbar .subtitle { display: none; }
  .topbar .title { font-size: 16px; }
  .content { padding: 16px; }

  /* Landing nav + hero */
  .landing-nav { padding: 14px 16px; gap: 12px; }
  .landing-hero { padding: 36px 16px 24px; }
  .landing-hero-grid { gap: 24px !important; }
  .landing-hero p.lead { font-size: 16px; }
  /* URL form: stack input above the submit button so the input doesn't
     get squeezed off-screen on narrow viewports. */
  .landing-hero .url-form {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
  }
  .landing-hero .url-form .btn {
    width: 100%;
    justify-content: center;
  }

  /* Features grid (Landing.jsx sets repeat(3,1fr) inline → override) */
  .features {
    grid-template-columns: 1fr !important;
    padding: 0 16px;
    gap: 12px;
    margin: 28px auto 60px !important;
  }
  .feature { padding: 18px; }

  /* Pricing */
  .pricing-shell { margin: 50px auto; padding: 0 16px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .plan.highlight { grid-column: auto; }
  .plan { padding: 22px; }
  .plan .price { font-size: 42px; }

  /* Numbers */
  .numbers { grid-template-columns: 1fr 1fr; padding: 0 16px; margin: 40px auto; gap: 8px; }
  .numbers .stat { padding: 16px; border-right: 0; }
  .numbers .stat .n { font-size: 36px; }

  /* Footer */
  .footer .row { padding: 0 16px; flex-direction: column; gap: 18px; }

  /* Onboarding */
  .onb-wrap { padding: 24px 16px; gap: 18px; }
  .onb-wrap h2 { font-size: 26px; }
  /* URL card row: stack input above the "Continuar" button just like the
     landing form does, otherwise the button gets pushed off-screen. */
  .url-card .urlrow {
    flex-direction: column;
    align-items: stretch;
  }
  .url-card .urlrow .btn {
    width: 100%;
    justify-content: center;
  }
  .onb-found-card { flex-direction: column; align-items: stretch; }

  /* Generic .row-gap headers (used in AvatarDetail, AvatarLibrary,
     Account, etc.) are display:flex with no wrap by default — the
     trailing button (e.g. "Usar em thumbnail") gets cut off when the
     title is long. Allow wrap on mobile. */
  .row-gap { flex-wrap: wrap; }

  /* Editor — stack canvas + side panel, no fixed viewport height */
  .editor-shell { gap: 14px; min-height: 0 !important; }
  .editor-panel { padding: 12px; overflow: visible; }

  /* Account / checkout — flip to flex column so the inline grid-column:
     span 2 on the Profile and Transactions cards stops creating implicit
     columns that exceed the viewport. */
  .account-grid {
    display: flex !important;
    flex-direction: column;
    gap: 16px !important;
  }
  .account-grid > * { grid-column: auto !important; min-width: 0; }
  .usage-card .big-num { font-size: 44px; }

  /* Avatar library — looser cards */
  .avatar-library-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hide dev tweaks panel on mobile if it ever opens */
  [data-tweaks-panel] { display: none !important; }

  /* Hero animation: compact the avatar circle so it fits 360px screens */
  .hero-anim { gap: 14px; }
  .hero-anim .source-avatar { width: 78px; }
  .hero-anim .arrow-col svg { width: 24px; }
}

/* tweaks panel adjustments — make it match dark UI */
[data-tweaks-panel] { z-index: 50; }
