*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F9F9F9;
  --surface: #FFFFFF;
  --surface-variant: #F3F4F6;
  --text-primary: #303236;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --primary: #FF0000;
  --primary-light: #FF5F5F;
  --primary-bg: #FFF0F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --radius: 16px;
}

[data-theme="dark"] {
  --bg: #121212;
  --surface: #1E1E1E;
  --surface-variant: #2A2A2A;
  --text-primary: #E5E5E5;
  --text-secondary: #9CA3AF;
  --border: #3A3A3A;
  --primary-bg: #2A1010;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  /* env(safe-area-inset-*) keeps content clear of the iPhone notch /
     Dynamic Island when the device is held in landscape. max() means
     the base 24px is honored on desktop / safe-area=0 environments. */
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* Mobile-tap polish for every interactive surface. `manipulation`
   removes the 300ms double-tap-zoom delay; a soft tinted highlight
   replaces the harsh default gray flash on iOS / Android. Applied
   globally to anchors, buttons, role=button, and the demo controls. */
a, button, select, [role="button"], .lang-tag,
.demo-pill, .demo-lang-option, .demo-video-poster,
.recent-card, .faq-item, .feature-card {
  -webkit-tap-highlight-color: rgba(255, 0, 0, 0.12);
  touch-action: manipulation;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.header-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

/* Shining effect for app icons */
.shine-icon {
  position: relative;
  overflow: hidden;
  display: inline-block;
  line-height: 0;
}
.shine-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,0.5) 50%,
    rgba(255,255,255,0) 70%,
    transparent 100%
  );
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine {
  0% { left: -100%; }
  20% { left: 120%; }
  100% { left: 120%; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.lang-select:focus { outline: none; border-color: var(--primary); }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); }

/* Brand is a link to home — strip the default underline/colour. */
.header-brand { text-decoration: none; }
.header-brand:hover { text-decoration: none; }

/* ── Primary nav (header links) ── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto 0 28px;   /* sit just right of the brand, push actions to the far right */
}
.header-nav a {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.header-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-variant);
}

/* Hamburger — hidden on desktop, shown ≤768px. */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Hero ── */
.hero {
  padding: 56px 0 44px;
  text-align: center;
}

.hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero h1 .highlight {
  color: var(--primary);
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 19px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 26px;
  line-height: 1.55;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  text-decoration: none;
}

.btn-ios {
  background: var(--text-primary);
  color: var(--bg);
}

