/* ── LookBFF — mobile-first app styling with one theme per review mode ──────
 *
 * The page is built for a phone held in one hand: a sticky mode bar at the
 * top, the photo as the stage, a sticky action bar at the bottom (safe-area
 * aware), 44 px+ touch targets. Wider screens just get a centered column.
 *
 * Every review mode (src/modes.ts) is a theme: html[data-mode=…] swaps the
 * design tokens below (colors, fonts, radii, shadows, background) plus a few
 * flourishes, so switching the reviewer changes the whole aesthetic:
 *   normal      friendly, clean, violet + pink
 *   flattering  comforting, warm cream and honey, pillowy
 *   critic      the terrifying business of fashion: black, white, Bodoni, red
 *   romantic    cliché romance: blush, roses, hearts, script
 *   sexy        secretive and private: velvet dark, crimson, gold, veiled photo
 * public/share-card.js mirrors the palettes for the 9:16 card. */

/* Self-hosted fonts (OFL, see fonts/OFL-*.txt): no third-party request, and
   the strict CSP (font-src 'self') stays as it is. Latin subsets cover
   Portuguese, Spanish and English. Every theme's face loads on the first
   visit (the per-mode copies that reserve space, .tstack below), so
   scripts/subset-fonts.py cuts each file to the Latin characters and the
   weights used here (single-weight display faces are static); keep the
   weights below in sync with it. Fonts are cached as immutable: bump the
   ?v= of a file whenever it changes. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/jakarta-latin.woff2?v=2) format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/baloo2-latin.woff2?v=2) format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/quicksand-latin.woff2?v=2) format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/fonts/bodonimoda-latin.woff2?v=2) format("woff2");
}
@font-face {
  font-family: "Dancing Script";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/dancingscript-latin.woff2?v=2) format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/cormorant-italic-latin.woff2?v=2) format("woff2");
}

/* ── design tokens (normal mode is the base) ─────────────────────────────── */

/* [data-theme] carries a mode's tokens on one element: the invisible
   per-mode copies that reserve space (.ghost, below) start from the base set
   so nothing leaks in from the page's current mode. */

