/* ============================================================
   Blungie Web v2 — Comic Style System
   Used by index.html, read.html, privacy.html, delete.html
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Bungee&family=Quicksand:wght@400;500;600;700&display=swap');

/* ---- Tokens ---- */
:root {
  /* Brand (preserved from v1) */
  --primary: #00B89C;
  --primary-dark: #008f78;
  --primary-light: #f0fbf8;
  --accent: #FF8A50;
  --accent-dark: #E5703A;
  --highlight: #FFD93D;
  --purple: #8b5cf6;

  /* Comic core */
  --ink: #1a1a2e;           /* near-black for borders, headings */
  --ink-soft: #2D2D44;
  --paper: #FFF8E4;         /* parchment for reading bg */
  --paper-soft: #FFFCE8;
  --canvas: #FAFBFC;        /* page bg */
  --card: #FFFFFF;

  /* Comic shadows (offset, no blur) */
  --shadow-comic-sm: 4px 4px 0 var(--ink);
  --shadow-comic: 6px 6px 0 var(--ink);
  --shadow-comic-lg: 10px 10px 0 var(--ink);

  /* Semi-soft shadows (depth, behind comic offset) */
  --shadow-soft: 0 6px 24px rgba(26, 26, 46, 0.08);

  /* Halftone (dot pattern bg) */
  --halftone:
    radial-gradient(circle at 1px 1px, rgba(26,26,46,0.10) 1px, transparent 1.5px);
  --halftone-size: 14px 14px;

  /* Text */
  --text: #1a1a2e;
  --muted: #6b7280;
  --border-soft: #E5E7EB;

  /* Typography */
  --font-display: 'Bangers', 'Bungee', 'Quicksand', sans-serif;
  --font-body: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radius (comic = sharper than v1) */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
}

/* ---- Reset + base ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--canvas);
  line-height: 1.6;
  overflow-x: hidden;
  /* Subtle halftone over entire page — scroll attachment for perf */
  background-image: var(--halftone);
  background-size: var(--halftone-size);
}
[dir="rtl"] body { font-family: 'Quicksand', 'Segoe UI', Tahoma, sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---- Comic display headings ---- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.05;
  font-weight: 400; /* Bangers is single-weight */
}
.display-xxl { font-size: clamp(48px, 7vw, 84px); }
.display-xl  { font-size: clamp(36px, 5vw, 60px); }
.display-lg  { font-size: clamp(28px, 3.5vw, 42px); }

/* Body strong (Quicksand) for sub-text */
.subtitle {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---- Comic panel (the workhorse) ---- */
.comic-panel {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-comic);
  padding: 28px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.comic-panel:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}
.comic-panel.flat { box-shadow: var(--shadow-comic-sm); }
.comic-panel.tilt-l { transform: rotate(-1.2deg); }
.comic-panel.tilt-r { transform: rotate(1.2deg); }
.comic-panel.tilt-l:hover { transform: rotate(-1.2deg) translate(-2px, -2px); }
.comic-panel.tilt-r:hover { transform: rotate(1.2deg) translate(-2px, -2px); }