.btn-android {
  background: var(--surface);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-download svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ── Features ── */
.features { padding: 64px 0; }

.section-title {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  font-size: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s, border-color 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ── Screenshots ── */
.screenshots { padding: 64px 0; }

.screenshots-scroll {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.phone-mockup {
  width: 220px;
  height: 440px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-mockup .phone-inner {
  width: 200px;
  height: 420px;
  border-radius: 22px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.phone-mockup .phone-inner .mock-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.phone-mockup .phone-inner .mock-icon {
  font-size: 40px;
  opacity: 0.4;
}

.phone-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
}

.phone-mockup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mockup-caption {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Languages ── */
.languages { padding: 64px 0; }

.lang-subsection {
  margin-bottom: 32px;
}
.lang-subsection:last-child { margin-bottom: 0; }

.lang-subsection h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.lang-subsection > p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 14.5px;
}

.lang-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-tag {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.2s, border-color 0.2s;
}
.lang-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── CTA ── */
.cta {
  padding: 64px 0;
  text-align: center;
}

.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 22px;
  padding: 44px 36px;
  color: #fff;
}

.cta-box h2 {
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.cta-box p {
  font-size: 16px;
  opacity: 0.92;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
  background: #fff;
  color: var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-decoration: none;
}

.btn-cta svg { width: 20px; height: 20px; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  transition: border-color 0.3s;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); text-decoration: none; }

/* ── FAQ ── */
/* ── Demo (live video + transcript + translation animation) ── */
/* Pinned to the spot right after the hero so the very first scroll
   a user does on this page shows "this is what the app does" — a
   working video + a transcript that types itself in + a flag flip
   that translates the lines. The animation only fires once on
   first scroll-in (IntersectionObserver). Below 900px we stack
   the video on top and the transcript below. */
.demo { padding: 44px 0 60px; background: var(--surface-variant); }
.demo-head { text-align: center; max-width: 720px; margin: 0 auto 26px; }
.demo-head h2 {
  font-size: clamp(26px, 4vw, 34px); font-weight: 800;
  color: var(--text-primary); margin-bottom: 8px; line-height: 1.2;
}
.demo-head p {
  font-size: 15px; color: var(--text-secondary); line-height: 1.55;
}
.demo-grid {
  /* Single-column on every viewport — video on top, transcript
     below — so the user always sees the "tap to play" thumbnail
     as the first thing in the section. Side-by-side layouts
     tempted the eye to read the transcript before pressing
     play, which broke the demo pacing. */
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
  align-items: stretch;
}
.demo-video {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
}
.demo-video iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
/* Facade poster — thumbnail-as-button, swapped for real iframe
   on first interaction. See JS handler in the demo script block. */
.demo-video-poster {
  position: absolute; inset: 0;
  cursor: pointer;
  display: block;
  width: 100%; height: 100%;
  background: #000;
  transition: filter 0.25s ease;
}
.demo-video-poster img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.demo-video-poster:hover { filter: brightness(1.08); }
.demo-video-poster:focus { outline: 3px solid var(--primary); outline-offset: 3px; }
.demo-video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
  transition: transform 0.2s ease;
}
.demo-video-poster:hover .demo-video-play { transform: translate(-50%, -50%) scale(1.08); }
.demo-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  min-height: 240px;
  display: flex; flex-direction: column;
  /* Cap panel height so all 43 transcript lines don't push the
     page down. Lines accumulate inside .demo-lines, which scrolls.
     Auto-scroll-to-latest keeps the most-recent caption in view. */
  max-height: 460px;
}
.demo-pill-wrap {
  align-self: flex-start;
  position: relative;
  margin-bottom: 14px;
}
.demo-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 0;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.4s ease, opacity 0.15s ease;
}
.demo-pill:hover { opacity: 0.88; }
.demo-pill:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.demo-pill-caret {
  margin-left: 2px;
  transition: transform 0.18s ease;
}
.demo-pill[aria-expanded="true"] .demo-pill-caret { transform: rotate(180deg); }
.demo-pill.flip { animation: demoPillFlip 0.55s ease-in-out; }

/* Dropdown listbox of all 30 target locales. Opens beneath the
   pill on click; closes on outside click / Escape / option select.
   Scrolls internally so it never exceeds ~half the viewport. */