:root,
[data-theme] {
  color-scheme: light;
  --bg: #f6f4ff;
  --bg-image: radial-gradient(circle at 0% -10%, #e2d9ff 0, transparent 45%), radial-gradient(circle at 110% 0%, #ffdce8 0, transparent 40%);
  --surface: #ffffff;
  --surface-2: #f0ecff;
  --ink: #1c1840;
  --ink-soft: #5d5880;
  --accent: #6a45ff;
  --accent-2: #ff5f8f;
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --line: #e3defa;
  --chip-bg: #ffffff;
  --chip-ink: var(--ink);
  --ring-track: #ece8ff;
  --score-ink: var(--accent);
  --radius: 24px;
  --radius-sm: 14px;
  --radius-btn: 999px;
  --shadow: 0 10px 30px -12px rgba(54, 30, 160, 0.25);
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --display-weight: 800;
  --display-style: normal;
  --display-case: none;
  --display-tracking: -0.025em;
  --h1-scale: 1;
  --label-case: none;
  --label-tracking: 0;
  --border: 1px solid var(--line);
  --bar-bg: rgba(246, 244, 255, 0.86);
  --mark-ring: #ffd166;
}

/* Flattering: comforting, encouraging — warm cream, honey, pillowy shapes. */
html[data-mode="flattering"],
[data-theme="flattering"] {
  --bg: #fff6ec;
  --bg-image: radial-gradient(circle at 50% -15%, #ffdcb8 0, transparent 60%), url(/themes/sparkles.svg);
  --surface: #fffdf9;
  --surface-2: #fff0e0;
  --ink: #5a3e2b;
  --ink-soft: #8f6f58;
  --accent: #ec8358;
  --accent-2: #f5bf4f;
  --line: #f6dcc3;
  --ring-track: #fde8d3;
  --score-ink: #e0723f;
  --radius: 32px;
  --radius-sm: 20px;
  --shadow: 0 14px 34px -14px rgba(196, 110, 50, 0.35);
  --font-display: "Baloo 2", "Quicksand", system-ui, sans-serif;
  --font-body: "Quicksand", system-ui, sans-serif;
  --display-tracking: -0.01em;
  --bar-bg: rgba(255, 246, 236, 0.88);
}

/* Critic: the terrifying business of fashion — black and white, Bodoni, red ink. */
html[data-mode="critic"],
[data-theme="critic"] {
  --bg: #f2f0eb;
  --bg-image: none;
  --surface: #ffffff;
  --surface-2: #f2f0eb;
  --ink: #0b0b0b;
  --ink-soft: #55534f;
  --accent: #0b0b0b;
  --accent-2: #c8102e;
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(#0b0b0b, #0b0b0b);
  --line: #0b0b0b;
  --chip-bg: transparent;
  --ring-track: transparent;
  --score-ink: #c8102e;
  --radius: 0px;
  --radius-sm: 0px;
  --radius-btn: 0px;
  --shadow: none;
  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --display-weight: 600;
  --display-case: uppercase;
  --display-tracking: 0.01em;
  --h1-scale: 0.9;
  --label-case: uppercase;
  --label-tracking: 0.18em;
  --bar-bg: rgba(242, 240, 235, 0.92);
  --mark-ring: #c8102e;
}

/* Romantic: cliché romance — blush and rose, hearts, a love-letter script. */
html[data-mode="romantic"],
[data-theme="romantic"] {
  --bg: #fff0f3;
  --bg-image: url(/themes/hearts.svg), radial-gradient(circle at 50% -10%, #ffd0dc 0, transparent 55%);
  --surface: #fffafb;
  --surface-2: #ffe4eb;
  --ink: #5b0f26;
  --ink-soft: #9a4a62;
  --accent: #d81e5b;
  --accent-2: #ff7d9c;
  --line: #ffc6d4;
  --ring-track: #ffdbe4;
  --score-ink: #d81e5b;
  --radius: 28px;
  --radius-sm: 18px;
  --shadow: 0 14px 34px -14px rgba(216, 30, 91, 0.35);
  --font-display: "Dancing Script", "Brush Script MT", cursive;
  --display-weight: 700;
  --display-tracking: 0;
  --h1-scale: 1.2;
  --bar-bg: rgba(255, 240, 243, 0.88);
}

/* Sexy (18+): secretive, private — velvet dark, crimson glow, a gold thread. */
html[data-mode="sexy"],
[data-theme="sexy"] {
  color-scheme: dark;
  --bg: #0c0709;
  --bg-image: radial-gradient(ellipse at 50% -12%, rgba(160, 18, 55, 0.5) 0, transparent 58%), radial-gradient(ellipse at 110% 105%, rgba(110, 12, 48, 0.4) 0, transparent 50%);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --ink: #f4e7e1;
  --ink-soft: #b9a39b;
  --accent: #b5133f;
  --accent-2: #d9a46b;
  --on-accent: #fff6f0;
  --accent-grad: linear-gradient(120deg, #8e0e33, #c41a4a);
  --line: rgba(217, 164, 107, 0.28);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --ring-track: rgba(255, 255, 255, 0.08);
  --score-ink: #d9a46b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  --font-display: "Cormorant Garamond", "Garamond", serif;
  --display-weight: 600;
  --display-style: italic;
  --display-tracking: 0;
  --h1-scale: 1.1;
  --bar-bg: rgba(12, 7, 9, 0.86);
  --mark-ring: #d9a46b;
}

/* ── base ────────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.45s ease,
    color 0.45s ease;
}

html[data-mode="romantic"] body {
  background-repeat: repeat, no-repeat;
  background-size: 180px auto, auto;
}
html[data-mode="flattering"] body {
  background-repeat: no-repeat, repeat;
  background-size: auto, 220px auto;
}

h1,
h2,
h3,
.hero-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style);
  text-transform: var(--display-case);
  letter-spacing: var(--display-tracking);
  line-height: 1.08;
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Layout never moves when the reviewer changes: blocks whose size depends on
   the theme (fonts, scale, per-mode copy) share one grid cell with an
   invisible copy per mode (src/pages/home.ts themeGhosts), so the cell is
   always as tall as the tallest mode. */
.tstack {
  display: grid;
}
.tstack > * {
  grid-area: 1 / 1;
  min-width: 0;
}
.ghost {
  /* body text inherits a resolved font-family: re-read this theme's */
  font-family: var(--font-body);
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* main.js swaps the mode's texts in; until then they stay invisible */
.mode-pending [data-m] {
  visibility: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
}

/* ── top bar + mode bar ──────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.25rem max(1rem, env(safe-area-inset-left));
  max-width: 640px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  text-decoration: none;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: calc(var(--radius-sm) * 0.8);
  background: var(--accent-grad);
  color: var(--on-accent);
  box-shadow: var(--shadow);
  flex: none;
}

.mark-ring {
  stroke: var(--mark-ring);
}
.footer-brand .mark-ring {
  stroke: var(--accent-2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
  white-space: nowrap;
}
html[data-mode="critic"] .brand-tag {
  letter-spacing: 0.08em;
}

.brand-name {
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  font-size: 1.3rem;
  /* a fixed line box: every theme's face fits the same height */
  line-height: 1.65rem;
  height: 1.65rem;
  letter-spacing: var(--display-tracking);
}
.brand-name b {
  color: var(--accent);
  font-weight: inherit;
}
html[data-mode="critic"] .brand-name {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
}
html[data-mode="critic"] .brand-name b,
html[data-mode="sexy"] .brand-name b {
  color: var(--accent-2);
}

.brand-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: var(--label-case);
  letter-spacing: var(--label-tracking);
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-suggest {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-btn);
  background: var(--surface);
  border: var(--border);
  text-decoration: none;
  white-space: nowrap;
}

.mode-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.55rem 0 0.6rem;
  background: var(--bar-bg);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: background-color 0.45s ease;
}
html[data-mode="critic"] .mode-bar {
  border-bottom-color: var(--line);
}

/* The five reviewers always fit on one row, even at 320 px: no sideways
   scroll that would hide the last ones. Each is a small tile, emoji over name,
   lined up with the page column. The name gets a fixed two-line box, so every
   tile (and the bar) keeps its height in every theme and the emojis share
   one baseline whether a name wraps or not. */
.mode-chips {
  --chip-name-height: 1.65rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.15rem max(1rem, env(safe-area-inset-right)) 0.2rem max(1rem, env(safe-area-inset-left));
  max-width: 640px;
  margin: 0 auto;
}

#modeChips .mode-chip {
  position: relative;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.2rem;
  padding: 0.45rem 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  line-height: 1.1;
  text-align: center;
}
#modeChips .chip-emoji {
  font-size: 1.45rem;
  height: 1.45rem;
}
#modeChips .chip-name {
  display: flex;
  align-items: center;
  height: var(--chip-name-height);
  overflow-wrap: anywhere;
}
#modeChips .chip-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.2rem;
  font-size: 0.6rem;
  padding: 0.08rem 0.3rem;
}
html[data-mode="critic"] #modeChips .mode-chip {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem 0.45rem 0.75rem;
  border-radius: var(--radius-btn);
  border: var(--border);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.15s ease;
}
.mode-chip:active {
  transform: scale(0.96);
}
.mode-chip[aria-checked="true"] {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: var(--shadow);
}
html[data-mode="critic"] .mode-chip {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}

