/* Tikaroo. Concept: a 1950s enamel kitchen timer.
   One bold element (the rotating numbered dial), everything else quiet. */

/* ---------- fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/unbounded-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/unbounded-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/unbounded-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/unbounded-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --ink: #25213b;        /* plum ink: text, primary button */
  --ink-soft: #5c5871;
  --cherry: #e0412f;     /* the pointer, done pips, today */
  --line: rgba(37, 33, 59, .14);
  --white: #fff;
  /* enamel, per mode */
  --paper: #edf5f0;      /* page */
  --face: #a9dec6;       /* dial */
  --face-deep: #7fcaa9;  /* time left band */
  --display: "Unbounded", "Noto Sans", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  color-scheme: light;
}
body[data-mode="short"] { --paper: #fbf5e2; --face: #f6d677; --face-deep: #ecbd3f; }
body[data-mode="long"]  { --paper: #edf2fa; --face: #b3cff0; --face-deep: #85afe4; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.55 var(--text);
  color: var(--ink);
  background: var(--paper);
  transition: background-color .5s ease;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
:focus-visible { outline: 3px solid var(--cherry); outline-offset: 3px; border-radius: 6px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 20px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 700 22px/1 var(--display); letter-spacing: -.02em; }
.mark { width: 32px; height: 32px; }
.mark-face { fill: var(--face); stroke: var(--ink); stroke-width: 2; transition: fill .5s ease; }
.mark-cap { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.mark-pointer { fill: var(--cherry); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none;
  padding: 9px 12px; border-radius: 999px; }
.link-btn:hover { background: rgba(37, 33, 59, .07); }
.link-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
select { border: 1.5px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 8px 14px; max-width: 160px; }

/* ---------- layout ---------- */
.app { max-width: 1120px; margin: 0 auto; padding: 8px 24px 72px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; gap: 64px; }
  .clock { position: sticky; top: 16px; }
}

/* ---------- the clock ---------- */
.clock { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }

.modes { display: inline-flex; max-width: 100%; padding: 4px; gap: 2px; border: 1.5px solid var(--ink); border-radius: 999px; }
.modes button { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; padding: 8px 16px; border-radius: 999px; white-space: nowrap; font-size: 15px; }
.modes button.on { background: var(--ink); color: var(--white); font-weight: 700; }

.dial-wrap { position: relative; width: min(86vw, 460px); aspect-ratio: 1; }
.dial { display: block; width: 100%; height: 100%; overflow: visible; }
.face { fill: var(--face); stroke: var(--ink); stroke-width: 3; transition: fill .5s ease; }
.left { fill: var(--face-deep); transition: fill .5s ease; }
.tick { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.tick.major { stroke-width: 3.2; opacity: 1; }
.num { fill: var(--ink); font: 500 17px var(--display); text-anchor: middle; dominant-baseline: central; }
.cap { fill: var(--white); stroke: var(--ink); stroke-width: 3; }
.pointer { fill: var(--cherry); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }

.readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; pointer-events: none; }
.time { font: 700 min(11.5vw, 60px)/1 var(--display); letter-spacing: -.03em; display: flex; }
.time .d { display: inline-block; width: .74em; text-align: center; }
.time .c { display: inline-block; width: .34em; text-align: center; }
.session { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }

.controls { display: flex; align-items: center; gap: 14px; }
.start { min-width: 210px; padding: 16px 40px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--white); font-weight: 700; font-size: 19px;
  box-shadow: 0 4px 0 var(--cherry); transition: transform .08s ease, box-shadow .08s ease; }
.start:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cherry); }
.skip { border: 0; background: none; padding: 10px 12px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.skip:hover { color: var(--ink); }
.current { margin: 0; min-height: 1.6em; font-weight: 700; max-width: 420px; overflow-wrap: anywhere; }
.current.none { font-weight: 400; color: var(--ink-soft); }

/* ---------- side: today + tasks ---------- */
.side { display: grid; gap: 52px; padding-top: 6px; }
.side h2 { font-size: 22px; margin-bottom: 18px; }

.goal .label, .figures dt, .week-h { display: block; font: 400 15px var(--text); color: var(--ink-soft); letter-spacing: 0; }
.goal-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.pips { display: flex; flex-wrap: wrap; gap: 8px; }
.pip { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: var(--white); }
.pip.on { background: var(--cherry); }
.goal-text { font-weight: 700; }

.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 26px 0 0; }
.figures dd { margin: 4px 0 0; font: 500 26px/1.2 var(--display); letter-spacing: -.02em; }

