/* ═══════════════════════════════════════════════════════════════════════════
   Langue Lab — Stylesheet
   
   DESIGN DIRECTION: Editorial / refined — inspired by quality print design.
   
   FONTS:
     - Playfair Display (serif display) — for headlines, giving the app a 
       cultured, literary quality appropriate for language learning
     - IBM Plex Mono — for the target phrases (monospaced makes each character
       distinct, helping with careful pronunciation reading)
     - IBM Plex Sans — clean, neutral body text
   
   COLOURS:
     --ink:    near-black for primary text
     --cream:  warm off-white background (less harsh than pure white)
     --gold:   warm accent for active states and highlights
     --french: muted indigo-blue (evokes France)
     --arabic: warm terracotta (evokes MENA)
     --good:   muted green for high scores
     --ok:     amber for middling scores
     --low:    muted red for low scores
═══════════════════════════════════════════════════════════════════════════ */

/* ── RESET & VARIABLES ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:         #1a1814;
  --ink-light:   #5a5650;
  --ink-faint:   #9a9690;
  --cream:       #f8f5f0;
  --cream-dark:  #ede9e2;
  --cream-mid:   #f2ede6;
  --gold:        #c9973a;
  --gold-light:  #e8c97a;
  --french:      #3d4b8c;
  --french-light:#8090c4;
  --arabic:      #a8431c;
  --arabic-light:#d4805e;
  --good:        #2d6a4f;
  --good-bg:     #d8f3dc;
  --ok:          #b85c00;
  --ok-bg:       #fff0d4;
  --low:         #9b2335;
  --low-bg:      #fde8eb;
  --border:      #ddd8d0;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;

  --radius:  6px;
  --radius-lg: 12px;
  --shadow:  0 2px 12px rgba(26,24,20,0.08);
  --shadow-lg: 0 8px 32px rgba(26,24,20,0.14);
}

/* ── BASE ───────────────────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }

/* RTL for Arabic text */
.rtl { direction: rtl; font-size: 1.2em; }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(248,245,240,0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.logo-icon {
  color: var(--gold);
  font-size: 1.1rem;
}

.site-nav { display: flex; gap: 0.25rem; }

.nav-link {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: var(--ink);
  color: var(--cream);
}

/* ── MAIN ───────────────────────────────────────────────────────────────── */
.site-main { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 2.5rem 2rem 4rem; }

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════════════════════════════════════ */

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  max-width: 640px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero-title em { font-style: italic; color: var(--gold); }

.hero-subtitle {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.7;
}

/* Language cards */
.language-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: white;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.lang-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.lang-card--french::before { background: linear-gradient(135deg, rgba(61,75,140,0.04), transparent); }
.lang-card--arabic::before { background: linear-gradient(135deg, rgba(168,67,28,0.04), transparent); }

.lang-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.lang-card--french:hover { border-color: var(--french-light); }
.lang-card--arabic:hover { border-color: var(--arabic-light); }
.lang-card:hover::before { opacity: 1; }

.lang-card__flag { font-size: 2.5rem; flex-shrink: 0; }

.lang-card__body { flex: 1; }

.lang-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.lang-card--french .lang-card__title { color: var(--french); }
.lang-card--arabic .lang-card__title { color: var(--arabic); }

.lang-card__sub { font-size: 0.8rem; color: var(--ink-faint); margin: 0.1rem 0 0.5rem; font-family: var(--font-mono); }
.lang-card__desc { font-size: 0.9rem; color: var(--ink-light); }
.lang-card__arrow { font-size: 1.3rem; color: var(--ink-faint); flex-shrink: 0; transition: transform 0.2s; }
.lang-card:hover .lang-card__arrow { transform: translateX(4px); }

/* Stats strip */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 2rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-lg);
  margin: 1rem 0 2.5rem;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; }
.stat__number { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 500; color: var(--gold-light); }
.stat__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(248,245,240,0.5); }
.stat-divider { color: rgba(248,245,240,0.2); font-size: 1.2rem; }
.stat--link { font-size: 0.85rem; color: var(--gold-light); align-self: center; }
.stat--link:hover { text-decoration: underline; }

/* How it works */
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step {
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}

.step__title { font-weight: 500; margin-bottom: 0.4rem; }
.step__desc { font-size: 0.875rem; color: var(--ink-light); line-height: 1.5; }

/* Browser notice */
.browser-notice {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: var(--ok-bg);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--ok);
}

