/* ==========================================================================
   Heaven's Library — a quiet place where thoughts are listened to.
   Frosted glass over soft colour.
   ========================================================================== */

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

:root {
  --bg: #fbf7f2;
  --bg-soft: #f5ede4;
  --surface: #fffdfa;
  --ink: #2d2522;
  --ink-soft: #5c504a;
  --ink-faint: #6b5d55;
  --line: #ebe0d5;
  --line-glass: rgba(120, 86, 66, .14);
  --accent: #a64f48;
  --accent-strong: #8c3e38;
  --accent-soft: #f6e1db;
  --on-accent: #fffaf6;

  /* Glass */
  --glass: rgba(255, 252, 248, .5);
  --glass-strong: rgba(255, 252, 248, .74);
  --glass-hover: rgba(255, 252, 248, .66);
  --glass-soft: rgba(255, 252, 248, .3);
  --glass-solid: #fdf8f3;
  --glass-border: rgba(255, 255, 255, .72);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .8);
  --glass-shadow: 0 1px 1px rgba(74, 45, 35, .04), 0 12px 40px -16px rgba(74, 45, 35, .24);
  --glass-shadow-lift: 0 2px 4px rgba(74, 45, 35, .05), 0 24px 56px -20px rgba(74, 45, 35, .32);
  --glass-blur: blur(22px) saturate(165%);

  /* Soft colour behind the glass */
  --glow-rose: rgba(240, 158, 148, .58);
  --glow-lav: rgba(188, 166, 240, .52);
  --glow-peach: rgba(255, 200, 146, .52);
  --glow-sky: rgba(150, 198, 240, .42);
  --glow-sage: rgba(168, 214, 178, .4);
  --glow-rose-solid: #e9a198;
  --glow-lav-solid: #b9a6e6;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-text: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  --radius: 22px;
  --radius-small: 14px;
  --radius-large: 28px;
  --wrap: 112rem;
  --gutter: clamp(1rem, 3.2vw, 3rem);
  --header-space: 5.25rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1619;
    --bg-soft: #221d21;
    --surface: #251f24;
    --ink: #f3ebe4;
    --ink-soft: #cbbfb7;
    --ink-faint: #b5a8a1;
    --line: #3a3138;
    --line-glass: rgba(255, 255, 255, .09);
    --accent: #ef9f94;
    --accent-strong: #f6b8ae;
    --accent-soft: #3b2528;
    --on-accent: #1a1619;
    --glass: rgba(44, 36, 43, .46);
    --glass-strong: rgba(36, 30, 35, .74);
    --glass-hover: rgba(52, 43, 51, .6);
    --glass-soft: rgba(44, 36, 43, .26);
    --glass-solid: #241f24;
    --glass-border: rgba(255, 255, 255, .1);
    --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .06);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 14px 44px -16px rgba(0, 0, 0, .65);
    --glass-shadow-lift: 0 2px 4px rgba(0, 0, 0, .25), 0 26px 60px -20px rgba(0, 0, 0, .75);
    --glow-rose: rgba(196, 88, 110, .36);
    --glow-lav: rgba(112, 84, 196, .4);
    --glow-peach: rgba(196, 122, 80, .22);
    --glow-sky: rgba(68, 110, 182, .3);
    --glow-sage: rgba(66, 130, 100, .2);
    --glow-rose-solid: #e08f8c;
    --glow-lav-solid: #9f88dd;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1619;
  --bg-soft: #221d21;
  --surface: #251f24;
  --ink: #f3ebe4;
  --ink-soft: #cbbfb7;
  --ink-faint: #b5a8a1;
  --line: #3a3138;
  --line-glass: rgba(255, 255, 255, .09);
  --accent: #ef9f94;
  --accent-strong: #f6b8ae;
  --accent-soft: #3b2528;
  --on-accent: #1a1619;
  --glass: rgba(44, 36, 43, .46);
  --glass-strong: rgba(36, 30, 35, .74);
  --glass-hover: rgba(52, 43, 51, .6);
    --glass-soft: rgba(44, 36, 43, .26);
  --glass-solid: #241f24;
  --glass-border: rgba(255, 255, 255, .1);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .06);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 14px 44px -16px rgba(0, 0, 0, .65);
  --glass-shadow-lift: 0 2px 4px rgba(0, 0, 0, .25), 0 26px 60px -20px rgba(0, 0, 0, .75);
  --glow-rose: rgba(196, 88, 110, .36);
  --glow-lav: rgba(112, 84, 196, .4);
  --glow-peach: rgba(196, 122, 80, .22);
  --glow-sky: rgba(68, 110, 182, .3);
  --glow-sage: rgba(66, 130, 100, .2);
  --glow-rose-solid: #e08f8c;
  --glow-lav-solid: #9f88dd;
  color-scheme: dark;
}