.demo-lang-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  /* Cap to viewport so it never spills past the screen on narrow
     phones. The pill is anchored flex-start in the panel so this
     measures from the panel's left edge — leaves ~16px of breathing
     room before the right screen edge. */
  max-width: calc(100vw - 40px);
  max-height: min(50vh, 380px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
}
.demo-lang-picker.open { display: block; }
.demo-lang-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.12s ease;
}
.demo-lang-option:hover { background: var(--surface-variant); }
.demo-lang-option.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}
.demo-lang-option .flag { font-size: 18px; line-height: 1; }
.demo-lang-option .lang-code {
  margin-left: auto;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.demo-lang-option.active .lang-code { color: var(--primary); }
@keyframes demoPillFlip {
  0%   { transform: rotateY(0); }
  45%  { transform: rotateY(90deg); }
  55%  { transform: rotateY(-90deg); }
  100% { transform: rotateY(0); }
}
.demo-pill .flag { font-size: 18px; line-height: 1; }
.demo-lines {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  /* Scrolls inside the panel — new lines append at the bottom and
     the JS sync layer auto-scrolls to keep the latest in view.
     Hidden until the first line is revealed; until then the
     .demo-empty placeholder occupies the same flex slot. */
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 4px;  /* room for the scrollbar gutter */
  scroll-behavior: smooth;
}
.demo-lines.is-empty { display: none; }

/* Empty-state placeholder shown before the user presses play.
   Same flex slot as .demo-lines so the panel height doesn't jump
   when content switches in. Center-aligned, soft secondary text,
   gently-bobbing finger emoji as a visual call-to-action. */
.demo-empty {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 16px 8px;
  gap: 10px;
  color: var(--text-secondary);
}
.demo-empty.hidden { display: none; }
.demo-empty-icon {
  font-size: 36px; line-height: 1;
  animation: demoEmptyBob 2.2s ease-in-out infinite;
}
.demo-empty-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}
.demo-empty-hint {
  font-size: 13px; line-height: 1.5;
  max-width: 320px;
}
@keyframes demoEmptyBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
/* Thin subtle scrollbar inside the transcript panel. */
.demo-lines::-webkit-scrollbar { width: 6px; }
.demo-lines::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.demo-lines::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
.demo-line {
  display: flex; gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  min-height: 36px;
  align-items: flex-start;
}
.demo-line:last-child { border-bottom: 0; }
.demo-ts {
  flex: 0 0 auto;
  font-family: 'Inter', monospace;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  padding-top: 2px;
  letter-spacing: 0.2px;
}
.demo-line.is-active .demo-ts { color: var(--primary); }
.demo-txt {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  font-weight: 400;
  opacity: 0.95;
  min-height: 22px;
}
.demo-line.is-active .demo-txt { font-weight: 600; }
.demo-txt.fading { opacity: 0; transition: opacity 0.3s ease; }
.demo-txt.fade-in { opacity: 1; transition: opacity 0.3s ease; }
.demo-caret {
  display: inline-block;
  width: 1px; height: 1em;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: demoCaret 0.9s steps(2) infinite;
}
@keyframes demoCaret {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/* No special demo grid rule at 900px anymore — the stack is the
   default. Section breakpoints below still tighten paddings. */

/* ── Recently Summarized ── */
.recent { padding: 64px 0; }
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}
.recent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.recent-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.recent-card a { display: block; text-decoration: none; color: inherit; }
.recent-thumb {
  aspect-ratio: 16/9; background: #000; overflow: hidden;
}
.recent-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s;
}
.recent-card:hover .recent-thumb img { transform: scale(1.04); }
.recent-body { padding: 14px 16px; }
.recent-title {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  color: var(--text-primary); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recent-meta {
  display: flex; gap: 8px; font-size: 12px;
  color: var(--text-secondary);
}
.recent-lang {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-bg, #FFF0F0); color: var(--primary);
  font-weight: 600; font-size: 11px; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.recent-cta { text-align: center; margin-top: 22px; }
.recent-cta a {
  display: inline-block; padding: 10px 22px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text-primary);
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.recent-cta a:hover { border-color: var(--primary); color: var(--primary); }
.recent-skeleton {
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, var(--border) 0%, var(--surface) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.faq { padding: 64px 0; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 10px;
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.faq-item p { color: var(--text-secondary); line-height: 1.6; font-size: 14.5px; }

/* ── Responsive ── */
/* Two breakpoints — 768px (tablet / large phone landscape) and
   480px (phone portrait). Layout collapses gradually: side-by-side
   things stack, dense grids drop to single column, padding shrinks,
   touch targets grow to ≥44px. Tested at 320px (iPhone SE 1st gen)
   up through 1440px desktop. */
@media (max-width: 768px) {
  .container {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  .hero { padding: 36px 0 28px; }
  .features, .screenshots, .languages, .cta, .faq, .recent { padding: 40px 0; }
  .demo { padding: 28px 0 40px; }
  .features-grid { grid-template-columns: 1fr; gap: 14px; }
  .feature-card { padding: 20px; }
  .recent-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
  /* Mobile screenshots: horizontal scroll-snap carousel instead of
     a wrap-to-grid. Wrap on mobile collapsed 4 mockups into an
     awkward 2×2 block with small thumbnails; a swipeable carousel
     keeps each mockup at full size and reads as a "swipe through
     the flow" instead of a static dump. Negative inline margins
     pull the scroll surface to the viewport edges so the first
     and last mockup don't visually float in mid-container. */
  .screenshots-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 18px;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    justify-content: flex-start;
    padding: 4px 18px 8px;
    margin: 0 -18px;
    scrollbar-width: none;
  }
  .screenshots-scroll::-webkit-scrollbar { display: none; }
  .phone-mockup-wrap { scroll-snap-align: center; }
  .phone-mockup { width: 180px; height: 360px; }
  .phone-mockup .phone-inner { width: 162px; height: 342px; border-radius: 20px; }
  .cta-box { padding: 32px 22px; }
  .cta-box h2 { font-size: 22px; }
  .cta-box p { font-size: 14.5px; margin-bottom: 18px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { gap: 16px 20px; justify-content: center; }
  /* Header — keep brand text but shrink. Touch targets bumped to
     ≥40px so the language switcher + theme toggle pass Apple
     HIG / Material accessibility minimums (44px ideal, 40px floor
     for compact bars). */
  .header-inner { height: 60px; }
  .header-brand { font-size: 15px; gap: 8px; }
  .header-brand img { width: 30px; height: 30px; }
  .header-actions { gap: 8px; }
  .lang-select {
    padding: 9px 10px;
    font-size: 13px;
    max-width: 140px;
    min-height: 40px;
  }
  .theme-toggle { width: 40px; height: 40px; font-size: 17px; }
  /* Header nav → hamburger dropdown below the bar. Links stay in the DOM
     (display toggled, not removed) so they remain crawlable for SEO. */
  .nav-toggle { display: flex; }
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px max(18px, env(safe-area-inset-left)) 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 12px 14px; font-size: 15px; }
  .nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  /* Demo section: panel padding tighter, font-size scales down. */
  .demo-head { margin-bottom: 18px; }
  .demo-head h2 { font-size: 23px; }
  .demo-head p { font-size: 14px; }
  .demo-grid { gap: 14px; }
  .demo-panel { padding: 14px 14px 12px; min-height: 200px; max-height: 400px; }
  .demo-line { padding: 6px 2px; min-height: 32px; }
  .demo-ts { font-size: 11px; }
  .demo-txt { font-size: 14px; line-height: 1.45; }
  .demo-pill { font-size: 12px; padding: 5px 12px; }
  .demo-pill .flag { font-size: 16px; }
  /* Touch — keep download buttons full-width so they're easy to
     tap and don't word-wrap onto two visual lines. */
  .hero-buttons, .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .btn-download, .btn-cta {
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
  }
  /* Language tag bubbles wrap nicely already; just tighten gap. */
  .lang-tags { gap: 6px; }
  .lang-tag { padding: 5px 10px; font-size: 12px; }
  .lang-subsection { margin-bottom: 24px; }
  .lang-subsection h3 { font-size: 18px; }
  .lang-subsection > p { font-size: 13.5px; margin-bottom: 12px; }
  /* FAQ items: tighter padding so questions don't feel cramped. */
  .faq-item { padding: 14px 18px; margin-bottom: 8px; }
  .faq-item h3 { font-size: 15.5px; }
  .faq-item p { font-size: 13.5px; }
  .section-desc { font-size: 14.5px; margin-bottom: 24px; }
  .section-title { font-size: clamp(22px, 5vw, 28px); }
}

@media (max-width: 480px) {
  /* Phone portrait — squeeze further but stay legible. */
  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  /* Carousel edges follow the tighter 14px container padding. */
  .screenshots-scroll {
    padding: 4px 14px 8px;
    margin: 0 -14px;
    scroll-padding-left: 14px;
  }
  .hero { padding: 28px 0 22px; }
  .hero-logo { width: 72px; height: 72px; margin-bottom: 14px; border-radius: 16px; }
  .features, .screenshots, .languages, .cta, .faq, .recent { padding: 32px 0; }
  .demo { padding: 22px 0 32px; }
  .recent-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .recent-thumb { aspect-ratio: 16/9; }
  .recent-title { font-size: 12px; }
  .recent-meta { font-size: 10px; gap: 6px; }
  .recent-body { padding: 10px 12px; }
  /* Hide brand text below 380px so the header doesn't break.
     Logo + controls keep working. */
  .header-brand span:not(.shine-icon) {
    display: none;
  }
  .demo-head h2 { font-size: 22px; }
  .demo-head p { font-size: 13px; }
  .demo-panel { padding: 14px 14px 10px; min-height: 200px; }
  .demo-line { padding: 5px 0; min-height: 28px; }
  .demo-ts { font-size: 10.5px; padding-top: 1px; }
  .demo-txt { font-size: 13px; }
  .demo-pill { font-size: 11.5px; padding: 4px 10px; margin-bottom: 10px; }
  .cta-box { padding: 32px 18px; border-radius: 18px; }
  .cta-box h2 { font-size: 20px; }
  .cta-box p { font-size: 14px; }
  .feature-card { padding: 20px; }
  .feature-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; margin-bottom: 12px; }
  .feature-card h3 { font-size: 17px; }
  .feature-card p { font-size: 14px; line-height: 1.6; }
  .btn-download, .btn-cta {
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 12px;
  }
  .btn-download svg, .btn-cta svg { width: 18px; height: 18px; }
  .phone-mockup { width: 140px; height: 280px; }
  .phone-mockup .phone-inner { width: 128px; height: 264px; border-radius: 16px; }
}

/* Prevent horizontal overflow universally — common cause is a
   single long word in a translation pushing past the viewport
   edge. word-break on flexible text containers is cheap insurance. */
.demo-txt, .feature-card p, .faq-item p, .hero-subtitle,
.section-desc, .recent-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}
html, body { overflow-x: hidden; }

/* ── Ultra-narrow phones (iPhone SE 1st gen, 320×568) ── */
/* The 480px breakpoint covers most modern phones; this final tier
   keeps things from cramping on 320–375px viewports. */
@media (max-width: 360px) {
  .hero h1 { font-size: 26px; }
  .hero-subtitle { font-size: 15px; }
  .hero-logo { width: 76px; height: 76px; }
  .header-inner { height: 56px; }
  .lang-select { max-width: 110px; font-size: 12.5px; }
  .demo-head h2 { font-size: 20px; }
  .demo-panel { padding: 12px 12px 10px; }
  .demo-empty-title { font-size: 14px; }
  .demo-empty-hint { font-size: 12px; }
  .feature-card { padding: 18px; }
  .feature-card h3 { font-size: 16px; }
  .cta-box { padding: 28px 16px; }
  .cta-box h2 { font-size: 19px; }
  /* Drop Recently Summarized to single column so each card is
     readable instead of two tiny side-by-side thumbnails. */
  .recent-grid { grid-template-columns: 1fr; gap: 12px; }
  .recent-thumb { aspect-ratio: 16/8; }
  .recent-title { font-size: 13px; }
  /* Keep mockup carousel from feeling too wide on a 320px screen. */
  .phone-mockup { width: 150px; height: 300px; }
  .phone-mockup .phone-inner { width: 134px; height: 282px; border-radius: 16px; }
}

/* ── Reduced motion ── */
/* Honor the system "Reduce Motion" preference — disables the
   marquee shine sweep, transcript bob, recent-card hover lift,
   smooth scroll, and pill-flip animation. Critical accessibility
   feature for users with vestibular sensitivity. Animations only
   stop on devices where the user opted in; everyone else gets
   the full animated experience. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Focus-visible ── */
/* Visible 2px ring on keyboard focus only. Mouse / touch users
   don't see it (we already have :hover and tap highlight); keyboard
   navigators get a clear "I am here" indicator without the
   permanent dotted outline on click. */
a:focus-visible, button:focus-visible, select:focus-visible,
[role="button"]:focus-visible, .lang-tag:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

