/* =========================================================
   FONTS — stored in site/fonts (downloaded once from Google Fonts,
   SIL Open Font License). Visitors never contact Google.
   ========================================================= */
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   DESIGN TOKENS — change the look of the whole site here.
   Brand palette: ivory, ink navy and lamp amber
   (the earlier "Midnight and marigold" look is in Git history)
   ========================================================= */
:root {
  --bg:        #F7F2EA;  /* warm ivory page background */
  --text:      #14213D;  /* ink navy: main text */
  --muted:     #5C5A63;  /* slate: secondary text */
  --line:      #E6DCCB;  /* sand: thin borders */
  --surface:   #EDE4D5;  /* subtle raised areas (selected pills, menus) */
  --accent:    #C8772E;  /* lamp amber: the one accent color (big text, rings, dots) */
  --accent-text: #A35C1C; /* deep amber: SMALL amber text (passes WCAG AA 4.5:1 on ivory) */
  --on-accent: #14213D;  /* text on top of amber */
  --panel:     #FBF8F2;  /* slide-up panels */

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius-pill: 999px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --tap: 44px;           /* minimum touch target size */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  /* The brand is flat: just a whisper of warm amber light. */
  background-image:
    radial-gradient(40rem 32rem at 8% -6%, rgba(200, 119, 46, 0.06), transparent 70%),
    radial-gradient(60rem 30rem at 50% 45%, rgba(200, 119, 46, 0.03), transparent 70%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Page layout: header / centered practice area / footer ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) 1.25rem max(0.5rem, env(safe-area-inset-bottom));
  max-width: 64rem;
  margin: 0 auto;
  transition: transform 0.3s ease-out;   /* slides up when the framework guide opens */
}