/* Browsers that can't blur behind elements get solid panels instead. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, :root[data-theme] {
    --glass: var(--glass-solid);
    --glass-strong: var(--glass-solid);
    --glass-hover: var(--glass-solid);
    --glass-soft: var(--glass-solid);
  }
}

/* Mood colours: each pill gets a soft background and a readable ink. */
.mood--rose     { --m-bg: #f9e0dc; --m-fg: #8b3a35; }
.mood--peach    { --m-bg: #fbe5d3; --m-fg: #87461c; }
.mood--honey    { --m-bg: #f6ebc6; --m-fg: #6a5110; }
.mood--sage     { --m-bg: #e1ebdb; --m-fg: #3b5735; }
.mood--sky      { --m-bg: #dbe9f4; --m-fg: #2b526e; }
.mood--lavender { --m-bg: #e9e0f5; --m-fg: #573f82; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mood--rose     { --m-bg: rgba(233, 140, 132, .18); --m-fg: #f3b3ab; }
  :root:not([data-theme="light"]) .mood--peach    { --m-bg: rgba(240, 168, 112, .18); --m-fg: #f5c49c; }
  :root:not([data-theme="light"]) .mood--honey    { --m-bg: rgba(230, 196, 96, .17);  --m-fg: #ead28a; }
  :root:not([data-theme="light"]) .mood--sage     { --m-bg: rgba(146, 186, 132, .17); --m-fg: #b8d6ab; }
  :root:not([data-theme="light"]) .mood--sky      { --m-bg: rgba(118, 168, 214, .18); --m-fg: #a9cbea; }
  :root:not([data-theme="light"]) .mood--lavender { --m-bg: rgba(168, 140, 226, .19); --m-fg: #cdbcf2; }
}
:root[data-theme="dark"] .mood--rose     { --m-bg: rgba(233, 140, 132, .18); --m-fg: #f3b3ab; }
:root[data-theme="dark"] .mood--peach    { --m-bg: rgba(240, 168, 112, .18); --m-fg: #f5c49c; }
:root[data-theme="dark"] .mood--honey    { --m-bg: rgba(230, 196, 96, .17);  --m-fg: #ead28a; }
:root[data-theme="dark"] .mood--sage     { --m-bg: rgba(146, 186, 132, .17); --m-fg: #b8d6ab; }
:root[data-theme="dark"] .mood--sky      { --m-bg: rgba(118, 168, 214, .18); --m-fg: #a9cbea; }
:root[data-theme="dark"] .mood--lavender { --m-bg: rgba(168, 140, 226, .19); --m-fg: #cdbcf2; }


/* ---- Glass ----------------------------------------------------------------
   Every panel on the site shares the same frosted look.
   -------------------------------------------------------------------------- */

:is(
  .header-bar, .search-panel, .footer-bar, .toast,
  .latest, .card, .mood-panel, .btn-ghost,
  .side-card, .post-paper, .post-nav-link, .whisper, .whisper-form, .notice,
  .archive-month-card, .about-card, .about-letter, .center-card,
  .desk-panel, .desk-paper, .panel
) {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-inner);
}

/* Panels you read long text on are a little more opaque. */
:is(.post-paper, .about-letter, .desk-paper, .latest, .center-card) { background: var(--glass-strong); }

/* Things that come in groups (cards, notes, months) use a lighter glass with
   no edge or shadow, so the page doesn't fill up with boxes. They firm up on hover. */
:is(.card, .post-nav-link, .whisper, .archive-month-card, .mood-panel) {
  background: var(--glass-soft);
  border-color: transparent;
  box-shadow: none;
}


/* ---- Base ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

/* Grow everything a little on very large screens so nothing feels lost. */
@media (min-width: 1800px) { html { font-size: 112.5%; } }
@media (min-width: 2300px) { html { font-size: 125%; } }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  font-optical-sizing: auto;
  line-height: 1.65;
  overflow-x: hidden;
  /* A very long word or link (no spaces) breaks onto the next line instead
     of pushing the page wider than the screen. Normal words are never split. */
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s ease, color .3s ease;
}

/* Soft paper grain over everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

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

::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 420;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 999px;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 1rem; color: var(--bg); }

.eyebrow {
  font-family: var(--font-text);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .9rem;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1.2;
}

.meta {
  font-size: .9rem;
  color: var(--ink-faint);
  font-variant-numeric: oldstyle-nums;
}
.meta a { color: inherit; }

.muted { color: var(--ink-faint); font-style: italic; }


/* ---- The colourful background -------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}
.ambient span:nth-child(1) { width: 48vmax; height: 48vmax; top: -18vmax; right: -14vmax; background: var(--glow-rose); }
.ambient span:nth-child(2) { width: 42vmax; height: 42vmax; top: 22vh; left: -18vmax; background: var(--glow-lav); }
.ambient span:nth-child(3) { width: 36vmax; height: 36vmax; bottom: -20vmax; right: 14vw; background: var(--glow-peach); }
.ambient span:nth-child(4) { width: 30vmax; height: 30vmax; top: 34vh; right: -12vmax; background: var(--glow-sky); }
.ambient span:nth-child(5) { width: 26vmax; height: 26vmax; bottom: -10vmax; left: 18vw; background: var(--glow-sage); }

/* The colours drift slowly on the home page only (it keeps scrolling smooth elsewhere). */
.page-home .ambient span { animation: drift 28s ease-in-out infinite alternate; }
.page-home .ambient span:nth-child(2) { animation-duration: 34s; animation-delay: -8s; }
.page-home .ambient span:nth-child(3) { animation-duration: 31s; animation-delay: -15s; }
.page-home .ambient span:nth-child(4) { animation-duration: 37s; animation-delay: -4s; }
.page-home .ambient span:nth-child(5) { animation-duration: 25s; animation-delay: -19s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-4vmax, 3vmax) scale(1.08); }
  100% { transform: translate(3vmax, -2vmax) scale(.95); }
}


/* ---- Buttons & links ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 1rem/1.2 var(--font-text);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.btn-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 22%, transparent);
  font-size: .8rem;
}

.btn-ghost { background: var(--glass); border-color: var(--glass-border); color: var(--ink); }
.btn-ghost:hover { background: var(--glass-hover); color: var(--ink); border-color: var(--glass-border); box-shadow: var(--glass-shadow-lift), var(--glass-inner); }

.btn-small { padding: .5rem 1.05rem; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-danger { background: #a33a35; border-color: #a33a35; color: #fff; }
.btn-danger:hover { background: #862d29; border-color: #862d29; color: #fff; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .18em;
}
.link-quiet { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.link-quiet:hover { color: var(--accent); text-decoration: underline; }
.link-danger:hover { color: #b8433d; }
.inline-form { display: inline; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--glass-hover); border-color: var(--glass-border); color: var(--ink); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Show the moon in light mode, the sun in dark mode. */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}


/* ---- Pills (moods) ------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .75rem .26rem;
  border-radius: 999px;
  background: var(--m-bg, var(--bg-soft));
  color: var(--m-fg, var(--ink-soft));
  font-size: .85rem;
  font-style: italic;
  line-height: 1.4;
  text-decoration: none;
  max-width: 100%;  /* an unusually long mood name wraps instead of overflowing */
  transition: transform .2s, box-shadow .2s;
}
.pill:hover { color: var(--m-fg); transform: translateY(-1px); box-shadow: 0 6px 14px -8px var(--m-fg); }
.pill-count { font-style: normal; font-size: .75rem; opacity: .7; }

.mood-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }


/* ---- Social icons -------------------------------------------------------- */

.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.social a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-soft);
  transition: color .2s, background-color .2s, border-color .2s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s;
}
.social a:hover {
  color: var(--accent);
  background: var(--glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-lift), var(--glass-inner);
}
.social svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social .dot { fill: currentColor; stroke: none; }

.social--footer { gap: .1rem; }
.social--footer a { width: 2.2rem; height: 2.2rem; background: transparent; border-color: transparent; }
.social--footer a:hover { border-color: var(--glass-border); }
.social--footer svg { width: 1.1rem; height: 1.1rem; }

.social--small { grid-column: 1 / -1; }
.social--small a { width: 2.2rem; height: 2.2rem; }
.social--small svg { width: 1.05rem; height: 1.05rem; }

/* Settings (Writing desk): links & photo on the left, signing in on the right */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(min(100%, 20rem), 1fr);
  gap: 1.25rem;
  align-items: start;
  padding-bottom: 3rem;
}
.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.settings-nudge { margin-bottom: 1.25rem; text-align: left; }
.settings-side { display: grid; gap: 1.25rem; }
.settings-about-help { margin-bottom: .9rem; }

/* About page editor and the "Edit this page" link only Heaven sees */
.about-intro-field { margin-top: 1rem; }
.about-reset { margin-top: .9rem; font-size: .9rem; }
.edit-page-link {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: -.5rem -.5rem 1rem 1rem;
  padding: .4rem .9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  color: var(--accent);
  font-size: .9rem;
  text-decoration: none;
}
.edit-page-link:hover { background: var(--accent-soft); color: var(--accent-strong); }
.edit-page-link svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.settings-item + .settings-item { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line-glass); }
.settings-item-title { font-size: 1.15rem; font-weight: 420; }
.settings-item .field-help { margin: .35rem 0 .8rem; }

/* Recovery codes */
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: .5rem 1rem;
  margin: 1.5rem 0 .5rem;
  padding: 1rem 1.25rem 1rem 2.5rem;
  border: 1px dashed var(--line-glass);
  border-radius: var(--radius-small);
  background: var(--glass-soft);
  text-align: left;
}
.recovery-codes code { font: 500 1.05rem/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; white-space: nowrap; }

/* Forgot password: the two ways back in */
.reset-option { margin-top: 1.5rem; }
.reset-option .page-intro { margin-bottom: 1rem; }
.reset-or { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; color: var(--ink-faint); font-style: italic; }
.reset-or::before, .reset-or::after { content: ""; flex: 1; border-top: 1px solid var(--line-glass); }
.profile-help { margin-bottom: 1rem; }
.social-field { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; align-items: start; }
.social-field + .social-field { margin-top: 1rem; }
.social-field-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 1.55rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-soft);
}
.social-field-icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.social-field-icon .dot { fill: currentColor; stroke: none; }
.profile-photo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.profile-photo .about-portrait { margin: 0; animation: none; }
.profile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }

.about-social { display: grid; gap: .6rem; margin-top: .5rem; }
.about-social .eyebrow { margin: 0; }


/* ---- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: .75rem;
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  padding: .35rem .45rem .35rem 1.1rem;
  border-radius: 999px;
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled .header-bar {
  background: var(--glass-strong);
  box-shadow: var(--glass-shadow-lift), var(--glass-inner);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 2rem; height: 2rem; flex-shrink: 0; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.brand-mark .stop-rose { stop-color: var(--glow-rose-solid); }
.brand-mark .stop-lav { stop-color: var(--glow-lav-solid); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 460;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand-name em { font-weight: 360; color: var(--accent); }
@media (max-width: 380px) { .brand-name { font-size: 1.2rem; } }

.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav > a {
  position: relative;
  padding: .5rem .9rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 1rem;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.site-nav > a:hover { color: var(--ink); background: var(--glass-hover); }
.site-nav > a[aria-current="page"] { color: var(--ink); background: var(--glass-hover); }
.site-nav > a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .2rem;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}
/* Once Heaven is signed in, this appears in the public menu: her door back to the desk. */
.site-nav .nav-desk {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .3rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  color: var(--accent);
}
.site-nav .nav-desk:hover { background: var(--accent-soft); color: var(--accent-strong); }
.site-nav .nav-desk svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Heaven's private pages: their own top bar, clearly marked. */
.author-badge {
  margin-left: .15rem;
  padding: .22rem .7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 .7rem/1.3 var(--font-text);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header--author .header-bar { background: var(--glass-strong); }
.sign-out { margin-left: .35rem; }
@media (max-width: 560px) { .author-badge { display: none; } }

/* Sign-in pages: just the name and a way back. */
.back-to-blog { padding: .5rem .9rem; border-radius: 999px; white-space: nowrap; }
@media (max-width: 420px) { .back-to-blog .back-long { display: none; } }
.back-to-blog:hover { background: var(--glass-hover); text-decoration: none; }
.nav-tools { display: flex; align-items: center; gap: .1rem; margin-left: .35rem; }

.nav-toggle { display: none; }

.search-panel {
  margin-top: .5rem;
  padding: .55rem;
  border-radius: var(--radius);
  background: var(--glass-strong);
  animation: drop .25s ease;
}
.search-form { display: flex; gap: .6rem; }
.search-form input { flex: 1; min-width: 0; }
.search-form--page { max-width: 34rem; margin-top: 1.6rem; }

@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .header-bar { padding-left: .9rem; }
  .site-nav {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: .6rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    /* Solid, not glass: the menu sits inside the frosted header, and browsers can't
       blur the page behind a frosted panel nested in another one, so see-through
       glass here would let the page text show through the links. */
    z-index: 2;
    background: var(--glass-solid);
    box-shadow: var(--glass-shadow-lift), var(--glass-inner);
    display: none;
  }
  .site-nav.is-open { display: flex; animation: drop .2s ease; }
  .site-nav > a { padding: .75rem 1rem; border-radius: var(--radius-small); font-size: 1.1rem; }
  .site-nav > a[aria-current="page"]::after { left: auto; right: 1rem; top: 50%; bottom: auto; margin-top: -2px; }
  .nav-tools { margin: .3rem 0 0; padding-left: .4rem; }
}


/* ---- Messages ------------------------------------------------------------ */

.toasts { display: grid; gap: .6rem; padding-top: 1rem; }
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.1rem .85rem 1.3rem;
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  color: var(--ink);
  animation: drop .3s ease;
  transition: opacity .4s, transform .4s;
}
.toast.is-leaving { opacity: 0; transform: translateY(-6px); }
.toast-close {
  border: 0; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: 0 .25rem;
}


