/* FocusOS — ambient focus + Pomodoro+. Deep-work aesthetic: dark, calm, one job. */

:root {
  --bg-0: #070b16;
  --bg-1: #0d1424;
  --bg-2: #131c33;
  --panel: rgba(20, 30, 55, 0.72);
  --panel-border: rgba(120, 150, 220, 0.16);
  --text-0: #eef2ff;
  --text-1: #b8c2dd;
  --text-2: #7d8bb0;
  --accent: #22d3ee; /* focus cyan */
  --accent-2: #fbbf24; /* amber (breaks/streaks) */
  --warn: #f59e0b;
  --bad: #f87171;
  --good: #34d399;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

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

html { color-scheme: dark; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(34, 211, 238, 0.09), transparent 60%),
    radial-gradient(900px 500px at 85% 110%, rgba(129, 140, 248, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-2));
  color: var(--text-0);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
}

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

.container { width: 100%; max-width: 720px; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.tagline { color: var(--text-2); font-size: 13px; }
.nav a { margin-left: 14px; font-size: 13px; color: var(--text-1); }

/* ---------- Timer Card ---------- */
.timer-card {
  /* <main> is a SIBLING of .container on this page, so it never inherits that
     element's 720px cap — measured 2026-11-13 at 1408px wide on a 1440px
     viewport, i.e. the card spanning edge to edge. Cap it here, to the same
     column the header and footer use. */
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px 26px;
  position: relative;
  overflow: hidden;
}
.timer-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 50% 0%, rgba(34, 211, 238, 0.06), transparent 70%);
  pointer-events: none;
}

/* ---------- Session-complete celebration ---------- */
.timer-card.celebrating {
  animation: celebrate-glow 1.6s ease-out;
}
@keyframes celebrate-glow {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.7); }
  60% { box-shadow: 0 0 34px 10px rgba(34, 211, 238, 0.35); }
  100% { box-shadow: var(--shadow); }
}
.celebrate {
  margin: -6px -6px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(129, 140, 248, 0.16));
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  animation: celebrate-pop 0.35s ease-out;
}
.celebrate[hidden] { display: none; }
@keyframes celebrate-pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.celebrate-inner { display: inline-flex; align-items: center; gap: 8px; }
.celebrate-emoji { font-size: 20px; animation: celebrate-wiggle 0.7s ease-in-out infinite; }
@keyframes celebrate-wiggle {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(18deg); }
}

.phase-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.phase-pill {
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.12); color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.phase-pill[data-phase="break"] { background: rgba(251, 191, 36, 0.12); color: var(--accent-2); border-color: rgba(251, 191, 36, 0.28); }
.phase-pill[data-phase="idle"] { background: rgba(125, 139, 176, 0.12); color: var(--ink); border-color: rgba(125, 139, 176, 0.25); }
.phase-pill[data-status="paused"] { background: rgba(245, 158, 11, 0.12); color: var(--warn); border-color: rgba(245, 158, 11, 0.3); }

.session-dots { display: flex; gap: 6px; }
.session-dots .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(125, 139, 176, 0.25);
}
.session-dots .dot.done { background: var(--accent); box-shadow: 0 0 8px rgba(34, 211, 238, 0.6); }

.clock {
  font-family: var(--font-mono);
  font-size: 86px; font-weight: 300; line-height: 1; text-align: center;
  letter-spacing: 0.02em; margin: 18px 0 6px;
  font-variant-numeric: tabular-nums;
}
.clock[data-phase="break"] { color: var(--accent-2); }
.clock[data-phase="idle"] { color: var(--text-1); }