/* Color-tinted panels */
.comic-panel.tint-primary { background: var(--primary-light); }
.comic-panel.tint-accent  { background: #FFF0E5; }
.comic-panel.tint-highlight { background: #FFFBE0; }
.comic-panel.tint-paper   { background: var(--paper); }
.comic-panel.tint-dark    {
  background: var(--ink);
  color: #fff;
  box-shadow: 6px 6px 0 var(--accent);
}
.comic-panel.tint-dark h1,
.comic-panel.tint-dark h2,
.comic-panel.tint-dark h3 { color: #fff; }

/* ---- Speech bubble ---- */
.bubble {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 24px;
  padding: 14px 22px;
  position: relative;
  display: inline-block;
  font-weight: 700;
  box-shadow: var(--shadow-comic-sm);
}
.bubble::before,
.bubble::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 28px;
  width: 0; height: 0;
  border: 12px solid transparent;
}
.bubble::before {
  border-top-color: var(--ink);
  bottom: -26px;
}
.bubble::after {
  border-top-color: var(--card);
  bottom: -22px;
}
.bubble.tail-right::before { left: auto; right: 28px; }
.bubble.tail-right::after  { left: auto; right: 28px; }
.bubble.tail-up::before {
  bottom: auto; top: -26px;
  border-top-color: transparent;
  border-bottom-color: var(--ink);
}
.bubble.tail-up::after {
  bottom: auto; top: -22px;
  border-top-color: transparent;
  border-bottom-color: var(--card);
}

/* Action pop (POW!, WHAM! style burst) */
.pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--highlight);
  border: 3px solid var(--ink);
  border-radius: 50%;
  width: 88px;
  height: 88px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  transform: rotate(-12deg);
  box-shadow: var(--shadow-comic-sm);
  letter-spacing: 0.04em;
  position: relative;
}
.pop.lg { width: 120px; height: 120px; font-size: 32px; }
.pop.accent { background: var(--accent); color: #fff; }
.pop.primary { background: var(--primary); color: #fff; }

/* Eyebrow chip (small label above section title) */
.eyebrow {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}
.eyebrow.accent { background: var(--accent); }
.eyebrow.primary { background: var(--primary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1em;
  border: 3px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-comic-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.highlight { background: var(--highlight); color: var(--ink); }
.btn.lg { padding: 18px 34px; font-size: 1.1em; }
.btn.ghost { background: transparent; }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--ink);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon {
  width: 42px; height: 42px;
  background: var(--primary);
  border: 3px solid var(--ink);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  box-shadow: 3px 3px 0 var(--ink);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  gap: 26px;
  align-items: center;
}
.nav-links a {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--ink);
  transition: color 0.15s;
  position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  font-weight: 700;
  font-size: 0.9em;
  color: var(--ink);
  transition: all 0.15s;
  box-shadow: 2px 2px 0 var(--ink);
}
.lang-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-comic-sm);
  display: none;
  z-index: 200;
  max-height: 420px;
  overflow-y: auto;
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-dropdown.active { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600; font-size: 0.95em;
  color: var(--ink); text-align: start;
  transition: background 0.12s;
  cursor: pointer;
}
.lang-option:hover { background: var(--primary-light); color: var(--primary); }
.lang-option.active { background: var(--primary); color: #fff; }
.lang-flag { font-size: 1.15em; }

/* Mobile burger (header) */
.burger {
  display: none;
  width: 44px; height: 44px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  align-items: center; justify-content: center;
}
.burger span {
  display: block; width: 18px; height: 2.5px;
  background: var(--ink);
  position: relative;
}
.burger span::before, .burger span::after {
  content: ''; position: absolute; left: 0;
  width: 18px; height: 2.5px; background: var(--ink);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

/* ---- Footer ---- */
.site-footer {
  background: var(--ink);
  color: #B8B8C8;
  padding: 60px 0 30px;
  margin-top: 80px;
  border-top: 4px solid var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand { color: #fff; }
.footer-brand .brand-name { color: #fff; font-size: 32px; }
.footer-brand p { margin-top: 12px; max-width: 320px; color: #B8B8C8; }
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 18px;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.08em;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #B8B8C8; transition: color 0.15s; font-weight: 500; }
.footer-col a:hover { color: var(--highlight); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px;
  border-top: 1px solid #2D2D44;
  font-size: 0.9em;
  color: #888;
  flex-wrap: wrap;
  gap: 16px;
}
.social-row {
  display: flex; gap: 12px; margin-top: 14px;
}
.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #2D2D44;
  border: 2.5px solid #B8B8C8;
  color: #B8B8C8;
  font-size: 18px;
  transition: all 0.15s;
  position: relative;
}
.social-icon:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.social-icon[data-soon]::after {
  content: 'Soon';
  position: absolute;
  bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px;
  background: var(--highlight);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.social-icon[data-soon]:hover::after { opacity: 1; }

/* ---- Image slot (placeholder until user uploads) ---- */
.img-slot {
  position: relative;
  background: var(--paper-soft);
  border: 3px dashed var(--ink);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 200px;
}
.img-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.img-slot .slot-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 64px;
  line-height: 1;
}
.img-slot .slot-fallback .slot-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 12px;
  text-transform: uppercase;
}
.img-slot.loaded { border-style: solid; }
.img-slot.loaded .slot-fallback { display: none; }

/* ---- Hero ---- */
.hero {
  padding: 80px 0 60px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero-copy h1 { margin-bottom: 18px; }
.hero-copy .accent-word {
  color: var(--accent);
  display: inline-block;
}
.hero-copy .highlight-word {
  background: var(--highlight);
  padding: 0 8px;
  border-radius: 6px;
  display: inline-block;
  transform: rotate(-1.5deg);
}
.hero-subtitle {
  margin: 18px 0 32px;
  max-width: 540px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust {
  margin-top: 32px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-trust .trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.88em;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
}
.hero-trust .trust-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero-art {
  position: relative;
  min-height: 460px;
}
.hero-art .img-slot {
  min-height: 460px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #E5F8F5 100%);
}
.hero-art .floating-bubble {
  position: absolute;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9em;
  box-shadow: var(--shadow-comic-sm);
  z-index: 2;
}
.hero-art .floating-bubble.b1 { top: 20px; left: -20px; transform: rotate(-3deg); }
.hero-art .floating-bubble.b2 { top: 160px; right: -10px; transform: rotate(2deg); background: var(--highlight); }
.hero-art .floating-bubble.b3 { bottom: 40px; left: 30px; transform: rotate(-2deg); background: var(--accent); color: #fff; }

/* ---- Section spacing ---- */
section { padding: 70px 0; position: relative; }
.section-head {
  text-align: center;
  margin-bottom: 50px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { margin-bottom: 16px; }

/* ---- Generic grid ---- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ---- Game mode card ---- */
.mode-card { display: flex; flex-direction: column; }
.mode-card .img-slot { aspect-ratio: 4 / 3; margin-bottom: 18px; }
.mode-card h3 {
  font-size: 28px;
  margin-bottom: 8px;
}
.mode-card .mode-meta {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mode-card p { color: var(--ink-soft); font-weight: 500; }

/* ---- Why panels ---- */
.why-panel .img-slot { aspect-ratio: 3 / 2; margin-bottom: 16px; }
.why-panel h3 { font-size: 24px; margin-bottom: 8px; }
.why-panel p { color: var(--ink-soft); }

/* ---- Pro section ---- */
.pro-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
.pro-features {
  list-style: none;
  margin-top: 18px;
}
.pro-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-weight: 600;
  color: #fff;
}
.pro-features li::before {
  content: '★';
  color: var(--highlight);
  font-size: 22px;
  line-height: 1;
  margin-top: 1px;
}

/* ---- Languages pill grid ---- */
.lang-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 880px;
  margin: 0 auto;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.15s;
}
.lang-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--primary-light);
}

/* ---- FAQ accordion ---- */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--card);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-comic-sm);
}
.faq-item summary {
  list-style: none;
  padding: 18px 22px;
  font-weight: 700;
  font-size: 1.05em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--primary);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq-item p {
  padding: 0 22px 20px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ---- Final CTA ---- */
.final-cta {
  text-align: center;
  background: var(--primary);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 60px 30px;
  box-shadow: var(--shadow-comic-lg);
  position: relative;
  color: #fff;
}
.final-cta h2 { color: #fff; margin-bottom: 14px; }
.final-cta .subtitle { color: #E5F8F5; margin-bottom: 28px; }
.final-cta .pop {
  position: absolute;
  top: -40px;
  right: 40px;
}

/* ============================================================
   READER (read.html) — comic book paper feel
   ============================================================ */

.reader-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 24px;
}

.reader-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-comic-lg);
  /* Light halftone overlay on paper */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26,26,46,0.06) 1px, transparent 1.5px);
  background-size: 16px 16px;
}
.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.reader-meta .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
}
.reader-meta .pill.type-story { background: var(--highlight); color: var(--ink); }
.reader-meta .pill.type-dialogue { background: var(--accent); color: #fff; }
.reader-meta .pill.type-article { background: var(--primary); color: #fff; }
.reader-meta .pill.level { background: var(--card); color: var(--ink); }
.reader-meta .pill.minutes { background: transparent; border-color: var(--muted); color: var(--muted); }

.reader-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px);
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.05;
}
.reader-subtitle {
  font-size: 1.05em;
  color: var(--ink-soft);
  margin-bottom: 26px;
  font-weight: 500;
}

