:root {
  color-scheme: light;
  --bg: hsl(210 40% 98%);
  --surface: hsl(0 0% 100% / .78);
  --surface-strong: hsl(0 0% 100% / .92);
  --text: hsl(222 47% 11%);
  --muted: hsl(215 16% 47%);
  --line: hsl(214 32% 91% / .9);
  --brand: hsl(222 89% 56%);
  --brand-strong: hsl(225 84% 38%);
  --tomato: hsl(5 90% 55%);
  --tomato-strong: hsl(4 79% 38%);
  --mint: hsl(160 84% 39%);
  --mint-strong: hsl(162 88% 26%);
  --shadow-soft: 0 18px 60px hsl(222 47% 11% / .12);
  --shadow-glow: 0 28px 90px hsl(222 89% 56% / .26);
  --shadow-tomato: 0 28px 90px hsl(5 90% 55% / .22);
  --ring: 0 0 0 4px hsl(215 100% 57% / .28);
}

.dark {
  color-scheme: dark;
  --bg: hsl(222 47% 5%);
  --surface: hsl(222 47% 11% / .72);
  --surface-strong: hsl(222 47% 14% / .9);
  --text: hsl(210 40% 98%);
  --muted: hsl(215 20% 72%);
  --line: hsl(0 0% 100% / .12);
  --brand: hsl(215 100% 66%);
  --brand-strong: hsl(224 76% 48%);
  --tomato: hsl(5 100% 68%);
  --tomato-strong: hsl(5 90% 50%);
  --mint: hsl(160 84% 52%);
  --mint-strong: hsl(162 88% 34%);
  --shadow-soft: 0 18px 70px hsl(0 0% 0% / .34);
  --shadow-glow: 0 28px 100px hsl(215 100% 56% / .22);
  --shadow-tomato: 0 28px 100px hsl(5 100% 58% / .18);
  --ring: 0 0 0 4px hsl(215 100% 66% / .32);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 8%, hsl(5 100% 78% / .22), transparent 30rem),
    radial-gradient(circle at 85% 15%, hsl(215 100% 66% / .22), transparent 34rem),
    radial-gradient(circle at 48% 100%, hsl(160 84% 62% / .14), transparent 32rem),
    linear-gradient(135deg, hsl(210 40% 98%), hsl(214 45% 96%));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dark body {
  background:
    radial-gradient(circle at 12% 6%, hsl(5 90% 55% / .18), transparent 32rem),
    radial-gradient(circle at 88% 18%, hsl(215 100% 56% / .18), transparent 36rem),
    radial-gradient(circle at 50% 100%, hsl(160 84% 45% / .08), transparent 34rem),
    linear-gradient(135deg, hsl(222 47% 5%), hsl(229 45% 8%));
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div,
a,
button,
li,
label,
input,
textarea,
select {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select,
[role="button"],
[tabindex] {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease, filter .2s ease;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
  transform: none !important;
  filter: grayscale(.15);
}

::selection {
  background: hsl(215 100% 57% / .28);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: hsl(215 28% 92%);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, hsl(215 100% 57%), hsl(5 90% 55%));
  border: 3px solid hsl(215 28% 92%);
  border-radius: 999px;
}

.dark ::-webkit-scrollbar-track {
  background: hsl(222 47% 8%);
}

.dark ::-webkit-scrollbar-thumb {
  border-color: hsl(222 47% 8%);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.hidden,
[hidden] {
  display: none !important;
}

#app-shell {
  isolation: isolate;
}

#app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(hsl(222 47% 11% / .035) 1px, transparent 1px),
    linear-gradient(90deg, hsl(222 47% 11% / .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.dark #app-shell::before {
  background-image:
    linear-gradient(hsl(0 0% 100% / .045) 1px, transparent 1px),
    linear-gradient(90deg, hsl(0 0% 100% / .045) 1px, transparent 1px);
}

#background-orb-tomato,
#background-orb-brand,
#background-orb-mint {
  animation: orbFloat 12s ease-in-out infinite;
  will-change: transform;
}

#background-orb-brand {
  animation-delay: -4s;
}

#background-orb-mint {
  animation-delay: -8s;
}

#main-navigation,
.glass,
.card,
.timer-card,
.settings-card,
.tasks-card,
.stats-card,
.modal-content,
[data-glass] {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

#main-navigation::after,
.glass::after,
.card::after,
.timer-card::after,
[data-glass]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, hsl(0 0% 100% / .55), transparent 38%, hsl(215 100% 66% / .08));
  opacity: .72;
}

