@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Blink brand: Velvet green, Electric green, Morzine white. */
:root {
  --velvet: #03390f;
  --electric: #cfff71;
  --white: #ffffff;
  --ink: #03390f;
  --muted: rgba(3, 57, 15, 0.64);
  --line: rgba(3, 57, 15, 0.12);
  --wash: #f3f6f4;
  --electric-soft: #f0ffd1;
  --velvet-2: #0a4a1a;
  --on-velvet-muted: #b9cdbf;
  --late: #b3261e;
  --late-soft: #fde8e6;
  --now: #8a5a00;
  --now-soft: #fff1d1;
  --focus: #3f46da;

  --display: "Outfit", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --gutter: 16px;
  --max: 760px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--white);
  color: var(--ink);
  font: 16px/1.5 var(--text);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
h2 { font-size: 1.2rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- Wordmark: "Blink." always ends with a full stop ---------- */
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; margin: 0 0 0.5rem; color: var(--white); }
.wordmark span { color: var(--electric); }
.wordmark-dark, .notice .wordmark-dark { color: var(--velvet); }
.wordmark-dark span { color: var(--velvet); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.25rem;
  border: 1.5px solid var(--velvet); border-radius: 999px;
  background: transparent; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--velvet); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--velvet-2); }
.btn-quiet { border-color: transparent; }
.btn-quiet:hover:not(:disabled) { background: rgba(3, 57, 15, 0.06); }
.btn-sm { min-height: 40px; padding: 0 1rem; font-size: 0.9rem; }

/* ---------- Notices (sign in, errors, the colleague intro) ---------- */
.notice { max-width: 460px; margin: 12vh auto 0; padding: 0 var(--gutter); text-align: center; }
.notice h1 { margin-bottom: 0.75rem; }
.notice p { color: var(--muted); }
.notice .btn { margin-top: 0.75rem; }
.intro { text-align: left; }
.intro .wordmark { margin-bottom: 1.5rem; }

/* ---------- Toasts ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
  background: var(--velvet); color: var(--white); padding: 0.8rem 1.1rem; border-radius: var(--r-md);
  width: max-content; max-width: calc(100vw - 2 * var(--gutter)); box-shadow: 0 8px 24px rgba(3, 57, 15, 0.25);
}
.toast.error { background: var(--late); }

.cheer {
  position: fixed; left: 50%; bottom: 24px; z-index: 70;
  transform: translate(-50%, calc(100% + 40px)); opacity: 0;
  background: var(--velvet); color: var(--white); border-radius: var(--r-md); padding: 14px 20px;
  display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  box-shadow: 0 10px 30px rgba(3, 57, 15, 0.3);
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease;
  pointer-events: none;
}
.cheer.show { transform: translate(-50%, 0); opacity: 1; }
.cheer b { font-family: var(--display); color: var(--electric); font-size: 1rem; }
.cheer span { font-size: 0.9rem; color: var(--on-velvet-muted); }

dialog { border: 0; border-radius: var(--r-lg); padding: 20px; max-width: min(92vw, 420px); color: var(--ink); }
dialog::backdrop { background: rgba(3, 57, 15, 0.35); }
.dialog-body { margin-top: 0.5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

/* ---------- Progress bars ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--velvet); border-radius: inherit; transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-dark { background: rgba(255, 255, 255, 0.14); }
.bar-dark .bar-fill { background: var(--electric); }

/* ---------- Setup wizard: one question per screen ---------- */
.wizard { max-width: 560px; margin: 0 auto; padding: 20px var(--gutter) 32px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wizard-top { position: sticky; top: 0; background: var(--white); padding: 4px 0 16px; z-index: 2; }
.wizard-meta { display: flex; justify-content: space-between; font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; }
.question { flex: 1; padding-top: 12px; }
.question h1 { margin-bottom: 0.4rem; }
.q-note { margin-bottom: 0; }
.options { display: grid; gap: 10px; margin-top: 20px; }
.option {
  display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 12px; row-gap: 2px;
  width: 100%; min-height: 56px; padding: 12px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--white);
  font-weight: 500; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--velvet); }
.option:disabled { opacity: 0.4; cursor: not-allowed; }
.option-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: background 0.15s, border-color 0.15s; }
.option-multi .option-mark { border-radius: 6px; }
.option-sub { grid-column: 2; font-size: 0.85rem; color: var(--muted); }
.option[aria-checked="true"], .option[aria-pressed="true"] { border-color: var(--velvet); background: var(--electric-soft); }
.option[aria-checked="true"] .option-mark, .option[aria-pressed="true"] .option-mark { background: var(--velvet); border-color: var(--velvet); }
.option[aria-checked="true"] .option-mark::after, .option[aria-pressed="true"] .option-mark::after {
  content: ""; width: 10px; height: 6px; border: solid var(--electric); border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg);
}
.date-field { display: grid; gap: 6px; margin-top: 18px; font-size: 0.9rem; font-weight: 600; }
.date-field input {
  min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  font: inherit; color: var(--ink); background: var(--white); width: 100%;
}
.date-field input:focus { outline: none; border-color: var(--velvet); }
.form-error { color: var(--late); margin-top: 16px; font-weight: 500; }
.wizard-nav { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 calc(8px + env(safe-area-inset-bottom)); background: var(--white); }
.wizard-nav .btn-primary { min-width: 140px; }

