:root {
  --color-work: #e85c41;
  --color-work-dark: #c94a32;
  --color-work-soft: #fdece7;
  --color-rest: #3fa66b;
  --color-rest-soft: #e9f7ef;
  --color-long-break: #3f7fd1;
  --color-long-break-soft: #eaf2fc;

  --bg: #fff8f5;
  --surface: #ffffff;
  --text: #2b2118;
  --text-muted: #6f6155;
  --border: #f0dcd3;

  color-scheme: light;
}

/* Dark mode: follows the OS/browser preference by default, or an explicit
   data-theme="dark"/"light" set by the toggle button (see assets/theme.js).
   Text goes noticeably lighter, not just the background going darker. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-work: #ff7d61;
    --color-work-dark: #ffb4a0;
    --color-work-soft: #3a231d;
    --color-rest: #5cd08a;
    --color-rest-soft: #1c3226;
    --color-long-break: #6fa8ea;
    --color-long-break-soft: #1c2c3f;

    --bg: #1b1512;
    --surface: #241b17;
    --text: #f5ece6;
    --text-muted: #b7a99d;
    --border: #3a2c25;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-work: #ff7d61;
  --color-work-dark: #ffb4a0;
  --color-work-soft: #3a231d;
  --color-rest: #5cd08a;
  --color-rest-soft: #1c3226;
  --color-long-break: #6fa8ea;
  --color-long-break-soft: #1c2c3f;

  --bg: #1b1512;
  --surface: #241b17;
  --text: #f5ece6;
  --text-muted: #b7a99d;
  --border: #3a2c25;

  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: var(--color-work-dark);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--color-work);
}

.nav-links .btn {
  color: #fff;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--color-work-soft);
  color: var(--color-work);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-work);
  color: #fff !important;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text) !important;
}

.btn-secondary:hover {
  border-color: var(--color-work);
  color: var(--color-work) !important;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}

.hero .badge {
  display: inline-block;
  background: var(--color-work-soft);
  color: var(--color-work-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero p.lead {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-mockup {
  max-width: 320px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 60px -30px rgba(43, 33, 24, 0.25);
}

.hero-mockup .mockup-phase {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-work);
  margin-bottom: 10px;
}

.hero-mockup .mockup-ring {
  width: 160px;
  height: 160px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  /* Same shape as the real popup countdown ring: starts at 12 o'clock and
     fills clockwise. 18:24 left out of a 25:00 session is 73.6% remaining. */
  background:
    radial-gradient(closest-side, var(--surface) 87%, transparent 88% 100%),
    conic-gradient(var(--color-work) 0% 73.6%, var(--color-work-soft) 73.6% 100%);
}

.hero-mockup .mockup-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* Mirrors the real popup's cycle dots: a completed session is a solid dot,
   the session in progress is the outlined dot with a halo ring, and upcoming
   sessions are faint outlined dots. */
.hero-mockup .mockup-dots span {
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--color-work-soft);
  border: 1.5px solid var(--color-work);
  opacity: 0.5;
}

.hero-mockup .mockup-dots span.filled {
  background: var(--color-work);
  opacity: 1;
}

.hero-mockup .mockup-dots span.active {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--color-work-soft);
}

/* Feature grid */
.section {
  padding: 56px 0;
}

.section h2 {
  font-size: 28px;
  text-align: center;
  margin: 0 0 8px;
}

.section .section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.feature-card .icon {
  font-size: 26px;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Support */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.support-card {
  text-align: center;
}

.support-card .icon {
  font-size: 30px;
}

.support-card p {
  margin-bottom: 18px;
}

.support-card .btn {
  width: 100%;
  justify-content: center;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

.step {
  text-align: center;
  padding: 0 12px;
}

.step .step-number {
  counter-increment: step;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-work);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin: 0 auto 14px;
}

.step .step-number::before {
  content: counter(step);
}

.step h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* CTA band */
.cta-band {
  background: var(--color-work);
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  color: #fff;
  margin: 24px;
}

.cta-band h2 {
  color: #fff;
  margin: 0 0 12px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
  margin: 0 auto 24px;
}

.cta-band .btn-secondary {
  /* This button's background is deliberately always white (for contrast
     against the always-orange band), so its text must stay a fixed dark
     color too — not var(--text), which flips to a light color in dark mode
     and would otherwise render white-on-white. */
  background: #fff;
  border-color: transparent;
  color: #c94a32 !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-work);
}

/* Privacy policy page */
.policy-page {
  padding: 48px 0 80px;
}

.policy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  max-width: 760px;
  margin: 0 auto;
}

.policy-card h1 {
  margin-top: 0;
}

.policy-card h2 {
  font-size: 19px;
  margin-top: 32px;
}

.policy-card h3 {
  font-size: 16px;
}

.policy-card p,
.policy-card li {
  color: var(--text-muted);
  font-size: 15px;
}

.policy-card code {
  background: var(--color-work-soft);
  color: var(--color-work-dark);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.policy-loading,
.policy-error {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

/* "Use the Web Timer" callout on the homepage */
.web-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
}

.web-cta-text {
  max-width: 620px;
}

.web-cta h2 {
  margin: 0 0 8px;
  font-size: 22px;
  text-align: left;
}

.web-cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

.web-cta .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .feature-grid,
  .steps,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 14px;
  }

  .web-cta {
    padding: 24px;
  }
}
