/* My Planner: landing page. A warm beige background (--bg), a darker top bar, paper grain, an open notebook. */

/* ------------------------------------------------------------------ tokens */

:root {
  --paper: #FAF7F2;
  --card: #FFFDF8;
  --ink: #2B2420;
  --ink-2: #6A5D54;
  --ink-3: #A08F82;
  --rule: #EADFD1;
  --accent: #B4574A;
  --accent-soft: rgba(180, 87, 74, .12);
  --hover: rgba(80, 55, 35, .06);
  --c-peach: #F6C9A6;
  --c-rose: #EDB1BE;
  --c-lavender: #C7C0EA;
  --c-sage: #BBD5B1;
  --c-sky: #B8D6EB;
  --c-gold: #EBCB86;
  --grain-op: .32;
  --bg: #EDE3D5;       /* page background (warm beige) */
  --bar: #E2D5C2;      /* top bar: one shade darker than the page, so it reads as its own strip */
  --bar-rule: #CFBFA8;
  --shadow: 0 1px 2px rgba(60, 40, 25, .05), 0 12px 32px rgba(60, 40, 25, .08);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

/* Dark mode. index.html sets <html data-theme> from the signed-in account's Light/Dark setting; with nobody
   signed in it follows the computer. The two blocks below hold the same tokens; keep them in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1C1A17;
    --card: #221D18;
    --ink: #F2EADF;
    --ink-2: #C2B4A6;
    --ink-3: #8C7D70;
    --rule: #3A322B;
    --accent: #E48C7C;
    --accent-soft: rgba(228, 140, 124, .14);
    --hover: rgba(255, 240, 220, .07);
    --grain-op: .14;
    --bg: #2A251F;
    --bar: #211D18;
    --bar-rule: #3F372F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1C1A17;
  --card: #221D18;
  --ink: #F2EADF;
  --ink-2: #C2B4A6;
  --ink-3: #8C7D70;
  --rule: #3A322B;
  --accent: #E48C7C;
  --accent-soft: rgba(228, 140, 124, .14);
  --hover: rgba(255, 240, 220, .07);
  --grain-op: .14;
  --bg: #2A251F;
  --bar: #211D18;
  --bar-rule: #3F372F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; text-wrap: balance; }

/* faint paper grain over the beige background */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--grain-op); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .16 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; } }
:root[data-theme="dark"] .grain { mix-blend-mode: screen; }

main, .top, .foot { position: relative; z-index: 2; }

/* ------------------------------------------------------------------ top bar */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 5vw, 56px);
  /* always a darker strip with a line under it, so the bar is set apart from the page */
  background: var(--bar);
  box-shadow: 0 1px 0 var(--bar-rule);
  transition: background .3s, box-shadow .3s;
}
.top.scrolled {
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--bar-rule), 0 6px 18px rgba(43, 36, 32, .08);
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 23px/1 var(--serif); letter-spacing: -.01em; }
.logo svg { color: var(--accent); flex: none; }
.logo.small { font-size: 18px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
/* signed in: a round profile icon (first initial) that opens a small account menu */
.acct { position: relative; }
.acct-btn {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: var(--c); color: #fff; font: 500 19px/1 var(--serif); cursor: pointer;
  box-shadow: 0 0 0 2px var(--bar), 0 0 0 3px var(--bar-rule); transition: box-shadow .2s, transform .2s;
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px var(--c); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 280px; max-width: calc(100vw - 32px); padding: 8px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 16px 40px rgba(43, 36, 32, .16);
}
.acct-menu[hidden] { display: none; }
.acct-who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.acct-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--c); color: #fff; font: 500 22px/1 var(--serif); }
.acct-text { display: grid; gap: 2px; min-width: 0; }
.acct-text strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 18px var(--serif); }
.acct-text span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; color: var(--ink-2); }
.acct-out {
  display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font: 500 14.5px var(--sans); text-align: left; cursor: pointer;
}
.acct-out:hover, .acct-out:focus-visible { background: var(--hover); outline: none; }

