/* ─── rozalive — log / açık defter ──────────────────────────────────────
   Roza's open journal. Shares the home identity (Newsreader + Inter, cosmic
   ink + cream + gradient). The boldness is spent in one place: the spine —
   a vertical thread of days, the latest one carrying the same green pulse
   as the home "alive" dot. Everything else stays quiet. */

:root {
  color-scheme: dark;
  --ink:        #0c0a14;
  --ink-soft:   #15101f;
  --line:       #1f1a2c;
  --line-soft:  #1a1426;
  --cream:      #f4ecdc;
  --cream-mute: #f4ecdcb3;
  --cream-faint:#f4ecdc7a;
  --cream-dim:  #f4ecdc44;
  --cream-ghost:#f4ecdc26;
  --rose:       #ff6b9d;
  --violet:     #c06bff;
  --sky:        #6bb1ff;
  --sand:       #a89378;
  --rose-deep:  #c75c7d;
  --grad:       linear-gradient(135deg, var(--rose) 0%, var(--violet) 60%, var(--sky) 100%);
  --pulse:      #4ade80;
  --serif:      Newsreader, "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:       Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --eyebrow:    .72rem/1 var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--cream);
  font: 17px/1.7 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

/* a faint vertical wash on the far left, like the gutter of a bound book */
body::before {
  content: ""; position: fixed; inset: 0 auto 0 0; width: 40vw; max-width: 520px;
  background: radial-gradient(60% 50% at 0% 30%, #1a1030 0%, transparent 70%);
  opacity: .5; pointer-events: none; z-index: 0;
}

.shell { position: relative; z-index: 1; max-width: 60rem; margin: 0 auto; padding: 3.2rem 1.4rem 5rem; }

/* ── masthead ───────────────────────────────────────────── */
.masthead { text-align: center; margin: 0 0 2.6rem; }
.masthead h1 {
  margin: 0; font-family: var(--sans); font-weight: 600;
  font-size: clamp(2.1rem, 6.5vw, 3rem); letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.masthead .tagline {
  margin: .7rem 0 0; font: var(--eyebrow); letter-spacing: .18em; text-transform: uppercase;
  color: var(--sand);
}
.masthead .tagline b { color: var(--cream-mute); font-weight: 500; }

/* ── two-column shell: spine rail + reading column ──────── */
.wrap { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 2.8rem; align-items: start; }

/* ── rail ───────────────────────────────────────────────── */
.rail { position: sticky; top: 1.6rem; align-self: start; }
.railtoggle { display: none; }
/* the index is collapsible on mobile (starts hidden); on desktop it always shows */
@media (min-width: 801px) { .railbody[hidden] { display: block; } }

.lens-tabs {
  display: flex; gap: .15rem; margin: 0 0 1.4rem; padding: .25rem;
  background: var(--ink-soft); border: 1px solid var(--line); border-radius: .7rem;
}
.lens-tabs button {
  flex: 1; appearance: none; background: none; border: 0; cursor: pointer;
  padding: .5rem .2rem; border-radius: .5rem;
  font: 600 .76rem/1 var(--sans); letter-spacing: .04em; color: var(--cream-faint);
  transition: color .2s, background .2s;
}
.lens-tabs button:hover { color: var(--cream-mute); }
.lens-tabs button[aria-selected="true"] { color: var(--ink); background: var(--cream); }

.lens { animation: fade .35s ease; }
.lens[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.month h3, .cal h3 {
  margin: 0 0 .9rem; font: 600 .74rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  color: var(--sand);
}

/* ── Zaman: the spine ───────────────────────────────────── */
.spine { list-style: none; margin: 0; padding: 0; position: relative; }
.spine::before {
  content: ""; position: absolute; top: .4rem; bottom: .4rem; left: 4px; width: 1px;
  background: linear-gradient(var(--line) 0%, var(--line) 70%, transparent 100%);
}
.spine .day { position: relative; }
.spine a, .spine .day-label {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .32rem 0 .32rem 1.4rem; position: relative;
}
.spine a { transition: color .18s; color: var(--cream-faint); }
.spine a:hover, .spine a.active { color: var(--cream); }
.node {
  position: absolute; left: 0; top: .62rem; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--cream-dim); transition: border-color .18s, background .18s, box-shadow .18s;
}
.spine a:hover .node, .spine a.active .node { border-color: var(--rose); background: var(--rose); }
/* the latest entry — the living edge of the journal */
.spine .day.now > a .node, .spine .day.now .day-label .node {
  border-color: var(--pulse); background: var(--pulse);
  box-shadow: 0 0 0 0 rgba(74,222,128,.5); animation: nodepulse 2.4s infinite;
}
@keyframes nodepulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.spine .d { font: 600 .82rem/1 var(--sans); font-variant-numeric: tabular-nums; min-width: 1.1rem; }
.spine .t { font: .9rem/1.3 var(--serif); }
/* multi-entry day: a labelled cluster of sub-nodes */
.spine .day.multi .day-label { color: var(--cream-mute); cursor: default; }
.spine .day.multi .sub { list-style: none; margin: 0 0 .2rem; padding: 0; }
.spine .day.multi .sub a { padding: .22rem 0 .22rem 1.4rem; }
.spine .day.multi .sub .seq {
  font: 600 .68rem/1 var(--sans); color: var(--sand); min-width: .9rem;
}
.spine .day.multi .sub a::before {
  content: ""; position: absolute; left: 2.5px; top: .55rem; width: 4px; height: 4px;
  border-radius: 50%; background: var(--cream-ghost);
}
.spine .day.multi .sub a:hover::before, .spine .day.multi .sub a.active::before { background: var(--rose); }

/* the spine's month pager: ‹ Month YYYY › — arrows are real links to the
   adjacent month archives, so month-stepping works with JS off. */
.spine-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 1rem; }
.spine-nav h3 { margin: 0; }
.spine-arrow {
  flex: none; width: 1.9rem; height: 1.9rem; display: flex; align-items: center; justify-content: center;
  border-radius: .5rem; background: var(--ink-soft); border: 1px solid var(--line);
  color: var(--cream-mute); font: 400 1.05rem/1 var(--sans); text-decoration: none;
  transition: color .18s, border-color .18s, background .18s;
}
a.spine-arrow:hover { color: var(--cream); border-color: var(--cream-dim); }
.spine-arrow[aria-hidden="true"] { opacity: .28; }

/* ── Takvim ─────────────────────────────────────────────── */
/* dynamic month picker header: ‹  [Ay ▾][Yıl ▾]  › (JS-injected) */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 1rem; }
.cal-arrow {
  flex: none; appearance: none; cursor: pointer;
  width: 1.9rem; height: 1.9rem; display: flex; align-items: center; justify-content: center;
  border-radius: .5rem; background: var(--ink-soft); border: 1px solid var(--line);
  color: var(--cream-mute); font: 400 1.05rem/1 var(--sans);
  transition: color .18s, border-color .18s, background .18s;
}
.cal-arrow:hover:not(:disabled) { color: var(--cream); border-color: var(--cream-dim); }
.cal-arrow:disabled { opacity: .28; cursor: default; }
.cal-picker { display: flex; gap: .4rem; }
.cal-picker select {
  appearance: none; cursor: pointer;
  padding: .4rem 1.45rem .4rem .6rem; border-radius: .5rem;
  background: var(--ink-soft); border: 1px solid var(--line); color: var(--cream);
  font: 600 .78rem/1 var(--sans); letter-spacing: .02em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23a89378' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1.5 1.8 6 6.2 10.5 1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .55rem center; background-size: .62rem;
  transition: border-color .18s, color .18s;
}
.cal-picker select:hover { border-color: var(--cream-dim); }
.cal-month { min-width: 6.4rem; }
.cal-dyn .cal { margin: 0; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .wd {
  font: 600 .6rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  color: var(--cream-dim); text-align: center; padding-bottom: .35rem;
}
.cal-grid .cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: .42rem; font: 500 .76rem/1 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--cream-ghost); position: relative;
}
.cal-grid .cell.empty { visibility: hidden; }
.cal-grid a.cell {
  color: var(--cream-mute); background: var(--ink-soft); border: 1px solid var(--line);
  transition: border-color .18s, color .18s, background .18s;
}
.cal-grid a.cell:hover, .cal-grid a.cell.active { color: var(--ink); background: var(--cream); border-color: var(--cream); }
.cal-grid a.cell .dots { display: flex; gap: 2px; margin-top: 2px; height: 4px; }
.cal-grid a.cell .dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--rose); }
.cal-grid a.cell.now { border-color: var(--pulse); }
.cal-grid a.cell.now .dots i { background: var(--pulse); }
.cal-grid a.cell:hover .dots i, .cal-grid a.cell.active .dots i { background: var(--ink); }