.chip-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

.chip-badge {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  background: #1b0a10;
  color: #f3c99b;
  vertical-align: middle;
  text-transform: none;
}

/* ── main column ─────────────────────────────────────────────────────────── */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right)) 7.5rem max(1rem, env(safe-area-inset-left));
}

.hero {
  padding: 1rem 0 0.9rem;
}

.result-persona {
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
html[data-mode="sexy"] .result-persona,
html[data-mode="critic"] .result-persona {
  color: var(--accent-2);
}

.hero-title {
  font-size: calc(clamp(2.1rem, 9vw, 3.3rem) * var(--h1-scale));
}

.hero-sub {
  margin: 0.75rem 0 0;
  font-size: 1.04rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* ── stage: pick a photo / preview / processing ──────────────────────────── */

.stage {
  margin-top: 0.4rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1.6rem 1.1rem 1.3rem;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.dropzone.dragging {
  border-color: var(--accent);
  transform: scale(1.01);
}
/* a hairline instead of the dashed 2px border: the padding makes up the
   difference so the content doesn't move */
html[data-mode="critic"] .dropzone {
  border: 1px solid var(--line);
  padding: calc(1.6rem + 1px) calc(1.1rem + 1px) calc(1.3rem + 1px);
}

.dz-art {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  margin-bottom: 0.3rem;
}
html[data-mode="critic"] .dz-art {
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--line);
}
html[data-mode="sexy"] .dz-art {
  color: var(--accent-2);
  box-shadow: 0 0 40px rgba(181, 19, 63, 0.45);
}

.dz-title {
  margin: 0;
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  font-size: calc(1.6rem * var(--h1-scale));
  line-height: 1.1;
}

.dz-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  max-width: 22rem;
  margin: 0.6rem 0 0.35rem;
}
.dz-actions .btn {
  white-space: nowrap;
}
html[data-mode="critic"] .dz-actions .btn {
  letter-spacing: 0.08em;
}

.dz-hint,
.dz-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}
.dz-note {
  margin-top: 0.4rem;
}

