/* Clocked It — HUD style
   Night violet, sunset magenta → orange, electric cyan */

:root {
  --bg: #0d0b1e;
  --surface: #161330;
  --surface-2: #221d42;
  --ink: #f1eeff;
  --ink-soft: #a79fcb;
  --line: #2a2452;
  --hot: #ff3d8b;
  --sun: #ff9e3d;
  --volt: #3de0ff;
  --on-hot: #120e24;
  --focus: #3de0ff;
  --meter-a: #ff3d8b;
  --meter-b: #ff9e3d;
  color-scheme: dark;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--volt); text-underline-offset: 0.18em; }
a:hover { color: var(--hot); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.wrap { width: min(100% - 2.5rem, 64rem); margin-inline: auto; }

/* chamfered corner helper */
.chamfer {
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

/* ---------- Header ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: #0d0b1e;
}

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 9;
  background: rgba(13, 11, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffffff;
  text-decoration: none;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.brand:hover { color: #ffffff; }
.brand svg { width: 2rem; height: 2rem; flex: none; }
.brand b { color: var(--hot); font-weight: 700; }

.site-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.site-nav a {
  color: rgba(241, 238, 255, 0.72);
  text-decoration: none;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.site-nav a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
.site-nav a[aria-current="page"] { color: #120e24; background: #ff3d8b; }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-weight: 700; font-size: clamp(2.3rem, 6.2vw, 4rem); max-width: 14ch; }
h2 { font-weight: 700; font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-weight: 700; font-size: 1.2rem; }

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; margin: 1.1rem 0 0; }

/* ---------- Hero with stopwatch ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: center;
  padding: 3.5rem 0 2.5rem;
}

.hero-stats { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.75rem; }
.stat {
  background: var(--surface);
  border-left: 3px solid var(--volt);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.stat strong {
  display: block;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.1;
}

.watch {
  position: relative;
  width: clamp(13rem, 30vw, 17rem);
  aspect-ratio: 1;
}
.watch svg { width: 100%; height: 100%; display: block; overflow: visible; }
.watch .ticks line { stroke: var(--line); stroke-width: 2; }
.watch .ticks line.major { stroke: var(--ink-soft); stroke-width: 3; }
.watch .track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.watch .meter {
  fill: none;
  stroke: url(#hotsun);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 700ms cubic-bezier(.2,.8,.2,1);
}
.watch .crown { fill: var(--ink-soft); }
.watch-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.watch-pct {
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 3.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.watch-label { color: var(--ink-soft); font-weight: 600; margin-top: 0.3rem; }
.watch.is-done .watch-label { color: var(--hot); }

@media (prefers-reduced-motion: reduce) { .watch .meter { transition: none; } }


/* ---------- Sunset hero band (same in light and dark) ---------- */
.hero-band {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(42rem 16rem at 72% 100%, rgba(255, 196, 92, 0.55), transparent 70%),
    linear-gradient(180deg, #0d0b1e 0%, #241047 30%, #5b1a68 55%, #c22f6f 78%, #ff8a3d 100%);
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.78);
  --line: rgba(255, 255, 255, 0.28);
  --surface-2: rgba(255, 255, 255, 0.16);
  --meter-a: #3de0ff;
  --meter-b: #ffffff;
}
.hero-band::before {
  /* fine scanlines for a screen-like texture */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.hero-band .wrap { position: relative; z-index: 1; }
.hero-band .hero { padding-bottom: 7.5rem; }
.hero-band .lede { color: rgba(255, 255, 255, 0.82); }
.hero-band .stat {
  background: rgba(13, 11, 30, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left-color: #3de0ff;
  color: rgba(255, 255, 255, 0.78);
}
.hero-band .stat strong { color: #ffffff; }
.hero-band .watch-face { text-shadow: 0 2px 12px rgba(13, 11, 30, 0.45); }
.hero-band .watch.is-done .watch-label { color: #3de0ff; }
.hero-band .watch .meter { filter: drop-shadow(0 0 6px rgba(61, 224, 255, 0.6)); }

.skyline {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: clamp(70px, 11vw, 140px);
  display: block;
}
.sky-build { fill: var(--bg); }
.sky-palm path { stroke: var(--bg); stroke-linecap: round; }
.sky-win { fill: #ffc45c; opacity: 0.5; }

main.wrap { padding-top: 1.75rem; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
  margin: 0 0 1.5rem;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(90deg, var(--hot), var(--sun) 40%, var(--line) 60%) border-box;
}
.search {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.search::placeholder { color: var(--ink-soft); }
.search:focus { border-color: var(--volt); outline: none; box-shadow: 0 0 0 1px var(--volt); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.btn {
  font: inherit;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.btn:hover { background: var(--volt); color: var(--on-hot); }
.btn-danger:hover { background: var(--hot); color: var(--on-hot); }
.tool-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* custom checkbox */
.toggle input,
.item input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  margin: 0;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--ink-soft);
  background: transparent;
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  display: grid;
  place-content: center;
}
.toggle input { width: 1.15rem; height: 1.15rem; }
.toggle input:checked,
.item input:checked {
  background: var(--hot);
  border-color: var(--hot);
}
.toggle input:checked::after,
.item input:checked::after {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: var(--on-hot);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
.toggle input:focus-visible,
.item input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Categories ---------- */
.category {
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--volt) 45%, var(--line)), var(--line) 40%, var(--line) 70%, color-mix(in srgb, var(--hot) 45%, var(--line))) border-box;
  margin-bottom: 1rem;
}
.category::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--volt);
}
.category.is-complete::before { background: linear-gradient(var(--hot), var(--sun)); }
.category.is-soon::before { background: var(--line); }

.cat-head {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem 1.1rem 1.5rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cat-desc { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.cat-score {
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 700;
  white-space: nowrap;
  color: var(--volt);
  font-variant-numeric: tabular-nums;
}
.category.is-soon .cat-score { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }
.category.is-complete .cat-score { color: var(--hot); }

/* segmented HUD bar */
.cat-bar {
  position: relative;
  grid-column: 1 / -1;
  height: 8px;
  background: var(--surface-2);
  margin-top: 0.55rem;
  overflow: hidden;
}
.cat-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--volt);
  transition: width 400ms ease;
}
.category.is-complete .cat-bar span { background: linear-gradient(90deg, var(--hot), var(--sun)); }
.cat-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 3px), var(--surface) calc(10% - 3px) 10%);
}

.cat-body { padding: 0 1.25rem 1rem 1.5rem; }
.category[data-open="false"] .cat-body { display: none; }
.chevron { display: inline-block; margin-left: 0.45rem; color: var(--ink-soft); transition: transform 200ms ease; }
.category[data-open="false"] .chevron { transform: rotate(-90deg); }

.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.item:first-child { border-top: 0; }
.item input { margin-top: 0.1rem; }
.item label { cursor: pointer; font-weight: 600; }
.item .note { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.93rem; }
.item.is-done label > span:first-child { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--hot); text-decoration-thickness: 2px; }