/* ── İzlek ──────────────────────────────────────────────── */
.izlek-hint { margin: 0 0 1rem; font: .82rem/1.5 var(--serif); font-style: italic; color: var(--cream-faint); }
.izlek-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.izlek-list button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  appearance: none; cursor: pointer; text-align: left;
  padding: .5rem .7rem; border-radius: .55rem;
  background: var(--ink-soft); border: 1px solid var(--line); color: var(--cream-mute);
  font: 500 .9rem/1.2 var(--serif); transition: border-color .18s, color .18s, background .18s;
}
.izlek-list button:hover { border-color: var(--cream-dim); color: var(--cream); }
.izlek-list button em { font-style: normal; font: 600 .7rem/1 var(--sans); color: var(--sand); font-variant-numeric: tabular-nums; }
.izlek-list button[aria-pressed="true"] {
  color: var(--cream); border-color: transparent;
  background: linear-gradient(var(--ink-soft), var(--ink-soft)) padding-box,
              var(--grad) border-box;
  border: 1px solid transparent;
}
.izlek-list button[aria-pressed="true"] em { color: var(--rose); }
.izlek-clear {
  margin-top: .9rem; appearance: none; cursor: pointer; width: 100%;
  padding: .45rem; border-radius: .5rem; background: none; border: 1px dashed var(--line);
  color: var(--cream-faint); font: 600 .72rem/1 var(--sans); letter-spacing: .06em;
  transition: color .18s, border-color .18s;
}
.izlek-clear:hover { color: var(--cream); border-color: var(--cream-dim); }
.izlek-clear[hidden] { display: none; }

