/* ============================================================================
   tvhud — pomodoro focus dashboard
   Landscape iPhone → AirPlay-mirrored 16:9 TV. Dark, minimal, burn-in safe.

   STATE CONTRACT (attributes toggled by app.js):
     body[data-mode]          "pomodoro" | "timer" | "stopwatch"
     body[data-state]         "idle" | "focus" | "shortBreak" | "longBreak"
                              | "timer" | "stopwatch"   → per-state accent tokens
     body[data-paused]        time display dims + gentle 2.5s pulse
     body[data-warning]       amber tokens + slow 2s glow pulse (vignette)
     body[data-chrome-hidden] #chrome and #settings-btn fade out,
                              pointer-events none
     body[data-standalone]    installed PWA (no special styling)
     [hidden]                 always display:none (overlays, drawer, presets)
     .bar-fill                width set inline by JS (%) — smooth transition here
     #session-dots .dot       ".done" filled, ".current" filled + glow ring
     #quote-strip             dimmed during focus; ".flash" shows it briefly
     #task-banner             "NOW" + current task; [hidden] when unset,
                              dimmed during breaks so a break reads as a break
   ========================================================================== */

/* ----------------------------------------------------------------------------
   0. Registered theme tokens — lets the whole mood cross-fade between states
   -------------------------------------------------------------------------- */
@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #8b93b0;
}
@property --accent-soft {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(139, 147, 176, 0.14);
}
@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(139, 147, 176, 0.28);
}
@property --bg-tint {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(120, 130, 165, 0.05);
}

/* ----------------------------------------------------------------------------
   1. Base / reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;

  /* neutrals */
  --bg: #07070c;
  --ink: #e8eaf2;
  --ink-dim: #8b8fa3;
  --ink-faint: #565b6e;
  --line: rgba(255, 255, 255, 0.06);
  --lift: rgba(255, 255, 255, 0.028);

  /* spacing scale */
  --space-1: clamp(6px, 1vmin, 12px);
  --space-2: clamp(10px, 1.8vmin, 22px);
  --space-3: clamp(16px, 3vmin, 36px);
  --radius: 24px;
  --radius-pill: 999px;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: hidden;
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Display", system-ui, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  /* whole-screen mood shift between states (~1.2s) */
  transition:
    --accent 1.2s ease,
    --accent-soft 1.2s ease,
    --glow 1.2s ease,
    --bg-tint 1.2s ease,
    background-color 1.2s ease;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:active {
  transform: scale(0.97);
}

/* ----------------------------------------------------------------------------
   2. Per-state ambient theming
   -------------------------------------------------------------------------- */
body[data-state="idle"] {
  --accent: #8b93b0;
  --accent-soft: rgba(139, 147, 176, 0.14);
  --glow: rgba(139, 147, 176, 0.28);
  --bg-tint: rgba(120, 130, 165, 0.05);
}

body[data-state="focus"] {
  --accent: #7c9bff;
  --accent-soft: rgba(124, 155, 255, 0.16);
  --glow: rgba(104, 140, 255, 0.45);
  --bg-tint: rgba(80, 110, 255, 0.075);
}

body[data-state="shortBreak"] {
  --accent: #4fd1a1;
  --accent-soft: rgba(79, 209, 161, 0.15);
  --glow: rgba(64, 205, 150, 0.4);
  --bg-tint: rgba(50, 190, 140, 0.06);
}

body[data-state="longBreak"] {
  --accent: #b78cff;
  --accent-soft: rgba(183, 140, 255, 0.16);
  --glow: rgba(175, 125, 255, 0.42);
  --bg-tint: rgba(160, 110, 255, 0.07);
}

body[data-state="timer"] {
  --accent: #56d4e6;
  --accent-soft: rgba(86, 212, 230, 0.15);
  --glow: rgba(70, 205, 228, 0.4);
  --bg-tint: rgba(60, 190, 220, 0.06);
}

body[data-state="stopwatch"] {
  --accent: #a3b2cc;
  --accent-soft: rgba(163, 178, 204, 0.14);
  --glow: rgba(163, 178, 204, 0.3);
  --bg-tint: rgba(140, 158, 190, 0.05);
}