.reader-body {
  font-family: var(--font-body);
  font-size: 1.15em;
  line-height: 1.85;
  color: var(--ink);
}
.reader-body p { margin-bottom: 1.1em; }

/* Tappable word inside reading body */
.word {
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  border-bottom: 2px dotted transparent;
  padding: 0 2px;
  border-radius: 3px;
}
.word:hover {
  background: rgba(255, 217, 61, 0.45); /* light yellow */
}
.word.has-translation {
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.word.has-translation:hover {
  background: var(--highlight);
}

/* Dialogue mode rendering */
.dialogue-turn {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: flex-start;
}
.dialogue-turn.alt { flex-direction: row-reverse; }
.dialogue-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--ink);
}
.dialogue-turn.alt .dialogue-avatar { background: var(--accent); }
.dialogue-line {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 14px 18px;
  font-size: 1.05em;
  line-height: 1.6;
  box-shadow: var(--shadow-comic-sm);
  max-width: 80%;
}
.dialogue-turn.alt .dialogue-line { background: #FFF3E8; }
.dialogue-speaker {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Translation popup (tap-to-translate) */
.translate-popup {
  position: fixed;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-comic-lg);
  z-index: 500;
  max-width: 320px;
  display: none;
}
.translate-popup.active { display: block; }
.translate-popup .tw {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 4px;
}
.translate-popup .tw-ipa {
  font-size: 0.9em;
  color: var(--muted);
  font-family: 'Courier New', monospace;
  margin-bottom: 12px;
}
.translate-popup .tw-translation {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--highlight);
  border-radius: 8px;
  display: inline-block;
}
.translate-popup .tw-pos {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.translate-popup .tw-example {
  font-size: 0.95em;
  color: var(--ink-soft);
  font-style: italic;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  margin-top: 8px;
}
.translate-popup .tw-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Reading list (read.html landing) */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.reading-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-comic-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.reading-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.reading-card .img-slot {
  aspect-ratio: 16 / 10;
  border: none;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--paper));
}
.reading-card-body { padding: 20px; }
.reading-card-meta { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.reading-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 6px;
  line-height: 1.15;
}
.reading-card p {
  font-size: 0.95em;
  color: var(--ink-soft);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reading-filter-row {
  display: flex; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.reading-filter-row + .reading-filter-row { margin-bottom: 30px; }
.filter-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-soft);
  border: 2px dashed var(--ink);
  margin-inline-end: 4px;
}
.filter-pill {
  padding: 8px 18px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: all 0.15s;
}
.filter-pill.active { background: var(--ink); color: #fff; }
.filter-pill:hover:not(.active) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---- Privacy / Delete legal pages ---- */
.legal-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.legal-wrap h1 {
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.legal-wrap .updated { color: var(--muted); font-size: 0.9em; margin-bottom: 24px; }
.legal-wrap h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 32px 0 12px;
  color: var(--ink);
}
.legal-wrap p, .legal-wrap li {
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.7;
}
.legal-wrap ul { padding-left: 24px; margin-bottom: 14px; }
.legal-wrap a { color: var(--primary); font-weight: 700; }
.legal-wrap a:hover { color: var(--primary-dark); }

/* ---- Loading / empty states ---- */
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--muted);
  font-weight: 600;
}
.loading-row .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-row .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-row .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-weight: 500;
}
.empty-state .emoji { font-size: 64px; margin-bottom: 12px; }

