/*
Theme Name: Workout Timer Online
Theme URI: https://workouttimeronline.com/
Author: Workout Timer Online
Description: Custom theme for Workout Timer Online — free online workout and interval timer.
Version: 1.7.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: workout-timer-online
*/

:root {
  --bg: #faf6f1;
  --bg-soft: #fdeede;
  --card: #ffffff;
  --ink: #1c1a18;
  --ink-soft: #6f6a63;
  --line: #f1e4d6;
  --orange: #ff7a00;
  --orange-deep: #bd4804;
  --orange-soft: #ffc38a;
  --grad: linear-gradient(135deg, #ffb45e 0%, #ff8a1e 45%, #ff6a00 100%);
  --grad-soft: linear-gradient(180deg, #ffd9b3 0%, #ffb471 100%);
  --dark: #171512;
  --rest: #2fa27e;
  --warm: #f5a623;
  --cool: #4f8fe8;
  --radius: 28px;
  --shadow: 0 18px 45px -18px rgba(242, 92, 5, 0.22);
  --shadow-soft: 0 10px 30px -12px rgba(28, 26, 24, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* Keep anchor targets (e.g. #timer) clear of the sticky header, which wraps
   onto two lines on small screens. */
html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Accessibility ---------- */

/* Visible to screen readers only. Used for the timer's live announcements. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Skip link: off-screen until it takes focus, then pinned above the sticky header. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  white-space: nowrap;
  transform: translateY(-200%);
  background: var(--dark);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
  color: #fff;
}

/* One consistent keyboard focus ring. Mouse and touch users never see it. */
:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Round controls keep their own shape so the ring hugs the button. */
.ctrl-btn:focus-visible,
.step-btn:focus-visible,
.preset-btn:focus-visible,
.start-cta:focus-visible,
.start-again:focus-visible,
.btn-primary:focus-visible,
.site-nav a:focus-visible,
.footer-nav a:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 3px;
  border-radius: 999px;
}

.ctrl-btn.primary:focus-visible,
.start-cta:focus-visible,
.btn-primary:focus-visible {
  outline-color: var(--dark);
}

.card:focus-visible,
.faq-list summary:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 2px;
  border-radius: 18px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link { transition: none; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 241, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(242, 92, 5, 0.55);
  flex: none;
}
.brand-dot svg { width: 18px; height: 18px; }

.site-nav {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.nav-group { position: relative; }

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}

.nav-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-caret {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  transition: transform 0.18s;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}

/* Hover bridge so the pointer can cross the gap to the panel. */
.nav-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-panel a {
  border-radius: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}

.nav-group.is-open .nav-panel,
.nav-group:focus-within .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-group.is-open .nav-top,
.nav-group:focus-within .nav-top {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-group.is-open .nav-caret,
.nav-group:focus-within .nav-caret { transform: rotate(180deg); }

/* Hover only opens the panel where hovering exists; touch pointers get the
   tap-to-open behaviour from assets/nav.js instead. */
@media (hover: hover) {
  .nav-group:hover .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-group:hover .nav-top {
    background: var(--bg-soft);
    color: var(--ink);
  }

  .nav-group:hover .nav-caret { transform: rotate(180deg); }
}

@media (max-width: 760px) {
  .site-header .wrap {
    flex-wrap: wrap;
    gap: 10px;
  }
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .nav-group { flex: 1; }
  .nav-top {
    justify-content: center;
    width: 100%;
    background: var(--bg-soft);
  }
  .nav-panel {
    left: 0;
    right: auto;
    min-width: 190px;
  }
  .nav-group:last-child .nav-panel {
    left: auto;
    right: 0;
  }
}

/* ---------- Breadcrumb ---------- */

.breadcrumb {
  padding: 14px 0 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--orange-soft);
}

.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--orange-deep); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 56px 0 30px;
  text-align: center;
  background:
    radial-gradient(600px 320px at 15% 0%, rgba(255, 180, 94, 0.28), transparent 70%),
    radial-gradient(700px 380px at 85% 10%, rgba(255, 106, 0, 0.18), transparent 70%);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero .tagline {
  margin: 14px auto 0;
  max-width: 620px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* ---------- Timer ---------- */

.timer-shell {
  padding: 34px 0 10px;
}

.timer-app {
  background: linear-gradient(180deg, #ffffff 0%, #fff7ef 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 44px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

@media (max-width: 860px) {
  .timer-app { grid-template-columns: 1fr; }
}

/* Dial side */

.timer-dial {
  text-align: center;
}

.dial-wrap {
  position: relative;
  width: min(320px, 78vw);
  margin: 0 auto;
}

.dial-wrap svg { display: block; width: 100%; height: auto; }

.ring-track { stroke: #f3e8db; }

.ring-progress {
  stroke: url(#wtoGrad);
  transition: stroke-dashoffset 0.2s linear;
}

.timer-app[data-phase="rest"] .ring-progress { stroke: var(--rest); }
.timer-app[data-phase="warmup"] .ring-progress { stroke: var(--warm); }
.timer-app[data-phase="cooldown"] .ring-progress { stroke: var(--cool); }

.dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.phase-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange-deep);
}
.timer-app[data-phase="rest"] .phase-label { color: var(--rest); }
.timer-app[data-phase="warmup"] .phase-label { color: var(--warm); }
.timer-app[data-phase="cooldown"] .phase-label { color: var(--cool); }
.timer-app[data-phase="done"] .phase-label { color: var(--ink); }

.time-display {
  font-size: clamp(3rem, 9vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.round-label {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Mode badge + meta chips (EMOM) */

.mode-badge {
  display: inline-block;
  margin-bottom: 16px;
  background: var(--grad);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 18px -8px rgba(242, 92, 5, 0.6);
}

.mode-meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mode-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.mode-chip strong {
  color: var(--ink);
  font-weight: 800;
}

.timer-app.is-emom .round-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  font-weight: 700;
}

/* AMRAP: single duration setting + restart button */

.timer-app.is-amrap .round-label,
.timer-app[data-mode="amrap"] .round-label,
.timer-app[data-mode="fortime"] .round-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 64%;
  margin-top: 4px;
  line-height: 1.35;
}

.timer-app.is-amrap .settings-grid { grid-template-columns: 1fr; }

.start-again {
  display: none;
  margin-top: 18px;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--grad);
  color: #fff;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px rgba(242, 92, 5, 0.5);
  transition: transform 0.12s;
}
.start-again:hover { transform: translateY(-2px); }

.timer-app[data-phase="done"] .start-again { display: inline-block; }

.total-label {
  margin-top: 14px;
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Controls */

.timer-controls {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-soft);
}

.ctrl-btn:hover { transform: translateY(-2px); }
.ctrl-btn svg { width: 20px; height: 20px; }

.ctrl-btn.primary {
  width: 68px;
  height: 68px;
  background: var(--dark);
  color: #fff;
  border: none;
}
.ctrl-btn.primary svg { width: 26px; height: 26px; }

/* Dimmed = sound off. The fullscreen button also carries aria-pressed, but
   "not in fullscreen" is its resting state, not a disabled one. */
.ctrl-btn[aria-pressed="false"]:not(#btn-fullscreen) { opacity: 0.45; }

/* Settings side */

.timer-settings h2 {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting.is-wide { grid-column: 1 / -1; }

@media (max-width: 420px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.setting {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

/* Sub-label for a setting the timer records but never acts on (EMOM reps). */
.setting .label-note {
  display: block;
  margin-top: 3px;
  max-width: 18ch;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
  opacity: 0.7;
}

.setting .stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  color: var(--orange-deep);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.step-btn:hover { background: var(--orange-soft); }

.setting .value {
  min-width: 52px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.02rem;
}

.start-cta {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 24px;
  background: var(--grad);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 28px -10px rgba(242, 92, 5, 0.5);
  transition: transform 0.12s, box-shadow 0.12s;
  font-family: inherit;
}
.start-cta:hover { transform: translateY(-2px); }

/* Presets */

.presets { margin-top: 16px; }

.presets-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-variant-numeric: tabular-nums;
}

.preset-chip:hover {
  border-color: var(--orange-soft);
  background: var(--bg-soft);
}

.preset-chip.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.preset-load {
  display: inline-block;
  margin-top: 12px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange-deep);
  cursor: pointer;
}
.preset-load:hover { text-decoration: underline; }

/* Fullscreen mode
   `.is-bigscreen` is the fallback for browsers with no Fullscreen API for
   ordinary elements — Safari on iPhone above all — where the button would
   otherwise do nothing. It fills the viewport by hand. */

.timer-app:fullscreen,
.timer-app.is-bigscreen {
  border-radius: 0;
  border: none;
  display: grid;
  place-content: center;
  grid-template-columns: 1fr;
  background: linear-gradient(180deg, #fff 0%, #ffefdd 100%);
}
.timer-app:fullscreen .timer-settings,
.timer-app.is-bigscreen .timer-settings { display: none; }
.timer-app:fullscreen .dial-wrap,
.timer-app.is-bigscreen .dial-wrap { width: min(56vh, 86vw); }
.timer-app:fullscreen .time-display,
.timer-app.is-bigscreen .time-display { font-size: clamp(4rem, 14vh, 8rem); }

.timer-app.is-bigscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  margin: 0;
  max-width: none;
  box-shadow: none;
  overflow: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

body.has-bigscreen { overflow: hidden; }

/* ---------- Sections ---------- */

section.block { padding: 64px 0 0; }

section.block h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

section.block > .wrap > p.lead {
  color: var(--ink-soft);
  max-width: 640px;
  font-size: 1.04rem;
}

.center { text-align: center; }
.center > .wrap > p.lead { margin: 0 auto; }

/* Cards grid (workout types) */

.cards {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--orange-soft);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card .card-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--grad-soft);
  color: var(--orange-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.card .card-icon svg { width: 22px; height: 22px; }

.card h3,
.card h4 { font-size: 1.08rem; font-weight: 800; margin-bottom: 4px; }
.card p { color: var(--ink-soft); font-size: 0.92rem; }

/* Cards split into named groups (hub pages) */

.cards-group { margin-top: 28px; }
.cards-group + .cards-group { margin-top: 36px; }

.cards-group .group-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.cards-group .cards { margin-top: 14px; }

.card .go {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange-deep);
}

/* Card for a timer page that does not exist yet */

.card.is-soon {
  opacity: 0.62;
  box-shadow: none;
}
.card.is-soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}
.card.is-soon .go { color: var(--ink-soft); }

/* Chip-style internal links (hub pages) */

a.preset-chip { text-decoration: none; }
a.preset-chip:hover {
  text-decoration: none;
  border-color: var(--orange-soft);
  background: var(--bg-soft);
  color: var(--orange-deep);
}

/* Steps */

.steps {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}

@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  position: relative;
}

.step .num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 18px -8px rgba(242, 92, 5, 0.6);
}

.step h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.step p { color: var(--ink-soft); font-size: 0.94rem; }

.steps.steps-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .steps.steps-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps.steps-4 { grid-template-columns: 1fr; } }

/* Settings table */

.settings-table-wrap {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  /* The table runs wider than a phone: it has to scroll, or the last column —
     the "Load" buttons — sits permanently off screen. `auto` still clips to the
     rounded corners the way `hidden` did. */
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.settings-table th,
.settings-table td {
  text-align: left;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.settings-table tbody tr:last-child th,
.settings-table tbody tr:last-child td { border-bottom: none; }

.settings-table thead th {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.settings-table td:first-child { font-weight: 700; white-space: nowrap; }
.settings-table td:last-child { color: var(--ink-soft); }

/* Use cases */

.usecases {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 700px) { .usecases { grid-template-columns: 1fr; } }

.usecase {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
}

.usecase h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.usecase h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  flex: none;
}

.usecase p { color: var(--ink-soft); font-size: 0.94rem; }

/* Why block */

.why-inner {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow-soft);
}

.why-inner p { color: #4a453f; margin-bottom: 16px; max-width: 75ch; }
.why-inner p:last-child { margin-bottom: 0; }
.why-inner h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 22px 0 8px;
}

/* A block opening on its own heading has nothing to be spaced from. */
.why-inner > h3:first-child { margin-top: 0; }

/* Features */

.features-list {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  list-style: none;
}

@media (max-width: 820px) { .features-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .features-list { grid-template-columns: 1fr; } }

.features-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.features-list li svg {
  width: 20px;
  height: 20px;
  color: var(--orange-deep);
  flex: none;
}

/* FAQ */

.faq-list { margin-top: 28px; display: grid; gap: 10px; }

.faq-list details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--orange-deep);
  transition: transform 0.15s;
  flex: none;
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list details p {
  padding: 0 22px 18px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* Final CTA */

.final-cta {
  margin: 72px 0 0;
  padding: 64px 0;
  background:
    radial-gradient(700px 340px at 50% 0%, rgba(255, 154, 61, 0.35), transparent 75%),
    linear-gradient(180deg, var(--bg) 0%, #ffe9d2 100%);
  text-align: center;
}

.final-cta h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.final-cta p {
  color: var(--ink-soft);
  max-width: 520px;
  margin: 12px auto 26px;
}

.btn-primary {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  padding: 15px 34px;
  border-radius: 999px;
  box-shadow: 0 14px 28px -10px rgba(242, 92, 5, 0.5);
  transition: transform 0.12s;
}
.btn-primary:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff8f1;
  padding: 34px 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-nav a { color: var(--ink-soft); font-weight: 600; }
.footer-nav a:hover { color: var(--orange-deep); }

/* Site information links: their own row under the timer list, so they stay
   findable instead of being lost at the end of 24 timer links. */
.footer-nav-utility {
  flex-basis: 100%;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer-nav-utility a { color: var(--ink); font-weight: 700; }

/* ---------- Contact & legal pages ---------- */

/* Standalone call to action inside a text section, not in the .final-cta band. */
.cta-row { margin-top: 24px; }

/* Anchor chips under a hero, centred with the rest of the hero text. */
.presets-row.is-centered { justify-content: center; margin-top: 22px; }

/* ---------- Generic page content (inner pages) ---------- */

.page-content { padding: 48px 0 72px; }
.page-content h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px; }
.page-content h2 { font-size: 1.5rem; font-weight: 800; margin: 28px 0 10px; }
.page-content p { margin-bottom: 14px; color: #4a453f; max-width: 75ch; }
.page-content ul, .page-content ol { margin: 0 0 14px 22px; color: #4a453f; }

/* ---------- Editorial pages (guides, about) ---------- */

/* The reset zeroes list padding, so a list inside an article card needs its
   own indent — .page-content already does this for the generic templates. */
.why-inner ul,
.why-inner ol {
  margin: 0 0 16px 22px;
  max-width: 75ch;
  color: #4a453f;
}
.why-inner ul:last-child,
.why-inner ol:last-child { margin-bottom: 0; }
.why-inner li { margin-bottom: 6px; }
.why-inner li:last-child { margin-bottom: 0; }
.why-inner li::marker { color: var(--orange-deep); }

/* Guide cards link from their own heading. */
.usecase h3 a { color: inherit; }
.usecase h3 a:hover { color: var(--orange-deep); text-decoration: none; }

/* Four menus no longer fit on one line at phone widths. Wrapping them into a
   2x2 grid means a panel opened from the first row lands on top of the second
   row, so the open group has to be lifted above its later siblings — without
   a z-index it is the chips that paint over the panel. */
@media (max-width: 760px) {
  .site-nav { flex-wrap: wrap; }
  .nav-group { flex: 1 1 calc(50% - 6px); }
  .nav-group:nth-child(even) .nav-panel {
    left: auto;
    right: 0;
  }
}

.nav-panel { z-index: 20; }
.nav-group.is-open,
.nav-group:focus-within { z-index: 20; }

@media (hover: hover) {
  .nav-group:hover { z-index: 20; }
}

/* ---------- Timer modes: For Time and the round counter ---------- */

/* Rows, chips and buttons that belong to another workout mode. The attribute
   has to beat `.setting { display: flex }` and friends. */
.timer-app [data-modes][hidden] { display: none !important; }

.round-counter {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.round-counter button {
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s, opacity 0.12s;
}
.round-counter button:disabled { opacity: 0.4; cursor: default; }

.counter-plus {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--orange-soft);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.counter-plus strong {
  min-width: 2.2em;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.counter-minus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
}

.counter-finish {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: var(--dark);
  color: #fff;
  font-size: 1rem;
}

.round-counter button:not(:disabled):active { transform: scale(0.96); }

/* ---------- Steppers: hold to repeat, tap the value to type ---------- */

.step-btn {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (pointer: coarse) {
  .step-btn { width: 40px; height: 40px; }
}

.setting .value[role="button"] {
  cursor: text;
  padding: 2px 4px;
  border-radius: 8px;
  text-decoration: underline dotted var(--orange-soft);
  text-underline-offset: 4px;
}
.setting .value[role="button"]:hover { background: var(--bg-soft); }
.setting .value.is-editing { text-decoration: none; padding: 0; }

.value-edit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.value-edit input {
  width: 2.6em;
  padding: 4px 2px;
  border: 1px solid var(--orange-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  /* 16px keeps iOS from zooming the page when the field takes focus. */
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Phone layout: get the Start button on the first screen ---------- */

/* One row of four menus instead of a 2x2 grid: the sticky header drops from
   ~150px to ~90px. The outer two panels open towards the middle. */
@media (max-width: 760px) {
  .site-header .wrap {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 8px;
  }
  .brand { font-size: 1rem; }
  .brand-dot { width: 30px; height: 30px; border-radius: 10px; }
  .site-nav { flex-wrap: nowrap; gap: 4px; }
  .nav-group { flex: 1 1 0; min-width: 0; }
  .site-nav a.nav-top {
    padding: 6px 4px;
    gap: 3px;
    font-size: 0.8rem;
  }
  .nav-caret { width: 11px; height: 11px; }
  .nav-group:nth-child(2) .nav-panel { left: 0; right: auto; }
  .nav-group:nth-child(3) .nav-panel,
  .nav-group:nth-child(4) .nav-panel { left: auto; right: 0; }

  /* In the iPhone overlay a bottom anchor ad sits above everything: keep the
     controls clear of it. */
  .timer-app.is-bigscreen {
    padding-bottom: calc(max(16px, env(safe-area-inset-bottom)) + 90px);
  }
}

/* Spacing only: the H1 and the introduction stay exactly as they are. */
@media (max-width: 600px) {
  .breadcrumb { padding-top: 10px; }
  .hero { padding: 18px 0 8px; }
  .hero h1 { font-size: 2rem; }
  .hero .tagline { margin-top: 8px; font-size: 0.98rem; }
  .timer-shell { padding-top: 14px; }
  .timer-app { gap: 20px; }
  .mode-badge { margin-bottom: 10px; }
  .dial-wrap { width: min(320px, 62vw); }
  .mode-meta { margin-top: 10px; }
  .total-label { margin-top: 8px; }
  .timer-controls { margin-top: 12px; gap: 10px; }
}

/* Five round buttons did not fit a 375px card and pushed the last one onto
   the edge. */
@media (max-width: 420px) {
  .ctrl-btn { width: 48px; height: 48px; }
  .ctrl-btn.primary { width: 64px; height: 64px; }
}