/* last 2 minutes — amber takeover; declared after state blocks so it wins */
body[data-warning] {
  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, 0.18);
  --glow: rgba(255, 170, 60, 0.5);
  --bg-tint: rgba(255, 160, 60, 0.07);
}

/* ----------------------------------------------------------------------------
   3. Ambient background drift — two dim orbs, transform/opacity only (GPU)
   -------------------------------------------------------------------------- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 95vmax;
  height: 95vmax;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--bg-tint), transparent 72%);
  will-change: transform;
}

body::before {
  top: -45vmax;
  left: -25vmax;
  animation: drift-a 90s ease-in-out infinite alternate;
}

body::after {
  bottom: -50vmax;
  right: -30vmax;
  opacity: 0.8;
  animation: drift-b 120s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(9vw, 6vh, 0) scale(1.18); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.12); }
  to   { transform: translate3d(-8vw, -5vh, 0) scale(0.96); }
}

/* ----------------------------------------------------------------------------
   4. Dashboard grid — landscape 16:9
   -------------------------------------------------------------------------- */
#dashboard {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "timer clock"
    "timer stats"
    "timer progress"
    "quote quote";
  gap: var(--space-2);
  padding:
    calc(env(safe-area-inset-top, 0px) + var(--space-2))
    calc(env(safe-area-inset-right, 0px) + var(--space-2))
    calc(env(safe-area-inset-bottom, 0px) + var(--space-2))
    calc(env(safe-area-inset-left, 0px) + var(--space-2));
  /* burn-in mitigation: imperceptible ±1px wander */
  animation: burn-in-drift 240s linear infinite;
}

@keyframes burn-in-drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(1px, -1px); }
  50%  { transform: translate(-1px, 1px); }
  75%  { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* warning vignette — pulses opacity only; box-shadow itself is static */
#dashboard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: var(--radius);
  box-shadow: inset 0 0 18vh var(--glow);
  opacity: 0;
  transition: opacity 1.2s ease;
}

body[data-warning] #dashboard::after {
  animation: warn-pulse 2s ease-in-out infinite;
}

@keyframes warn-pulse {
  0%, 100% { opacity: 0.28; }
  50%      { opacity: 0.75; }
}

/* panels: one composed screen, faint lift — not boxes */
.panel {
  background: var(--lift);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  min-width: 0;
  min-height: 0;
}

/* ----------------------------------------------------------------------------
   5. Timer panel — the hero
   -------------------------------------------------------------------------- */
#timer-panel {
  grid-area: timer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.6vh, 30px);
  text-align: center;
}

/* current-task banner — sits above the phase label in the hero column */
#task-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.7em;
  max-width: 100%;
  font-size: clamp(12px, 2.2vh, 24px);
  /* opacity only — GPU-composited, no layout shift between phases */
  opacity: 1;
  transition: opacity 1.2s ease;
}

.task-eyebrow {
  flex: none;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--accent);
  transition: color 1.2s ease;
}

#task-text {
  min-width: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* breaks are for not thinking about the task */
body[data-state="shortBreak"] #task-banner,
body[data-state="longBreak"] #task-banner {
  opacity: 0.26;
}

#phase-label {
  font-size: clamp(13px, 2.6vh, 28px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* recenters letter-spaced text */
  color: var(--accent);
  transition: color 1.2s ease;
}

#time-display {
  font-size: min(32vh, 14vw);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
  text-shadow: 0 0 clamp(24px, 7vh, 80px) var(--glow);
  transition: opacity 0.6s ease, text-shadow 1.2s ease;
}

body[data-paused] #time-display {
  opacity: 0.55;
  animation: paused-pulse 2.5s ease-in-out infinite;
}

@keyframes paused-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.38; }
}

/* phase progress bar */
#phase-progress {
  width: min(64%, 560px);
}

/* stopwatch has no end — an empty track is noise, not information */
body[data-mode="stopwatch"] #phase-progress {
  display: none;
}

/* ----------------------------------------------------------------------------
   6. Bars — shared track/fill (phase, workday, goal)
   -------------------------------------------------------------------------- */
.bar {
  height: clamp(6px, 1.3vh, 12px);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  transition:
    width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 1.2s ease,
    box-shadow 1.2s ease;
}