.soon {
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  color: var(--ink-soft);
  border-left: 3px solid var(--sun);
}
.empty-search { color: var(--ink-soft); padding: 2rem 0; text-align: center; }

/* ---------- Content pages ---------- */
.prose { max-width: 44rem; padding: 1.5rem 0 3rem; }
body:not(:has(.hero-band)) .site-header { box-shadow: 0 3px 0 0 #c22f6f, 0 6px 0 0 #ff8a3d; }
.prose h1 { margin-bottom: 0.75rem; max-width: 18ch; }
.prose h2 { margin: 2.5rem 0 0.75rem; }
.prose p, .prose li { max-width: 68ch; }
.updated { color: var(--ink-soft); font-size: 0.95rem; }

.table-scroll { overflow-x: auto; }
.fact-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
}
.fact-table th, .fact-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.fact-table th { width: 38%; color: var(--ink-soft); font-weight: 600; }
.fact-table td { font-weight: 600; }

.timeline { list-style: none; padding: 0; margin: 1.25rem 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.2rem 1.4rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px; top: 0.4rem;
  width: 12px; height: 12px;
  background: var(--volt);
  transform: rotate(45deg);
}
.timeline li:last-child::before { background: var(--hot); }
.timeline strong { display: block; font-family: "Chakra Petch", "Segoe UI", sans-serif; }

.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--hot);
}

/* ---------- Ads + support ---------- */
.ad-slot { margin: 2rem 0; min-height: 90px; }
.ad-slot[hidden] { display: none; }

.support {
  display: none;
  margin: 2.5rem 0 0;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sun);
}
.support.is-on { display: block; }
.support p { color: var(--ink-soft); }
.support a.btn { display: inline-block; text-decoration: none; background: var(--sun); color: #1a1530; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  background: var(--bg);
}
.site-footer p { max-width: 70ch; margin: 0 0 0.6rem; }
.site-footer nav { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--hot);
  color: var(--on-hot);
  padding: 0.65rem 1.15rem;
  font-family: "Chakra Petch", "Segoe UI", sans-serif;
  font-weight: 700;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.toast.is-on { opacity: 1; }

.updated-note { color: var(--ink-soft); font-size: 0.95rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.25rem; }
  .hero-band .hero { padding-bottom: 5.5rem; }
  .watch { justify-self: center; grid-row: 2; }
}
@media (max-width: 560px) {
  .fact-table th { width: auto; }
  .site-nav a { padding: 0.35rem 0.55rem; }
}