/* ============================================================
   Mobile drawer (slide-down menu, shown by burger)
   ============================================================ */
.mobile-drawer {
  position: fixed;
  left: 0; right: 0;
  background: var(--card);
  border-bottom: 3px solid var(--ink);
  padding: 80px 24px 28px;
  z-index: 90;
  /* Animate via translateY. Initial state is hidden above viewport.
     The .open class sets translateY(0) — JS also sets data-state for
     extra reliability across browsers. */
  top: 0;
  transform: translateY(-110%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  max-height: 100vh;
  overflow-y: auto;
  visibility: hidden;
}
.mobile-drawer[data-state="open"] {
  transform: translateY(0) !important;
  visibility: visible;
}
.mobile-drawer .drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}
.mobile-drawer .drawer-links a {
  display: block;
  padding: 14px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--paper-soft);
  font-weight: 700;
  font-size: 1.05em;
  color: var(--ink);
  transition: transform 0.15s;
}
.mobile-drawer .drawer-links a:hover {
  background: var(--highlight);
  transform: translateX(4px);
}
.mobile-drawer .drawer-cta {
  width: 100%;
  justify-content: center;
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
body.drawer-locked { overflow: hidden; }
.burger.open span { background: transparent; }
.burger.open span::before { transform: rotate(45deg) translate(4px, 4px); top: 0; }
.burger.open span::after  { transform: rotate(-45deg) translate(4px, -4px); top: 0; }
.burger span,
.burger span::before,
.burger span::after { transition: transform 0.2s, background 0.2s, top 0.2s; }

/* ============================================================
   Responsive (tablet → mobile)
   ============================================================ */

/* Tablet (≤900px) */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .pro-card { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { min-height: 320px; }
  .hero-art .img-slot { min-height: 320px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 20px; }

  /* Hide tilt rotation on tablets — prevents horizontal overflow */
  .comic-panel.tilt-l,
  .comic-panel.tilt-r { transform: rotate(0); }
  .comic-panel.tilt-l:hover,
  .comic-panel.tilt-r:hover { transform: translate(-2px, -2px); }
}

/* Small tablet / large phone (≤768px) */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .burger { display: inline-flex; }
  .nav-actions .btn.primary { padding: 10px 16px; font-size: 0.88em; }
  .lang-btn { padding: 7px 11px; font-size: 0.82em; }
  .lang-dropdown { min-width: 180px; }
}

