/* DotNotes — your days, down to the dot.
   Two moods, like the app: night ink, and morning paper.

   Every colour below is written once, as light-dark(morning, night), so the
   mood is decided by one thing only: the used color-scheme. That means
   pinning a mood is a single declaration (see [data-theme]), and no palette
   is ever kept in two places waiting to drift apart. */

/* Registered so the palette can be *transitioned* rather than swapped: an
   unregistered custom property has no type, and an untyped property can only
   ever jump. These are the ones large enough on screen for the jump to show. */
@property --bg1 { syntax: '<color>'; inherits: true; initial-value: #0d0b14; }
@property --bg2 { syntax: '<color>'; inherits: true; initial-value: #160f22; }
@property --paper { syntax: '<color>'; inherits: true; initial-value: #eceaf4; }
@property --dim { syntax: '<color>'; inherits: true; initial-value: #8c86a6; }
@property --strong { syntax: '<color>'; inherits: true; initial-value: #f2f0fa; }
@property --h2a { syntax: '<color>'; inherits: true; initial-value: #f6f4fc; }
@property --h2b { syntax: '<color>'; inherits: true; initial-value: #c7c1e0; }
@property --faint { syntax: '<color>'; inherits: true; initial-value: rgba(236, 234, 244, 0.1); }
@property --card { syntax: '<color>'; inherits: true; initial-value: rgba(13, 11, 20, 0.55); }
@property --card2 { syntax: '<color>'; inherits: true; initial-value: rgba(13, 11, 20, 0.4); }

:root {
  color-scheme: light dark;

  /* The accent, in the app's own two variants — see [data-accent] below.
     `on-accent` is what stays readable on top of a filled surface, which is
     not always white: Ink at night is nearly white itself. */
  --accent-light: #6C5CE7;
  --accent-dark: #7D6FF3;
  --on-accent-light: #ffffff;
  --on-accent-dark: #ffffff;

  --accent: light-dark(var(--accent-light), var(--accent-dark));
  --on-accent: light-dark(var(--on-accent-light), var(--on-accent-dark));

  --bg1: light-dark(#fbfaf7, #0d0b14);
  --bg2: light-dark(#f1eeea, #160f22);
  --paper: light-dark(#221c30, #eceaf4);   /* foreground text */
  --dim: light-dark(#6e6884, #8c86a6);
  --faint: light-dark(rgba(34, 28, 48, 0.13), rgba(236, 234, 244, 0.1));
  --glow: light-dark(var(--accent), #dfe6ff);   /* the dot's halo colour */
  --dot-core: light-dark(color-mix(in srgb, var(--accent) 60%, #ffffff), #ffffff);
  --dot-edge: light-dark(var(--accent), #dfe6ff);
  --strong: light-dark(#181224, #f2f0fa);
  --h2a: light-dark(#241c38, #f6f4fc);
  --h2b: light-dark(#5a5175, #c7c1e0);
  --card: light-dark(rgba(255, 255, 255, 0.65), rgba(13, 11, 20, 0.55));
  --card2: light-dark(rgba(255, 255, 255, 0.55), rgba(13, 11, 20, 0.4));
  --shadow: light-dark(rgba(34, 28, 48, 0.22), rgba(0, 0, 0, 0.45));
  /* year dots, as colours rather than opacities, so they switch with the rest */
  --dot-off: light-dark(rgba(34, 28, 48, 0.12), rgba(236, 234, 244, 0.07));
  --dot-lit: light-dark(rgba(34, 28, 48, 0.45), rgba(236, 234, 244, 0.4));

  --serif: 'Iowan Old Style', 'Palatino Nova', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Long enough to read as a sunrise, short enough not to be in the way. */
  transition:
    --bg1 0.7s ease, --bg2 0.7s ease, --paper 0.7s ease, --dim 0.7s ease,
    --strong 0.7s ease, --h2a 0.7s ease, --h2b 0.7s ease, --faint 0.7s ease,
    --card 0.7s ease, --card2 0.7s ease;
}

/* Pinning a mood. One declaration each — every colour above already knows
   what to do with it, including the browser's own form controls. */
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

/* The app's accents, both variants of each. The page carries the name on
   the root element; the pair is looked up here rather than in script, so a
   colour is never mid-flight during the first paint. */
:root[data-accent='ocean'] {
  --accent-light: #2F80ED; --accent-dark: #4D93FF;
}
:root[data-accent='mint'] {
  --accent-light: #0EA48E; --accent-dark: #17C8B0;
  --on-accent-dark: #00332C;
}
:root[data-accent='leaf'] {
  --accent-light: #5E9C3E; --accent-dark: #7BC25C;
  --on-accent-dark: #12290A;
}
:root[data-accent='sunrise'] {
  --accent-light: #F0A32B; --accent-dark: #F0A32B;
  --on-accent-dark: #1A1300;
}
:root[data-accent='coral'] {
  --accent-light: #F0564C; --accent-dark: #FF7B6E;
  --on-accent-dark: #33100C;
}
:root[data-accent='blossom'] {
  --accent-light: #DB4D8E; --accent-dark: #F06CB2;
  --on-accent-dark: #380E24;
}
:root[data-accent='ink'] {
  --accent-light: #1C1C21; --accent-dark: #F2F2F5;
  --on-accent-dark: #141417;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%) fixed;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* the sky lives behind everything: stars at night, ink specks on paper */
#sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* a whisper of film grain over the whole page */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

a {
  color: var(--paper);
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--accent); }

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

.col {
  width: min(40rem, 100% - 3rem);
  margin-inline: auto;
}

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

/* ---------- scroll thread: a day travelling down the page ---------- */

.thread {
  position: fixed;
  left: max(2.2rem, 4vw);
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--faint) 12%,
    var(--faint) 88%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}
.thread .traveler {
  position: absolute;
  top: 12%;
  left: -3.5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--dot-core), var(--dot-edge));
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
@media (max-width: 1150px) { .thread { display: none; } }

/* ---------- header ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
}

.top-end {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}

.wordmark .mark {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--dot-core), var(--dot-edge));
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--glow) 55%, transparent);
  flex: none;
}

.top a.mailto {
  font-size: 0.8125rem;
  color: var(--dim);
  text-decoration: none;
}
.top a.mailto:hover { color: var(--paper); }

/* ---------- the mood switch ----------
   Three words and the site's own dot. The dot is the state — it lights for
   the mood in force, so the control reads at a glance without an icon in it. */

.modes {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 0.2rem;
}

.modes button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.3rem 0.62rem;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.modes button:hover { color: var(--paper); }

.modes button .d {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--dim);
  opacity: 0.45;
  flex: none;
  transition: background-color 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.modes button[aria-pressed='true'] {
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 9%, transparent);
}
.modes button[aria-pressed='true'] .d {
  background: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 65%, transparent);
}

@media (max-width: 34rem) {
  .top-end .mailto { display: none; }
}

/* ---------- hero ---------- */

.hero {
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5rem 0 4rem;
}

.dot-stage {
  height: 8rem;
  display: grid;
  place-items: center;
}

.dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--dot-core) 0%, var(--dot-edge) 100%);
  box-shadow:
    0 0 24px 6px color-mix(in srgb, var(--glow) 50%, transparent),
    0 0 90px 30px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 24px 6px color-mix(in srgb, var(--glow) 50%, transparent),
      0 0 90px 30px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  50% {
    transform: scale(1.12);
    box-shadow:
      0 0 30px 9px color-mix(in srgb, var(--glow) 60%, transparent),
      0 0 110px 40px color-mix(in srgb, var(--accent) 30%, transparent);
  }
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  background: linear-gradient(180deg, var(--h2a) 20%, var(--h2b) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 {
  font-size: clamp(2.1rem, 6.5vw, 3.4rem);
  line-height: 1.18;
  margin-top: 2.5rem;
  color: var(--strong);
}

/* the sentence is fully laid out from the first frame — lines never move.
   Each character is already in place and simply comes into focus. */
h1 .ch {
  opacity: 0;
  filter: blur(7px);
  transition: opacity 0.5s ease, filter 0.7s ease;
}
h1 .ch.on { opacity: 1; filter: blur(0); }

h1 .end-dot { transition: opacity 0.9s ease; }
h1 .end-dot.pending { opacity: 0; }

.end-dot {
  display: inline-block;
  width: 0.17em; height: 0.17em;
  border-radius: 50%;
  background: var(--dot-edge);
  box-shadow:
    0 0 12px 2px color-mix(in srgb, var(--glow) 70%, transparent),
    0 0 30px 8px color-mix(in srgb, var(--accent) 35%, transparent);
  margin-left: 0.08em;
  vertical-align: 0.02em;
}

.hero .sub {
  max-width: 34em;
  margin-top: 1.75rem;
  color: var(--dim);
  font-size: 1rem;
  transition: opacity 1.2s ease;
}
.hero .sub.pending { opacity: 0; }

.hero .down {
  margin-top: 4rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--dim) 60%, transparent);
  text-decoration: none;
}
.hero .down:hover { color: var(--dim); }

/* ---------- sections ---------- */

section { padding: 8rem 0 0; }
section:last-of-type { padding-bottom: 2rem; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease, transform 1s ease;
}
.reveal.in { opacity: 1; transform: none; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.7em;
  vertical-align: 0.14em;
}

h2 {
  font-size: clamp(1.7rem, 4.8vw, 2.3rem);
  line-height: 1.25;
  margin-bottom: 1.1rem;
}

.prose { color: var(--dim); max-width: 60ch; }
.prose strong { color: var(--paper); font-weight: 500; }
.prose + .prose { margin-top: 1em; }

/* ---------- spark card ---------- */

.spark-card {
  margin-top: 2.5rem;
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.1rem;
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.spark-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 10%, transparent);
}

.spark-card .dateline {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.9rem;
}

.spark-card textarea {
  width: 100%;
  background: none;
  border: none;
  resize: none;
  color: var(--paper);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  min-height: 3.2em;
}
.spark-card textarea::placeholder {
  color: color-mix(in srgb, var(--dim) 65%, transparent);
  font-style: italic;
}
.spark-card textarea:focus { outline: none; }

.spark-card .row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.4rem;
}

.keep {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.4rem;
  cursor: pointer;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.keep:hover { filter: brightness(1.12); }
.keep:disabled { opacity: 0.35; cursor: default; filter: none; }

.deck { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }

.kept {
  border: 1px solid var(--faint);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card2);
  animation: settle 0.5s ease;
}
@keyframes settle {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.kept.crowned {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 12%, transparent);
}

.kept .text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.kept .when {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 0.45rem;
}

.crown-btn {
  flex: none;
  background: none;
  border: 1px solid var(--faint);
  border-radius: 999px;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.32rem 0.85rem;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.crown-btn:hover { color: var(--paper); border-color: var(--dim); }
.kept.crowned .crown-btn {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.hint { margin-top: 1.4rem; font-size: 0.9rem; color: var(--dim); }

/* ---------- the phone: where the crowned spark lands ----------
   The screen stays night-dark in both modes on purpose:
   the widget's promise is a glowing line in the dark. */

.phone {
  margin: 3rem auto 0;
  width: min(300px, 86%);
  aspect-ratio: 9 / 18.5;
  border: 1px solid var(--faint);
  border-radius: 46px;
  padding: 10px;
  background: rgba(127, 120, 150, 0.06);
  box-shadow: 0 30px 76px var(--shadow);
}

.screen {
  height: 100%;
  border-radius: 37px;
  background:
    radial-gradient(130% 80% at 50% -10%, #1c1432 0%, rgba(28, 20, 50, 0) 60%),
    linear-gradient(170deg, #100c1c 0%, #0b0912 100%);
  overflow: hidden;
  padding: 1.7rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
}

.screen .clock {
  text-align: center;
  font-size: 2.1rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: rgba(236, 234, 244, 0.85);
  line-height: 1;
  margin-bottom: 1.4rem;
}

.widget {
  border-radius: 22px;
  padding: 1rem 1.1rem 0.9rem;
  background: linear-gradient(160deg, #171126 0%, #0f0c18 100%);
  border: 1px solid rgba(236, 234, 244, 0.1);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
.widget.lit {
  border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent);
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent-dark) 18%, transparent);
}

.widget .w-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8c86a6;
}
.widget .w-label::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-dark);
  margin-right: 0.6em;
  vertical-align: 0.15em;
}

.widget .w-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #8c86a6;
  margin-top: 0.55rem;
  min-height: 2.8em;
  overflow-wrap: anywhere;
  transition: color 0.6s ease;
}
.widget.lit .w-text { color: #eceaf4; }

.widget .w-date {
  margin-top: 0.6rem;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(140, 134, 166, 0.7);
}

.screen .icons {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem 0;
  justify-items: center;
}
.screen .icons i,
.screen .dock i {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(236, 234, 244, 0.05);
}

.screen .dock {
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.65rem;
  border-radius: 26px;
  background: rgba(236, 234, 244, 0.04);
}

/* ---------- year dots ---------- */

.year-dots {
  margin: 2.4rem 0 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
  gap: 8px;
}
.year-dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--dot-off);
  justify-self: center;
}
.year-dots i.lit { background: var(--dot-lit); }
.year-dots i.today {
  background: var(--accent);
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: breathe-sm 4s ease-in-out infinite;
}
@keyframes breathe-sm {
  0%, 100% { box-shadow: 0 0 8px 2px color-mix(in srgb, var(--accent) 60%, transparent); }
  50%      { box-shadow: 0 0 12px 4px color-mix(in srgb, var(--accent) 85%, transparent); }
}

/* ---------- features ---------- */

.features dl {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.features dt {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.features dt::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot-edge);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--glow) 50%, transparent);
  margin-right: 0.8em;
  vertical-align: 0.18em;
}
.features dd { color: var(--dim); max-width: 56ch; }

/* ---------- a to-do, opened ----------
   The card is the section's whole argument: a heavy line looks lighter the
   moment it is broken into things you could actually start. So the steps are
   real — tick them and the rule under the title fills. */

.todo-card {
  margin-top: 2.5rem;
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
.todo-card.clear {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 44px color-mix(in srgb, var(--accent) 10%, transparent);
}

.todo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.todo-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--strong);
  transition: color 0.6s ease, opacity 0.6s ease;
}
.todo-card.clear .todo-title { opacity: 0.55; }

/* A star, drawn rather than fetched — the app's own "this one matters". */
.star {
  flex: none;
  width: 15px; height: 15px;
  background: var(--accent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent));
}

.todo-meter {
  margin-top: 1.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--faint);
  overflow: hidden;
}
.todo-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px 1px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.todo-count {
  margin-top: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.steps {
  list-style: none;
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
}

.steps button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  padding: 0.55rem 0.5rem;
  margin-left: -0.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--paper);
  transition: color 0.35s ease, background-color 0.25s ease;
}
.steps button:hover { background: color-mix(in srgb, var(--paper) 5%, transparent); }

.steps .box {
  flex: none;
  margin-top: 0.28em;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--dim) 70%, transparent);
  position: relative;
  transition: border-color 0.35s ease, background-color 0.35s ease;
}
/* The tick is two strokes of a rotated corner — nothing to download. */
.steps .box::after {
  content: '';
  position: absolute;
  left: 5px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid var(--on-accent);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.steps li.done button {
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--dim) 55%, transparent);
}
.steps li.done .box { background: var(--accent); border-color: var(--accent); }
.steps li.done .box::after { opacity: 1; transform: rotate(45deg) scale(1); }