.link-btn {
  padding: 10px 16px; border: 0; border-radius: 999px; background: none;
  font-weight: 500; font-size: 15px; cursor: pointer; transition: background .2s;
}
.link-btn:hover { background: var(--hover); }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 500; font-size: 15px;
  cursor: pointer; box-shadow: 0 6px 18px rgba(43, 36, 32, .18);
  transition: transform .2s, box-shadow .2s;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(43, 36, 32, .22); }
.pill.big { padding: 15px 28px; font-size: 16.5px; }
.pill.full { width: 100%; justify-content: center; }
.pill svg { transition: transform .2s; }
.pill:hover svg { transform: translateX(3px); }


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

.hero {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(36px, 5vw, 84px);
  max-width: 1280px; min-height: calc(100vh - 76px); margin: 0 auto;
  padding: clamp(24px, 6vh, 72px) clamp(16px, 5vw, 56px) 96px;
}
/* the features section follows the hero closely, with about the same gap as before the Journal section */
.hero + .features { padding-top: 0; }

.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }

h1 { margin: 0 0 26px; font-size: clamp(42px, 5.8vw, 80px); line-height: 1.03; }
.hand { position: relative; display: inline-block; font-style: italic; color: var(--accent); white-space: nowrap; }
.hand svg { position: absolute; left: -2%; bottom: -.12em; width: 104%; height: .32em; overflow: visible; }
.hand path {
  fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; opacity: .7;
  stroke-dasharray: 320; stroke-dashoffset: 320; animation: draw 1.6s .5s cubic-bezier(.6, .1, .3, 1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 34px 0 18px; }
.hero .cta { margin-top: 12px; }
.cta.center { justify-content: center; }


/* ------------------------------------------------------------------ notebook */

.notebook {
  --nb-paper: #FFFCF5; --nb-ink: #2B2420; --nb-faint: #9C8B7E; --nb-rule: #E8DCCB; --nb-red: rgba(205, 105, 92, .45);
  --lh: 4.3cqw;
  position: relative; container-type: inline-size;
  display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1.42; margin: 0;
  transform: rotate(-2.5deg);
  filter: drop-shadow(0 30px 40px rgba(60, 40, 25, .2)) drop-shadow(0 4px 8px rgba(60, 40, 25, .08));
  animation: float 10s ease-in-out infinite alternate;
}
@keyframes float { from { translate: 0 0; } to { translate: 0 -10px; } }

.page {
  position: relative; overflow: hidden; margin: 0;
  padding: calc(var(--lh) * .9) 3.4cqw;
  background-color: var(--nb-paper); color: var(--nb-ink);
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), var(--nb-rule) calc(var(--lh) - 1px));
  background-size: 100% var(--lh); background-position: 0 calc(var(--lh) * .9);
  line-height: var(--lh);
}
.page p { margin: 0; }
.page.left { border-radius: 2.2cqw .4cqw .4cqw 2.2cqw; box-shadow: inset -3cqw 0 3cqw -2.4cqw rgba(80, 55, 35, .25); padding-left: 6.4cqw; }
.page.left::before { content: ""; position: absolute; top: 0; bottom: 0; left: 4.8cqw; width: 1px; background: var(--nb-red); }
.page.right { border-radius: .4cqw 2.2cqw 2.2cqw .4cqw; box-shadow: inset 3cqw 0 3cqw -2.4cqw rgba(80, 55, 35, .25); }