/* ── reading column ─────────────────────────────────────── */
.reading { min-width: 0; }
.filter-note {
  margin: 0 0 1.8rem; padding: .7rem 1rem; border-radius: .6rem;
  background: var(--ink-soft); border: 1px solid var(--line);
  font: .82rem/1.4 var(--sans); color: var(--cream-mute);
}
.filter-note[hidden] { display: none; }
.filter-note b { color: var(--cream); font-weight: 600; }

.day-group { margin: 0 0 2.4rem; }
.day-group[hidden] { display: none; }
.day-head {
  display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  margin: 0 0 1.3rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line);
}
.day-head time { font: 600 .76rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--cream-mute); }
.day-head .cnt { font: .76rem/1 var(--sans); letter-spacing: .04em; color: var(--sand); font-style: normal; }

.entry { scroll-margin-top: 1.4rem; padding: 0 0 .4rem; margin: 0 0 2.2rem; }
.entry:last-child { margin-bottom: 0; }
.entry.hide { display: none; }
.entry-meta { margin: 0 0 .35rem; font: 600 .68rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.entry-meta .first { color: var(--pulse); }
.entry h2 { /* the title — kept as h2 for document outline */
  margin: 0 0 1rem; font: 500 clamp(1.5rem, 3.6vw, 2rem)/1.15 var(--serif); letter-spacing: -0.01em;
}
.entry h3 { margin: 1.7rem 0 .5rem; font: 600 1.18rem/1.3 var(--serif); font-style: italic; color: var(--cream); opacity: .95; }
.entry p { margin: 0 0 1.05rem; color: var(--cream-mute); }
.entry p:last-of-type { margin-bottom: 0; }

.entry-izlek { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.3rem 0 0; padding: 0; }
.entry-izlek button {
  appearance: none; cursor: pointer;
  font: 600 .64rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: .34rem .6rem; border-radius: 2rem;
  background: none; border: 1px solid var(--line); color: var(--cream-faint);
  transition: color .18s, border-color .18s;
}
.entry-izlek button:hover { color: var(--cream); border-color: var(--rose); }

.colophon { margin: 3.5rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--line); text-align: center; }
.colophon a { color: var(--cream-faint); font: .85rem/1 var(--sans); border-bottom: 1px dotted var(--cream-dim); padding-bottom: .12rem; transition: color .18s, border-color .18s; }
.colophon a:hover { color: var(--cream); border-bottom-color: var(--cream); }
.colophon .sep { color: var(--cream-dim); margin: 0 .6rem; }

.empty { opacity: .5; text-align: center; }

/* ── focus + motion floor ───────────────────────────────── */
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 2px; }