#brand-logo {
  box-shadow: 0 14px 34px hsl(222 47% 11% / .24), inset 0 1px 0 hsl(0 0% 100% / .18);
  transition: transform .25s ease, box-shadow .25s ease;
}

#brand-home-link:hover #brand-logo {
  transform: translateY(-2px) rotate(-4deg) scale(1.04);
  box-shadow: 0 18px 42px hsl(222 47% 11% / .28), 0 0 0 7px hsl(215 100% 57% / .1);
}

nav a,
.nav-link {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: -.01em;
}

nav a:hover,
.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
}

main,
section,
header,
footer {
  min-width: 0;
}

section {
  scroll-margin-top: 7rem;
}

.hero-title,
h1 {
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.055em;
  line-height: .92;
}

h2,
h3 {
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.035em;
  line-height: 1.05;
}

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

.text-gradient,
.gradient-text {
  background: linear-gradient(90deg, var(--tomato), var(--brand) 48%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#timer-section {
  position: relative;
}

#timer-section::before {
  content: "";
  position: absolute;
  inset: 5% 8% auto;
  height: min(54vw, 34rem);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, hsl(215 100% 57% / .16), transparent 65%);
  filter: blur(18px);
}

.timer-display,
#timer-display,
#time-display,
.pomodoro-time,
[data-timer-display] {
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(4.5rem, 15vw, 11rem);
  line-height: .82;
  letter-spacing: -.08em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: 0 16px 54px hsl(222 47% 11% / .14);
}

.dark .timer-display,
.dark #timer-display,
.dark #time-display,
.dark .pomodoro-time,
.dark [data-timer-display] {
  text-shadow: 0 18px 68px hsl(215 100% 66% / .18);
}

.timer-ring,
.progress-ring,
[data-progress-ring] {
  filter: drop-shadow(0 24px 50px hsl(215 100% 57% / .22));
}

.timer-ring circle,
.progress-ring circle {
  transition: stroke-dashoffset .45s cubic-bezier(.22, 1, .36, 1), stroke .25s ease;
}

.mode-tabs,
.timer-modes,
[data-mode-tabs] {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem;
  background: hsl(222 47% 11% / .05);
}

.dark .mode-tabs,
.dark .timer-modes,
.dark [data-mode-tabs] {
  background: hsl(0 0% 100% / .06);
}

.mode-tabs button,
.timer-modes button,
[data-mode-tabs] button {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  border-radius: 999px;
  padding: .72rem 1rem;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.mode-tabs button:hover,
.timer-modes button:hover,
[data-mode-tabs] button:hover {
  color: var(--text);
  background: hsl(0 0% 100% / .72);
}

.dark .mode-tabs button:hover,
.dark .timer-modes button:hover,
.dark [data-mode-tabs] button:hover {
  background: hsl(0 0% 100% / .1);
}

.mode-tabs button[aria-selected="true"],
.mode-tabs button.active,
.timer-modes button[aria-selected="true"],
.timer-modes button.active,
[data-mode-tabs] button[aria-selected="true"],
[data-mode-tabs] button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 14px 34px hsl(215 100% 57% / .28);
}

button,
.btn,
.button,
[type="button"],
[type="submit"],
[type="reset"] {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 1rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.btn-primary,
#start-button,
#start-timer,
button[data-action="start"],
button.primary {
  background: linear-gradient(135deg, hsl(225 84% 34%), hsl(215 100% 45%));
  color: #fff;
  box-shadow: 0 18px 44px hsl(215 100% 45% / .32);
}

.btn-primary:hover,
#start-button:hover,
#start-timer:hover,
button[data-action="start"]:hover,
button.primary:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.04);
  box-shadow: 0 22px 56px hsl(215 100% 45% / .4);
}

.btn-danger,
#reset-button,
#reset-timer,
button[data-action="reset"],
button.danger {
  background: linear-gradient(135deg, hsl(4 79% 35%), hsl(5 90% 48%));
  color: #fff;
  box-shadow: 0 18px 44px hsl(5 90% 48% / .28);
}

.btn-danger:hover,
#reset-button:hover,
#reset-timer:hover,
button[data-action="reset"]:hover,
button.danger:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.04);
}

.btn-secondary,
#pause-button,
#pause-timer,
button[data-action="pause"],
button.secondary {
  background: hsl(222 47% 11%);
  color: #fff;
  border-color: hsl(222 47% 11%);
  box-shadow: 0 14px 34px hsl(222 47% 11% / .22);
}

.dark .btn-secondary,
.dark #pause-button,
.dark #pause-timer,
.dark button[data-action="pause"],
.dark button.secondary {
  background: hsl(0 0% 100%);
  color: hsl(222 47% 11%);
  border-color: hsl(0 0% 100%);
}