.nb-date { font-size: 1.45cqw; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--nb-faint); }
.nb-hello { font: italic 3.3cqw/var(--lh) var(--serif); }
.nb-typed { min-height: calc(var(--lh) * 2); font: italic 2.2cqw/var(--lh) var(--serif); }
.caret { display: inline-block; width: .2cqw; height: 2.4cqw; margin-left: .2cqw; vertical-align: -.4cqw; background: #B4574A; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }


/* section labels like the planner's card titles; each sits on its own ruled line */
.nb-label { margin-top: var(--lh) !important; font-size: 1.35cqw; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--nb-faint); }
.page.left .nb-label:first-of-type { margin-top: 0 !important; }
.page.right .nb-label:first-of-type { margin-top: calc(var(--lh) * 2) !important; }
/* to-do rows: square checkboxes like the planner, done ones ticked and struck through */
.nb-list { list-style: none; margin: 0; padding: 0; font: 2.15cqw/var(--lh) var(--serif); }
.nb-list li { display: flex; align-items: center; gap: 1.2cqw; white-space: nowrap; }
.nb-list i { position: relative; flex: none; width: 1.9cqw; height: 1.9cqw; border: .22cqw solid #8A7B6E; border-radius: .45cqw; }
.nb-list .done { color: var(--nb-faint); text-decoration: line-through; }
.nb-list .done i { background: #7A9E7E; border-color: #7A9E7E; }
.nb-list .done i::after {
  content: ""; position: absolute; left: .45cqw; top: .1cqw; width: .55cqw; height: 1cqw;
  border-right: .28cqw solid #fff; border-bottom: .28cqw solid #fff; transform: rotate(40deg);
}
/* priorities: only the text is struck through, not the number */
.nb-pri .done { text-decoration: none; }
.nb-pri .done span { text-decoration: line-through; }
.nb-pri b { display: inline-block; width: 1.6cqw; font: 600 2cqw var(--serif); color: var(--nb-faint); text-decoration: none; }
/* habits: a coloured circle per habit, filled once done */
.nb-habit-list { list-style: none; margin: 0; padding: 0; font: 2.15cqw/var(--lh) var(--serif); }
.nb-habit-list li { display: flex; align-items: center; gap: 1.2cqw; }
.nb-habit-list i { position: relative; flex: none; width: 2.1cqw; height: 2.1cqw; border-radius: 50%; border: .25cqw solid var(--c); }
.nb-habit-list .done i { background: var(--c); }
.nb-habit-list .done i::after {
  content: ""; position: absolute; left: .55cqw; top: .2cqw; width: .5cqw; height: .95cqw;
  border-right: .26cqw solid #fff; border-bottom: .26cqw solid #fff; transform: rotate(40deg);
}
/* mood: five faces, one picked */
.nb-moods { display: flex; gap: 1.3cqw; height: var(--lh); align-items: center; color: #B3A496; }
.nb-moods span { display: inline-grid; width: 3.2cqw; height: 3.2cqw; }
.nb-moods svg { width: 100%; height: 100%; }
.nb-moods .on { color: #5A7F4A; transform: scale(1.12); }

.notebook::after {
  content: ""; position: absolute; top: 1%; bottom: 1%; left: 50%; width: 2px; transform: translateX(-1px);
  background: linear-gradient(to bottom, transparent, rgba(80, 55, 35, .25) 10% 90%, transparent);
}

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

section { padding: clamp(64px, 11vh, 128px) clamp(16px, 5vw, 56px); }
.section-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.section-head .kicker { justify-content: center; }
.section-head .kicker::after { content: ""; width: 28px; height: 1px; background: currentColor; }
h2 { margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.08; }
.section-lede { margin: 18px auto 0; max-width: 36em; color: var(--ink-2); font-size: 17.5px; }


/* features */
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; max-width: 1200px; margin: 0 auto; }
.feature {
  padding: 16px 16px 26px; border-radius: 22px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); transition: transform .3s;
}
.feature:hover { transform: translateY(-4px) rotate(-.4deg); }
.feature h3 { margin: 20px 10px 6px; font-size: 27px; }
.feature p { margin: 0 10px; color: var(--ink-2); font-size: 15.5px; }
.feature:nth-child(2) { transition-delay: .08s; }
.feature:nth-child(3) { transition-delay: .16s; }
.feature:nth-child(4) { transition-delay: .24s; }

.art {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; padding: 16px;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--wash) 90%, #fff) 0, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--wash) 75%, #fff), color-mix(in srgb, var(--wash) 95%, #000 5%));
}
.art > div { height: 100%; background: #FFFCF5; border-radius: 8px; box-shadow: 0 6px 16px rgba(60, 40, 25, .14); }
/* Mini planner pages. Sizes are in cqw (percent of the sketch's width) so they scale with the card. */
.art > div { container-type: inline-size; overflow: hidden; }
.art p { margin: 0; }
.art u { display: block; text-decoration: none; }
.art .lbl { width: 22cqw; height: 1.6cqw; margin: 0 0 1.8cqw; border-radius: 1cqw; background: #D9CBB8; }
/* a to-do row: square checkbox + a line of "text" */
.art .r { display: flex; align-items: center; gap: 2.2cqw; height: 5cqw; }
.art .r i { flex: none; width: 3.4cqw; height: 3.4cqw; border: .5cqw solid #A89888; border-radius: .9cqw; box-sizing: border-box; }
.art .r u { height: 1.5cqw; border-radius: 1cqw; background: #E3D6C5; }
.art .r.done i { background: #7A9E7E; border-color: #7A9E7E; }
.art .r.done u { background: #EFE6DA; }
.art .r b { width: 3cqw; font: 600 3.4cqw/1 var(--serif); color: #B3A496; }

/* day */
/* (the sketch's own padding is in %, not cqw: cqw on the container itself would measure the window) */
.art-day > div { padding: 7% 8%; transform: rotate(-2deg); }
.art-day .pri { margin-bottom: 3cqw; }
.art-day .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6cqw; }
.art-day .day-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 3.5cqw; padding-top: 3cqw; border-top: .4cqw solid #EFE6DA; }
.art-day .habits, .art-day .moods { display: flex; gap: 2cqw; }
.art-day .habits i { width: 4cqw; height: 4cqw; border-radius: 50%; border: .6cqw solid var(--c); box-sizing: border-box; }
.art-day .habits i.done { background: var(--c); }
.art-day .moods i { width: 4cqw; height: 4cqw; border-radius: 50%; border: .5cqw solid #C8BAAA; box-sizing: border-box; }
.art-day .moods i.on { border-color: #5A7F4A; background: #DCE8D3; }

/* week */
.art-week > div { padding: 6% 7%; transform: rotate(1.5deg); }
.art-week .lists { display: grid; grid-template-columns: 1fr 1fr; gap: 5cqw; margin-bottom: 4cqw; }
.art-week .lists .lbl { margin-bottom: 1cqw; }
.art-week .item { margin-bottom: 1cqw; }
.art-week .pick { display: flex; gap: .9cqw; padding-left: 5.6cqw; }
.art-week .pick i { width: 2.4cqw; height: 2.4cqw; border-radius: .7cqw; border: .35cqw solid #D3C6B6; box-sizing: border-box; }
.art-week .pick i.on { background: #7A9E7E; border-color: #7A9E7E; }
.art-week .strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #E8DDCF; border: 1px solid #E8DDCF; border-radius: 1.5cqw; overflow: hidden; }
.art-week .strip span { display: flex; flex-direction: column; gap: 1.2cqw; min-height: 17cqw; padding: 1.6cqw 1.4cqw; background: #FFFCF5; }
.art-week .strip span.past { background: #F6F0E7; }
.art-week .strip b { align-self: flex-end; width: 2.6cqw; height: 2.6cqw; border-radius: 50%; background: #D9CBB8; }
.art-week .strip span.today b { background: #7A9E7E; }
.art-week .strip i { height: 1.3cqw; border-radius: 1cqw; background: #CFDCE8; }
.art-week .strip i.done { background: #E5DCD0; }

/* month */
.art-month > div { padding: 6% 7%; transform: rotate(-1.5deg); }
.art-month .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqw; margin-bottom: 3.5cqw; }
.art-month .cards > div { padding: 2.4cqw; border-radius: 1.6cqw; background: #F7F1E8; }
.art-month .cards .lbl { width: 60%; margin-bottom: 1.6cqw; }
.art-month .cards u { height: 1.4cqw; margin-top: 1.4cqw; border-radius: 1cqw; background: #E3D6C5; }
.art-month .cards .r { height: 4.2cqw; gap: 1.4cqw; }
.art-month .cards .r u { margin-top: 0; }
.art-month .cards .r i { width: 2.8cqw; height: 2.8cqw; }
.art-month .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.art-month .cal span { position: relative; height: 6.2cqw; background: #FFFCF5; outline: 1px solid #E8DDCF; }
.art-month .cal span.blank { outline: 0; background: none; }
.art-month .cal span.past { background: #F6F0E7; }
.art-month .cal span.today::before { content: ""; position: absolute; top: .8cqw; left: .8cqw; width: 2.6cqw; height: 2.6cqw; border-radius: 50%; background: #7A9E7E; }
.art-month .cal span i { position: absolute; left: 1cqw; right: 1.4cqw; bottom: 1.2cqw; height: 1.1cqw; border-radius: 1cqw; background: #B9CDB1; }

/* year */
.art-year > div { padding: 6% 7%; transform: rotate(2deg); }
.art-year .quote { width: 58%; height: 2.4cqw; margin: 0 auto 4cqw; border-radius: 1.5cqw; background: #D9CBB8; }
.art-year .vision { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4cqw; margin-bottom: 4cqw; }
.art-year .vision span { padding: 1.8cqw 1.6cqw; border-radius: 1.4cqw; border-top: .9cqw solid var(--c); background: color-mix(in srgb, var(--c) 10%, #FFFCF5); }
.art-year .vision .r { height: 3.6cqw; gap: 1.2cqw; }
.art-year .vision .r i { width: 2.6cqw; height: 2.6cqw; border-width: .4cqw; }
.art-year .vision .r u { height: 1.1cqw; }
.art-year .heat { display: grid; grid-template-columns: repeat(16, 1fr); gap: .8cqw; }
/* plain year calendar (no task shading) with reminder dots, like the planner's Year page */
.art-year .heat i { position: relative; aspect-ratio: 1; border-radius: .6cqw; background: #EBDDC4; }
.art-year .heat i.future { background: #E3CFAC; }
.art-year .heat i.today { background: #E3CFAC; box-shadow: 0 0 0 .4cqw #3A332B; }
.art-year .heat i b { position: absolute; left: 50%; bottom: 14%; width: 1.3cqw; height: 1.3cqw; margin-left: -.65cqw; border-radius: 50%; background: var(--rc); }

/* habits */
.habits-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 6vw, 96px); max-width: 1200px; margin: 0 auto; }
.habits-copy p:not(.kicker) { margin: 22px 0 0; color: var(--ink-2); font-size: 17.5px; max-width: 32em; }
.ticks { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: baseline; color: var(--ink-2); }
.ticks li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.habit-art {
  margin: 0; padding: 28px; border-radius: 26px; transform: rotate(1.5deg);
  background: color-mix(in srgb, var(--card) 78%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
/* a copy of the planner's habit card (css/styles.css .habit-card / .heat): name, meta line, three
   stats, then this month as numbered squares that fill in with colour when the card scrolls into view */
/* the planner's first habit colour (green), so a red ✗ day stands apart from the ticked ones */
.habit-art { --c: #7A9E7E; width: 100%; max-width: 440px; justify-self: center; }
.habit-art figcaption { display: flex; align-items: center; gap: 10px; font: 22px/1.3 var(--serif); }
.habit-art .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--c); }
.hc-meta { margin: 2px 0 16px 23px; font-size: 13px; color: var(--ink-3); }
.hc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.hc-num { font: 28px/1.1 var(--serif); }
.hc-num small { margin-left: 3px; font: 13px var(--sans); color: var(--ink-3); }
.hc-label { font-size: 12.5px; color: var(--ink-3); }
.hc-label span { display: block; font-size: 11.5px; }
.habit-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.habit-grid b { padding-bottom: 2px; text-align: center; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.habit-grid i {
  display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border-radius: 7px;
  font: 500 12.5px/1 var(--sans); font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink);
  background: color-mix(in srgb, var(--c) 14%, color-mix(in srgb, var(--ink) 5%, transparent));
  transition: background .5s ease, color .5s ease, transform .5s ease; transition-delay: var(--d, 0s);
}
.habit-grid i.later { opacity: .75; }
.habit-grid i.today { box-shadow: inset 0 0 0 2px var(--c); font-weight: 700; }
.habit-art.in .habit-grid i.on { background: var(--c); color: #fff; font-weight: 600; transform: scale(1); }
.habit-art.in .habit-grid i.x { background: var(--danger, #B4533E); color: #fff; transform: scale(1); }
.habit-art:not(.in) .habit-grid i.on, .habit-art:not(.in) .habit-grid i.x { transform: scale(.85); }

/* journal: a lined entry page beside a small calendar of the days written */
.journal-band { padding-top: 0; }
.journal-art { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; margin: 0; transform: rotate(-1.2deg); }
.ja-page {
  --lh: 30px;
  padding: 22px 24px 26px; border-radius: 18px; background-color: #FFFCF5; color: #2B2420;
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), #E8DCCB calc(var(--lh) - 1px));
  background-size: 100% var(--lh); background-position: 0 70px; /* first rule at 70px = padding-top 22 + header 48 */
  box-shadow: var(--shadow);
}
.ja-page p { margin: 0; }
.ja-head { height: 48px; margin: -22px -24px 0; padding: 22px 24px 0; box-sizing: content-box; background: #FFFCF5; border-radius: 18px 18px 0 0; }
.ja-date { font: 600 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #9C8B7E; }
.ja-count { margin-top: 6px !important; font-size: 12.5px; color: #B3A496; }
.ja-text { font: 18px/var(--lh) var(--serif); }
.ja-text.faint { margin-top: var(--lh) !important; font-style: italic; color: #9C8B7E; }
.ja-cal { padding: 18px 16px; border-radius: 18px; background: color-mix(in srgb, var(--card) 85%, transparent); box-shadow: var(--shadow); transform: rotate(2.4deg) translateY(28px); }
.ja-cal-title { margin: 0 0 10px; font: 16px var(--serif); text-align: center; }
.ja-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 3px; text-align: center; }
.ja-grid b { padding-bottom: 2px; font-size: 10px; font-weight: 600; color: var(--ink-3); }
/* each day: the number in a 20px circle, then a 4px row for the dot, so every dot lines up neatly */
.ja-grid span { display: flex; flex-direction: column; align-items: center; gap: 0; height: 24px; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ja-grid em { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; line-height: 1; }
/* tucked up just under the digits (the 20px circle leaves room below the number) */
.ja-grid span::after { content: ""; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; }
.ja-grid span.today::after { margin-top: 1px; } /* below today's filled circle, not on it */
.ja-grid span.wrote { font-weight: 700; color: var(--ink); }
.ja-grid span.wrote::after { background: #7A9E7E; }
.ja-grid span.today em { background: #7A9E7E; color: #fff; }
.ja-grid span.later { opacity: .4; }

/* closing */
.closing { text-align: center; padding-bottom: clamp(80px, 14vh, 160px); }
.closing h2 { font-size: clamp(38px, 5.4vw, 72px); font-style: italic; }
.closing > p { margin: 16px 0 0; color: var(--ink-2); font-size: 18px; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  padding: 28px clamp(16px, 5vw, 56px) 40px; border-top: 1px solid var(--rule);
  color: var(--ink-3); font-size: 14px;
}

/* reveal on scroll (only once JS has marked the page) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ sign in / sign up */

dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  background: transparent; color: var(--ink); overflow: visible;
}
dialog::backdrop { background: rgba(30, 22, 16, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog[open] { animation: rise .35s cubic-bezier(.2, .8, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.auth-card {
  position: relative; max-height: calc(100vh - 32px); overflow: auto;
  padding: 36px 32px 26px; border-radius: 24px; background: var(--card);
  box-shadow: 0 30px 80px rgba(30, 20, 10, .3);
  background-image: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--c-peach) 35%, transparent), transparent 45%),
                    radial-gradient(circle at 0 100%, color-mix(in srgb, var(--c-lavender) 30%, transparent), transparent 45%);
}
.auth-close {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer;
}
.auth-close:hover { background: var(--hover); color: var(--ink); }
.auth-card h2 { font-size: 34px; margin-bottom: 6px; }
.auth-sub { margin: 0 0 26px; color: var(--ink-2); }
.auth-label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.auth-input {
  width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--paper); font: 18px var(--serif); outline: none; transition: border-color .2s, box-shadow .2s;
}
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-error { min-height: 22px; margin: 6px 2px 10px; color: var(--accent); font-size: 13.5px; }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: 14.5px; color: var(--ink-2); }
.text-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--rule); font-size: 12.5px; color: var(--ink-3); }

.profile-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.profile-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 70%, transparent); text-align: left; cursor: pointer; transition: border-color .2s, transform .2s;
}
.profile-btn:hover { border-color: var(--accent); transform: translateX(2px); }
.profile-btn .avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: #fff; font: 20px var(--serif); }
.profile-btn .avatar svg { width: 22px; height: 22px; }
.profile-btn .who { flex: 1; min-width: 0; }
.profile-btn strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 18px var(--serif); }
.profile-btn small { color: var(--ink-3); font-size: 13px; }
.profile-btn .go { color: var(--ink-3); }
.empty-profiles { padding: 22px; border: 1px dashed var(--rule); border-radius: 16px; text-align: center; color: var(--ink-2); }
/* sign in / create an account */
.auth-switch.is-lead { margin: -12px 0 18px; text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 52px; }
.pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer;
}
.pw-toggle svg { display: block; }
.pw-toggle:hover { background: var(--hover); color: var(--ink); }
.auth-input + .auth-label, .pw-wrap + .auth-label { margin-top: 16px; }
form .auth-error + .pill { margin-top: 2px; }
form.is-busy .pill { opacity: .6; pointer-events: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--ink-3); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px 20px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper);
  color: var(--ink); font: 600 15.5px var(--sans); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.google-btn span { display: inline-grid; }
.google-btn:hover { border-color: var(--ink-3); box-shadow: 0 4px 14px rgba(43, 36, 32, .08); }
/* password help: the "can't be recovered" hint, the Forgot password link, and the forgot-password form */
.auth-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.auth-forgot { margin: 8px 2px 0; text-align: right; font-size: 13px; }
.auth-check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 2px 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.auth-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.pill.danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.danger:hover { filter: brightness(.95); }
.auth-note { min-height: 0; margin: 8px 2px 0; font-size: 13.5px; color: var(--ink-2); text-align: center; }
.auth-note:empty { display: none; }
.opening { padding: 30px 0 16px; text-align: center; font: italic 22px var(--serif); color: var(--ink-2); }

/* ------------------------------------------------------------------ responsive & motion */

@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-bottom: 72px; }
  .notebook { width: min(620px, 100%); justify-self: center; margin-top: 8px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .habits-band { grid-template-columns: minmax(0, 1fr); }
  /* stacked: the journal text comes first, like the habits section */
  .journal-band .habits-copy { order: -1; }
}
@media (max-width: 560px) {
  .journal-art { grid-template-columns: minmax(0, 1fr); }
  .ja-cal { transform: none; max-width: 300px; justify-self: center; }
}
@media (max-width: 560px) {
  .top { padding: 12px 16px; }
  .logo { font-size: 20px; }
  .logo svg { width: 26px; height: 26px; }
  .link-btn { padding: 9px 12px; }
  .pill { padding: 9px 16px; }
  .pill.big { padding: 14px 22px; }
  /* Day / Week / Month / Year cards: two per row and more compact, instead of four full-width cards */
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .feature { padding: 8px 8px 14px; border-radius: 16px; }
  .feature:hover { transform: none; }
  .art { padding: 8px; border-radius: 10px; }
  .art > div { border-radius: 5px; }
  .feature h3 { margin: 10px 4px 4px; font-size: 20px; }
  .feature p { margin: 0 4px; font-size: 13px; line-height: 1.45; }
  .auth-card { padding: 30px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .hand path { stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; }
}
