/* SpeakerEZ — tokens, base, landing, deck view, shared components. */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../assets/fonts/bricolage-grotesque.woff2') format('woff2-variations'), url('../assets/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #0d1222;
  --ink-2: #4b5168;
  --line: #dddbd3;
  --brand: #0055ff;
  --brand-hover: #0044cc;
  --brand-ink: #ffffff;
  --brand-soft: #e6eeff;
  --amber: #ffb020;
  --amber-soft: rgb(255 176 32 / 0.18);
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --success: #1c7a4c;
  --success-soft: #e5f4ec;
  --stage: #0b0f1c;
  --stage-ink: #f3f4f8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(13 18 34 / 0.06), 0 12px 32px rgb(13 18 34 / 0.08);
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0f1c;
    --surface: #131a2c;
    --surface-2: #1b2338;
    --ink: #eef0f6;
    --ink-2: #a4aac0;
    --line: #273049;
    --brand: #5b93ff;
    --brand-hover: #7aa8ff;
    --brand-ink: #06122e;
    --brand-soft: #16254a;
    --danger: #ff8a80;
    --danger-soft: #3a1714;
    --success: #6fd3a0;
    --success-soft: #11301f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: 0.15em; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0.6em 1.15em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn-small { min-height: 36px; padding: 0.4em 0.9em; font-size: 0.9rem; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

/* Header / footer */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { font: 800 1.35rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.03em; }
.logo span { color: var(--brand); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-2); font-size: 0.9rem; margin-top: 64px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .link-button { color: var(--brand); font-weight: 400; }