/* ---------- Header ---------- */
.brand { text-align: center; }
.brand__name {
  margin: 0;
  font-weight: 400;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand__dot { color: var(--accent); }   /* the amber full stop after the name */
.brand__by {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
/* "alexlayspeaks" in a small, quiet pill with the Instagram icon */
.ig-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.ig-pill:hover { color: var(--accent-text); border-color: rgba(200, 119, 46, 0.5); }

/* ---------- Practice area ---------- */
.practice {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
}

/* ---------- Settings ---------- */
.settings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.settings__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

/* Pill-shaped segmented control (used for Topic/Word and difficulty) */
.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: flex;
  align-items: center;
  min-height: calc(var(--tap) - 8px);
  padding: 0 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--accent); color: var(--on-accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented--small span { padding: 0 0.9rem; font-size: 0.875rem; white-space: nowrap; }
@media (max-width: 360px) { .segmented--small span { padding: 0 0.6rem; } }   /* 4 difficulty pills fit tiny phones */
.segmented--small input:checked + span { background: var(--surface); color: var(--text); }

/* Category dropdown styled as a pill */
.select { position: relative; display: inline-flex; width: min(100%, 17rem); }
.select[hidden] { display: none; }
.select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  min-height: var(--tap);
  padding: 0 2.5rem 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  cursor: pointer;
}
.select select:hover { border-color: var(--muted); }
.select select option { background: var(--bg); color: var(--text); }
.select::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ---------- The topic (hero) ---------- */
.stage {
  text-align: center;
  width: 100%;
  max-width: 46rem;
  min-height: 9rem;  /* keeps the layout from jumping between short and long topics */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}
.stage__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.stage__result {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
/* ---------- Spin animation layer ----------
   The real result text stays in place (invisible) to hold the layout;
   the reel plays on top of it. The layer reaches a little past the text
   so tall letters (g, y, p) are never clipped. */
.stage__result { position: relative; }
.stage__result.is-spinning { color: transparent; }
.reel {
  position: absolute;
  inset: -0.25em -0.5rem;
  overflow: hidden;
  color: var(--text);
  pointer-events: none;
}
/* Words: a soft fade at the top and bottom edges, like a real slot window */
.reel--word {
  inset: -0.12em -0.5rem;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.reel__column { position: absolute; top: 0.12em; left: 0.5rem; right: 0.5rem; will-change: transform; }
.reel__item {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
/* Topics: each flip sits exactly where the final text will be */
.reel__flip {
  position: absolute;
  top: 0.25em;
  left: 0.5rem;
  right: 0.5rem;
  text-wrap: balance;
  will-change: transform, opacity;
}
.btn.is-busy { pointer-events: none; }

/* Word mode: a single word gets even more room to shine */
.stage--word .stage__result {
  white-space: nowrap;   /* single words never wrap, so the reel lines up exactly */
  font-size: clamp(3rem, 14vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 0.75rem; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background-color 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
/* Main buttons (Spin, Pause): solid ink navy, flat, no glow */
.btn--primary {
  background: var(--text);
  color: var(--bg);
  transition: transform 0.12s, background-color 0.2s;
}
.btn--primary:hover { background: #24345A; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--muted); }

/* ---------- Timer button on the main page ---------- */
/* "−  1:00 Start  +" : one pill with three buttons */
.timer-group {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s;
}
.timer-group:hover { border-color: var(--muted); }
.timer {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0 0.35rem;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s;
}
.timer:active { transform: scale(0.97); }
.timer-step {
  width: 40px;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.timer-step:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.timer-step:disabled { opacity: 0.3; cursor: default; }
.timer__time { font-family: var(--font-display); font-size: 1.375rem; font-weight: 400; line-height: 1; }
.timer__hint { font-size: 0.8125rem; color: var(--muted); font-weight: 500; }

/* ---------- Speaking view: full-screen timer ----------
   Built to be readable from a few meters away on a laptop screen. */
body.is-speaking { overflow: hidden; }
.speak {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: clamp(1.25rem, 4vh, 3rem) 1.25rem max(clamp(1.25rem, 4vh, 2.5rem), env(safe-area-inset-bottom));
  background-color: var(--bg);
  background-image:
    radial-gradient(40rem 32rem at 8% -6%, rgba(200, 119, 46, 0.05), transparent 70%),
    radial-gradient(60rem 30rem at 50% 55%, rgba(200, 119, 46, 0.03), transparent 70%);
  text-align: center;
  animation: speak-in 0.25s ease-out;
}
.speak[hidden] { display: none; }
@keyframes speak-in { from { opacity: 0; } to { opacity: 1; } }

.speak__top { display: flex; flex-direction: column; gap: 0.5rem; max-width: 60rem; }
.speak__topic {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.2vw, 3.5rem);
  line-height: 1.1;
  text-wrap: balance;
}
.speak--word .speak__topic { font-size: clamp(2.25rem, 6vw, 4.5rem); }

.speak__clock {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2.5vh, 1.5rem);
  width: 100%;
  min-height: 0;
  container-type: size;   /* lets the ring size itself to the space that's left */
}
/* The ring is as big as the screen allows, and the numbers scale with it */
.ring {
  --ring: min(84vw, 58vh, 40rem);
  --ring: min(84cqw, 96cqh, 40rem);   /* never bigger than the space between topic and buttons */
  position: relative;
  width: var(--ring);
  height: var(--ring);
}
.ring__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);      /* start the ring at 12 o'clock */
  overflow: visible;
}
.ring__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.2;
}
.ring__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 0;           /* JS increases this as time runs out */
  transition: stroke-dashoffset 0.12s linear, stroke-width 0.4s;
}
.ring__head circle {
  fill: var(--accent);
  filter: drop-shadow(0 0 1.6px rgba(200, 119, 46, 0.9));
}
.ring__head { transform-origin: 50px 50px; transition: transform 0.12s linear, opacity 0.3s; }

.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--ring) * 0.03);
}
.speak__time {
  font-family: var(--font-display);
  font-size: calc(var(--ring) * 0.36);
  line-height: 0.85;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: color 0.6s, opacity 0.3s;
}
.speak__note {
  font-size: clamp(0.75rem, calc(var(--ring) * 0.032), 1rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.6s;
}
.speak__controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; align-items: center; }
.speak__add { padding: 0 1.1rem; }
.speak__toggle { min-width: 9rem; }

.speak.is-paused .speak__time { opacity: 0.45; }
.speak.is-paused .ring__head { opacity: 0.4; }

/* Final 10 seconds: the numbers warm up to deep amber */
.speak.is-final .speak__time { color: #A35C1C; }

/* Time's up: full amber ring + numbers, one gentle pulse */
.speak.is-done .speak__time { color: var(--accent); }
.speak.is-done .speak__note { color: var(--accent-text); }
.speak.is-done .ring__track { stroke: var(--accent); stroke-width: 2.2; }
.speak.is-done .ring__head { opacity: 0; }
.speak.pulse .ring { animation: time-up 1.2s ease-out 1; }
@keyframes time-up {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(200, 119, 46, 0)); }
  25%  { transform: scale(1.03); filter: drop-shadow(0 0 24px rgba(200, 119, 46, 0.45)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(200, 119, 46, 0)); }
}