/* ---------- Plan ---------- */
.hero { background: var(--velvet); color: var(--white); }
.hero-inner { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 28px; }
.hero h1 { margin-bottom: 20px; }
.hero-stats { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; }
.countdown { display: flex; flex-direction: column; }
.countdown strong { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--electric); font-weight: 700; }
.countdown span { font-size: 0.875rem; color: var(--on-velvet-muted); margin-top: 4px; }
.hero-progress-label { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--on-velvet-muted); margin-bottom: 8px; }
.hero-date { margin: 18px 0 0; font-size: 0.9rem; color: var(--on-velvet-muted); }

.plan { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 48px; }
.card { border-radius: var(--r-lg); padding: 20px; }
.eyebrow { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.up-next { background: var(--electric-soft); border: 1.5px solid var(--electric); margin-bottom: 28px; }
.up-next h2 { font-size: 1.3rem; }
.up-next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.ready { display: none; background: var(--electric); border-radius: var(--r-lg); padding: 22px; margin-bottom: 20px; }
.ready.show { display: block; }
.ready h2 { font-size: 1.5rem; margin-bottom: 6px; }
.ready p { margin: 0; }
.ready.land { animation: land 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes land { 0% { transform: translateY(-14px) scale(0.97); opacity: 0; } 100% { transform: none; opacity: 1; } }

.phase { position: relative; margin-bottom: 28px; }
.phase-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--line); transition: border-color 0.3s; }
.phase-due { margin: 4px 0 0; font-size: 0.875rem; color: var(--muted); }
.phase-count { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 2px; }
.count { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.phase.complete .phase-head { border-bottom-color: var(--electric); }
.sweep { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--electric); transform-origin: left; display: none; border-radius: 2px; }
.phase.celebrate .sweep { display: block; animation: sweep 0.65s ease-out forwards; }
@keyframes sweep { 0% { transform: scaleX(0); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

.chip { font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip-done { background: var(--electric); color: var(--velvet); }
.chip-now { background: var(--now-soft); color: var(--now); }
.chip-late { background: var(--late-soft); color: var(--late); }

.phase-later > details > summary { list-style: none; cursor: pointer; }
.phase-later > details > summary::-webkit-details-marker { display: none; }
.phase-later .phase-head h2::after { content: " +"; color: var(--muted); }
.phase-later > details[open] .phase-head h2::after { content: " −"; }

.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item.flash { animation: rowflash 0.8s ease-out; }
@keyframes rowflash { 0% { background: rgba(207, 255, 113, 0.55); } 100% { background: transparent; } }

.tick {
  flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 8px;
  border: 2px solid rgba(3, 57, 15, 0.35); background: var(--white); cursor: pointer;
  display: grid; place-items: center; padding: 0; transition: background 0.15s, border-color 0.15s;
}
.tick:hover { border-color: var(--velvet); }
.tick[aria-checked="true"] { background: var(--velvet); border-color: var(--velvet); }
.tick[aria-checked="true"] .tick-mark { width: 13px; height: 7px; border: solid var(--electric); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.tick.just { animation: pop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.item-body { flex: 1; min-width: 0; }
.item-body > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.item-body > summary::-webkit-details-marker { display: none; }
.item-title { font-weight: 600; }
.item-title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-3px) rotate(45deg); transition: transform 0.15s; }
.item-body[open] .item-title::after { transform: translateY(0) rotate(-135deg); }
.item.done .item-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.item-meta { font-size: 0.8rem; color: var(--muted); }
.item-more { padding: 8px 0 4px; }
.item-more p { color: var(--ink); opacity: 0.85; font-size: 0.95rem; }
.links { margin: 12px 0 0; padding-left: 18px; font-size: 0.9rem; }
.links li + li { margin-top: 4px; }

.plan-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* Confetti */
.burst { position: fixed; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; z-index: 60; animation: fly 800ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes fly {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(var(--rot)); opacity: 0; }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr; gap: 16px; }
  .countdown { flex-direction: row; align-items: baseline; gap: 10px; }
  .countdown strong { font-size: 2.5rem; }
  .phase-head { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .tick.just, .item.flash, .phase.celebrate .sweep, .ready.land { animation: none !important; }
}

@media print {
  .hero { background: none; color: var(--ink); }
  .countdown strong, .wordmark span { color: var(--ink); }
  .countdown span, .hero-progress-label, .hero-date { color: var(--muted); }
  .bar, .up-next, .plan-actions, .toast, .cheer, .burst, .item-title::after { display: none !important; }
  .phase, .item { break-inside: avoid; }
  .item-more a.btn { display: none; }
}