.todo-clear {
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent);
}

.chips {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}
.chip.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.file-row {
  margin-top: 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  border-top: 1px solid var(--faint);
  padding-top: 1rem;
  font-size: 0.9rem;
}
.file-row .file-name { color: var(--paper); }
.file-row .file-size { color: var(--dim); font-size: 0.78rem; }

.todo-note {
  margin-top: 1rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--dim);
  line-height: 1.6;
}

/* ---------- a note, with things living inside the writing ---------- */

.note-mock {
  margin-top: 2.5rem;
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 1.8rem 1.6rem;
  background: var(--card);
  backdrop-filter: blur(6px);
}

.note-mock .n-date {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.note-mock .n-title {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--strong);
}
.note-mock .n-p {
  margin-top: 1rem;
  color: var(--paper);
  line-height: 1.7;
}
.note-mock .n-quiet { color: var(--dim); font-size: 0.95rem; }
.note-mock .n-quiet strong { color: var(--paper); font-weight: 600; }
.note-mock mark {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: inherit;
  padding: 0 0.15em;
  border-radius: 3px;
}

/* An empty room with twenty minutes of morning in it, drawn in gradients —
   the page ships no images, and a photo here is a promise, not a product shot. */
.shot {
  margin-top: 1.2rem;
  aspect-ratio: 5 / 3;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg,
      light-dark(#e8ddcd, #241d2e) 0%,
      light-dark(#e2d6c4, #1d1726) 71%,
      light-dark(#c9b79f, #171223) 71.5%,
      light-dark(#bda98e, #120e1c) 100%);
}
/* the window */
.shot::before {
  content: '';
  position: absolute;
  left: 11%; top: 13%;
  width: 26%; height: 40%;
  border-radius: 3px;
  background: light-dark(#fffdf6, #cfd6ee);
  box-shadow: 0 0 34px 12px light-dark(rgba(255, 250, 232, 0.85), rgba(190, 200, 240, 0.28));
}
/* the light it puts on the floor */
.shot::after {
  content: '';
  position: absolute;
  left: 14%; bottom: 0;
  width: 46%; height: 46%;
  background: linear-gradient(120deg,
    light-dark(rgba(255, 249, 228, 0.9), rgba(198, 206, 244, 0.22)) 0%,
    transparent 72%);
  transform: skewX(-26deg);
  filter: blur(6px);
}

.n-table {
  margin-top: 1.1rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.n-table th,
.n-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--faint);
}
.n-table th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.n-table td { color: var(--paper); }

/* ---------- calendar: the same days, asked two ways ---------- */

.cal {
  margin-top: 2.5rem;
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 1.4rem 1.4rem 1.6rem;
  background: var(--card);
  backdrop-filter: blur(6px);
}

.cal-switch {
  display: flex;
  gap: 0.15rem;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 0.2rem;
  width: fit-content;
  margin: 0 auto 1.4rem;
}
.cal-switch button {
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0.35rem 1rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.3s ease, background-color 0.3s ease;
}
.cal-switch button:hover { color: var(--paper); }
.cal-switch button[aria-pressed='true'] {
  color: var(--on-accent);
  background: var(--accent);
}

/* The two faces cross-fade in place: it is one calendar answering differently,
   not two screens sliding past each other. */
.cal-face { animation: fade-in 0.45s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.cal-month-label {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--strong);
  margin-bottom: 0.9rem;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-weekdays {
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--dim);
}
.cal-grid { gap: 0.3rem; }

.cal-day {
  aspect-ratio: 1 / 0.74;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.78rem;
  color: var(--paper);
}
.cal-day.out { color: color-mix(in srgb, var(--dim) 45%, transparent); }
.cal-day.today {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.cal-day .pips { display: flex; gap: 2px; height: 4px; }
.cal-day .pips i {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-day .pips i.spark { background: var(--dot-lit); }

.ag-head {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.3rem 0 0.5rem;
}
.ag-head:first-child { margin-top: 0; }
.ag-head.ag-past { color: var(--dim); }

.ag-row {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--faint);
}
.ag-time {
  flex: none;
  width: 5.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding-top: 0.12em;
}
.ag-what { color: var(--paper); }
.ag-row.ag-dim .ag-what { color: var(--dim); }

/* ---------- the two moods, side by side ----------
   Each card is the page it would give you, small. Auto sits under them as a
   line rather than a third card: following the phone is the absence of a
   choice, and shouldn't look like one more thing to pick. */

.moods {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 30rem) { .moods { grid-template-columns: 1fr; } }

.mood {
  border: 1px solid var(--faint);
  border-radius: 16px;
  padding: 1rem;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.mood:hover { transform: translateY(-2px); }
.mood[aria-pressed='true'] {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Fixed colours on purpose: a preview of night has to stay night even while
   you are standing in the morning. */
.mood .swatchcard {
  border-radius: 11px;
  padding: 0.9rem 0.9rem 1rem;
  border: 1px solid;
}
.mood.night .swatchcard {
  background: linear-gradient(160deg, #0d0b14 0%, #160f22 100%);
  border-color: rgba(236, 234, 244, 0.12);
}
.mood.morning .swatchcard {
  background: linear-gradient(160deg, #fbfaf7 0%, #f1eeea 100%);
  border-color: rgba(34, 28, 48, 0.12);
}

.mood .line {
  height: 5px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.mood .line.w1 { width: 82%; }
.mood .line.w2 { width: 64%; }
.mood .line.w3 { width: 45%; margin-bottom: 0; }
.mood.night .line { background: rgba(236, 234, 244, 0.22); }
.mood.morning .line { background: rgba(34, 28, 48, 0.18); }

.mood .pip {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 0.75rem;
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 55%, transparent);
}

.mood .name {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--strong);
}
.mood .what {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--dim);
}

.auto-line {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--dim);
}
.auto-line button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auto-line button[aria-pressed='true'] { color: var(--dim); text-decoration: none; cursor: default; }
/* the line belongs to the cards above it, not to the paragraph after it */
.auto-line + .prose { margin-top: 2.6rem; }

/* ---------- accent picker ---------- */

.accents {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
/* Each swatch carries both of its variants and shows the one the current
   mood would actually use — so the row is a preview, not a legend. */
.accents button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--swatch);
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.7s ease;
}
.accents button:hover { transform: scale(1.15); }
.accents button[aria-pressed="true"] {
  box-shadow:
    0 0 0 2px var(--bg1),
    0 0 0 4px var(--swatch),
    0 0 18px 4px color-mix(in srgb, var(--swatch) 55%, transparent);
}

/* ---------- footer ---------- */

footer {
  padding: 10rem 0 4rem;
  text-align: center;
}
footer .dot {
  width: 12px; height: 12px;
  margin: 0 auto 2rem;
}
footer .signoff {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
}
footer .mail {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--dim);
}
footer .mail:hover { color: var(--paper); }
footer .fine {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--dim) 60%, transparent);
}
footer .fine a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--dim) 40%, transparent);
}
footer .fine a:hover { color: var(--dim); }