.week-h { margin-top: 26px; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 10px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.col .n { font-size: 13px; color: var(--ink-soft); min-height: 1.2em; }
.track { width: 100%; max-width: 30px; height: 76px; display: flex; align-items: flex-end;
  border-bottom: 2px solid var(--ink); }
.b { width: 100%; background: var(--ink); border-radius: 6px 6px 0 0; }
.col.today .b { background: var(--cherry); }
.col .d { font-size: 13px; color: var(--ink-soft); }
.col.today .d { color: var(--ink); font-weight: 700; }

#task-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#task-name { flex: 1 1 220px; min-width: 0; padding: 12px 16px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--white); }
#task-name::placeholder { color: var(--ink-soft); opacity: .8; }
.est { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 15px; }
.est input { width: 64px; padding: 11px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); text-align: center; }
.add { border: 0; border-radius: 999px; padding: 12px 22px; background: var(--ink); color: var(--white); font-weight: 700; }

#task-list { list-style: none; margin: 18px 0 0; padding: 0; }
.task { display: flex; align-items: center; gap: 12px; padding: 13px 10px 13px 12px;
  border-bottom: 1px solid var(--line); border-inline-start: 4px solid transparent; }
.task:first-child { border-top: 1px solid var(--line); }
.task.active { border-inline-start-color: var(--cherry); background: rgba(255, 255, 255, .55); }
.task-name { flex: 1; min-width: 0; text-align: start; border: 0; background: none; padding: 0; overflow-wrap: anywhere; }
.task.active .task-name { font-weight: 700; }
.task.done .task-name { text-decoration: line-through; color: var(--ink-soft); }
.count { color: var(--ink-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.del { border: 0; background: none; color: var(--ink-soft); font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.del:hover { color: var(--cherry); }
.empty { margin: 16px 0 0; color: var(--ink-soft); }
.empty:empty { display: none; }
.guest { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }

input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--white); display: grid; place-content: center; }
input[type="checkbox"]::after { content: ""; width: 10px; height: 6px; border: solid var(--white);
  border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type="checkbox"]:checked { background: var(--ink); }
input[type="checkbox"]:checked::after { opacity: 1; }

/* ---------- about ---------- */
.about { border-top: 1.5px solid var(--line); }
.about-inner { max-width: 1120px; margin: 0 auto; padding: 56px 24px 64px; }
.about-inner > * { max-width: 660px; }
.about h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.025em; max-width: 720px; }
.lede { font-size: 19px; margin: 18px 0 0; }
.about h2 { font-size: 21px; margin-top: 44px; }
.steps { margin: 16px 0 0; padding-inline-start: 1.4em; }
.steps li { margin: 8px 0; padding-inline-start: 6px; }
.steps li::marker { font: 700 16px var(--display); color: var(--cherry); }
.faq { margin: 16px 0 0; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; color: #3a3650; }

.foot { max-width: 1120px; margin: 0 auto; padding: 24px; border-top: 1.5px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 14px; }
.foot p { margin: 0; }

/* ---------- settings ---------- */
dialog { border: 2px solid var(--ink); border-radius: 22px; padding: 28px; width: min(440px, 92vw);
  color: var(--ink); background: var(--white); box-shadow: 0 6px 0 var(--ink); }
dialog::backdrop { background: rgba(37, 33, 59, .45); }
#settings-form h2 { font-size: 22px; margin-bottom: 14px; }
#settings-form label { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; }
#settings-form input[type="number"] { width: 84px; padding: 9px; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; }
#settings-form label.check { justify-content: flex-start; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; }

/* ---------- small screens ---------- */
@media (max-width: 520px) {
  .top { padding: 14px 16px; }
  .link-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .app { padding: 4px 16px 56px; gap: 44px; }
  .modes { width: 100%; border-radius: 18px; }
  .modes button { flex: 1 1 0; white-space: normal; overflow: visible; line-height: 1.2; padding: 8px 6px; border-radius: 14px; font-size: 14px; }
  .start { min-width: 0; padding: 15px 34px; }
  .about-inner { padding: 44px 16px 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
