:root {
  color-scheme: dark;
  --bg: #101412;
  --ink: #f5f1e8;
  --muted: #b8b1a3;
  --line: #313b36;
  --panel: #18201c;
  --panel-strong: #202b25;
  --accent: #f05d23;
  --accent-dark: #c84413;
  --mint: #67d5b5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgb(103 213 181 / 0.18), transparent 28rem),
    linear-gradient(135deg, #101412 0%, #141b18 45%, #211b15 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
  padding: 0 5vw;
  background: rgb(16 20 18 / 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.top-nav {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

.nav-link {
  background: rgb(245 241 232 / 0.04);
  border: 1px solid rgb(245 241 232 / 0.08);
  color: var(--muted);
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
  font-weight: 900;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
  background: linear-gradient(135deg, rgb(240 93 35 / 0.28), rgb(103 213 181 / 0.16));
  border-color: rgb(240 93 35 / 0.44);
  box-shadow: 0 14px 30px rgb(240 93 35 / 0.18);
  transform: translateY(-1px);
}

.nav-link:disabled {
  cursor: not-allowed;
  color: rgb(184 177 163 / 0.38);
  background: rgb(245 241 232 / 0.025);
  border-color: rgb(245 241 232 / 0.05);
  box-shadow: none;
  transform: none;
}

.nav-link.active:disabled {
  color: rgb(245 241 232 / 0.58);
  background: rgb(240 93 35 / 0.08);
  border-color: rgb(240 93 35 / 0.16);
}

.brand {
  display: grid;
  gap: 0.1rem;
  min-width: max-content;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.05;
  text-decoration: none;
}

.brand-title {
  color: var(--ink);
  font-size: 1.12rem;
}

.brand-subtitle {
  color: var(--mint);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  gap: clamp(0.85rem, 3vw, 1.75rem);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
}

main {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  overflow: auto;
}

.section.active {
  display: flex;
}

.timer-panel {
  width: 100%;
  max-height: calc(100vh - 110px);
  padding: 1.4rem 5vw;
  background: rgb(24 32 28 / 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 28px 90px rgb(0 0 0 / 0.32);
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.settings-panel {
  width: 100%;
  padding: 1.5rem 5vw;
  justify-content: flex-start;
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 1.2rem;
  font-size: clamp(3.4rem, 9vw, 7.6rem);
  line-height: 0.9;
}

h2 {
  max-width: 11ch;
  margin-bottom: 0;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.lead {
  max-width: 38rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.8rem;
  padding: 0.9rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.26);
  font-weight: 900;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgb(0 0 0 / 0.34);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.28);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: white;
  box-shadow: 0 16px 34px rgb(240 93 35 / 0.36);
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.button.secondary {
  background: var(--panel-strong);
  border-color: var(--line);
  box-shadow: 0 14px 30px rgb(103 213 181 / 0.14);
}

.button.ghost {
  background: rgb(245 241 232 / 0.04);
  border-color: var(--line);
}

.timer-panel {
  width: 100vw;
  max-width: none;
  min-height: calc(100vh - 70px);
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-height: none;
  padding: clamp(1.1rem, 2.4vw, 2.1rem) 5vw clamp(1.6rem, 3vw, 3rem);
  background: rgb(24 32 28 / 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.34);
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.timer-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: clamp(0.55rem, 1.4vw, 1.25rem);
}

.timer-topline span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  min-height: 3.15rem;
  padding: 0.7rem 1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.24);
  font-size: clamp(1.05rem, 1.45vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#timer-status {
  color: var(--mint);
  background: linear-gradient(135deg, rgb(103 213 181 / 0.26), rgb(103 213 181 / 0.08));
  text-shadow: 0 0 18px rgb(103 213 181 / 0.28);
}

#round-status {
  color: var(--accent);
  background: linear-gradient(135deg, rgb(240 93 35 / 0.28), rgb(240 93 35 / 0.08));
  text-shadow: 0 0 18px rgb(240 93 35 / 0.28);
}

.time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(12rem, 31vw, 22rem);
  font-variant-numeric: tabular-nums;
  font-size: clamp(6.4rem, 24vw, 19rem);
  font-weight: 950;
  line-height: 1;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  background: #0d110f;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--accent));
  transform-origin: left;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  background: #101412;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(0.85rem, 2vw, 1.25rem);
  margin-top: clamp(1rem, 2.4vw, 1.85rem);
}

.section,
.split-section {
  padding: clamp(2rem, 4vw, 3rem) 5vw;
}

.section.timer-panel {
  padding: clamp(1.1rem, 2.4vw, 2.1rem) 5vw clamp(1.6rem, 3vw, 3rem);
}

.settings-panel {
  padding: 1.5rem 5vw 2rem;
}

.section-heading {
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.preset {
  display: grid;
  gap: 0.65rem;
  min-height: 15rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  color: var(--ink);
  text-align: left;
  background: var(--panel);
  border: 0;
}

.preset:hover {
  background: var(--panel-strong);
}

.preset span {
  color: var(--accent);
  font-weight: 950;
}

.preset strong {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 1;
}

.preset small {
  align-self: end;
  color: var(--muted);
  font-size: 0.95rem;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(20rem, 1fr);
  gap: clamp(2rem, 8vw, 8rem);
  background: rgb(16 20 18 / 0.68);
  border-block: 1px solid var(--line);
}

.split-section p {
  max-width: 47rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

@media (max-width: 860px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 64px;
    padding: 0 1rem;
  }

  .brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    overflow: hidden;
    max-width: 8.75rem;
    text-overflow: ellipsis;
    font-size: 0.64rem;
  }

  .top-nav {
    gap: 0.35rem;
    max-width: calc(100vw - 10.5rem);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    padding: 0.6rem 0.7rem;
    font-size: 0.82rem;
  }

  .timer-panel {
    min-height: calc(100vh - 64px);
  }

  .hero,
  .split-section,
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .controls-grid,
  .timer-actions {
    grid-template-columns: 1fr;
  }

  .preset {
    min-height: 11rem;
  }
}

@media (max-width: 520px) {
  .time-display {
    min-height: 10rem;
    font-size: clamp(4.6rem, 22vw, 6.5rem);
  }

  .progress-track {
    height: 14px;
  }

  .button {
    min-height: 3.35rem;
  }

  .timer-topline {
    gap: 0.5rem;
  }

  .timer-topline span {
    min-width: 0;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }
}