/* Desktop/laptop: no camera button (the file picker is the camera there). */
@media (hover: hover) and (pointer: fine) {
  .dz-camera {
    display: none !important;
  }
}

.preview {
  margin: 0;
}

.preview-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  aspect-ratio: 3 / 4;
  max-height: 68dvh;
  margin: 0 auto;
}
html[data-mode="critic"] .preview-frame {
  border: 1px solid var(--line);
}

.preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: filter 0.5s ease;
}

/* Spicy mode keeps the photo veiled until the visitor taps it. */
.preview-reveal {
  display: none;
}
html[data-mode="sexy"] .preview-frame.veiled img {
  filter: blur(22px) brightness(0.6) saturate(1.2);
}
html[data-mode="sexy"] .preview-frame.veiled .preview-reveal {
  display: inline-flex;
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.6rem 1.2rem;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 7, 9, 0.55);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.preview-remove {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 8, 20, 0.55);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
html[data-mode="critic"] .preview-remove {
  border-radius: 0;
  background: #0b0b0b;
}

.upload-pill {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  margin: 0;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(10, 8, 20, 0.6);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.processing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
  background: linear-gradient(to top, rgba(8, 6, 16, 0.85) 0%, rgba(8, 6, 16, 0.35) 55%, rgba(8, 6, 16, 0.1) 100%);
  color: #fff;
}
html[data-mode="sexy"] .processing {
  background: linear-gradient(to top, rgba(12, 4, 8, 0.92) 0%, rgba(60, 6, 24, 0.55) 60%, rgba(12, 4, 8, 0.4) 100%);
}

.scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--accent-grad);
  box-shadow: 0 0 18px 4px var(--accent-2);
  animation: scan 2.2s ease-in-out infinite;
}
html[data-mode="critic"] .scan {
  background: #c8102e;
  box-shadow: none;
  height: 1px;
}

@keyframes scan {
  0%,
  100% {
    top: 4%;
  }
  50% {
    top: 92%;
  }
}

.processing-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  text-transform: var(--display-case);
  font-size: calc(1.5rem * var(--h1-scale));
  line-height: 1.1;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.92rem;
}
.steps li {
  opacity: 0.45;
  transition: opacity 0.3s ease;
}
.steps li::before {
  content: "○ ";
}
.steps li.active {
  opacity: 1;
}
.steps li.active::before {
  content: "● ";
  color: var(--accent-2);
}

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-btn);
  border: var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  /* min-height sets the height in every theme, whatever the font size */
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background-color 0.3s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-primary {
  background: var(--accent-grad);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
}

.btn-wide {
  width: 100%;
}