/* ---------- plain pages (privacy, terms, support) ---------- */

.page {
  padding: 5rem 0 2rem;
}
.page ul {
  color: var(--dim);
  max-width: 60ch;
  margin-top: 0.6em;
  padding-left: 1.3em;
}
.page li { margin-top: 0.35em; }
.page li strong { color: var(--paper); font-weight: 500; }

.faq { margin-top: 2.4rem; }
.faq details {
  border-top: 1px solid var(--faint);
  padding: 1.15rem 0;
}
.faq details:last-child { border-bottom: 1px solid var(--faint); }
.faq summary {
  font-family: var(--serif);
  font-size: 1.15rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  color: var(--dim);
  font-family: var(--sans);
  flex: none;
}
.faq details[open] summary::after { content: '\2212'; }
.faq details p { color: var(--dim); margin-top: 0.8rem; max-width: 60ch; }
.faq details p + p { margin-top: 0.6rem; }

.page h1 {
  min-height: 0;
  margin: 0 0 1.2rem;
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  text-align: left;
}
.page h2 {
  margin-top: 2.6rem;
  font-size: 1.25rem;
}
.page .updated {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 2.4rem;
}

/* ---------- password reset ---------- */

/* One page, four states — the phone handoff, the browser form, success, and a
   dead link — of which exactly one is ever un-hidden. See reset-password.html. */

