/* ============================================================
   setTimerNow — visual system
   Direction: a physical countdown instrument (kitchen timer / stage
   clock / darkroom timer), not a SaaS dashboard. Warm near-black body,
   one amber accent, huge tabular-mono digits, a physical dial ring.
   ============================================================ */

:root {
  /* Neutrals — warm charcoal, not pure black, not AI-cream */
  --bg:        oklch(0.16 0.010 55);
  --bg-raised: oklch(0.21 0.012 55);
  --bg-panel:  oklch(0.24 0.014 55);
  --line:      oklch(0.32 0.014 55);
  --line-soft: oklch(0.28 0.012 55);

  --ink:       oklch(0.96 0.010 70);
  --ink-dim:   oklch(0.74 0.015 65);
  --ink-faint: oklch(0.52 0.015 65);

  /* Accent — amber/copper, the one committed color */
  --amber:      oklch(0.78 0.16 65);
  --amber-dim:  oklch(0.62 0.13 60);
  --amber-glow: oklch(0.78 0.16 65 / 0.35);

  /* Status */
  --ring-track: oklch(0.30 0.012 55);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --space-1: 0.5rem;
  --space-2: 0.875rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --font-display: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -10%, oklch(0.24 0.02 60 / 0.55), transparent),
    radial-gradient(ellipse 700px 500px at 100% 100%, oklch(0.20 0.02 55 / 0.4), transparent);
}

a { color: inherit; text-decoration: none; }

.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------------- Topbar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 1.25rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--amber);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 2px;
  background: var(--amber);
  transform-origin: left center;
  transform: translate(0, -50%) rotate(-45deg);
}

.topnav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.9rem;
  color: var(--ink-dim);
}
.topnav a:hover { color: var(--ink); }

/* ---------------- Layout ---------------- */

.main-content {
  flex: 1;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  padding: 0.5rem 1.5rem 5rem;
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.75rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a:hover { color: var(--ink-dim); }

/* ============================================================
   Timer page
   ============================================================ */

.timer-hero {
  padding: 1.5rem 0 2.5rem;
  text-align: center;
}

.timer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.timer-h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.timer-sub {
  color: var(--ink-dim);
  font-size: 1rem;
  max-width: 46ch;
  margin: 0 auto;
}

/* The dial */
.timer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem 0 1rem;
}

.dial-wrap {
  position: relative;
  width: min(360px, 82vw);
  height: min(360px, 82vw);
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 5;
}

.dial-progress {
  fill: none;
  stroke: var(--amber);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
  filter: drop-shadow(0 0 10px var(--amber-glow));
}

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

.dial-time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.8rem, 11vw, 4.4rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}

.dial-time.is-running { color: var(--ink); }
.dial-time.is-done {
  color: var(--amber);
  animation: pulse-done 1s ease-in-out infinite;
}

@keyframes pulse-done {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.dial-state {
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* controls */
.timer-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn:hover { border-color: var(--ink-faint); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: oklch(0.18 0.02 60);
}
.btn-primary:hover { background: var(--amber-dim); border-color: var(--amber-dim); }

.btn-ghost {
  background: transparent;
}

.timer-adjust {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.adjust-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  background: var(--bg-raised);
  color: var(--ink-dim);
  font-weight: 500;
}
.adjust-chip:hover { color: var(--ink); border-color: var(--ink-faint); }

/* sound toggle */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
}
.sound-toggle input { accent-color: var(--amber); }

/* ---------------- Other-durations rail ---------------- */

.durations-rail {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--line-soft);
}

.rail-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 1rem;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.6rem;
}

.duration-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-dim);
  transition: border-color 0.12s ease, color 0.12s ease;
}
.duration-chip:hover { border-color: var(--amber-dim); color: var(--ink); }
.duration-chip.is-active {
  border-color: var(--amber);
  color: var(--amber);
  background: oklch(0.24 0.03 60);
}

/* ---------------- Content section (SEO copy) ---------------- */

.info-section {
  margin-top: 3.5rem;
  display: grid;
  gap: 2rem;
}

.info-block h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.info-block p {
  color: var(--ink-dim);
  line-height: 1.65;
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
}

.faq-item {
  border-bottom: 1px solid var(--line-soft);
  padding: 1.1rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.faq-a {
  color: var(--ink-dim);
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 0;
}

/* ---------------- Homepage grid ---------------- */

.home-hero {
  padding: 2.5rem 0 1rem;
  text-align: center;
}
.home-h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}
.home-h1 .accent { color: var(--amber); }
.home-sub {
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 50ch;
  margin: 0 auto;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
  margin: 2.5rem 0;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover {
  border-color: var(--amber-dim);
  transform: translateY(-2px);
}
.tool-card-time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--amber);
}
.tool-card-label {
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.custom-panel {
  margin: 2.5rem auto 0;
  max-width: 420px;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-panel);
  text-align: center;
}
.custom-panel-label {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 0.85rem;
}
.custom-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.custom-input-group { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.custom-input {
  width: 68px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 0.5rem 0.25rem;
}
.custom-input:focus { outline: none; border-color: var(--amber); }
.custom-input-label { font-size: 0.72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.custom-colon { font-family: var(--font-mono); font-size: 1.4rem; color: var(--ink-faint); }

/* ---------------- Static pages ---------------- */

.prose-page h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; }
.prose-page h2 { font-size: 1.2rem; font-weight: 700; margin: 1.75rem 0 0.6rem; }
.prose-page p { color: var(--ink-dim); line-height: 1.7; margin-bottom: 0.9rem; }

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .topbar { padding: 1rem; }
  .main-content { padding: 0.25rem 1rem 3.5rem; }
  .timer-controls { gap: 0.5rem; }
  .btn { padding: 0.65rem 1.3rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