/* Phone (≤640px) */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  section { padding: 48px 0; }
  .hero { padding: 40px 0 32px; }
  .section-head { margin-bottom: 36px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; gap: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; text-align: start; }

  /* Hide the desktop Get App button on phones — drawer handles it */
  .nav-actions > .btn.primary { display: none; }

  /* Hero typography */
  .display-xxl { font-size: 40px; line-height: 1.05; }
  .display-xl { font-size: 30px; }
  .display-lg { font-size: 24px; }
  .subtitle { font-size: 15px; }

  /* Hero CTA — full width stack */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; width: 100%; }
  .hero-trust { gap: 10px; }
  .hero-trust .trust-pill { font-size: 0.78em; padding: 6px 10px; }

  /* Hero floating bubbles: smaller + closer to content */
  .hero-art { min-height: 280px; }
  .hero-art .img-slot { min-height: 280px; }
  .hero-art .floating-bubble {
    font-size: 0.78em;
    padding: 7px 12px;
  }
  .hero-art .floating-bubble.b1 { top: 8px; left: -4px; }
  .hero-art .floating-bubble.b2 { top: 110px; right: -4px; }
  .hero-art .floating-bubble.b3 { bottom: 24px; left: 12px; }

  /* Pop accents */
  .pop.lg { width: 78px; height: 78px; font-size: 20px; }
  .pop { width: 64px; height: 64px; font-size: 16px; }

  /* Comic panels */
  .comic-panel { padding: 22px 18px; }
  .why-panel h3 { font-size: 22px; }
  .mode-card h3 { font-size: 24px; }

  /* Sections that have inner dark/highlight panels */
  #pro .comic-panel.tint-dark { padding: 32px 22px; }
  #pro .comic-panel.tint-dark .pro-card { gap: 24px; }

  /* AI section: keep the image visible but smaller */
  #ai .pro-card { grid-template-columns: 1fr !important; }
  #ai .img-slot { min-height: 220px !important; }

  /* FAQ */
  .faq-item summary { padding: 16px 18px; font-size: 0.98em; }
  .faq-item p { padding: 0 18px 18px; }

  /* Final CTA */
  .final-cta { padding: 42px 22px; }
  .final-cta .pop { top: -26px; right: 18px; }

  /* Reader */
  .reader-wrap { padding: 28px 16px 60px; }
  .reader-card { padding: 24px 18px; }
  .reader-title { font-size: clamp(28px, 7vw, 38px); }
  .reader-body { font-size: 1.05em; line-height: 1.78; }

  /* Filter pills: horizontal scroll if too many */
  .reading-filter-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .reading-filter-row::-webkit-scrollbar { height: 4px; }
  .reading-filter-row::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 2px; }
  .filter-pill { flex-shrink: 0; padding: 7px 14px; font-size: 0.85em; }

  /* Dialogue lines fill more of the row on mobile */
  .dialogue-turn { gap: 10px; }
  .dialogue-avatar { width: 40px; height: 40px; font-size: 18px; }
  .dialogue-line { max-width: 88%; font-size: 0.98em; padding: 12px 14px; }

  /* Translation popup → bottom sheet on phones */
  .translate-popup {
    left: 12px !important;
    right: 12px !important;
    bottom: 14px !important;
    top: auto !important;
    max-width: none !important;
    border-radius: 18px;
    border-width: 3px;
    padding: 20px 22px 22px;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18), var(--shadow-comic-sm);
  }
  .translate-popup .tw { font-size: 26px; }
  .translate-popup .tw-close {
    width: 36px; height: 36px;
    font-size: 18px;
    top: 10px;
    inset-inline-end: 10px;
  }

  /* Legal pages */
  .legal-wrap { padding: 28px 16px 60px; }
  .legal-wrap section.legal-block { padding: 22px 18px; }
  .legal-wrap h2 { font-size: 22px; }
  .lang-nav { padding: 12px; gap: 8px; }
  .lang-nav a { padding: 6px 12px; font-size: 0.85em; }

  /* Header trim */
  .site-header .nav { padding: 12px 0; gap: 10px; }
  .brand-name { font-size: 24px; }
  .brand-icon { width: 38px; height: 38px; font-size: 20px; }
}

/* Extra small (≤380px) — tightest devices */
@media (max-width: 380px) {
  .display-xxl { font-size: 34px; }
  .display-xl { font-size: 26px; }
  .lang-btn .lang-current { display: none; }
  .lang-btn { padding: 7px 9px; }
  .brand-name { font-size: 22px; }
  .container { padding: 0 14px; }
}