.reset .card {
  margin-top: 2rem;
  max-width: 26rem;
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 1.6rem;
  background: var(--card);
  backdrop-filter: blur(6px);
}

.reset .field { margin-bottom: 0.9rem; }
.reset .field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.reset .field input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  /* 16px or larger, or iOS Safari zooms the whole page on focus. */
  font-size: 1rem;
  color: var(--paper);
  background: color-mix(in srgb, var(--paper) 4%, transparent);
  border: 1px solid var(--faint);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.reset .field input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--paper) 7%, transparent);
}
.reset .field input.mismatch {
  border-color: color-mix(in srgb, #f0564c 65%, transparent);
}

.reset .show {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.1rem 0 1.1rem;
  font-size: 0.9rem;
  color: var(--dim);
  cursor: pointer;
  user-select: none;
}
.reset .show input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.reset .alert {
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid color-mix(in srgb, #f0564c 40%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, #f0564c 12%, transparent);
  color: var(--paper);
  font-size: 0.92rem;
  line-height: 1.5;
}

.reset .cta {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.reset .cta:hover { filter: brightness(1.12); }
.reset .cta[disabled] { opacity: 0.4; cursor: default; filter: none; }
.reset form .cta { width: 100%; }

.reset .quiet {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--dim);
}
.reset .card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--paper);
}

/* Last in the section on purpose: these rules tie on specificity with the
   ones above, so [hidden] must come after to keep winning. */
.reset [hidden] { display: none; }

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

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  .dot, .year-dots i.today { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .kept, .cal-face { animation: none; }
  .accents button, .accents button:hover { transform: none; transition: none; }
  .mood, .mood:hover { transform: none; }
  .todo-meter span { transition: none; }
  .thread { display: none; }
}
