/* ============ tokens ============ */
:root {
  --cream: #faf6ef; --paper: #ffffff; --ink: #17151c; --muted: #6c6877; --line: #e6e0d4;
  --accent: #ff5b2e; --accent-d: #e84a1e; --indigo: #2b2dff; --ok: #1f8a4c; --bad: #c92a2a;
  --r: 14px; --shadow: 0 10px 30px rgba(23, 21, 28, .10);
  --head: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; }
a { color: var(--indigo); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }

/* ============ buttons / forms ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 1.5px solid transparent; border-radius: 999px;
  padding: .7em 1.3em; font: 600 .95rem var(--body); cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--ink); color: #fff; } .btn-primary:hover { background: #2c2935; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255, 91, 46, .35); } .btn-accent:hover { background: var(--accent-d); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn-ghost:hover { background: #fff; border-color: #cfc8b9; }
.btn-sm { padding: .4em .9em; font-size: .85rem; } .btn-block { width: 100%; }
.danger { color: var(--bad); }
label { display: block; font-size: .85rem; font-weight: 600; color: #3a3744; }
input, select, textarea { width: 100%; font: 400 .95rem var(--body); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: .65em .8em; margin-top: .3em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(43, 45, 255, .15); }
textarea { resize: vertical; }
.alert { background: #fdecec; color: #8a1f1f; border: 1px solid #f5c2c2; border-radius: 10px; padding: .7em 1em; margin: 0 0 1em; font-size: .9rem; }
.alert.ok { background: #e8f6ee; color: #14532d; border-color: #b7e2c8; }
.chips { display: flex; flex-wrap: wrap; gap: .5em; margin: .7em 0; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35em .8em; font: 500 .8rem var(--body); cursor: pointer; }
.chips button:hover { border-color: var(--ink); }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 1rem; padding: .3em; border-radius: 8px; } .icon-btn:hover { background: #f0ebe0; }

/* ============ nav / footer ============ */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(250, 246, 239, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .45em; font: 800 1.3rem var(--head); color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
.logo-mark { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.3em; }
.nav-links a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; } .nav-links a:not(.btn):hover { color: var(--accent); }
.footer { border-top: 1px solid var(--line); padding: 1.6em 0; color: var(--muted); font-size: .9rem; }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1em; }