/* ── responsive: collapse the rail under a toggle ───────── */
@media (max-width: 800px) {
  .shell { padding: 2.2rem 1.1rem 4rem; }
  .wrap { display: block; }
  .rail {
    position: static; margin: 0 0 2rem;
  }
  .railtoggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    appearance: none; cursor: pointer; margin: 0 0 1rem;
    padding: .7rem 1rem; border-radius: .6rem;
    background: var(--ink-soft); border: 1px solid var(--line); color: var(--cream-mute);
    font: 600 .78rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  }
  .railtoggle .chev { transition: transform .25s; color: var(--sand); }
  .railtoggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .railbody { overflow: hidden; }
  .railbody[hidden] { display: none; }
}

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

/* ── scale layer: permalinks, month archives, archive lens ──────────────
   The journal is permalink-first: the landing renders only the most recent
   month inline; deep history lives at /log/YYYY/MM/ and /log/YYYY/MM/slug/. */

/* landing: which month am I reading + where the rest lives */
.reading-scope {
  margin: 0 0 2rem; padding: 0 0 1.4rem; border-bottom: 1px solid var(--line-soft);
  font: .9rem/1.5 var(--serif); font-style: italic; color: var(--cream-faint);
}
.reading-scope b { color: var(--cream-mute); font-style: normal; font-weight: 500; }

/* entry titles are now links to their permalink (color unchanged, underline on hover) */
.entry h2 a { color: inherit; transition: color .18s; }
.entry h2 a:hover { color: var(--rose); }
.entry-perma { margin: 1.1rem 0 0; }
.entry-perma a {
  font: 600 .66rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--cream-faint); border-bottom: 1px dotted var(--cream-dim);
  padding-bottom: .12rem; transition: color .18s, border-color .18s;
}
.entry-perma a:hover { color: var(--rose); border-bottom-color: var(--rose); }

/* Arşiv lens — year → month index over the whole journal */
.lens-arsiv .izlek-hint { /* reuse the izlek hint styling */ }
.arch-year { margin: 0 0 1.3rem; }
.arch-year h3 {
  margin: 0 0 .5rem; font: 600 .72rem/1 var(--sans); letter-spacing: .16em;
  text-transform: uppercase; color: var(--sand);
}
.arch-months { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.arch-months a {
  display: inline-flex; align-items: baseline; gap: .35rem;
  padding: .3rem .6rem; border-radius: 2rem;
  border: 1px solid var(--line); color: var(--cream-faint);
  font: .82rem/1 var(--serif); transition: color .18s, border-color .18s;
}
.arch-months a:hover { color: var(--cream); border-color: var(--rose); }
.arch-months em { font: 600 .62rem/1 var(--sans); font-style: normal; color: var(--sand); }

/* breadcrumb on permalink / month pages */
.crumb {
  margin: 0 0 1.8rem; font: 600 .7rem/1.4 var(--sans); letter-spacing: .1em;
  text-transform: uppercase; color: var(--cream-faint);
}
.crumb a { color: var(--cream-faint); border-bottom: 1px dotted var(--cream-dim); padding-bottom: .1rem; transition: color .18s; }
.crumb a:hover { color: var(--cream); }
.crumb .sep { color: var(--cream-dim); margin: 0 .5rem; }
.crumb [aria-current="page"] { color: var(--sand); }

/* prev / next navigation (entry permalinks + month archives) */
.entry-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin: 3rem 0 0; padding-top: 1.8rem; border-top: 1px solid var(--line);
}
.entry-nav a { display: flex; flex-direction: column; gap: .3rem; transition: color .18s; color: var(--cream-mute); }
.entry-nav a.next { text-align: right; align-items: flex-end; }
.entry-nav a:hover { color: var(--cream); }
.entry-nav .dir { font: 600 .66rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sand); }
.entry-nav .ttl { font: .95rem/1.3 var(--serif); }
.month-nav { grid-template-columns: 1fr 1fr; }
.month-nav a { font: 600 .82rem/1 var(--sans); letter-spacing: .04em; }
.month-nav a.next { text-align: right; }