/* Narrow phones: keep the controls tidy (they wrap to a second line if needed) */
@media (max-width: 420px) {
  .speak__controls { gap: 0.5rem; }
  .speak__toggle { min-width: 0; padding: 0 1.25rem; }
  #speak-close { padding: 0 1.1rem; }
}

/* Ticking on/off button: show the matching icon */
#speak-ticks .icon-sound-off { display: none; }
#speak-ticks[aria-pressed="false"] .icon-sound-on { display: none; }
#speak-ticks[aria-pressed="false"] .icon-sound-off { display: block; }

/* Small round icon button (restart) */
.btn--icon {
  width: 48px;
  min-height: 48px;
  padding: 0;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn--icon:hover { color: var(--text); border-color: var(--muted); }
.btn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .speak, .speak.pulse .ring { animation: none; }
  .ring__arc, .ring__head { transition: none; }
  .fw-panel { animation: none; }
  .page { transition: none; }
}

/* ---------- Frameworks footer ---------- */
.frameworks { text-align: center; }
.frameworks__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 0;
  background: none;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}
.frameworks__toggle strong { color: var(--text); font-weight: 500; text-wrap: balance; }
.frameworks__toggle { max-width: 100%; text-align: center; }
.frameworks__toggle:hover strong { color: var(--accent-text); }
.chev {
  width: 7px; height: 7px; margin-left: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.frameworks__toggle[aria-expanded="true"] .chev { transform: translateY(2px) rotate(225deg); }

/* ---------- Framework guide panel (slides up from the bottom) ---------- */
.fw-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  width: min(100%, 34rem);
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 1rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(20, 33, 61, 0.10);
  animation: fw-up 0.25s ease-out;
}
.fw-panel[hidden] { display: none; }
@keyframes fw-up {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}

