:root {
  color-scheme: light;
  --aqua: #0abab5;
  --aqua-dark: #078984;
  --aqua-deep: #075f5c;
  --mint: #d9fffb;
  --paper: rgba(255, 255, 255, 0.78);
  --ink: #073b3a;
  --muted: #5b7775;
  --shadow: 0 28px 80px rgba(5, 95, 92, 0.22);
  font-family: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.96), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(179, 255, 249, 0.9), transparent 30%),
    linear-gradient(135deg, #ecfffd 0%, #bff8f4 44%, var(--aqua) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.24) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.shell {
  height: 100svh;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.timer-card {
  width: min(480px, 100%);
  max-height: 100svh;
  padding: clamp(12px, 2.5vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--aqua-dark);
  font-family: "Poiret One", "Cormorant Garamond", serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Poiret One", "Cormorant Garamond", serif;
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.subtitle {
  max-width: 34rem;
  margin: 4px auto 10px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(10, 186, 181, 0.12);
}

button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 400;
  color: var(--aqua-deep);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px) scale(0.98); }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.mode {
  min-height: 36px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.92rem;
}

.mode.active {
  color: white;
  background: var(--aqua);
  box-shadow: 0 10px 24px rgba(10, 186, 181, 0.28);
}

.timer-wrap {
  position: relative;
  width: min(220px, 60vw);
  aspect-ratio: 1;
  margin: 10px auto 10px;
  display: grid;
  place-items: center;
}

.progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.track, .meter {
  fill: none;
  stroke-width: 12;
}

.track { stroke: rgba(10, 186, 181, 0.14); }

.meter {
  stroke: var(--aqua);
  stroke-linecap: round;
  stroke-dasharray: 603.19;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 8px 14px rgba(10, 186, 181, 0.28));
  transition: stroke-dashoffset .45s linear;
}

.time-display {
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  gap: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(221,255,252,.78));
  box-shadow: inset 0 1px 0 white, 0 18px 40px rgba(5, 95, 92, 0.13);
}

#time {
  font-family: "Poiret One", "Cormorant Garamond", serif;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

#status {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.controls button {
  min-width: 100px;
  min-height: 42px;
  padding: 0 18px;
}

.controls .primary {
  color: white;
  background: linear-gradient(135deg, var(--aqua), var(--aqua-dark));
  box-shadow: 0 15px 28px rgba(10, 186, 181, 0.34);
}

.settings {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 400;
}

input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(10, 186, 181, 0.22);
  border-radius: 14px;
  padding: 0 8px;
  color: var(--ink);
  background: rgba(255,255,255,.72);
  font: inherit;
  font-weight: 400;
  text-align: center;
}

@media (max-width: 430px) {
  .timer-card { border-radius: 28px; }
  .mode-tabs, .settings { grid-template-columns: 1fr; border-radius: 24px; }
  .controls { flex-direction: column; }
  .controls button { width: 100%; }
}