/* ---- Home: one screen, no scrolling --------------------------------------- */

/* Lock the page to the screen when it is tall enough to hold everything.
   Very short screens (a phone turned sideways) may still scroll. */
@media (min-height: 560px) {
  body.page-home { height: 100vh; height: 100dvh; overflow: hidden; }
}
.page-home main { display: flex; flex-direction: column; min-height: 0; }

.home {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(19rem, 1fr);
  align-items: center;
  align-content: center;
  gap: clamp(1.5rem, 5vw, 6rem);
  padding-block: clamp(.5rem, 2.5vh, 2rem);
}

.home-hero { position: relative; }

.hero-title {
  max-width: 15ch;
  font-size: clamp(2.2rem, min(6vw, 9vh), 6.5rem);
  font-weight: 340;
  line-height: 1.02;
  letter-spacing: -.035em;
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.hero-lede {
  max-width: 34rem;
  margin-top: clamp(.7rem, 2.4vh, 1.6rem);
  font-size: clamp(1.05rem, min(1.6vw, 2.4vh), 1.4rem);
  color: var(--ink-soft);
}
.hero-hand {
  width: fit-content;
  margin-top: clamp(.5rem, 2vh, 1.4rem);
  font-size: clamp(1.45rem, min(2.4vw, 3.6vh), 2.2rem);
  transform: rotate(-2deg);
  transform-origin: left;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: clamp(.9rem, 3.2vh, 2.2rem);
}
@media (max-width: 400px) { .hero-actions .btn { padding-inline: .95rem; } }

/* The latest-thought card */
.latest {
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* long titles are cut with "…", never stretch the card */
  border-radius: var(--radius-large);
  padding: clamp(1rem, 2.4vh, 1.75rem);
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) .7s both;
}
.latest-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
}
.latest-main:hover { color: inherit; }
.latest-main .eyebrow { margin-bottom: 0; }
.latest-media {
  display: none;
  aspect-ratio: 21 / 9;
  margin-bottom: .6rem;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-soft);
}
.latest-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.latest-main:hover .latest-media img { transform: scale(1.03); }
.latest-media--empty {
  place-items: center;
  background:
    radial-gradient(circle at 25% 30%, var(--glow-rose), transparent 60%),
    radial-gradient(circle at 75% 65%, var(--glow-lav), transparent 55%),
    radial-gradient(circle at 60% 15%, var(--glow-peach), transparent 50%),
    var(--bg-soft);
}
.latest-media .doodle { width: min(70%, 15rem); }
@media (min-height: 940px) and (min-width: 900px) {
  .latest-media { display: block; }
  .latest-media--empty { display: grid; }
}
.latest-title {
  width: fit-content;
  font-size: clamp(1.45rem, min(2.4vw, 3.6vh), 2.3rem);
  font-weight: 380;
  letter-spacing: -.02em;
  transition: color .2s;
}
.latest-main:hover .latest-title { color: var(--accent); }
.latest-summary {
  color: var(--ink-soft);
  font-size: 1.05rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  display: inline-flex;
  gap: .4rem;
  color: var(--accent);
  font-style: italic;
  font-size: 1.05rem;
}
.read-more span { transition: transform .3s; }
.latest-main:hover .read-more span,
.card:hover .read-more span { transform: translateX(4px); }

