:root {
  /* premium palette, matching the landing page: near-black, warm off-white, one champagne accent */
  --bg: #070707;
  --bg-2: #0c0c0b;
  --panel: #111110;
  --panel-2: #191917;
  --line: #262521;
  --text: #F5F3EE;
  --muted: #A6A39C;
  --violet: #C9B48A;
  --cyan: #E2D2AE;
  --pink: #C9B48A;
  --ink-dark: #0A0A0A;
  --serif: "Instrument Serif", Georgia, serif;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --grad: linear-gradient(135deg, #E2D2AE, #C9B48A);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .75em 1.25em; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; transition: transform .15s, border-color .15s, opacity .15s; }
.btn:hover { border-color: var(--violet); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 30px -10px rgba(201, 180, 138, .7); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .45em .8em; font-size: .85rem; }
.btn-danger:hover { border-color: var(--err); color: var(--err); }

input, select, textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: .7em .85em; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(201, 180, 138, .25); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35em; font-weight: 500; }
.field { margin-bottom: 1rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.pill { display: inline-flex; align-items: center; gap: .4em; padding: .3em .75em; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; }
.badge { font-size: .72rem; padding: .2em .6em; border-radius: 999px; font-weight: 600; background: var(--panel-2); color: var(--muted); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.err { color: var(--err); }

/* ---------- Landing ---------- */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(7, 8, 15, .7); border-bottom: 1px solid rgba(38, 43, 77, .6); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-weight: 900; color: #fff; font-size: .95rem; }
.logo-svg { width: 42px; height: 42px; flex: none; }
.logo-word { display: block; font: 700 1.75rem/1 "Outfit", var(--font); letter-spacing: -0.03em; text-transform: lowercase; }
.logo-word b { font-weight: inherit; color: inherit; }
.logo-word small { display: block; font: 500 .55rem/1 "Outfit", var(--font); letter-spacing: .62em; text-transform: uppercase; color: rgba(243, 240, 255, .62); margin: 5px 0 0; }
.logo small { display: block; font-size: .65rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-top: -3px; }
.nav-links { display: flex; gap: 1.75rem; align-items: center; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; z-index: -1; }
.hero::before { width: 520px; height: 520px; background: var(--violet); top: -160px; left: -120px; }
.hero::after { width: 460px; height: 460px; background: var(--cyan); top: 40px; right: -160px; opacity: .3; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.75rem 0 1rem; }

.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; transform: rotate(-2deg); }
.tile { border-radius: 16px; border: 1px solid var(--line); padding: 14px; background: var(--panel); position: relative; overflow: hidden; min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile .art { position: absolute; inset: 0; opacity: .9; }
.tile .meta { position: relative; z-index: 1; font-size: .78rem; background: rgba(7, 8, 15, .65); backdrop-filter: blur(6px); padding: 6px 10px; border-radius: 8px; align-self: flex-start; }
.tile.tall { grid-row: span 2; min-height: 354px; }
.art-1 { background: radial-gradient(circle at 30% 30%, #8E8064, transparent 55%), #141412; }
.art-2 { background: radial-gradient(circle at 60% 40%, #5A5243, transparent 60%), #111110; }
.art-3 { background: radial-gradient(circle at 50% 120%, #C9B48A, transparent 60%), #0c0c0b; }
.play { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; z-index: 1; }
.play::after { content: ''; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }

.logos { padding: 28px 0; border-block: 1px solid var(--line); color: var(--muted); }
.logos .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; font-weight: 600; font-size: .95rem; }

section.block { padding: 88px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: .75rem; display: block; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1rem; }
.feature ul { padding-left: 1.1em; color: var(--muted); margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-top: 3.5rem; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 1.4rem; left: 1.5rem; width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; }

.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), 0 20px 60px -30px rgba(201, 180, 138, .8); position: relative; }
.price-card.featured::before { content: 'Most popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); font-size: .72rem; font-weight: 700; padding: .25em .8em; border-radius: 999px; }
.price { font-size: 2.4rem; font-weight: 800; margin: .25rem 0; }
.price span { font-size: .95rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; flex: 1; }
.price-card li { padding: .35em 0 .35em 1.6em; position: relative; color: var(--muted); font-size: .93rem; }
.price-card li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: .75rem 0 0; }

.cta-band { text-align: center; padding: 64px 24px; border-radius: 24px; background: radial-gradient(circle at 20% 0%, rgba(201, 180, 138, .45), transparent 60%), radial-gradient(circle at 80% 100%, rgba(226, 210, 174, .35), transparent 60%), var(--panel); border: 1px solid var(--line); }

footer.site { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: .85rem; margin-top: 88px; }
footer.site .container { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer.site a { color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at 15% 10%, rgba(201, 180, 138, .25), transparent 45%), radial-gradient(circle at 85% 90%, rgba(226, 210, 174, .18), transparent 45%); }
.auth-card { width: min(420px, 100%); }
.tabs { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 1.25rem; }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); padding: .55em; border-radius: 7px; font: 600 .9rem var(--font); cursor: pointer; }
.tabs button.active { background: var(--panel-2); color: var(--text); }
.alert { padding: .7em .9em; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; border: 1px solid; }
.alert.err { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); color: var(--err); }
.alert.ok { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .08); color: var(--ok); }
.alert.info { border-color: rgba(226, 210, 174, .4); background: rgba(226, 210, 174, .08); color: var(--cyan); }

/* ---------- App ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { margin: 0 8px 22px; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .65em .8em; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .93rem; }
.side-link:hover { background: var(--panel); color: var(--text); }
.side-link.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--violet); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.6rem; margin: 0; }
.credits { background: var(--grad); color: #fff; border: 0; }

.create-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.kind-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1.25rem; }
.kind-tabs button { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: .7em .5em; font: 600 .85rem var(--font); cursor: pointer; }
.kind-tabs button.active { border-color: var(--violet); color: var(--text); background: rgba(201, 180, 138, .12); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model-desc { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.cost-line { display: flex; justify-content: space-between; align-items: center; margin: .5rem 0 1rem; font-size: .9rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.item .media { aspect-ratio: 1; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.item .media img, .item .media video { width: 100%; height: 100%; object-fit: cover; }
.item .info { padding: 10px 12px; font-size: .82rem; }
.item .info .prompt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.item .actions { display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--violet); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7em .6em; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td input { padding: .4em .6em; width: 110px; }
.table-wrap { overflow-x: auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat .k { font-size: .8rem; color: var(--muted); } .stat .v { font-size: 1.6rem; font-weight: 800; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: grid; place-items: center; z-index: 100; padding: 24px; }
.lightbox img, .lightbox video { max-height: 85vh; border-radius: 12px; }
.toast { position: fixed; bottom: 20px; right: 20px; z-index: 200; max-width: 360px; }

.storage-meter { margin: .4rem 0 .8rem; }
.storage-meter .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; }
.storage-meter .bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s; }
.storage-meter.full .bar span { background: var(--err); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border-style: dashed; cursor: pointer; padding: 32px; }
.dropzone.over { border-color: var(--violet); background: rgba(201, 180, 138, .08); }
.kind-tabs { grid-template-columns: repeat(4, 1fr) !important; }
.asset-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; }
.asset-pick { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); cursor: pointer; background: var(--bg-2); padding: 0; }
.asset-pick img, .asset-pick video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.asset-pick.on { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(201, 180, 138, .35); }
.asset-pick .n { position: absolute; top: 3px; right: 3px; background: var(--violet); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; }
.star { background: none; border: 0; cursor: pointer; font-size: 1.05rem; color: var(--muted); padding: 0 4px; }
.star.on { color: var(--warn); }

.mobile-nav { display: none; }

@media (max-width: 960px) {
  .hero-grid, .create-grid { grid-template-columns: 1fr; }
  .features, .steps { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; }
  .mobile-nav a { white-space: nowrap; }
}
@media (max-width: 560px) {
  .pricing { grid-template-columns: 1fr; }
  .showcase { transform: none; }
  .row { grid-template-columns: 1fr; }
}

/* Studio assistant (Create view) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.assistant { margin-bottom: 20px; }
.assistant-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.assistant-head h3 { margin: 0; }
.assistant-log { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
.assistant-log:empty { display: none; }
.assistant-msg { max-width: 760px; padding: 10px 14px; border-radius: 12px; line-height: 1.5; }
.assistant-msg p { margin: 0; }
.assistant-msg.me { justify-self: end; background: var(--panel-2); border: 1px solid var(--line); }
.assistant-msg.bot { justify-self: start; border: 1px solid var(--line); }
.assistant-card { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--panel-2); display: grid; gap: 6px; justify-items: start; }
.assistant-prompt { color: var(--text); }
.assistant-ask { display: flex; gap: 10px; align-items: stretch; }
.assistant-ask textarea { flex: 1; resize: vertical; min-height: 48px; }
.assistant-ask .btn { flex: none; min-width: 96px; }
@media (max-width: 560px) { .assistant-ask { flex-direction: column; } }

/* ---------- premium layer (Nov 2026): serif display type, spaced serif wordmark, pill buttons ---------- */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; }
.hero h1 { font-weight: 400; }
.topbar h1 { font-size: 2rem; }
.logo-svg { width: 40px; height: 40px; }
.logo-word { font: 400 1.18rem/1 var(--serif); letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase; }
.logo-word small { font: 500 .5rem/1 "Outfit", var(--font); letter-spacing: .62em; color: var(--cyan); margin: 7px 0 0; }
.btn { border-radius: 999px; font-weight: 500; }
.btn:hover { border-color: rgba(245, 243, 238, .4); }
.btn-primary { background: #F5F3EE; color: var(--ink-dark); box-shadow: none; }
.btn-primary:hover { background: #fff; }
.credits, .step::before, .price-card.featured::before, .asset-pick .n { color: var(--ink-dark); }
.eyebrow { font-weight: 500; letter-spacing: .26em; color: var(--cyan); }
.grad-text { background: none; color: rgba(245, 243, 238, .72); font-style: italic; }
.auth-wrap { background: radial-gradient(ellipse 70% 60% at 50% 0%, #1a1814, transparent 70%), var(--bg); }
::selection { background: var(--violet); color: var(--ink-dark); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 8px; }
.side-link, .kind-tabs button { display: flex; align-items: center; }
.kind-tabs button { justify-content: center; }
.ico-lg .ico { width: 34px; height: 34px; margin: 0 auto; stroke: var(--cyan); }
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#turnstile:empty { display: none; }
.alert.warn { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); color: var(--warn); }
.rights-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.rights-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); }
.pd-warn { margin-top: 8px; color: var(--warn); }