.btn-ghost,
button.ghost {
  background: hsl(0 0% 100% / .82);
  color: hsl(222 47% 11%);
  border-color: var(--line);
}

.dark .btn-ghost,
.dark button.ghost {
  background: hsl(0 0% 100% / .1);
  color: #fff;
  border-color: hsl(0 0% 100% / .16);
}

.btn-ghost:hover,
button.ghost:hover {
  transform: translateY(-1px);
  background: hsl(0 0% 100% / .96);
  box-shadow: 0 12px 30px hsl(222 47% 11% / .12);
}

.dark .btn-ghost:hover,
.dark button.ghost:hover {
  background: hsl(0 0% 100% / .16);
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: hsl(0 0% 100% / .82);
  color: var(--text);
  padding: .9rem 1rem;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .42);
}

.dark input,
.dark textarea,
.dark select {
  background: hsl(222 47% 9% / .8);
  color: #fff;
  border-color: hsl(0 0% 100% / .14);
}

input::placeholder,
textarea::placeholder {
  color: hsl(215 16% 47% / .75);
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: hsl(215 20% 72% / .6);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: var(--ring), inset 0 1px 0 hsl(0 0% 100% / .28);
}

.task-list,
#task-list,
[data-task-list] {
  display: grid;
  gap: .75rem;
  min-width: 0;
}

.task-item,
[data-task-item] {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: .85rem;
  background: hsl(0 0% 100% / .7);
}

.dark .task-item,
.dark [data-task-item] {
  background: hsl(0 0% 100% / .06);
}

.task-item > *,
[data-task-item] > * {
  min-width: 0;
}

.task-item:hover,
[data-task-item]:hover {
  transform: translateY(-1px);
  border-color: hsl(215 100% 57% / .36);
  box-shadow: 0 12px 30px hsl(222 47% 11% / .1);
}

.badge,
.tag,
[data-badge] {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: .35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .38rem .7rem;
  background: hsl(0 0% 100% / .72);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.dark .badge,
.dark .tag,
.dark [data-badge] {
  background: hsl(0 0% 100% / .08);
}

.stat-card,
.feature-card,
.pricing-card,
[data-card] {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.stat-card:hover,
.feature-card:hover,
.pricing-card:hover,
[data-card]:hover {
  transform: translateY(-4px);
  border-color: hsl(215 100% 57% / .35);
  box-shadow: var(--shadow-glow);
}

.modal,
.dialog,
[role="dialog"],
[data-modal],
.modal-backdrop {
  z-index: 9999;
}

.modal,
[data-modal],
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: hsl(222 47% 5% / .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fadeIn .18s ease both;
}

.modal-content,
.dialog-content {
  width: min(100%, 36rem);
  max-height: min(90vh, 52rem);
  overflow: auto;
  border-radius: 2rem;
  animation: modalIn .24s cubic-bezier(.22, 1, .36, 1) both;
}

.loading,
[data-loading="true"] {
  position: relative;
  pointer-events: none;
}

.loading::after,
[data-loading="true"]::after {
  content: "";
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  margin-left: .55rem;
  vertical-align: -.18em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin .75s linear infinite;
}

.pulse,
[data-pulse] {
  animation: softPulse 2s ease-in-out infinite;
}

.fade-in,
[data-animate="fade-in"] {
  animation: fadeInUp .55s cubic-bezier(.22, 1, .36, 1) both;
}

@media (hover: hover) {
  a:hover,
  button:hover {
    text-decoration: none;
  }

  .lift:hover,
  [data-lift]:hover {
    transform: translateY(-3px);
  }
}

@media (max-width: 640px) {
  #site-header {
    padding-top: .75rem;
  }

  #main-navigation {
    border-radius: 1.35rem;
  }

  .timer-display,
  #timer-display,
  #time-display,
  .pomodoro-time,
  [data-timer-display] {
    font-size: clamp(4rem, 22vw, 7rem);
  }

  .mode-tabs,
  .timer-modes,
  [data-mode-tabs] {
    border-radius: 1.25rem;
  }

  .mode-tabs button,
  .timer-modes button,
  [data-mode-tabs] button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

@keyframes orbFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(22px, -18px, 0) scale(1.06);
  }
  66% {
    transform: translate3d(-18px, 16px, 0) scale(.96);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes softPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 hsl(215 100% 57% / .25);
  }
  50% {
    box-shadow: 0 0 0 12px hsl(215 100% 57% / 0);
  }
}