/* standalone page chrome (permalink + month archive share the masthead link) */
.masthead .backhome {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.reading.solo { max-width: 42rem; margin: 0 auto; }
body.permalink .entry h1 {
  margin: 0 0 1.2rem; font: 500 clamp(1.8rem, 4.4vw, 2.4rem)/1.14 var(--serif); letter-spacing: -0.01em; color: var(--cream);
}
/* permalink chips are real links out to each motif's whole-thread page */
.entry-izlek.links a {
  display: inline-block;
  font: 600 .64rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: .34rem .6rem; border-radius: 2rem;
  border: 1px solid var(--line); color: var(--cream-faint);
  transition: color .18s, border-color .18s;
}
.entry-izlek.links a:hover { color: var(--cream); border-color: var(--rose); }

/* ── "same thread" siblings on a permalink page ─────────────────────────────
   The iz is this journal's signature, so following it is given real weight: a
   hairline-topped block, one strand per shared motif, the rose thread-accent
   waking only on hover (matching the chips + spine restraint). */
.related { margin: 3rem 0 0; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.related > h2 {
  margin: 0 0 1.3rem; font: 600 .7rem/1 var(--sans);
  letter-spacing: .14em; text-transform: uppercase; color: var(--sand);
}
.related .strand { margin: 0 0 1.5rem; }
.related .strand:last-child { margin-bottom: 0; }
.related .strand-name {
  display: inline-flex; align-items: baseline; gap: .45rem;
  font: 600 .64rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: .34rem .6rem; border-radius: 2rem;
  border: 1px solid var(--line); color: var(--cream-faint);
  transition: color .18s, border-color .18s;
}
.related .strand-name:hover { color: var(--cream); border-color: var(--rose); }
.related .strand-name .pull { font-size: .92em; color: var(--rose); }
.related ul { list-style: none; margin: .9rem 0 0; padding: 0 0 0 .15rem; display: grid; gap: .6rem; }
.related li a { display: flex; gap: .8rem; align-items: baseline; color: var(--cream-mute); transition: color .18s; }
.related li a:hover { color: var(--cream); }
.related li a:hover .r-ttl { border-bottom-color: var(--rose); }
.related .r-date {
  flex: none; min-width: 5rem;
  font: 600 .6rem/1.5 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--sand);
}
.related .r-ttl { font: 1rem/1.4 var(--serif); border-bottom: 1px solid transparent; transition: border-color .18s; }
@media (max-width: 32rem) {
  .related li a { flex-direction: column; gap: .15rem; }
  .related .r-date { min-width: 0; }
}

/* lead line atop a whole-thread (izlek) page */
.thread-lead {
  margin: 0 0 2.2rem; max-width: 42rem;
  font: 1.05rem/1.55 var(--serif); color: var(--cream-mute);
}
.thread-lead b { color: var(--cream); font-weight: 500; }

/* ── language toggle (TR · EN) ────────────────────────────────────────────
   Utility chrome, deliberately quiet: pinned to the shell's top-right corner
   on every page type. Current language wears --sand (the same mark the crumb
   gives the current page); the other is a dotted-underline link like the
   colophon/crumb links; the dot separator matches the colophon. No box. */
.langbar {
  position: absolute; top: clamp(1.1rem, 3vw, 1.6rem); right: clamp(1.05rem, 3.4vw, 1.5rem);
  z-index: 4; display: inline-flex; align-items: center;
  font: 600 .7rem/1 var(--sans); letter-spacing: .14em;
}
.langbar .cur { color: var(--sand); }
.langbar .alt {
  color: var(--cream-faint); border-bottom: 1px dotted var(--cream-dim);
  padding-bottom: .14rem; transition: color .18s, border-color .18s;
}
.langbar .alt:hover { color: var(--cream); border-bottom-color: var(--cream); }
.langbar .div { color: var(--cream-dim); margin: 0 .42rem; }

/* ── back-to-top ────────────────────────────────────────────
   Injected by log.js once the reader scrolls past ~1.25 viewports. Quiet by
   default (cream-on-ink, hairline), wakes to sand on hover — same restraint as
   the spine nodes and crumb. Respects the iOS home-indicator safe area. */
.totop {
  position: fixed; z-index: 30;
  right: clamp(1rem, 3.5vw, 2rem);
  bottom: calc(clamp(1rem, 3.5vw, 2rem) + env(safe-area-inset-bottom, 0px));
  width: 2.75rem; height: 2.75rem; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: var(--ink-soft); border: 1px solid var(--line);
  color: var(--cream-faint);
  box-shadow: 0 6px 20px -8px #00000099;
  opacity: 0; transform: translateY(.5rem) scale(.92);
  transition: opacity .2s ease, transform .2s ease, color .18s, border-color .18s, background .18s;
}
.totop.on { opacity: 1; transform: none; }
.totop:hover { color: var(--sand); border-color: var(--cream-dim); background: var(--ink); }
.totop:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }
.totop .arr { font: 500 1.2rem/1 var(--sans); }
@media (prefers-reduced-motion: reduce) {
  .totop { transition: opacity .2s ease, color .18s, border-color .18s; transform: none; }
  .totop:not(.on) { transform: none; }
}