.latest-more {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-glass);
}
.latest-more .eyebrow { margin-bottom: .4rem; }
.latest-more ul { list-style: none; margin: 0 -.6rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.latest-more a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .6rem;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.latest-more a:hover { background: var(--glass-hover); color: var(--accent); }
.latest-more-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.latest-more time { flex-shrink: 0; font-size: .85rem; color: var(--ink-faint); }

.latest--empty { justify-items: start; gap: 1rem; color: var(--ink-soft); }
.latest--empty .hand { font-size: 2rem; }

/* Short desktop screens: drop the "also lately" list. */
@media (max-height: 700px) { .latest-more { display: none; } }

/* Phones and tablets: stack hero and card, and keep everything on one screen. */
@media (max-width: 899px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: clamp(.9rem, 2.6vh, 2rem);
    padding-block: .5rem;
  }
  .hero-title { font-size: clamp(2.1rem, min(10vw, 6.2vh), 4rem); }
  .latest { padding: 1rem 1.15rem; }
  .latest-main { gap: .35rem; }
  .latest-summary { -webkit-line-clamp: 2; font-size: 1rem; }
  .latest .read-more { display: none; }
  .latest-more { display: none; }
  :is(.page-home, .page-about) .footer-hand,
  :is(.page-home, .page-about) .footer-small { display: none; }
  /* One-screen pages on phones: links (Archive, Sign in) and icons share one compact row. */
  :is(.page-home, .page-about) .footer-bar { flex-wrap: nowrap; justify-content: center; gap: .25rem .8rem; padding: .25rem .8rem; }
  :is(.page-home, .page-about) .footer-links { gap: .8rem; flex-wrap: nowrap; white-space: nowrap; }
  :is(.page-home, .page-about) .social--footer { flex-wrap: nowrap; gap: 0; }
  :is(.page-home, .page-about) .social--footer a { width: 1.85rem; height: 1.85rem; }
}
@media (max-width: 899px) and (min-height: 1250px) { .latest-more { display: block; } }
@media (max-width: 899px) and (max-height: 760px) { .home .hero-lede { display: none; } }
@media (max-width: 899px) and (max-height: 680px) {
  .latest-summary { display: none; }
}
@media (max-width: 899px) and (max-height: 650px) {
  .home .eyebrow { display: none; }
  .latest .meta { display: none; }
  .hero-actions { margin-top: .7rem; }
}


/* ---- Hero magic ----------------------------------------------------------
   1. The eyebrow fades up.
   2. The headline rises word by word out of a soft blur.
   3. A brush stroke draws itself under "soft".
   4. The intro line fades up.
   5. "pull up a chair" writes itself in, left to right.
   Little thought bubbles drift up behind it all.
   -------------------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }

.page-home .home-hero .eyebrow { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }

.hero-title .word {
  display: inline-block;
  animation: word-rise 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-title .word:nth-child(1)  { animation-delay: .20s; }
.hero-title .word:nth-child(2)  { animation-delay: .28s; }
.hero-title .word:nth-child(3)  { animation-delay: .36s; }
.hero-title .word:nth-child(4)  { animation-delay: .44s; }
.hero-title .word:nth-child(5)  { animation-delay: .52s; }
.hero-title .word:nth-child(6)  { animation-delay: .60s; }
.hero-title .word:nth-child(7)  { animation-delay: .68s; }
.hero-title .word:nth-child(8)  { animation-delay: .76s; }
.hero-title .word:nth-child(9)  { animation-delay: .84s; }
.hero-title .word:nth-child(10) { animation-delay: .92s; }
@keyframes word-rise {
  from { opacity: 0; transform: translateY(.4em); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.soft { position: relative; display: inline-block; }
.swash {
  position: absolute;
  left: -3%;
  bottom: -.14em;
  width: 106%;
  height: .26em;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1;   /* the path has pathLength="1" */
  stroke-dashoffset: 1;  /* hidden until it is drawn */
  opacity: .6;
  pointer-events: none;
  animation: draw 1.1s cubic-bezier(.6, .05, .3, 1) 1.35s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.page-home .hero-lede { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) 1s both; }
.page-home .hero-actions { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) 1.2s both; }

.page-home .hero-hand {
  /* A soft-edged mask slides from left to right, like ink going down. */
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 225% 100%;
  mask-size: 225% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: write-in 2s cubic-bezier(.5, .1, .35, 1) 1.6s both;
}
@keyframes write-in {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to   { -webkit-mask-position: 0 0;    mask-position: 0 0; }
}

/* Thought bubbles */
.bubbles {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}
.bubbles span {
  position: absolute;
  bottom: -3rem;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .75) 0 12%, transparent 42%),
    linear-gradient(135deg, var(--glow-rose-solid), var(--glow-lav-solid));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  opacity: 0;
  animation:
    bubble-rise var(--d) linear var(--delay) infinite,
    bubble-sway calc(var(--d) / 4) ease-in-out var(--delay) infinite alternate;
}
/*                           position    size        rise time   start          opacity    sway */
.bubbles span:nth-child(1) { --x: 58%; --s: 18px; --d: 20s; --delay: -2s;  --o: .5;  --sway: 12px; }
.bubbles span:nth-child(2) { --x: 68%; --s: 34px; --d: 26s; --delay: -12s; --o: .35; --sway: 18px; }
.bubbles span:nth-child(3) { --x: 76%; --s: 12px; --d: 17s; --delay: -7s;  --o: .55; --sway: 10px; }
.bubbles span:nth-child(4) { --x: 84%; --s: 26px; --d: 23s; --delay: -17s; --o: .4;  --sway: 16px; }
.bubbles span:nth-child(5) { --x: 91%; --s: 14px; --d: 19s; --delay: -3s;  --o: .5;  --sway: 10px; }
.bubbles span:nth-child(6) { --x: 49%; --s: 10px; --d: 16s; --delay: -10s; --o: .45; --sway: 8px;  }
.bubbles span:nth-child(7) { --x: 72%; --s: 8px;  --d: 14s; --delay: -1s;  --o: .6;  --sway: 6px;  }
.bubbles span:nth-child(8) { --x: 12%; --s: 16px; --d: 24s; --delay: -15s; --o: .25; --sway: 12px; }
.bubbles span:nth-child(9) { --x: 30%; --s: 9px;  --d: 18s; --delay: -8s;  --o: .25; --sway: 8px;  }

@keyframes bubble-rise {
  0%   { translate: 0 0;     scale: .5;  opacity: 0; }
  15%  { opacity: var(--o); }
  75%  { opacity: var(--o); }
  100% { translate: 0 -62vh; scale: 1.1; opacity: 0; }
}
@keyframes bubble-sway {
  from { transform: translateX(calc(var(--sway) * -1)); }
  to   { transform: translateX(var(--sway)); }
}

/* Fewer bubbles on phones, where the text fills the whole width. */
@media (max-width: 760px) {
  .bubbles span:nth-child(n + 7) { display: none; }
}


/* After the first visit, the home intro settles in quickly instead of replaying in full. */
.intro-seen .page-home :is(.home-hero .eyebrow, .hero-title .word, .swash, .hero-lede, .hero-actions, .hero-hand, .latest) {
  animation-delay: 0s !important;
  animation-duration: .6s !important;
}