.browser-notice__icon { font-size: 1rem; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   PRACTICE PAGE
══════════════════════════════════════════════════════════════════════════ */

.controls-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.lang-switcher { display: flex; gap: 0.5rem; }

.lang-btn {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  background: white;
  transition: all 0.15s;
}

.lang-btn:hover { border-color: var(--ink); color: var(--ink); }
.lang-btn--active { border-color: var(--ink); background: var(--ink); color: var(--cream); }

.category-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.category-filter__label { font-size: 0.8rem; color: var(--ink-faint); font-family: var(--font-mono); }

.cat-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-light);
  background: white;
  transition: all 0.15s;
}

.cat-btn:hover { background: var(--cream-dark); }
.cat-btn--active { background: var(--gold); border-color: var(--gold); color: white; }

/* Practice layout */
.practice-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Phrase list */
.phrase-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.phrase-list__heading {
  padding: 0.9rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
  background: var(--cream-mid);
}

.phrase-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.85rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}

.phrase-item:last-child { border-bottom: none; }
.phrase-item:hover { background: var(--cream-mid); }

.phrase-item--active {
  background: var(--ink) !important;
}

.phrase-item--active .phrase-item__text,
.phrase-item--active .phrase-item__translation {
  color: var(--cream);
}

.phrase-item__text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
}

.phrase-item__translation {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* Recorder panel */
.recorder-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-height: 400px;
  box-shadow: var(--shadow);
}

/* Phrase display */
.phrase-display { text-align: center; margin-bottom: 2.5rem; }

.phrase-display__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.phrase-display__target {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.phrase-display__romanised {
  font-size: 1rem;
  color: var(--ink-light);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.phrase-display__translation {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* Record / Listen buttons */
.recorder-controls { text-align: center; }

/* Flex row that holds the Listen and Record buttons side by side */
.recorder-btn-group {
  display: inline-flex;
  align-items: stretch;
  gap: 1rem;
  justify-content: center;
}

/* Shared base for both action buttons in the recorder area.
   flex: 1 ensures both buttons are always the same width regardless
   of label length ("Listen" vs "Tap to Speak"). */
.record-btn,
.listen-btn {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.8rem 3rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: var(--shadow);
}

.record-btn:hover,
.listen-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Record button — primary */
.record-btn {
  background: var(--ink);
  color: var(--cream);
}

.record-btn.recording {
  background: #c0392b;
  animation: pulse-record 1.2s ease-in-out infinite;
}

.record-btn__icon { font-size: 1.8rem; line-height: 1; }
.record-btn__label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; white-space: nowrap; }

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(192,57,43,0); }
}

/* Listen button — secondary, same size as Record button */
.listen-btn {
  background: var(--cream-dark);
  color: var(--ink);
  border: 2px solid var(--border);
}

.listen-btn:hover:not(:disabled) {
  background: var(--border);
  border-color: var(--ink-light);
}

/* Speaking state — pulsing teal-ish gold to signal active audio */
.listen-btn.is-speaking {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
  animation: pulse-listen 1.2s ease-in-out infinite;
}

.listen-btn__icon { font-size: 1.8rem; line-height: 1; }
.listen-btn__label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; white-space: nowrap; }

/* Disabled state (TTS not supported) */
.listen-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes pulse-listen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,151,58,0.45); }
  50%       { box-shadow: 0 0 0 12px rgba(201,151,58,0); }
}

.heard-display {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--cream-mid);
  border-radius: var(--radius);
  text-align: left;
}

.heard-display__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.heard-display__text {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
}

/* Feedback panel */
.feedback-panel { animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--gold) calc(var(--score-pct, 0) * 1%), var(--cream-dark) 0);
  flex-shrink: 0;
  position: relative;
}

.score-ring::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
}

.score-ring__number {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
}

.feedback-verdict {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.feedback-summary {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
}

.feedback-heard {
  padding: 0.8rem 1rem;
  background: var(--cream-mid);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 1.2rem;
  font-style: italic;
}

.feedback-tips {
  margin-bottom: 1.2rem;
}

.tip-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tip-item:last-child { border-bottom: none; }
.tip-item::before { content: '→'; color: var(--gold); flex-shrink: 0; }

.feedback-fact {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(201,151,58,0.08), rgba(201,151,58,0.02));
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem;
  color: var(--ink-light);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.feedback-actions { display: flex; gap: 0.8rem; }

/* Loading */
.loading-panel { text-align: center; padding: 3rem 0; }

.loading-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 1rem; }
.loading-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1; }
}