/* Banner + busy overlay */
.banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60;
  width: min(640px, calc(100vw - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 14px 44px 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.banner p { flex: 1 1 240px; }
.banner-error { background: var(--danger-soft); border-color: var(--danger); }
.banner-success { background: var(--success-soft); border-color: var(--success); }
.banner-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.busy { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgb(11 15 28 / 0.55); backdrop-filter: blur(3px); }
.busy-card { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

/* Landing */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); position: relative; }
.hero.is-dragging::after { content: 'Drop your .pptx to open it'; position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center; border: 3px dashed var(--brand); border-radius: 24px; background: color-mix(in srgb, var(--brand-soft) 85%, transparent); font: 700 1.5rem var(--font-display); color: var(--brand); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 18px; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.hero h1 { font-size: clamp(2.4rem, 4.4vw, 3.9rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { margin-top: 22px; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cta .btn { min-height: 52px; padding: 0.75em 1.4em; font-size: 1.05rem; }
.cta-note { margin-top: 14px; font-size: 0.92rem; color: var(--ink-2); }
.link-button { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.link-button:hover { color: var(--brand-hover); }

.drafts { margin-top: 28px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.drafts h2 { font: 700 0.95rem var(--font-body); letter-spacing: 0; margin-bottom: 8px; }
.drafts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.drafts li { display: flex; align-items: center; gap: 8px; }
.draft-open { flex: 1; min-width: 0; text-align: left; justify-content: flex-start; border-radius: var(--radius-sm); }
.draft-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-open small { color: var(--ink-2); font-weight: 500; margin-left: auto; white-space: nowrap; }

.benefits { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.benefits li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.9rem; font-weight: 600; }
.benefits li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* Hero preview: a miniature prompter */
.preview { position: relative; border-radius: 22px; background: var(--stage); color: var(--stage-ink); box-shadow: 0 30px 60px -20px rgb(11 15 28 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06) inset; overflow: hidden; aspect-ratio: 4 / 4.2; }
.preview-chrome { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgb(255 255 255 / 0.08); font-size: 0.78rem; color: rgb(243 244 248 / 0.6); }
.preview-chrome i { width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / 0.18); }
.preview-chrome b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.preview-window { position: absolute; inset: 42px 0 0; overflow: hidden; mask-image: linear-gradient(transparent, #000 18%, #000 78%, transparent); }
.preview-track { padding: 0 28px; animation: preview-scroll 42s linear infinite; }
.preview-card { padding: 18px 0 22px; border-bottom: 1px dashed rgb(255 255 255 / 0.14); }
.preview-card h3 { font: 700 0.72rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; }
.preview-card p { font: 600 clamp(1.05rem, 2vw, 1.35rem)/1.45 var(--font-body); }
.preview-card strong { color: #fff; }
.preview-card em { color: #cfe0ff; }
.preview-guide { position: absolute; left: 0; right: 0; top: 38%; height: 64px; background: linear-gradient(90deg, var(--amber-soft), rgb(255 176 32 / 0.06)); border-top: 1px solid rgb(255 176 32 / 0.5); border-bottom: 1px solid rgb(255 176 32 / 0.5); pointer-events: none; }
.preview-guide::before { content: ''; position: absolute; left: 10px; top: 50%; border: 7px solid transparent; border-left-color: var(--amber); transform: translateY(-50%); }
@keyframes preview-scroll { to { transform: translateY(-50%); } }

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; max-width: 18em; }
.section .section-lede { margin-top: 12px; color: var(--ink-2); max-width: 40em; font-size: 1.1rem; }
.reasons { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.reasons li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 16px; align-content: start; }
.reasons svg { grid-row: span 2; width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); }
.reasons h3 { font-size: 1.15rem; align-self: center; }
.reasons p { color: var(--ink-2); }
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; padding: 28px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 800 3rem/1 var(--font-display); color: transparent; -webkit-text-stroke: 1.5px var(--brand); margin-bottom: 18px; }
.steps h3 { font-size: 1.3rem; margin-bottom: 8px; }
.steps p { color: var(--ink-2); }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.value { padding: 26px 24px; border-radius: var(--radius); border: 1px solid var(--line); }
.value svg { width: 28px; height: 28px; color: var(--brand); margin-bottom: 16px; }
.value h3 { font-size: 1.25rem; margin-bottom: 6px; }
.value p { color: var(--ink-2); }
.privacy-band { margin-top: 20px; padding: clamp(28px, 4vw, 44px); border-radius: 24px; background: var(--ink); color: var(--paper); display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.privacy-band svg { width: 48px; height: 48px; color: var(--amber); }
@media (prefers-color-scheme: dark) { .privacy-band svg { color: #0044cc; } } /* the band inverts to light in dark mode; amber is too faint there */
.privacy-band h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); max-width: none; }
.privacy-band p { margin-top: 8px; opacity: 0.8; max-width: 52em; }
.privacy-band a { color: inherit; }
.ad-slot { margin: 32px auto 0; max-width: 728px; min-height: 90px; }

/* Privacy and cookie pages */
.legal { max-width: 46em; padding-top: 48px; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.4rem; margin: 36px 0 10px; }
.legal p, .legal ul { margin: 0 0 12px; color: var(--ink-2); }
.legal li { margin-bottom: 6px; }
.legal .table-wrap { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 720px) { .legal table { display: block; overflow-x: auto; } .legal th, .legal td { min-width: 9rem; } }

/* Deck view */
.deck-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 36px 0 24px; }
.deck-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); overflow-wrap: anywhere; }
.deck-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 0.95rem; align-items: center; }
.deck-notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid var(--amber); font-size: 0.95rem; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 6px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; }
.menu-list button { text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 0.98rem var(--font-body); cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-2); }
.menu-list button small { display: block; color: var(--ink-2); font-size: 0.82rem; }
.menu-list button:disabled { opacity: 0.5; cursor: not-allowed; }
.slide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.slide-row { display: grid; grid-template-columns: 44px auto minmax(0, 1fr); gap: 4px 18px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.slide-num { grid-row: span 2; font: 800 1.8rem/1 var(--font-display); color: var(--ink-2); }
.slide-thumb { grid-row: span 2; align-self: start; width: 160px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.slide-thumb svg, .slide-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb-placeholder { display: grid; place-items: center; width: 100%; height: 100%; font: 700 1rem var(--font-display); color: var(--ink-2); opacity: 0.6; }
.slide-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.slide-title { overflow-wrap: anywhere; }
.slide-title:empty::before { content: 'Untitled slide'; color: var(--ink-2); font-weight: 500; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 600 0.72rem/1.4 var(--font-body); letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); }
.badge-edited { background: var(--amber-soft); color: var(--ink); }
.empty-note { color: var(--ink-2); padding: 40px 0; }

/* Ad units (notes view and teleprompter). Kept clear of buttons to avoid accidental clicks. */
.ad-banner { margin: 8px 0 28px; padding: 8px 0 0; border-top: 1px solid var(--line); min-height: 90px; }
.ad-label { display: block; margin-bottom: 6px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ad-banner-prompt { margin: 0; padding: 8px var(--gutter) 10px; border-top: 0; border-bottom: 1px solid var(--line); min-height: 0; } /* never clip: AdSense forbids cropped ads */
.ad-banner-prompt .ad-label { margin-bottom: 4px; }

/* Notes editors (deck view + prompter) */
[data-notes-editor] { white-space: pre-wrap; overflow-wrap: anywhere; outline: none; min-height: 1.6em; }
[data-notes-editor] p { margin: 0 0 0.35em; }
[data-notes-editor] ul, [data-notes-editor] ol { margin: 0 0 0.35em; padding-left: 1.4em; }
.slide-notes { padding: 8px 10px; margin: 0 -10px; border-radius: 8px; transition: background 0.15s, box-shadow 0.15s; }
.slide-notes:hover { background: var(--surface-2); }
.slide-notes:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--brand); }
.slide-notes:has(> p:only-child > br:only-child)::before { content: 'No notes. Click to add some.'; position: absolute; color: var(--ink-2); pointer-events: none; }
.slide-notes { position: relative; }

.format-toolbar { position: fixed; z-index: 80; display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--ink); box-shadow: var(--shadow); }
.format-toolbar button { min-width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--paper); font: 700 0.95rem var(--font-body); cursor: pointer; }
.format-toolbar button[data-command='italic'] { font-style: italic; }
.format-toolbar button[data-command='underline'] { text-decoration: underline; }
.format-toolbar button[aria-pressed='true'], .format-toolbar button:hover { background: rgb(255 255 255 / 0.16); }

/* Prompter view frame */
/* Fixed to the viewport (below the 65px header) rather than sized with height: responsive AdSense units
   set height: auto !important on every ancestor, which would collapse the reading area to 0px. */
.view-prompt { display: flex; flex-direction: column; position: fixed; top: 65px; right: 0; bottom: 0; left: 0; }
.prompt-head { display: flex; align-items: center; gap: 12px; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); }
.prompt-head h1 { flex: 1; min-width: 0; font: 700 1rem var(--font-body); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-actions { display: flex; gap: 8px; flex: none; }
.prompt-actions .menu-list { z-index: 40; }
#prompter-root { flex: 1; min-height: 0; }
body.is-prompting .site-footer { display: none; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .preview { aspect-ratio: 4 / 3.4; }
  .steps, .values { grid-template-columns: 1fr; }
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .privacy-band { grid-template-columns: 1fr; }
  .reasons { grid-template-columns: 1fr; }
  .slide-row { grid-template-columns: 1fr; }
  .slide-num { grid-row: auto; font-size: 1.2rem; }
  .slide-thumb { grid-row: auto; width: 100%; }
  .cta .btn { width: 100%; }
  .deck-actions { width: 100%; }
  .deck-actions > * { flex: 1; }
  .menu-list { left: 0; right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .preview-track { animation: none; }
}