/* ---- Calm motion -----------------------------------------------------------
   Gentle things that happen while reading:
   - content further down the page softly fades up as it comes into view
   - "with love, Heaven" writes itself in when you reach the end
   - the little book drawing sketches itself, then its cloud floats
   (static/js/main.js adds the classes; nothing moves if motion is reduced.)
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1) !important;
}
.reveal.is-visible { opacity: 1; transform: none; }

.signature { width: fit-content; }
.sig-wait {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 225% 100%;
  mask-size: 225% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}
.sig-write { animation: write-in 2.4s cubic-bezier(.5, .1, .35, 1) .2s forwards; }

/* The book drawing */
.doodle {
  display: block;
  width: min(100%, 12rem);
  height: auto;
  margin-inline: auto;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The teacup: saucer, cup, handle and tea draw themselves; then the steam
   curls up and keeps drifting softly. */
.doodle path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2s cubic-bezier(.5, .1, .3, 1) forwards; }
.doodle > path:nth-child(1) { animation-delay: .1s; }
.doodle > path:nth-child(2) { animation-delay: .35s; }
.doodle > path:nth-child(3) { animation-delay: 1.2s; animation-duration: 1s; }
.doodle > path:nth-child(4) { animation-delay: 1.5s; animation-duration: 1s; opacity: .5; }
.doodle-steam path {
  stroke: var(--glow-lav-solid);
  animation: draw 1.8s ease-out forwards, steam 5s ease-in-out infinite alternate;
}
.doodle-steam path:nth-child(1) { animation-delay: 1.9s, 3.7s; }
.doodle-steam path:nth-child(2) { animation-delay: 2.2s, 4.2s; }
.doodle-steam path:nth-child(3) { animation-delay: 2.5s, 4.7s; }
.empty .doodle, .center-card .doodle, .latest--empty .doodle { margin-bottom: .5rem; }

@keyframes steam { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-6px); opacity: .35; } }

/* Her photo, when there is one, takes the place of the initial. */
/* The photo is pinned inside the soft colour ring and cropped to fit, whatever its shape. */
:is(.about-portrait, .author-avatar).has-photo { position: relative; overflow: hidden; }
:is(.about-portrait, .author-avatar) img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  max-width: none;
  object-fit: cover;
  border-radius: inherit;
}


/* ---- Page headers ---------------------------------------------------------- */

.page-head { padding-block: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.page-title { font-size: clamp(2.3rem, 5.5vw, 4.2rem); font-weight: 360; letter-spacing: -.03em; }
.page-intro { max-width: 36rem; margin-top: 1rem; font-size: 1.2rem; color: var(--ink-soft); }
.mood-title { color: var(--m-fg); font-style: italic; }
.result-count { margin-bottom: 1.5rem; }

.mood-panel {
  flex: 0 1 34rem;
  padding: 1rem 1.2rem 1.15rem;
  border-radius: var(--radius);
}
.mood-panel .eyebrow { margin-bottom: .65rem; }


/* ---- Cards (the Thoughts page, mood pages, search) ------------------------- */

.section { padding-bottom: clamp(3rem, 7vw, 5rem); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.5rem), 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s, background-color .45s, border-color .45s;
}
.card:hover {
  transform: translateY(-4px);
  background: var(--glass-hover);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow-lift), var(--glass-inner);
}

.card-link { display: block; flex: 1; color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 1.4rem 1.5rem 1rem; }
.card-title {
  width: fit-content;
  margin-top: .55rem;
  font-size: 1.45rem;
  font-weight: 420;
  transition: color .2s;
}
.card:hover .card-title { color: var(--accent); }
.card-summary {
  margin-top: .7rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-moods { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.5rem 1.4rem; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pagination-info { color: var(--ink-faint); font-size: .95rem; font-style: italic; }

.empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}
.empty .hand { font-size: 2.2rem; }


/* ---- A single thought: article in the middle, glass sidebars ------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--glow-rose-solid), var(--glow-lav-solid));
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(0, 48rem) minmax(15rem, 1fr);
  gap: clamp(1.25rem, 2.2vw, 2.5rem);
  align-items: start;
  padding-block: 1.5rem clamp(3rem, 7vw, 5rem);
}
.post-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* never wider than its column, whatever is inside */
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
.post-side {
  position: sticky;
  top: var(--header-space);
  display: grid;
  gap: 1rem;
}

.side-card {
  display: grid;
  gap: .85rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
}
.side-card .eyebrow { margin-bottom: 0; }

.author-card { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1rem; }
.author-card .link-quiet { grid-column: 1 / -1; }
.author-avatar {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%;
  background:
    radial-gradient(circle at 30% 30%, var(--glow-peach), transparent 60%),
    linear-gradient(135deg, var(--glow-rose-solid), var(--glow-lav-solid));
}
.author-avatar span { font-family: var(--font-display); font-size: 1.7rem; font-style: italic; font-weight: 340; color: #fff; }
.author-name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; }
.author-line { margin-top: .15rem; font-size: .92rem; font-style: italic; line-height: 1.4; color: var(--ink-faint); }

.facts { margin: 0; display: grid; gap: .45rem; }
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .45rem;
  border-bottom: 1px dashed var(--line-glass);
  font-size: .95rem;
}
.facts dt { color: var(--ink-faint); }
.facts dd { margin: 0; text-align: right; }

.meter { height: 6px; border-radius: 999px; background: var(--line-glass); overflow: hidden; }
.meter span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--glow-rose-solid), var(--glow-lav-solid));
}
.meter-label { margin-top: -.4rem; font-style: italic; }
.side-moods { display: flex; flex-wrap: wrap; gap: .4rem; }

.side-list { list-style: none; margin: 0 -.65rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem; }
.side-list a {
  display: grid;
  gap: .1rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-small);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .2s;
}
.side-list a:hover { background: var(--glass-hover); }
.side-list a:hover .side-list-title { color: var(--accent); }
.side-list-title { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3; transition: color .2s; }
.side-list .meta { font-size: .82rem; }

.whisper-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), background-color .3s, box-shadow .3s;
}
.whisper-cta:hover { color: var(--ink); background: var(--glass-hover); transform: translateY(-2px); box-shadow: var(--glass-shadow-lift), var(--glass-inner); }
.whisper-cta-count { font-family: var(--font-display); font-size: 2.6rem; font-weight: 340; line-height: 1; color: var(--accent); }
.whisper-cta-title { display: block; font-family: var(--font-display); font-size: 1.15rem; }

.notice {
  padding: .8rem 1.1rem;
  border-radius: var(--radius-small);
  border-style: dashed;
  border-color: var(--accent);
  font-size: .98rem;
  text-align: center;
}

