@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #627d98;
  --paper: #f7f4ed;
  --panel: #fffdf8;
  --line: #d9e2ec;
  --teal: #007c83;
  --teal-dark: #005f64;
  --orange: #e07a35;
  --shadow: 0 22px 60px rgba(16, 42, 67, 0.14);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  background: var(--paper);
  background-image: linear-gradient(135deg, rgba(255,255,255,.75), transparent 45%), repeating-linear-gradient(0deg, rgba(16,42,67,.025) 0 1px, transparent 1px 5px);
}

button, input { font: inherit; }
button { cursor: pointer; }

.timer-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 44px 0 28px;
}

.topbar, .status-row, .section-heading, .controls, .duration-inputs, .presets {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--orange); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -.04em; }
h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.03em; }

.icon-button {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: rgba(255,255,255,.55); font-size: 1.45rem; line-height: 1;
}
.icon-button:hover, .icon-button:focus-visible { border-color: var(--teal); color: var(--teal); }

.timer-panel, .setup-panel {
  border: 1px solid rgba(217,226,236,.9); background: var(--panel); box-shadow: var(--shadow);
}
.timer-panel { padding: clamp(24px, 6vw, 52px); border-radius: 10px 10px 0 0; text-align: center; }
.status-row { justify-content: space-between; gap: 16px; text-align: left; }
.status, .session-label { margin: 0; font-size: .83rem; font-weight: 600; }
.status { color: var(--teal); }
.session-label { color: var(--muted); }
.time-display { margin: 32px 0 23px; color: var(--ink); font-family: 'DM Mono', monospace; font-size: clamp(4.5rem, 18vw, 9rem); font-weight: 500; letter-spacing: -.09em; line-height: .95; }
.time-display.finished { color: var(--orange); }
.progress-track { height: 9px; overflow: hidden; border-radius: 10px; background: #e8edf1; }
.progress-bar { width: 100%; height: 100%; border-radius: inherit; background: var(--teal); transform-origin: left; transition: transform .4s linear, background .3s ease; }
.progress-bar.finished { background: var(--orange); }
.controls { justify-content: center; gap: 12px; margin-top: 32px; }
.primary-button, .secondary-button, .set-button, .presets button { border-radius: 7px; font-weight: 700; transition: transform .15s ease, background .15s ease, color .15s ease; }
.primary-button, .secondary-button, .student-view-button { min-width: 140px; padding: 13px 20px; }
.primary-button { border: 1px solid var(--teal); color: white; background: var(--teal); }
.primary-button:hover, .primary-button:focus-visible { background: var(--teal-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.secondary-button:hover, .secondary-button:focus-visible { border-color: var(--ink); transform: translateY(-1px); }
.student-view-button { border: 1px solid var(--orange); color: #a85018; background: #fff8f1; }
.student-view-button:hover, .student-view-button:focus-visible { color: white; background: var(--orange); transform: translateY(-1px); }

.setup-panel { padding: 24px clamp(24px, 6vw, 52px) 28px; border-top: 0; border-radius: 0 0 10px 10px; box-shadow: 0 14px 35px rgba(16,42,67,.08); }
.section-heading { justify-content: space-between; gap: 20px; }
.shortcut-hint { margin: 0; color: var(--muted); font-size: .76rem; }
kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: #f4f7f8; font-family: 'DM Mono', monospace; font-size: .7rem; }
.duration-inputs { gap: 10px; margin-top: 22px; }
.duration-inputs label { display: grid; gap: 7px; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.duration-inputs input { width: 100px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font-family: 'DM Mono', monospace; font-size: 1.2rem; }
.duration-inputs input:focus { outline: 2px solid rgba(0,124,131,.25); border-color: var(--teal); }
.colon { align-self: flex-end; padding-bottom: 11px; color: var(--muted); font-size: 1.4rem; }
.set-button { align-self: flex-end; padding: 11px 15px; border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.set-button:hover, .set-button:focus-visible { color: white; background: var(--ink); }
.presets { flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.presets span { margin-right: 4px; color: var(--muted); font-size: .78rem; }
.presets button { padding: 7px 10px; border: 1px solid var(--line); color: var(--ink); background: #f8faf9; font-size: .78rem; }
.presets button:hover, .presets button:focus-visible { border-color: var(--teal); color: var(--teal); }
footer { padding-top: 22px; color: var(--muted); font-size: .76rem; text-align: center; }

@media (max-width: 520px) {
  .timer-shell { width: min(100% - 22px, 760px); padding-top: 24px; }
  .timer-panel { padding: 24px 17px 28px; }
  .setup-panel { padding: 22px 17px 24px; }
  .status-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .time-display { margin: 30px 0 20px; font-size: clamp(3.7rem, 21vw, 6rem); }
  .controls { margin-top: 25px; }
  .primary-button, .secondary-button, .student-view-button { min-width: 0; flex: 1; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 11px; }
  .duration-inputs { align-items: flex-end; flex-wrap: wrap; }
  .duration-inputs input { width: 94px; }
  .set-button { flex: 1; }
}
