/* Honey-Do.
   The page is a honey-do list: one column, the claims are the checklist, and
   ticking one opens its answer and pays honey. Colour is carried by the tick
   marks and the finish card; everything else is paper. */

:root {
  --bg: #ece7db;               /* plain, calm */
  --paper: #fdf8e9;
  --card: #fffefa;
  --ink: #2b2317;
  --ink-soft: #6b5f4a;
  --honey: #f2a11c;
  --honey-deep: #d9820a;
  --blueprint: #1c4587;
  --hairline: rgba(66, 51, 26, .14);
  --shadow: 0 12px 28px rgba(60, 50, 30, .14), 0 2px 6px rgba(60, 50, 30, .08);
  --r: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* The list page is paper edge to edge; the legal pages keep the calm --bg the
   .sheet sits on. Matching the body to the page it holds is what stops a seam
   showing down either side of the centred column. */
body:has(.page) { background: var(--paper); }

img, svg { display: block; max-width: 100%; }

/* ---------- the sheet ---------- */

.page {
  min-height: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ---------- masthead: wordmark over the score card ---------- */

/* Sticky, and fading into the paper rather than sitting on a bar — the score
   has to stay in sight while you work down the list, or ticking pays nothing
   you can see. */
.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 18px 0 14px;
  background: linear-gradient(var(--paper) 72%, rgba(253, 248, 233, 0));
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* The app icon, wearing the corner radius the home screen would give it. */
.app-icon {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 23%;
}

.score {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 13px;
  padding: 11px 15px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 3px 10px rgba(70, 55, 25, .06);
}

.pot { grid-row: span 2; width: 34px; height: 34px; }

.score-points { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.score-rank { color: var(--ink-soft); font-size: .84rem; font-weight: 600; }

.meter {
  grid-column: 2;
  height: 7px;
  border-radius: 4px;
  background: #e9e2d0;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--honey);
  transition: width .45s cubic-bezier(.2, .9, .3, 1);
}

/* ---------- headline ---------- */

h1 {
  margin-top: 30px;
  font-size: clamp(2.3rem, 8vw, 3.3rem);
  line-height: 1;
  letter-spacing: -.035em;
}

h1 em { font-style: normal; color: var(--honey-deep); }

.hint {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.hint::before { content: "↓"; font-size: 1rem; }

/* ---------- the list ---------- */

.checklist {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 15px;
  overflow: hidden;
  transition: background .2s, border-color .2s, box-shadow .2s;
}

.task.done {
  background: #fffdf5;
  border-color: rgba(242, 161, 28, .5);
  box-shadow: 0 2px 12px rgba(217, 130, 10, .1);
}

.task-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.task-row:focus-visible { outline: 3px solid var(--honey-deep); outline-offset: -3px; }

.tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2.5px solid #cfc4ab;
  border-radius: 50%;
  transition: background .18s, border-color .18s;
}

.tick svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .18s, transform .28s cubic-bezier(.3, 1.5, .5, 1);
}

.done .tick { background: var(--honey); border-color: var(--honey); }
.done .tick svg { opacity: 1; transform: scale(1); }

.task-name {
  flex: 1;
  font-weight: 700;
  font-size: 1.04rem;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.done .task-name {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: rgba(107, 95, 74, .45);
}

.task-points {
  flex: none;
  font-size: .8rem;
  font-weight: 800;
  color: #bdb29a;
  font-variant-numeric: tabular-nums;
}

.done .task-points { color: var(--honey-deep); }

/* The answer. grid-template-rows 0fr → 1fr animates a box whose height nobody
   has to measure; the inner div carries the overflow so the text doesn't
   reflow as it opens. */
.why {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}

.done .why { grid-template-rows: 1fr; }
.why > div { overflow: hidden; }

.why p {
  padding: 0 16px 16px 54px;
  font-size: .96rem;
  line-height: 1.5;
  color: #5f5540;
}

.tick-all {
  margin-top: 14px;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-soft);
}

.tick-all button {
  font: inherit;
  font-weight: 700;
  color: var(--honey-deep);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- the finish ---------- */

.finish { position: relative; margin-top: 26px; animation: rise .45s cubic-bezier(.2, .9, .3, 1); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Overhangs the card so pieces can fly past its corners. */
.finish-confetti {
  position: absolute;
  inset: -70px -30px 0;
  width: calc(100% + 60px);
  height: calc(100% + 70px);
  pointer-events: none;
  z-index: 2;
}

.finish-card {
  position: relative;
  z-index: 1;
  padding: 30px 24px 26px;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffe3a0 0%, #f6b93f 100%);
  box-shadow: 0 14px 30px rgba(120, 85, 15, .22);
}

.finish-card h2 { font-size: 1.6rem; letter-spacing: -.02em; }
.finish-score { margin-top: 6px; font-size: .95rem; font-weight: 600; color: #5c4514; }

.appstore {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 13px 26px 13px 19px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 16px;
  text-decoration: none;
  line-height: 1.05;
  font-weight: 700;
  font-size: 1.25rem;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 16px rgba(60, 45, 15, .3);
}

.appstore:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(60, 45, 15, .35); }
.appstore svg { width: 27px; height: 32px; }
.appstore small { font-weight: 500; font-size: .7rem; letter-spacing: .04em; }

.fine { margin-top: 12px; font-size: .78rem; font-weight: 600; color: #6d5420; }

/* ---------- colophon ---------- */

.colophon {
  margin-top: 34px;
  text-align: center;
  color: var(--ink-soft);
  font-size: .78rem;
}

.colophon a {
  color: inherit;
  text-decoration-color: var(--hairline);
}

.colophon a:hover { color: var(--honey-deep); }

/* ---------- legal pages (support.html, privacy.html, terms.html) ---------- */

/* Their own shell: a small honey hero card over one prose card, on the calm
   background rather than the list page's paper. */
.sheet {
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--r);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-sheet { max-width: 760px; }

.legal-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-hero {
  background: linear-gradient(135deg, #ffe3a0 0%, #f6b93f 100%);
  padding: clamp(22px, 3vw, 34px) clamp(24px, 3vw, 40px);
}

.legal-hero h1 {
  margin-top: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -.02em;
  line-height: 1.05;
}

.legal-meta {
  margin-top: 6px;
  font-size: .85rem;
  font-weight: 700;
  color: #6d5420;
}

.legal-body {
  padding: clamp(24px, 3.5vw, 42px) clamp(24px, 3.5vw, 44px);
  line-height: 1.55;
}

.legal-body .lede {
  font-size: 1.05rem;
  font-weight: 600;
  color: #5c4514;
}

.legal-body h2 {
  margin-top: 26px;
  font-size: 1rem;
  letter-spacing: -.01em;
}

.legal-body p { margin-top: 10px; }

.legal-body ul {
  margin-top: 10px;
  padding-left: 1.2em;
}

.legal-body li { margin-top: 6px; }

.legal-body a {
  color: var(--honey-deep);
  font-weight: 600;
  text-decoration-color: rgba(217, 130, 10, .4);
}

/* The legal pages carry their own colophon inside the sheet. */
.sheet .colophon { margin-top: 0; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .appstore, .meter i, .why, .tick, .tick svg, .task { transition: none; }
  .finish { animation: none; }
}