.post-paper {
  padding: clamp(1.5rem, 4.5vw, 3.75rem) clamp(1.25rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-large);
}
.post-head { text-align: center; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.post-moods { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-bottom: 1.3rem; }
.post-title {
  width: fit-content;
  margin-inline: auto;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 350;
  letter-spacing: -.03em;
  line-height: 1.06;
}
.post-head .meta { margin-top: 1.2rem; font-style: italic; }

.post-cover { margin: 0 0 clamp(2rem, 4vw, 3rem); }
/* Tall (portrait) photos are cropped to about one screen so the words aren't pushed far away. */
.post-cover img { width: 100%; max-height: min(68vh, 40rem); object-fit: cover; border-radius: var(--radius); }
.post-cover figcaption { margin-top: .75rem; text-align: center; font-size: .92rem; font-style: italic; color: var(--ink-faint); }

/* On medium screens the sidebars sit below the article. */
@media (max-width: 1179px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-main { order: 1; width: 100%; max-width: 50rem; margin-inline: auto; }
  .post-side {
    position: static;
    width: 100%;
    max-width: 50rem;
    margin-inline: auto;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    align-items: start;
  }
  .post-side--right { order: 2; }
  .post-side--left { order: 3; }
}

/* Reading typography */
.prose {
  font-size: clamp(1.12rem, 1.5vw, 1.25rem);
  line-height: 1.78;
  color: var(--ink);
  hyphens: auto;
}
.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.35em; }
.prose > p:first-child::first-letter {
  float: left;
  margin: .1em .1em 0 0;
  font-family: var(--font-display);
  font-size: 3.3em;
  font-weight: 340;
  line-height: .8;
  color: var(--accent);
}
@supports (initial-letter: 2) or (-webkit-initial-letter: 2) {
  .prose > p:first-child::first-letter {
    float: none;
    margin: 0 .14em 0 0;
    font-size: 1em;
    line-height: 1;
    -webkit-initial-letter: 2;
    initial-letter: 2;
  }
}
.prose h2, .prose h3 { margin-top: 2.2em; font-weight: 420; }
.prose h2 { font-size: 1.6em; }
.prose h3 { font-size: 1.3em; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-decoration-thickness: 1.5px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: var(--radius-small); margin-inline: auto; }

.prose blockquote {
  margin: 2em 0;
  padding: .2em 0 .2em 1.6em;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.28em;
  font-style: italic;
  font-weight: 340;
  line-height: 1.5;
  color: var(--ink);
  break-inside: avoid;
}
.prose blockquote p + p { margin-top: .8em; }

.prose hr {
  border: 0;
  margin: 2.6em 0;
  text-align: center;
  overflow: visible;
}
.prose hr::before {
  content: "\2022\2002\2022\2002\2022";  /* • • • */
  font-size: .7em;
  color: var(--accent);
  opacity: .8;
}

.prose code {
  padding: .1em .35em;
  border-radius: 6px;
  background: var(--line-glass);
  font-size: .85em;
}
.prose pre {
  padding: 1.1em 1.3em;
  border-radius: var(--radius-small);
  background: var(--line-glass);
  overflow-x: auto;
  font-size: .85em;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { padding: .5em .7em; border-bottom: 1px solid var(--line-glass); text-align: left; }

.signature {
  margin-top: 2.5rem;
  font-family: var(--font-hand);
  font-size: 2.1rem;
  color: var(--accent);
  transform: rotate(-2deg);
  transform-origin: left;
}

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-nav-link {
  display: grid;
  gap: .2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: background-color .2s, transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}
.post-nav-link:hover { background: var(--glass-hover); border-color: var(--glass-border); color: var(--ink); transform: translateY(-2px); box-shadow: var(--glass-shadow-lift), var(--glass-inner); }
.post-nav-link .eyebrow { margin: 0; }
.post-nav-link--next { text-align: right; grid-column: 2; }
.post-nav-title { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; }

@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link--next { grid-column: auto; }
}


/* ---- Whispers (reader replies) ------------------------------------------- */

.whispers-title { font-size: 2rem; font-weight: 380; font-style: italic; }
.whispers-intro { margin-top: .4rem; color: var(--ink-soft); }

.whisper-list { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1rem; }
.whisper {
  position: relative;
  padding: 1.25rem 1.5rem 1.1rem;
  border-radius: var(--radius);
}
.whisper:nth-child(even) { margin-left: clamp(0rem, 4vw, 2.5rem); }
.whisper-message { font-size: 1.08rem; }

/* Long whispers show their first lines; "Read all" opens the rest. */
.whisper-message.is-long {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-all {
  margin-top: .35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: italic .95rem var(--font-text);
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
.whisper-from { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; margin-top: .6rem; color: var(--ink-faint); font-size: .85rem; }
.whisper-from time { white-space: nowrap; }
.whisper-from .hand { font-size: 1.45rem; }

.whisper-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius);
}
.whisper-form .btn { justify-self: start; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }


/* ---- Forms --------------------------------------------------------------- */

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; }
.field label, .field > label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.field-help { font-size: .85rem; color: var(--ink-faint); font-style: italic; }

input[type="text"], input[type="search"], input[type="password"], input[type="email"],
input[type="url"], input[type="datetime-local"], input:not([type]), textarea, select {
  width: 100%;
  min-width: 0;
  padding: .75rem 1rem;
  border: 1px solid var(--line-glass);
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--ink);
  font: 1.05rem/1.5 var(--font-text);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); font-style: italic; opacity: 1; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  background: var(--surface);
}
textarea { resize: vertical; }

.form-error {
  color: #b23c36;
  font-size: .92rem;
}
:root[data-theme="dark"] .form-error { color: #f3a39b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-error { color: #f3a39b; } }
.form-error ul { margin: 0; padding-left: 1.1rem; }

.check { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; cursor: pointer; font-size: .98rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }


/* ---- Archive ------------------------------------------------------------- */

.archive { padding-bottom: clamp(3rem, 7vw, 5rem); }
.archive-year {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  gap: 1.25rem 3rem;
  align-items: start;
}
.archive-year + .archive-year { margin-top: 3rem; }
.archive-year-title {
  position: sticky;
  top: var(--header-space);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  letter-spacing: -.04em;
  line-height: 1;
}
.archive-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}
.archive-month-card { padding: 1.2rem 1.35rem .9rem; border-radius: var(--radius); }
.archive-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-text);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.archive-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.archive-list li + li { border-top: 1px solid var(--line-glass); }
.archive-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .7rem .25rem;
  color: var(--ink);
  text-decoration: none;
  transition: padding .25s, color .2s;
}
.archive-list a:hover { color: var(--accent); padding-left: .6rem; }
.archive-day { min-width: 1.6rem; font-variant-numeric: tabular-nums; color: var(--ink-faint); font-size: .95rem; }
.archive-title { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.35; }

@media (max-width: 760px) {
  .archive-year { grid-template-columns: minmax(0, 1fr); }
  .archive-year-title { position: static; }
}


/* ---- About --------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem);
}
.about-card {
  position: sticky;
  top: var(--header-space);
  display: grid;
  justify-items: start;
  gap: .75rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--radius-large);
}
.about-card .eyebrow { margin: .5rem 0 0; }
.about-name { font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 360; letter-spacing: -.03em; }
.about-tagline { color: var(--ink-soft); font-style: italic; }
.about-moods { display: grid; gap: .6rem; margin-top: .5rem; }
.about-moods .eyebrow { margin: 0; }
.about-card .btn { margin-top: .75rem; }

.about-portrait {
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%;
  background:
    radial-gradient(circle at 30% 30%, var(--glow-peach), transparent 60%),
    linear-gradient(135deg, var(--glow-rose-solid), var(--glow-lav-solid));
  box-shadow: var(--glass-shadow);
  animation: breathe 7s ease-in-out infinite;
}
.about-portrait span {
  font-family: var(--font-display);
  font-size: 3rem;
  font-style: italic;
  font-weight: 340;
  color: #fff;
}
@keyframes breathe {
  0%, 100% { border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; }
  50%      { border-radius: 54% 46% 44% 56% / 46% 56% 44% 54%; }
}

.about-letter {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-radius: var(--radius-large);
}
/* On wide screens the letter flows into two columns, like a magazine page. */
.about-letter .prose { columns: 24rem 2; column-gap: clamp(2rem, 4vw, 4rem); }
.about-letter .prose > * { break-inside: avoid; }