/* ----------------------------------------------------------------------------
   7. Session dots
   -------------------------------------------------------------------------- */
#session-dots {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vh, 16px);
}

#session-dots:empty {
  display: none;
}

.dot {
  width: clamp(9px, 1.6vh, 15px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  transition:
    background-color 0.6s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
}

.dot.done {
  background: var(--accent);
  border-color: transparent;
}

.dot.current {
  background: var(--accent);
  border-color: transparent;
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 0 14px var(--glow);
}

/* ----------------------------------------------------------------------------
   8. Timer presets — large tappable pills
   -------------------------------------------------------------------------- */
#timer-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
}

.preset-chip,
#custom-minutes {
  min-height: 48px;
  padding: 10px clamp(16px, 2.6vmin, 26px);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  font-size: clamp(16px, 2.6vh, 22px);
  font-weight: 600;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.preset-chip:hover,
.preset-chip:active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

#custom-minutes {
  width: 6.5ch;
  text-align: center;
  font-family: inherit;
}

#custom-minutes::placeholder {
  color: var(--ink-faint);
}

/* ----------------------------------------------------------------------------
   9. Clock panel — large but secondary
   -------------------------------------------------------------------------- */
#clock-panel {
  grid-area: clock;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vh, 12px);
}

#clock-time {
  font-size: clamp(40px, 11vh, 120px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #dfe3f0;
}

#clock-date {
  font-size: clamp(11px, 2vh, 20px);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
}

/* ----------------------------------------------------------------------------
   10. Stats panel
   -------------------------------------------------------------------------- */
#stats-panel {
  grid-area: stats;
  display: flex;
  align-items: stretch;
  padding-block: clamp(12px, 2.4vmin, 28px);
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat-value {
  font-size: clamp(26px, 6.5vh, 68px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}

.stat-label {
  font-size: clamp(9px, 1.5vh, 14px);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   11. Progress panel — workday + goal bars
   -------------------------------------------------------------------------- */
#progress-panel {
  grid-area: progress;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 2.4vh, 24px);
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(8ch, auto) 1fr;
  align-items: center;
  gap: clamp(10px, 2vmin, 20px);
}

.progress-label {
  font-size: clamp(10px, 1.7vh, 15px);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   12. Quote strip — thin, elegant, near-invisible during focus
   -------------------------------------------------------------------------- */
#quote-strip {
  grid-area: quote;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  /* Row reserves the fixed #chrome band below the text so the pill never
     covers the quote; keeps layout static across chrome hide/show. */
  align-content: flex-start;
  min-height: clamp(96px, 13.5vh, 132px);
  gap: 4px 12px;
  padding: clamp(4px, 1vh, 10px) var(--space-3);
  border-top: 1px solid var(--line);
  opacity: 1;
  transition: opacity 0.8s ease;
}

#quote-text {
  font-size: clamp(14px, 2.6vh, 26px);
  font-weight: 400;
  font-style: italic;
  color: #a7abc0;
  text-align: center;
}

#quote-author {
  font-size: clamp(11px, 2vh, 18px);
  font-style: normal;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

#quote-author:not(:empty)::before {
  content: "\2014\00a0"; /* em dash */
}

/* near-invisible while focusing; softly present in timer/stopwatch */
body[data-state="focus"] #quote-strip {
  opacity: 0.05;
}

body[data-state="timer"] #quote-strip,
body[data-state="stopwatch"] #quote-strip {
  opacity: 0.3;
}

/* JS adds .flash at focus start for a brief fade-in/out reveal */
body[data-state] #quote-strip.flash {
  opacity: 0.95;
}

/* ----------------------------------------------------------------------------
   13. Chrome — auto-hiding control bar
   -------------------------------------------------------------------------- */
#chrome {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translate(-50%, 0);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: min(96vw, 940px);
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  background: rgba(13, 14, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body[data-chrome-hidden] #chrome {
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.98);
  pointer-events: none;
}

/* mode toggle — segmented pill */
#mode-toggle {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn {
  min-height: 44px;
  padding: 0 clamp(12px, 2.2vmin, 22px);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-dim);
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

.mode-btn[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* transport */
#timer-controls {
  display: flex;
  gap: 8px;
}