/* ============ landing ============ */
.hero { padding: 72px 0 56px; background: radial-gradient(900px 400px at 85% 0%, rgba(255, 91, 46, .14), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(43, 45, 255, .08), transparent 60%); }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.pill { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3em .9em; font-size: .8rem; font-weight: 600; margin-bottom: 1.2em; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 1.15rem; color: #3f3b4a; max-width: 34em; }
.hero-form { display: grid; gap: .7em; margin: 1.6em 0 .6em; max-width: 34em; }
.hero-form textarea { margin: 0; padding: 1em; border-radius: 14px; box-shadow: var(--shadow); }
.hero-art { position: relative; height: 420px; }
.art-slide { position: absolute; width: 82%; border-radius: 12px; box-shadow: 0 24px 50px rgba(23, 21, 28, .28); transition: transform .6s ease; }
.art-slide .frame { border-radius: 12px; }
.art-slide.a0 { top: 0; left: 0; transform: rotate(-4deg); z-index: 1; }
.art-slide.a1 { top: 110px; right: 0; transform: rotate(3deg); z-index: 2; }
.art-slide.a2 { top: 235px; left: 6%; transform: rotate(-1.5deg); z-index: 3; }
.section { padding: 80px 0; } .section.alt { background: #f3ede1; }
.h2 { font-size: clamp(1.9rem, 3.5vw, 2.7rem); text-align: center; margin-bottom: 1.2em; font-weight: 800; }
.h3 { font-size: 1.4rem; font-weight: 700; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.5em; }
.card h3 { font-size: 1.15rem; margin-bottom: .4em; } .card p { margin: 0; color: #4a4655; }
.step .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .95rem var(--head); margin-bottom: .8em; }
.price-card { background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 2em; display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.5em 2em; align-items: center; box-shadow: 8px 8px 0 var(--ink); }
.price-card .btn { grid-column: 1 / -1; }
.price { font: 800 3.4rem var(--head); margin: .1em 0; } .price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: .6em; }
.ticks li { padding-left: 1.7em; position: relative; } .ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1em 1.2em; margin-bottom: .7em; }
.faq summary { cursor: pointer; font-weight: 600; } .faq p { margin: .6em 0 0; color: #4a4655; }

/* ============ auth ============ */
.auth { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2em; box-shadow: var(--shadow); display: grid; gap: 1em; }
.auth-card h1 { font-size: 1.8rem; margin: 0; } .auth-card p { margin: 0; }

/* ============ dashboard ============ */
.dash { padding: 32px 0 80px; }
.gen-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.6em; margin-bottom: 2.2em; box-shadow: var(--shadow); }
.gen-head { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; margin-bottom: .8em; }
.gen-head h1 { font-size: 1.7rem; margin: 0; }
.quota { background: #f3ede1; border-radius: 999px; padding: .3em .9em; font-size: .8rem; font-weight: 600; } .quota-zero { background: #fdecec; color: #8a1f1f; }
.opts { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 12px; align-items: end; }
.opts .btn { height: 44px; margin-bottom: 1px; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.deck-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.deck-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.deck-card .frame { border-radius: 0; }
.deck-meta { display: flex; justify-content: space-between; align-items: center; padding: .8em 1em; gap: .5em; }
.deck-meta strong { display: block; font-size: .95rem; line-height: 1.25; } .deck-meta span { display: block; }
.loading { position: fixed; inset: 0; background: rgba(250, 246, 239, .92); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; }
.loading-card { text-align: center; } .loading-card h2 { font-size: 1.6rem; }
.spinner { width: 48px; height: 48px; border: 5px solid #eadfcd; border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 1em; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal { position: fixed; inset: 0; background: rgba(23, 21, 28, .55); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal-card { position: relative; background: #fff; border-radius: 20px; padding: 2em; width: min(440px, 100%); display: grid; gap: .8em; }
.modal-card h2 { margin: 0; } .modal-card p { margin: 0; }
.modal-x { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.acct { padding: 40px 0; } .acct .card { display: grid; gap: .8em; } .acct h1 { text-align: left; }
.legal { padding: 40px 0 80px; } .legal p { color: #3a3744; }
.view { padding: 28px 0 60px; } .view-head { display: flex; justify-content: space-between; align-items: center; gap: 1em; margin-bottom: 1em; }
.view-head h1 { margin: 0; font-size: 1.8rem; }
.view-slides { display: grid; gap: 20px; max-width: 900px; margin: 0 auto 2em; }
.view-slide { box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }

/* ============ editor ============ */
.editor-page { background: #ece8df; overflow: hidden; }
.ed { height: 100vh; display: grid; grid-template-rows: 58px 1fr; }
.ed-bar { display: flex; align-items: center; gap: 14px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.title-input { border: 1.5px solid transparent; background: transparent; font: 700 1.05rem var(--head); margin: 0; padding: .35em .5em; max-width: 360px; }
.title-input:hover { border-color: var(--line); }
.status { font-size: .8rem; color: var(--muted); white-space: nowrap; } .status.bad { color: var(--bad); }
.ed-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ed-actions select { width: auto; margin: 0; padding: .45em .7em; border-radius: 999px; }
.menu { position: relative; } .menu-list { position: absolute; right: 0; top: 110%; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; z-index: 30; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .6em .8em; border-radius: 8px; font: 500 .9rem var(--body); cursor: pointer; } .menu-list button:hover { background: #f3ede1; }
.ed-body { display: grid; grid-template-columns: 210px 1fr 290px; min-height: 0; }
.thumbs-col { background: #f7f3ea; border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.thumbs { overflow-y: auto; display: grid; gap: 10px; align-content: start; flex: 1; padding: 2px; }
.thumb { position: relative; border-radius: 8px; cursor: pointer; outline: 2px solid transparent; outline-offset: 1px; } .thumb .frame { border-radius: 6px; }
.thumb.on { outline-color: var(--accent); } .thumb:hover { outline-color: #cfc8b9; } .thumb.on:hover { outline-color: var(--accent); }
.tn { position: absolute; left: 6px; bottom: 5px; z-index: 2; font: 700 .7rem var(--body); color: #fff; background: rgba(0, 0, 0, .55); border-radius: 6px; padding: 0 .4em; }
.stage-col { overflow-y: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.stage { width: min(100%, 980px); box-shadow: 0 18px 50px rgba(23, 21, 28, .22); border-radius: 10px; }
.stage .frame { border-radius: 10px; }
.stage-nav { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--muted); }
.notes-wrap { width: min(100%, 980px); } .notes-wrap textarea { background: #fff; }
.panel { background: #fff; border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.panel h3 { font-size: 1rem; margin: 10px 0 0; } .panel .row { display: flex; gap: 8px; } .panel .row .btn { flex: 1; padding-inline: .4em; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7em 1.2em; border-radius: 999px; font-size: .9rem; z-index: 200; max-width: 90vw; }
#printArea { display: none; }

/* ============ slides (fixed 1280x720, scaled by JS) ============ */
.frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.slide { position: absolute; left: 0; top: 0; width: 1280px; height: 724px; transform-origin: 0 0; overflow: hidden; /* +4px hides sub-pixel seams when scaled */
  font-family: 'Inter', system-ui, sans-serif; color: var(--fg); background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%); }
.slide * { box-sizing: border-box; margin: 0; }
.slide .f { outline: none; }
.slide[data-edit="1"] .f { cursor: text; border-radius: 8px; transition: background .12s; }
.slide[data-edit="1"] .f:hover { background: rgba(127, 127, 127, .14); }
.slide[data-edit="1"] .f:focus { background: rgba(127, 127, 127, .2); box-shadow: 0 0 0 3px var(--ac); }
.slide .f:empty::before { content: attr(data-ph); opacity: .4; }
.slide[data-edit="0"] .f:empty { display: none; }
.slide .deco { position: absolute; border-radius: 50%; pointer-events: none; }
.slide .d1 { width: 560px; height: 560px; right: -160px; top: -200px; background: radial-gradient(circle at 35% 35%, var(--ac), transparent 70%); opacity: .5; }
.slide .d1.small { width: 360px; height: 360px; right: -120px; top: -140px; opacity: .35; }
.slide .d2 { width: 460px; height: 460px; left: -140px; bottom: -220px; background: radial-gradient(circle at 60% 60%, var(--ac2), transparent 70%); opacity: .4; }
.slide .inner { position: absolute; inset: 0; padding: 84px 104px; display: flex; flex-direction: column; justify-content: center; }
.slide .inner.top { justify-content: flex-start; padding-top: 72px; }
.slide h1 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 80px; line-height: 1.04; font-weight: 800; letter-spacing: -.025em; margin-bottom: 28px; }
.slide h2 { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 54px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin-bottom: 40px; }
.slide h2::after { content: ''; display: block; width: 72px; height: 6px; border-radius: 3px; background: var(--ac); margin-top: 20px; }
.slide .sub { font-size: 32px; line-height: 1.35; color: var(--muted); max-width: 900px; }
.slide .bar { width: 96px; height: 8px; border-radius: 4px; background: var(--ac); margin-bottom: 36px; }
.slide.l-closing .inner, .slide.l-title .inner { max-width: 1100px; }
.slide ul { list-style: none; padding: 0; display: grid; gap: 22px; }
.slide.l-bullets ul { flex: 1; align-content: center; padding-bottom: 40px; }
.slide li { position: relative; padding-left: 44px; font-size: 34px; line-height: 1.3; }
.slide li::before { content: ''; position: absolute; left: 0; top: .5em; width: 16px; height: 16px; border-radius: 5px; background: var(--ac); transform: rotate(45deg) scale(.8); }
.slide.dense li { font-size: 27px; } .slide.dense ul { gap: 15px; }
.slide .cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 48px; flex: 1; margin-bottom: 44px; }
.slide .col { background: var(--card); border-radius: 22px; padding: 36px 40px; }
.slide .col h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 34px; font-weight: 700; color: var(--ac); margin-bottom: 20px; }
.slide .col li { font-size: 28px; padding-left: 36px; } .slide.dense .col li { font-size: 23px; }
.slide .stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 28px; flex: 1; align-items: center; padding-bottom: 48px; }
.slide .stat { background: var(--card); border-radius: 24px; padding: 44px 28px; text-align: center; }
.slide .stat .num { font-family: 'Bricolage Grotesque', sans-serif; font-size: 84px; line-height: 1; font-weight: 800; color: var(--ac); margin-bottom: 18px; }
.slide .stat .lbl { font-size: 26px; line-height: 1.3; color: var(--muted); }
.slide .qm { font-family: 'Bricolage Grotesque', serif; font-size: 200px; line-height: .6; color: var(--ac); height: 90px; }
.slide blockquote { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; font-size: 52px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 10px 0 30px; max-width: 1000px; }
.slide cite { font-style: normal; font-size: 28px; color: var(--muted); } .slide cite::before { content: '— '; }
.slide .pn { position: absolute; right: 44px; bottom: 28px; font-size: 20px; color: var(--muted); font-weight: 600; }

/* ============ present mode ============ */
.present { position: fixed; inset: 0; background: #000; z-index: 1000; }
.pstage .slide { position: absolute; }
.pbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(20, 20, 20, .75); color: #fff; border-radius: 999px; padding: 6px 12px; opacity: 0; transition: opacity .2s; font-size: .85rem; }
.present:hover .pbar { opacity: 1; }
.pbar button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; padding: .2em .6em; border-radius: 8px; } .pbar button:hover { background: rgba(255, 255, 255, .15); }

/* ============ print (PDF export) ============ */
@page { size: 1280px 720px; margin: 0; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing { background: #fff; overflow: visible; }
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; }
  #printArea .slide { position: relative; transform: none !important; height: 720px; page-break-after: always; break-after: page; }
}

/* ============ responsive ============ */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; } .hero-art { height: 340px; order: -1; }
  .grid3 { grid-template-columns: 1fr; } .price-card { grid-template-columns: 1fr; box-shadow: 5px 5px 0 var(--ink); }
  .opts { grid-template-columns: 1fr 1fr; } .opts .btn { grid-column: 1 / -1; }
  .ed-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; overflow-y: auto; }
  .editor-page { overflow: auto; } .ed { height: auto; min-height: 100vh; }
  .thumbs-col { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .thumbs { display: flex; overflow-x: auto; } .thumb { width: 150px; flex: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .ed-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; } .ed-actions { flex-wrap: wrap; }
  .nav-links { gap: .8em; } .nav-links a.btn { display: none; }
}