@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-card { position: static; }
}

/* The About page is one screen, like the home page: the card and the letter
   each scroll inside themselves if there's a lot in them. */
@media (min-height: 560px) {
  body.page-about { height: 100vh; height: 100dvh; overflow: hidden; }
  .page-about main { display: flex; flex-direction: column; min-height: 0; }
  .page-about .about {
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    padding-block: clamp(.75rem, 2.5vh, 2rem) .25rem;
  }
  .page-about :is(.about-card, .about-letter) {
    position: static;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-glass) transparent;
  }
  .page-about .about-card { align-content: start; }

  /* Phones: a compact strip (photo, greeting, line, icons) above the letter. */
  @media (max-width: 900px) {
    .page-about .about { grid-template-rows: auto minmax(0, 1fr); gap: .75rem; }
    .page-about .about-card {
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      column-gap: 1rem;
      row-gap: .2rem;
      padding: .9rem 1.1rem;
      overflow: visible;
    }
    .page-about .about-portrait { grid-row: span 2; width: 3.6rem; height: 3.6rem; margin: 0; }
    .page-about .about-portrait span { font-size: 1.7rem; }
    .page-about .about-name { font-size: 1.5rem; align-self: end; }
    .page-about .about-tagline { font-size: .95rem; line-height: 1.4; align-self: start; }
    .page-about .about-social { grid-column: 1 / -1; margin-top: .4rem; }
    .page-about .about-social .eyebrow,
    .page-about .about-card > .eyebrow,
    .page-about .about-count,
    .page-about .about-moods,
    .page-about .about-card > .btn { display: none; }
    .page-about .about-letter { padding: 1.25rem 1.2rem; }
  }
}


/* ---- Centered cards (login, delete, errors) ------------------------------ */

.center-wrap {
  display: grid;
  place-items: center;
  padding-block: clamp(2rem, 8vh, 5rem);
}
.center-card {
  width: min(100%, 34rem);
  padding: clamp(1.75rem, 5vw, 3rem);
  border-radius: var(--radius-large);
  text-align: center;
}
.center-card .page-intro { margin-inline: auto; }
.center-card > .btn { margin-top: 2rem; }
.center-card .hand { font-size: 2rem; margin-bottom: .25rem; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 2rem; }
.center-card .page-intro + .page-intro { margin-top: .6rem; }
.center-note { margin-top: 1.25rem; }

.login-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
  text-align: left;
}
.login-form .btn { margin-top: .5rem; }


/* ---- Writing desk -------------------------------------------------------- */

/* The desk is one screen, like the home page: the three lists scroll inside
   their own panels. On phones the panels become tabs. Very short screens
   (a phone turned sideways) may still scroll the page. */
@media (min-height: 560px) {
  body.page-desk { height: 100vh; height: 100dvh; overflow: hidden; }
  .page-desk main { display: flex; flex-direction: column; min-height: 0; }
  .page-desk .desk { flex: 1; min-height: 0; }
}

.desk {
  display: flex;
  flex-direction: column;
  gap: clamp(.75rem, 2vh, 1.25rem);
  padding-block: clamp(.75rem, 3vh, 2rem) .25rem;
}

.desk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.desk-head .eyebrow { margin-bottom: .4rem; }
.desk-head .page-title { font-size: clamp(1.9rem, min(4vw, 6vh), 3.2rem); }
.desk-head .page-intro { margin-top: .4rem; font-size: 1.05rem; }

.desk-tabs { display: none; }

.desk-panels {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.75rem, 1.6vw, 1.5rem);
}
.desk-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.desk-panel-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.3rem .75rem;
  border-bottom: 1px solid var(--line-glass);
  font-size: 1.3rem;
  font-weight: 400;
}
.desk-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-glass) transparent;
}
.desk-scroll > .muted { padding: 1.25rem 1.3rem; }

/* Phones and small tablets: one panel at a time, picked with tabs. */
@media (max-width: 899px) {
  .desk.has-tabs .desk-tabs {
    display: flex;
    gap: .25rem;
    padding: .3rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
  .desk-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .55rem .5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font: 500 .95rem var(--font-text);
    cursor: pointer;
    transition: background-color .2s, color .2s;
  }
  .desk-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
  .desk-tab[aria-selected="true"] .count { background: color-mix(in srgb, var(--bg) 22%, transparent); color: var(--bg); }
  .desk.has-tabs .desk-panels { grid-template-columns: minmax(0, 1fr); }
  .desk.has-tabs .desk-panel:not(.is-active) { display: none; }
  .desk.has-tabs .desk-panel-title { display: none; }
  .desk-tab { min-width: 0; white-space: nowrap; }

  /* Compact top: title and "New thought" side by side; the counts live on the tabs. */
  .desk-head { flex-wrap: nowrap; align-items: center; }
  .desk-head .eyebrow, .desk-head .page-intro { display: none; }
  .desk-head .page-title { font-size: clamp(1.55rem, 7vw, 2.3rem); }
  .desk-new { flex-shrink: 0; padding: .6rem 1rem; }

  /* Footer: just the links (Sign out is there). */
  .page-desk :is(.footer-hand, .footer-small, .footer-bar .social) { display: none; }
}
@media (max-width: 400px) {
  /* Tiny phones: "New thought" becomes a round + button. */
  .desk-new { width: 2.75rem; height: 2.75rem; padding: 0; }
  .desk-new-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .desk-tab { padding: .5rem .25rem; font-size: .86rem; gap: .25rem; }
  .desk-tab .count { min-width: 1.35rem; height: 1.35rem; font-size: .75rem; }
}
/* Without the tabs (no JavaScript), the panels simply stack and the page scrolls. */
@media (max-width: 899px) {
  .desk:not(.has-tabs) .desk-panels { grid-template-columns: minmax(0, 1fr); }
  body.page-desk:not(:has(.desk.has-tabs)) { height: auto; overflow: visible; }
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--line-glass);
  font-family: var(--font-text);
  font-size: .85rem;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.desk-list { list-style: none; margin: 0; padding: 0; }
.desk-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1rem 1.4rem;
  transition: background-color .2s;
}
.desk-row + .desk-row { border-top: 1px solid var(--line-glass); }
.desk-row:hover { background: var(--glass-hover); }
.desk-row-main { display: grid; gap: .1rem; flex: 1 1 16rem; color: inherit; text-decoration: none; }
.desk-row-main:hover { color: inherit; }
.desk-row-title { font-family: var(--font-display); font-size: 1.2rem; }
.desk-row-main:hover .desk-row-title { color: var(--accent); }
.desk-row-actions { display: flex; gap: 1rem; }

.pending-list { list-style: none; margin: 0; padding: .75rem; display: grid; gap: .75rem; }
.pending {
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  background: var(--glass-soft);
}
.pending--shown { border-left-color: var(--line-glass); }