html[data-mode="critic"] .btn {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.84rem;
  font-weight: 700;
}
html[data-mode="sexy"] .btn-primary {
  box-shadow: 0 10px 30px -8px rgba(181, 19, 63, 0.7);
}
html[data-mode="sexy"] .btn-ghost {
  border-color: var(--line);
}

/* sticky bottom action bar (thumb zone) */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.85rem max(1rem, env(safe-area-inset-right)) calc(0.85rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
  animation: rise 0.3s ease both;
}
.action-bar .btn {
  display: flex;
  max-width: 608px;
  margin: 0 auto;
  min-height: 56px;
  font-size: 1.08rem;
}

/* ── error ───────────────────────────────────────────────────────────────── */

.error-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--accent-2);
  font-weight: 600;
}

/* ── result ──────────────────────────────────────────────────────────────── */

.result {
  margin-top: 0.4rem;
  /* main.js scrolls the result into view: keep it clear of the sticky mode bar */
  scroll-margin-top: 7rem;
  display: grid;
  gap: 1rem;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1.1rem 1.3rem;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.score {
  --score: 0;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  width: 168px;
  height: 168px;
  margin: 0.4rem 0 0.9rem;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, var(--accent-2) calc(var(--score) * 36deg), var(--ring-track) calc(var(--score) * 36deg));
}
.score::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--surface);
}
html[data-mode="sexy"] .score::before {
  background: #160b0f;
}
html[data-mode="sexy"] .score {
  box-shadow: 0 0 60px -10px rgba(181, 19, 63, 0.7);
}

.score-number,
.score-label {
  position: relative;
}

.score-number {
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--score-ink);
}

.score-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* The critic doesn't do rings: a printed mark, big and red. */
html[data-mode="critic"] .score {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  padding: 0.3rem 1.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
html[data-mode="critic"] .score::before {
  display: none;
}
html[data-mode="critic"] .score-number {
  font-size: 5.6rem;
  font-weight: 800;
}
html[data-mode="critic"] .score-label {
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

.verdict {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  font-size: calc(1.4rem * var(--h1-scale));
  line-height: 1.2;
  max-width: 30rem;
}
html[data-mode="critic"] .verdict {
  text-transform: none;
  font-style: italic;
  font-weight: 500;
}

.vibes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.vibes span {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.84rem;
  font-weight: 700;
}
html[data-mode="critic"] .vibes span {
  border-radius: 0;
  background: none;
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.result-sections {
  display: grid;
  gap: 0.75rem;
}

.r-section {
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-sm);
}
.r-section h2 {
  font-size: calc(1.15rem * var(--h1-scale));
  margin-bottom: 0.45rem;
}
html[data-mode="critic"] .r-section h2 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
}
html[data-mode="critic"] .r-bad h2 {
  color: #c8102e;
}
.r-section ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
}
.r-good li::marker {
  content: "✓  ";
  color: var(--accent);
}
.r-bad li::marker {
  content: "–  ";
  color: var(--accent-2);
}
.r-tip li::marker {
  content: "→  ";
  color: var(--accent);
}
html[data-mode="romantic"] .r-good li::marker {
  content: "♥  ";
}
html[data-mode="sexy"] .r-good li::marker {
  content: "✦  ";
  color: var(--accent-2);
}
html[data-mode="sexy"] .r-tip li::marker {
  color: var(--accent-2);
}
.empty-note {
  margin: 0;
  color: var(--ink-soft);
}

.share,
.other-modes {
  padding: 1.2rem 1.15rem;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
}
.share h2,
.other-modes h2 {
  font-size: calc(1.2rem * var(--h1-scale));
  margin-bottom: 0.8rem;
}