.progress { height: 5px; border-radius: 999px; background: rgba(125, 139, 176, 0.18); overflow: hidden; margin-bottom: 20px; }
.progress .bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #818cf8); border-radius: 999px; transition: width 0.2s linear; }
.timer-card[data-phase="break"] .progress .bar { background: linear-gradient(90deg, var(--accent-2), #fb7185); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  font: inherit; font-weight: 700; font-size: 15px;
  border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 12px 20px; cursor: pointer; color: var(--text-0);
  background: rgba(125, 139, 176, 0.12); transition: transform 0.06s, background 0.15s;
}
.btn:hover { background: rgba(125, 139, 176, 0.22); }
.btn:active { transform: scale(0.97); filter: brightness(0.82); background: rgba(34, 211, 238, 0.28); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #38bdf8); color: #062430; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { filter: brightness(0.78) saturate(1.4); background: #0e7490; transform: scale(0.96); }
.btn-amber { background: linear-gradient(135deg, var(--accent-2), #fb923c); color: #3a2402; border-color: transparent; }
.btn-amber:hover { filter: brightness(1.08); }
.btn-amber:active { filter: brightness(0.78) saturate(1.4); background: #b45309; transform: scale(0.96); }

/* Post-click flash — the button visibly changes color for a beat after any tap */
.btn.clicked, .slot.clicked, .sound-btn.clicked {
  animation: click-flash 0.32s ease-out;
}
@keyframes click-flash {
  0% { filter: brightness(0.7) saturate(1.6); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.55); }
  100% { filter: brightness(1); box-shadow: none; }
}

.settings {
  margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-2); font-size: 14px; flex-wrap: wrap;
}
.settings select {
  font: inherit; color: var(--text-0); background: rgba(125, 139, 176, 0.12);
  border: 1px solid var(--panel-border); border-radius: 8px; padding: 6px 8px;
}
.settings[hidden] { display: none; }

/* ---------- Break slots ---------- */
.break-panel[hidden] { display: none; }
.break-panel {
  margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--panel-border);
}
.break-panel h3 { font-size: 15px; color: var(--text-1); margin-bottom: 12px; }
.break-panel h3 span { color: var(--accent-2); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.slot {
  background: rgba(125, 139, 176, 0.08); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 12px 10px; cursor: pointer; text-align: center;
  transition: transform 0.06s, background 0.15s;
}
.slot:hover { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.4); }
.slot:active { transform: scale(0.96); }
.slot .e { font-size: 22px; display: block; margin-bottom: 4px; }
.slot .n { font-size: 13px; font-weight: 700; }
.slot .c { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* ---------- Ambient sound ---------- */
.sound-card, .stats-card, .streak-card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
}
.sound-card h2, .stats-card h2, .streak-card h2 { font-size: 15px; color: var(--text-1); margin-bottom: 12px; }
.sound-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sound-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text-0);
  background: rgba(125, 139, 176, 0.1); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: all 0.15s;
}
.sound-btn.on { background: rgba(34, 211, 238, 0.16); border-color: var(--accent); color: #4c3fc4; }
.sound-btn:active { transform: scale(0.94); background: rgba(34, 211, 238, 0.3); }
.vol { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; margin-left: auto; }
.vol input[type="range"] { accent-color: var(--accent); }

/* ---------- Streak + stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { text-align: center; padding: 10px; border-radius: 12px; background: rgba(125, 139, 176, 0.07); }
.stat .v { font-size: 26px; font-weight: 800; font-family: var(--font-mono); }
.stat .v.amber { color: var(--accent-2); }
.stat .l { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.reality { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.reality[data-level="on-track"] { background: rgba(52, 211, 153, 0.1); color: var(--good); border: 1px solid rgba(52, 211, 153, 0.3); }
.reality[data-level="warning"] { background: rgba(245, 158, 11, 0.1); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.reality[data-level="off-track"] { background: rgba(248, 113, 113, 0.1); color: var(--bad); border: 1px solid rgba(248, 113, 113, 0.3); }
.reality[data-level="fresh"] { background: rgba(125, 139, 176, 0.08); color: var(--text-1); border: 1px solid var(--panel-border); }
.reality .tag { font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; white-space: nowrap; }

/* ---------- Share + donate + ads ---------- */
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ad-zone {
  margin-top: 16px; min-height: 90px; border-radius: var(--radius);
  border: 1px dashed rgba(125, 139, 176, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 13px;
  overflow: hidden;
}
.donate-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.kofi, .paypal {
  font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 12px; text-decoration: none;
}
.kofi { background: #c62f2c; color: #fff; }
.paypal { background: #003087; color: #fff; }
.kofi:hover, .paypal:hover { filter: brightness(1.1); text-decoration: none; }

/* ---------- Nudge ---------- */
.nudge {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--accent-2); font-size: 14px;
}
.nudge[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 30px; text-align: center; color: var(--text-2); font-size: 13px; }
.site-footer a { margin: 0 8px; }

/* ---------- Toast + banner ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #0d1424; color: var(--text-0); border: 1px solid var(--panel-border);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all 0.25s; font-size: 14px; z-index: 50;
}
#toast:not([hidden]) { opacity: 1; transform: translateX(-50%) translateY(0); }

.banner {
  margin-bottom: 16px; padding: 12px 16px; border-radius: 12px;
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent); font-size: 14px;
}
.banner[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .clock { font-size: 64px; }
  .nav { display: none; }
  .vol { margin-left: 0; }
}


/* Hub rail — internal links across the tool network */
.hub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; justify-content: center; }
.hub a {
  color: inherit; opacity: 0.92; text-decoration: none; font-size: 0.9em;
  font-size: 0.8em; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px;
}
.hub a:hover { opacity: 1; }

/* >>> theme-by-name (2026-11-02) >>> */
/* Theme derived from the site's MEANING, not a random variant.
 * Focus = calm and low-stimulation. A saturated palette fights the product.
 * Ad layout is deliberately NOT set here — container width and rail geometry are
 * measured and verified separately by check-ad-layout.mjs.
 */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7685;
  --line: #e4e8ee;
  --brand: #3f5d7d;
  --brand-strong: #3f5d7d;
  --accent: #5b6675;
  --radius: 12px;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  /* The dark block above defines --text-0/1/2 for the pre-light theme, and
     .tagline / .nav a / .phase-pill / .hint all read them. Leaving them unset
     renders #eef2ff / #b8c2dd / #7d8bb0 on a near-white page — measured
     2026-11-13: 29 text elements under 4.5:1, worst 1.67:1. */
  --text-0: #1c2430;
  --text-1: #3d4b5c;
  --text-2: #5b6675;
  /* Surfaces too: .timer-card uses --panel/--panel-border, and leaving them
     dark put #1c2430 text on rgba(20,30,55,.72) — 1.06:1, i.e. invisible
     (measured 2026-11-13, the "why I built this" section). */
  --panel: #ffffff;
  --panel-border: #e4e8ee;
  --shadow: 0 10px 30px rgba(28, 36, 48, 0.08);
  /* Status colours: the dark block's amber/bad/good are pastel-on-dark and
     vanish on white (.phase-pill uses --accent-2 and --warn for its break and
     paused states — measured 2026-11-13 at 2.62:1). */
  --accent-2: #b45309;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #047857;
  --bg-0: #f7f8fa;
  --bg-1: #ffffff;
  --bg-2: #eef1f5;
}
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); }
h1, h2, h3 { font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.015em; }
.card, .panel, section[class*="card"] { border-radius: var(--radius); }
/* <<< theme-by-name <<< */

/* Privacy architecture section (2026-11-08) — the selling point of every site. */
.privacy-section{margin-top:34px;padding-top:24px;border-top:2px solid #e2e8f0}
.privacy-section h2{font-size:1.35em;margin-bottom:10px}
.privacy-section h3{font-size:1.05em;margin:20px 0 8px}
.privacy-steps{margin:10px 0 14px;padding-left:22px}
.privacy-steps li{margin-bottom:8px;line-height:1.6}
.privacy-section kbd{background:#f1f5f9;border:1px solid #cbd5e1;border-bottom-width:2px;
  border-radius:4px;padding:1px 5px;font-size:.85em;font-family:ui-monospace,Menlo,monospace}

/* screen-reader-only: names the page for AT users and search engines
   without altering the designed layout (heading sits inside panels). */
.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;
}