/* A small rose "new" label for whispers waiting for Heaven. */
.new-badge {
  display: inline-flex;
  align-items: center;
  padding: .05rem .5rem .1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 500 .72rem/1.4 var(--font-text);
  font-style: normal;
  letter-spacing: .03em;
  vertical-align: middle;
  white-space: nowrap;
}

/* Desk: whispers grouped under the thought they belong to. */
.whisper-group + .whisper-group { border-top: 1px solid var(--line-glass); }
.whisper-group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .6rem;
  padding: 1rem 1.3rem 0;
  font-size: 1.1rem;
  font-weight: 420;
  line-height: 1.3;
}
.whisper-group-title a { color: var(--ink); text-decoration: none; }
.whisper-group-title a:hover { color: var(--accent); text-decoration: underline; }

/* Editor: this thought's whispers. */
.mini-whispers { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.mini-whisper {
  padding: .75rem .9rem;
  border-left: 3px solid var(--line-glass);
  border-radius: var(--radius-small);
  background: var(--glass-soft);
}
.mini-whisper.is-new { border-left-color: var(--accent); }
.mini-whisper .whisper-message { font-size: .98rem; }
.mini-whisper .meta { margin-top: .3rem; }
.mini-whisper .meta .hand { font-size: 1.2rem; }
.mini-whisper .pending-actions { margin-top: .6rem; }

/* Thought page, when Heaven is signed in: the new whispers on this thought. */
.waiting-box {
  margin-top: 1.5rem;
  padding: .25rem 0 0;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--radius);
}
.waiting-note { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem 0; font-size: .92rem; color: var(--ink-soft); font-style: italic; }
.desk-group-title {
  padding: 1rem 1.3rem 0;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.desk-group-title + .muted { padding-top: .5rem; }
.whisper-remove { margin-top: .5rem; }
.whisper-remove .link-btn { font-size: .85rem; }
.pending .meta { margin-top: .5rem; }
.pending .meta .hand { font-size: 1.3rem; }
.pending-actions { display: flex; gap: .5rem; margin-top: 1rem; }

/* The editor */
.page-write .site-footer { display: none; }
.write-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
}

.desk-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 2rem;
  align-items: start;
  padding-block: 1.5rem 4rem;
}

.desk-paper {
  min-height: 70vh;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 4rem) 1.5rem;
  border-radius: var(--radius-large);
}
.desk-paper .desk-title,
.desk-paper textarea.desk-body {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.desk-paper .desk-title {
  display: block;
  font: 360 clamp(1.9rem, 4.5vw, 3rem)/1.15 var(--font-display);
  letter-spacing: -.025em;
  resize: none;
  overflow: hidden;
}
.desk-paper textarea.desk-body {
  min-height: 55vh;
  margin-top: 1.6rem;
  font: 1.22rem/1.8 var(--font-text);
  resize: none;
  overflow: hidden;
}
.desk-paper .desk-title:focus,
.desk-paper textarea.desk-body:focus { box-shadow: none; background: transparent; }

.desk-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-glass);
  color: var(--ink-faint);
  font-size: .9rem;
  font-style: italic;
}
.md-help summary { cursor: pointer; }
.md-help summary:hover { color: var(--accent); }
.md-help dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: .35rem 1.2rem;
  margin: .8rem 0 0;
  font-style: normal;
}
.md-help dd { margin: 0; color: var(--ink-soft); }
.md-help code { font-size: .85rem; padding: .1em .35em; border-radius: 5px; background: var(--line-glass); }

.desk-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr);  /* never wider than the screen, whatever the inputs want */
  gap: 1rem;
  position: sticky;
  top: var(--header-space);
}
.panel { padding: 1.25rem 1.3rem; border-radius: var(--radius); }
.panel-title {
  margin-bottom: .9rem;
  font-family: var(--font-text);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.panel .field + .field { margin-top: .9rem; }
.panel input, .panel textarea { font-size: .98rem; padding: .6rem .8rem; }
.panel-hint { margin-top: .7rem; font-size: .82rem; color: var(--ink-faint); text-align: center; }
kbd {
  padding: .05em .4em;
  border: 1px solid var(--line-glass);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--glass);
  font: .78rem var(--font-text);
}

.status-choice { margin-bottom: 1rem; }
.status-choice > div { display: grid; gap: .4rem; }
.status-choice label {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border: 1px solid var(--line-glass);
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: .96rem;
  transition: border-color .2s, background-color .2s;
}
.status-choice label:hover { border-color: var(--ink-faint); }
.status-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.mood-choices > div { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.mood-choices label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border: 1px solid var(--line-glass);
  border-radius: 999px;
  font-size: .88rem;
  font-style: italic;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.mood-choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mood-choices input { width: .9rem; height: .9rem; }

.file-field input[type="file"] { font: .9rem var(--font-text); color: var(--ink-soft); max-width: 100%; }
.file-field input[type="file"]::file-selector-button {
  margin-right: .75rem;
  padding: .45rem .95rem;
  border: 1px solid var(--line-glass);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.file-field input[type="file"]::file-selector-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-field a { word-break: break-all; }
.delete-link { justify-self: center; margin-top: .5rem; }

@media (max-width: 960px) {
  .desk-form { grid-template-columns: minmax(0, 1fr); }
  .desk-aside { position: static; }
}


/* ---- Footer -------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  padding-block: .75rem max(.75rem, env(safe-area-inset-bottom));
}
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .3rem 1.5rem;
  padding: .55rem 1.4rem;
  border-radius: var(--radius);
}
.footer-hand {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--accent);
  transform: rotate(-2deg);
  /* Writes itself in, left to right, a moment after the page opens. */
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 225% 100%;
  mask-size: 225% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: write-in 2.4s cubic-bezier(.5, .1, .35, 1) .9s both;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.3rem; font-size: .95rem; }
.footer-links a, .footer-links .link-btn { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover, .footer-links .link-btn:hover { color: var(--accent); text-decoration: underline; }
.footer-small { font-size: .85rem; color: var(--ink-faint); font-style: italic; }

@media (max-width: 760px) {
  .footer-bar { justify-content: center; text-align: center; padding: .6rem 1rem; }
  .footer-links { justify-content: center; }
}


/* ---- Page transitions ----------------------------------------------------
   Pages cross-fade with a gentle lift. The header stays still. When a thought
   is opened, its title glides from the card into the page heading; the
   element that glides is picked in static/js/transitions.js.
   Browsers without support simply change pages as usual.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.site-header { view-transition-name: site-header; }

::view-transition-old(root),
::view-transition-old(thought-title):only-child {
  animation: page-out .3s cubic-bezier(.4, 0, 1, 1) both;
}
::view-transition-new(root),
::view-transition-new(thought-title):only-child {
  animation: page-in .55s cubic-bezier(.2, .7, .2, 1) .1s both;
}
::view-transition-group(thought-title) {
  animation-duration: .6s;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
}

@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }


/* ---- Motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ---- Print --------------------------------------------------------------- */

@media print {
  body::before, .ambient, .site-header, .site-footer, .whispers, .post-nav, .post-side, .progress { display: none !important; }
  body { background: #fff; color: #000; }
  .post-layout { display: block; }
  .post-paper { border: 0; box-shadow: none; background: none; padding: 0; }
  .signature, .footer-hand, .reveal { -webkit-mask: none !important; mask: none !important; opacity: 1 !important; transform: none !important; }
  .prose { font-size: 12pt; }
}