.fw-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.fw-tabs {
  display: inline-flex;
  min-width: 0;                 /* may shrink so the close button always fits */
  overflow-x: auto;             /* last resort: swipe the tabs sideways */
  scrollbar-width: none;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.fw-tabs::-webkit-scrollbar { display: none; }
.fw-close { flex-shrink: 0; }
.fw-tab {
  position: relative;
  min-height: 36px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.fw-tab:hover { color: var(--text); }
.fw-tab[aria-selected="true"] { background: var(--surface); color: var(--text); }
/* a small amber dot marks the recommended framework */
.fw-tab.is-recommended::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.fw-close {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.fw-close:hover { color: var(--text); }
/* Phones: four compact tabs fit on one line */
@media (max-width: 420px) {
  .fw-panel__head { gap: 0.5rem; }
  .fw-tab { padding: 0 0.6rem; font-size: 0.8125rem; white-space: nowrap; }
}
@media (max-width: 340px) {
  .fw-tab { padding: 0 0.45rem; font-size: 0.75rem; }
  .fw-close { width: 36px; }
}

.fw-body { padding-top: 1.1rem; }
.fw-title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.fw-purpose { margin-top: 0.25rem; color: var(--muted); font-size: 0.9375rem; }
.fw-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.fw-steps li {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.fw-steps strong { color: var(--accent-text); font-weight: 600; }
.fw-example {
  margin-top: 1rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--muted);
}
.fw-arrow { margin: 0 0.4rem; color: var(--accent); }
.fw-good { margin-top: 1rem; font-size: 0.8125rem; color: var(--muted); }
.fw-good span:first-child {
  margin-right: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  color: var(--text);
}

/* ---------- Small "Privacy" link at the bottom of the main page ---------- */
.frameworks { display: flex; flex-direction: column; align-items: center; }
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: -4px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}
.footer-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Hidden sound check panel (only with #soundcheck in the address) ---------- */
.soundcheck {
  position: fixed;
  left: 12px; right: 12px; top: 12px;
  z-index: 20;
  max-width: 28rem;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--panel);
}
.soundcheck pre { margin: 0 0 10px; white-space: pre-wrap; font-size: 0.8125rem; line-height: 1.5; color: var(--text); }
.soundcheck div { display: flex; flex-wrap: wrap; gap: 8px; }
.soundcheck .btn { min-height: 40px; padding: 0 14px; font-size: 0.8125rem; }

/* ---------- Privacy page (simple readable document) ---------- */
.doc {
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--space-4) 1.25rem 4rem;
  line-height: 1.65;
}
.doc__back { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.doc__back:hover { color: var(--accent-text); }
.doc__title { margin: 1rem 0 0.5rem; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.5rem, 8vw, 3.5rem); line-height: 1.05; }
.doc__lead { font-size: 1.125rem; color: var(--text); margin-bottom: 1.5rem; }
.doc h2 { margin: 2rem 0 0.5rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.doc p, .doc li { color: var(--muted); }
.doc ul { padding-left: 1.2rem; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a:not(.doc__back) { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.doc a:not(.doc__back):hover { color: var(--accent-text); }
.doc__updated { margin-top: 2.5rem; font-size: 0.8125rem; color: var(--muted) !important; }

/* ---------- Gentle fade-in when the page opens ----------
   Each part rises softly into place, one after another. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.brand, .settings, .stage, .actions, .frameworks {
  animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.settings   { animation-delay: 0.08s; }
.stage      { animation-delay: 0.16s; }
.actions    { animation-delay: 0.24s; }
.frameworks { animation-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .brand, .settings, .stage, .actions, .frameworks { animation: none; }
}

/* ---------- Touch screens: every tap target at least 44px tall ---------- */
@media (pointer: coarse) {
  .segmented span { min-height: var(--tap); }
  .fw-tab { min-height: var(--tap); }
  /* invisible larger tap areas, same look */
  .ig-pill::after { content: ""; position: absolute; inset: -10px -6px; }
  .footer-link { position: relative; }
  .footer-link::after { content: ""; position: absolute; inset: -10px -6px 0; }  /* never below the page edge */
}

/* ---------- Short screens (small phones): tighter spacing ---------- */
@media (max-height: 700px) {
  .page { padding-top: 1rem; padding-bottom: max(0.25rem, env(safe-area-inset-bottom)); }
  .practice { gap: 1.25rem; padding: 1.25rem 0; }
  .settings { gap: 0.5rem; }
  .stage { min-height: 0; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .page { padding-top: var(--space-4); }
  .brand__name { font-size: 2.75rem; }
}

/* ---------- Phones turned sideways (wide but short) ----------
   Use the width instead of the height: header on one line, all
   settings in one row, and the topic/word sized to the screen height,
   so everything fits without scrolling. */
@media (orientation: landscape) and (max-height: 500px) {
  .page { padding: 0.5rem 1.25rem max(0.25rem, env(safe-area-inset-bottom)); }

  .brand { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
  .brand__name { font-size: 1.6rem; }
  .brand__by { margin-top: 0; }

  .practice { gap: clamp(0.5rem, 3vh, 1rem); padding: 0.5rem 0; }
  .settings { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
  .settings__row { width: auto; gap: 0.5rem; }
  .select { width: 15rem; }

  .stage { min-height: 0; gap: 0.35rem; }
  .stage__label { font-size: 0.6875rem; }
  .stage__result { font-size: clamp(1.4rem, 8.5vh, 2.6rem); }
  .stage--word .stage__result { font-size: clamp(2.5rem, 19vh, 5rem); }

  .btn { min-height: 44px; }
  .frameworks__toggle { min-height: 36px; }
  .frameworks { flex-direction: row; gap: 0.25rem; }   /* Privacy link sits beside the hint */
  .footer-link { margin-top: 0; }
  .practice { padding: 0.25rem 0; }
}

/* ---------- Tiny phones (≤360px wide): keep Spin + timer on one line ---------- */
@media (max-width: 360px) {
  .actions { gap: 0.5rem; }
  .btn { white-space: nowrap; }
  .btn--primary { padding: 0 1.2rem; }
  .timer__hint { display: none; }          /* "Start" is still read out by screen readers */
}

/* ---------- Very short portrait screens (old small phones): slightly smaller topic ---------- */
@media (max-height: 600px) and (orientation: portrait) {
  .stage__result { font-size: 2rem; }
  .brand__name { font-size: 2rem; }
}

/* ---------- Job Interview prep time: a calm slate ring, no ticking ---------- */
.speak.is-prep .ring__arc { stroke: var(--muted); }
.speak.is-prep .ring__head circle { fill: var(--muted); filter: none; }
.speak.is-prep .speak__time { color: var(--muted); }
.speak.is-prep .speak__note { color: var(--accent-text); }

/* ---------- "Suggested for this topic" label in the framework guide ---------- */
.fw-suggested {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.fw-suggested::before {               /* the same amber dot as on the tab */
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.fw-suggested[hidden] { display: none; }