#timer-controls button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 clamp(14px, 2.4vmin, 24px);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  color: #c9cde0;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

#timer-controls button:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

/* primary action — accent-filled */
#start-pause-btn {
  background: var(--accent);
  border-color: transparent;
  color: #0a0b12;
  box-shadow: 0 0 18px var(--glow);
  transition:
    background-color 1.2s ease,
    box-shadow 1.2s ease;
}

#start-pause-btn:hover {
  border-color: transparent;
}

/* Settings — a minimal corner affordance, not part of the control bar.
   Deliberately keeps a 44px hit area (iOS touch minimum) while presenting as a
   small faint glyph: no chip, no border, low resting opacity. Same top-right
   corner the drawer slides in from. */
#settings-btn {
  position: fixed;
  z-index: 30;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-dim);
  border: 0;
  background: none;
  opacity: 0.3;
  transition: opacity 0.4s ease, color 0.25s ease;
}

#settings-btn:hover,
#settings-btn:focus-visible {
  opacity: 1;
  color: var(--ink);
}

/* Hides with the control bar, on the same flag and the same poke.
   The open drawer (z-index 40) covers this corner on its own. */
body[data-chrome-hidden] #settings-btn {
  opacity: 0;
  pointer-events: none;
}

/* ----------------------------------------------------------------------------
   14. Settings drawer — right-side dark sheet
   -------------------------------------------------------------------------- */
#settings-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  overflow-y: auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 28px)
    calc(env(safe-area-inset-right, 0px) + 28px)
    calc(env(safe-area-inset-bottom, 0px) + 28px)
    28px;
  background: rgba(12, 13, 20, 0.92);
  border-left: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
}

#settings-drawer h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}

#settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}

#settings-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

#settings-form input[type="number"],
#settings-form input[type="time"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px; /* ≥16px prevents iOS focus zoom */
  font-variant-numeric: tabular-nums;
}

#settings-form input:focus {
  border-color: var(--accent);
}

#settings-form label.wide {
  grid-column: 1 / -1;
}

#settings-form input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px; /* ≥16px prevents iOS focus zoom */
}

#settings-form label.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

#settings-form input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

#settings-close {
  display: block;
  width: 100%;
  margin-top: 24px;
  min-height: 52px;
  border-radius: 16px;
  background: var(--accent);
  color: #0a0b12;
  font-size: 17px;
  font-weight: 700;
  transition: background-color 1.2s ease;
}

/* ----------------------------------------------------------------------------
   15. Overlays — start gate + portrait guard
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 40%, var(--bg-tint), transparent 70%),
    var(--bg);
}

#start-overlay {
  z-index: 50;
}

#rotate-overlay {
  z-index: 60;
}

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 3vh, 28px);
  padding: var(--space-3);
}

.overlay-inner p {
  font-size: clamp(15px, 2.8vh, 24px);
  color: var(--ink-dim);
}

.wordmark {
  font-size: clamp(56px, 16vh, 150px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: lowercase;
  background: linear-gradient(115deg, #7c9bff 10%, #b78cff 55%, #56d4e6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  color: var(--ink-dim);
  letter-spacing: 0.08em;
}

#fullscreen-btn {
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.rotate-icon {
  font-size: clamp(56px, 16vh, 140px);
  line-height: 1;
}

/* ----------------------------------------------------------------------------
   16. Portrait fallback — simple stacked column
   -------------------------------------------------------------------------- */
@media (orientation: portrait) {
  body {
    overflow: auto;
  }

  #dashboard {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "timer"
      "clock"
      "stats"
      "progress"
      "quote";
  }

  #timer-panel {
    min-height: 46dvh;
  }

  #time-display {
    font-size: min(18vh, 21vw);
  }

  #clock-time {
    font-size: min(9vh, 14vw);
  }
}

/* ----------------------------------------------------------------------------
   17. Reduced motion — kill drift and pulses, keep gentle fades
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  #dashboard {
    animation: none;
  }

  body[data-warning] #dashboard::after {
    animation: none;
    opacity: 0.5; /* warning stays visible, just static */
  }

  body[data-paused] #time-display {
    animation: none;
    opacity: 0.55;
  }
}