.card-preview {
  display: block;
  width: min(62%, 240px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  margin: 0 auto 0.8rem;
  border-radius: calc(var(--radius-sm) * 0.8);
  box-shadow: var(--shadow);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.toggle input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.share-actions .btn-primary {
  grid-column: 1 / -1;
}

.other-modes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.other-modes-row .mode-chip {
  justify-content: center;
}

.result-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.streak {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ── reviewers + checks ──────────────────────────────────────────────────── */

.modes,
.checks {
  margin-top: 2.6rem;
}
.modes h2,
.checks h2 {
  font-size: calc(1.7rem * var(--h1-scale));
}
.section-sub {
  margin: 0.4rem 0 1rem;
  color: var(--ink-soft);
}

.mode-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.mode-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "emoji title" "emoji text" "emoji action";
  column-gap: 0.9rem;
  row-gap: 0.15rem;
  align-items: start;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  border: var(--border);
  background: var(--surface);
}
.mode-card-emoji {
  grid-area: emoji;
  font-size: 1.9rem;
  line-height: 1;
  padding-top: 0.15rem;
}
.mode-card h3 {
  grid-area: title;
  font-size: calc(1.2rem * var(--h1-scale));
}
.mode-card p {
  grid-area: text;
  margin: 0 0 0.45rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.mode-card .btn {
  grid-area: action;
  justify-self: start;
}
.mode-card.current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
html[data-mode="sexy"] .mode-card.current,
html[data-mode="critic"] .mode-card.current {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-2);
}

.checks-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.check {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.check-num {
  font-family: var(--font-display);
  font-style: var(--display-style);
  font-weight: var(--display-weight);
  font-size: 1.4rem;
  color: var(--accent);
}
html[data-mode="critic"] .check-num,
html[data-mode="sexy"] .check-num {
  color: var(--accent-2);
}
.check h3 {
  font-size: 1.1rem;
  margin: 0.2rem 0 0.25rem;
}
html[data-mode="romantic"] .check h3 {
  font-family: var(--font-body);
  font-weight: 800;
}
.check p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.privacy-note {
  margin: 2rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* ── 18+ sheet (bottom sheet on phones, dialog on desktop) ──────────────── */

.sheet {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding: 0;
  border: none;
  border-radius: 24px 24px 0 0;
  background: #140a0e;
  color: #f4e7e1;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.sheet::backdrop {
  background: rgba(8, 3, 6, 0.7);
  backdrop-filter: blur(4px);
}
.sheet[open] {
  animation: rise 0.3s ease both;
}
.sheet-body {
  padding: 1.6rem 1.3rem calc(1.4rem + env(safe-area-inset-bottom));
  max-width: 30rem;
  margin: 0 auto;
}
.sheet h2 {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 600;
  text-transform: none;
  font-size: 1.9rem;
}
.sheet p {
  color: #c9b4ac;
}
.sheet-emoji {
  font-size: 2rem;
  margin: 0 0 0.3rem;
}
.sheet-actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.sheet .btn-primary {
  background: linear-gradient(120deg, #8e0e33, #c41a4a);
  color: #fff6f0;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
}
.sheet .btn-ghost {
  color: #f4e7e1;
  border-color: rgba(217, 164, 107, 0.35);
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── privacy page ────────────────────────────────────────────────────────── */

.page-card {
  padding: 1.3rem 1.2rem;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.prose h2 {
  font-size: calc(1.3rem * var(--h1-scale));
  margin: 1.4rem 0 0.5rem;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.4rem;
}
.prose p,
.prose li {
  color: var(--ink-soft);
}

/* ── footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.6rem max(1rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: var(--ink);
}
.footer-brand svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
/* the app page needs room for the sticky action bar */
.action-bar ~ .site-footer {
  padding-bottom: calc(6rem + env(safe-area-inset-bottom));
}

/* ── wider screens ───────────────────────────────────────────────────────── */

@media (min-width: 560px) {
  .dz-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
  .result-sections {
    grid-template-columns: 1fr 1fr;
  }
  .r-tip {
    grid-column: 1 / -1;
  }
  .mode-cards {
    grid-template-columns: 1fr 1fr;
  }
  .checks-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .share-actions {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .share-actions .btn-primary {
    grid-column: auto;
  }
  .other-modes-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .sheet {
    max-width: 30rem;
    margin: auto;
    border-radius: 24px;
  }
}

@media (min-width: 560px) {
  .mode-chips {
    --chip-name-height: 1.9rem;
  }
  #modeChips .mode-chip {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
