:root {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-soft: #f8fafc;
  --panel: #ffffff;
  --panel-subtle: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --line: #d8dee9;
  --track: #e5e7eb;
  --primary: #2563eb;
  --warning: #d97706;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #172033;
  --panel-subtle: #1f2a3d;
  --text: #f8fafc;
  --muted: #b6c2d1;
  --line: #334155;
  --track: #273449;
  --primary: #60a5fa;
  --warning: #f59e0b;
  --success: #22c55e;
  --danger: #f87171;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28rem),
    linear-gradient(135deg, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 14px max(20px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

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

.site-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text);
}

main {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 44px 20px 64px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 34px;
  align-items: center;
  margin-bottom: 56px;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.18;
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.timer-container,
.content-section {
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.timer-container {
  width: 100%;
  padding: 30px;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.title-row h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

.subtitle {
  margin: 0;
  font-size: 15px;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.theme-toggle:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.14);
  filter: none;
  transform: none;
}

.status-pill {
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

:root[data-theme="dark"] .status-pill {
  background: #273449;
  color: #dbeafe;
}

.status-pill.running {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.paused {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.done {
  background: #dcfce7;
  color: #166534;
}

.timer-face {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--progress, 0%), var(--track) 0);
}

.timer-face::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.time-display {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  font-size: clamp(48px, 15vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.input-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

input:disabled {
  background: rgba(148, 163, 184, 0.16);
  color: var(--muted);
  cursor: not-allowed;
}

.button-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

button {
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 0.15s, filter 0.15s, background 0.15s;
}

button:hover:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 4px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

button:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  transform: none;
}

:root[data-theme="dark"] button:disabled {
  background: #334155;
  color: #94a3b8;
}

.start {
  background: #2563eb;
}

.pause {
  background: var(--warning);
}

.resume {
  background: #15803d;
}

.reset {
  background: #b91c1c;
}

.message {
  min-height: 24px;
  margin-top: 18px;
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.message.success {
  color: var(--success);
}

.content-section {
  padding: 30px;
  margin-top: 22px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-grid article,
.text-columns article,
.policy-box,
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-subtle);
}

.info-grid article {
  padding: 20px;
}

.text-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.text-columns article,
.policy-box {
  padding: 22px;
}

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

.faq-list details {
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.policy-box p {
  margin: 0 0 14px;
}

.policy-box p:last-child {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 1100px);
  margin: 0 auto;
  padding: 28px 20px 42px;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 860px) {
  .hero-section,
  .info-grid,
  .text-columns {
    grid-template-columns: 1fr;
  }

  .hero-section {
    align-items: start;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 28px 16px 44px;
  }

  .timer-container,
  .content-section {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: space-between;
  }

  .input-group,
  .button-group {
    grid-template-columns: 1fr;
  }
}