.loading-text { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); letter-spacing: 0.06em; }

/* Buttons */
.action-btn {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}

.action-btn--primary {
  background: var(--ink);
  color: var(--cream);
}
.action-btn--primary:hover { background: #333; }

.action-btn--secondary {
  background: var(--cream-dark);
  color: var(--ink);
  border: 1px solid var(--border);
}
.action-btn--secondary:hover { background: var(--border); }

/* No speech warning */
.no-speech-warning {
  padding: 1.5rem;
  background: var(--low-bg);
  border: 1px solid var(--low);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--low);
  margin-top: 2rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   HISTORY PAGE
══════════════════════════════════════════════════════════════════════════ */

.page-header { margin-bottom: 2rem; }
.page-title { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: -0.03em; }
.page-subtitle { color: var(--ink-faint); font-size: 0.9rem; margin-top: 0.3rem; }

.history-stats {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--ink);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hstat { display: flex; flex-direction: column; gap: 0.2rem; }
.hstat__num { font-family: var(--font-mono); font-size: 1.6rem; color: var(--gold-light); }
.hstat__lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(248,245,240,0.45); }

.history-list { display: flex; flex-direction: column; gap: 1rem; }

.history-item {
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: flex-start;
  transition: box-shadow 0.15s;
}

.history-item:hover { box-shadow: var(--shadow); }
.history-item--good { border-left: 4px solid var(--good); }
.history-item--ok   { border-left: 4px solid var(--ok); }
.history-item--low  { border-left: 4px solid var(--low); }

.score-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  flex-shrink: 0;
}

.score-badge--good { background: var(--good-bg); color: var(--good); }
.score-badge--ok   { background: var(--ok-bg);   color: var(--ok); }
.score-badge--low  { background: var(--low-bg);  color: var(--low); }

.history-item__body { flex: 1; min-width: 0; }

.history-item__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.lang-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lang-tag--french { background: rgba(61,75,140,0.1); color: var(--french); }
.lang-tag--arabic { background: rgba(168,67,28,0.1); color: var(--arabic); }

.history-item__category { font-size: 0.75rem; color: var(--ink-faint); text-transform: capitalize; }
.history-item__date     { font-size: 0.75rem; color: var(--ink-faint); margin-left: auto; font-family: var(--font-mono); }

.history-item__target   { font-family: var(--font-mono); font-size: 1rem; margin-bottom: 0.2rem; }
.history-item__romanised { font-size: 0.8rem; color: var(--ink-light); font-style: italic; margin-bottom: 0.2rem; }
.history-item__translation { font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 0.5rem; }

.history-item__heard {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}
.heard-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }

.history-item__verdict { font-size: 0.85rem; font-style: italic; color: var(--ink-light); }

/* Empty state */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state__text { color: var(--ink-light); margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════════════════════════════════════
   BOTTOM SHEET
   A slide-up drawer triggered by tapping a phrase in the list.
   Uses CSS transform for GPU-accelerated animation.
══════════════════════════════════════════════════════════════════════════ */

/* Scrim — semi-transparent overlay behind the sheet */
.bottom-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 24, 20, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bottom-sheet-scrim.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Sheet container */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 32px rgba(26, 24, 20, 0.18);
  padding: 0.75rem 1.5rem 2rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.bottom-sheet.is-open {
  transform: translateY(0);
}

/* Drag handle — pill-shaped bar at the top */
.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 1.25rem;
}

/* Native script text */
.bottom-sheet__target {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
  margin-bottom: 0.4rem;
}

.bottom-sheet__target.rtl {
  direction: rtl;
  font-size: 1.8rem;
}

/* English translation */
.bottom-sheet__translation {
  font-size: 0.9rem;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 0.3rem;
}

/* Romanised / phonetic pronunciation */
.bottom-sheet__romanised {
  font-size: 0.95rem;
  color: var(--ink-light);
  font-style: italic;
  text-align: center;
  margin-bottom: 0.3rem;
}

/* Action buttons row */
.bottom-sheet__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.bottom-sheet__actions .listen-btn,
.bottom-sheet__actions .record-btn {
  flex: 1;
  padding: 1.2rem 1rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 0.8rem 1.2rem; }
  .site-main   { padding: 1.5rem 1rem 3rem; }

  .language-cards { grid-template-columns: 1fr; }
  .steps          { grid-template-columns: 1fr 1fr; }
  .practice-layout { grid-template-columns: 1fr; }
  .phrase-display__target { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}
