/* 星河 Starlit - a private observatory
   1 Tokens  2 Base  3 Top bar  4 Hero  5 Section heads  6 Poem  7 Diary  8 Almanac  9 Photos
   10 Wishes  11 Shelf  11b Guestbook  12 Footer  13 Motion  14 Larger screens  15 Reduced motion */

/* 1. Tokens */
:root {
  --bg: #060a14;                           /* page background, the ground */
  --sky-top: #03060f;
  --sky-mid: #0a1430;
  --sky-low: #182a4e;                      /* sky just above the hills */
  --horizon-glow: rgba(236,160,98,.2);
  --ridge-far: #0b1428;
  --panel: #0a1124;                        /* photo frames, star chart */
  --fg: #d5dae6;                           /* body text */
  --fg-strong: #f7f3ea;                    /* title, headings, poem */
  --muted: #a7b0c4;                        /* notes, intro */
  --faint: #8f9ab3;                        /* labels, dates (AA on --bg) */
  --accent: #ecc77f;                       /* starlight gold */
  --accent-strong: #ffe0a3;
  --accent-glow: rgba(236,199,127,.55);
  --line: rgba(178,196,232,.15);
  --line-strong: rgba(178,196,232,.3);

  --font-display: ui-serif, "New York", "Iowan Old Style", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --text-label: 0.75rem;
  --text-s: 0.9375rem;
  --text-m: 1.0625rem;
  --text-l: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-xl: clamp(2.25rem, 1.45rem + 3.4vw, 4.25rem);  /* section titles */
  --text-hero: clamp(3.25rem, 1.4rem + 8vw, 9rem);      /* site title */
  --leading: 1.9;
  --track-title: 0.06em;
  --track-label: 0.24em;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --wrap: 74rem;
  --section-pad: clamp(6rem, 4rem + 9vw, 11rem);
  --ridge-h: clamp(5rem, 3rem + 9vw, 11rem);
  --radius: 2px;
  --tap: 2.75rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);
  --star-shape: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  /* tiled stars: behind the page, inside the eyepiece, and the sky when JS is off */
  --starfield:
    radial-gradient(1.3px 1.3px at 24px 38px, #fffe, transparent),
    radial-gradient(1px 1px at 142px 96px, #fffb, transparent),
    radial-gradient(1.5px 1.5px at 238px 22px, #ffecced9, transparent),
    radial-gradient(1px 1px at 302px 214px, #d6e2ffbf, transparent),
    radial-gradient(1.7px 1.7px at 192px 304px, #fffe, transparent);
  --starfield-size: 360px 340px, 523px 479px, 611px 557px;
}

:root:lang(en) { --leading: 1.7; --track-title: -0.01em; --track-label: 0.18em; }
:root:lang(zh) { --text-label: 0.8125rem; --track-label: 0.14em; }

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body { margin: 0; color: var(--fg); font-family: var(--font-display); font-size: var(--text-m); line-height: var(--leading); overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }

body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--starfield); background-size: var(--starfield-size); opacity: 0.4; pointer-events: none; }

h1, h2, h3, p, figure, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
cite { font-style: normal; }
img { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-decoration-color: rgba(236,199,127,.45); text-underline-offset: 0.28em; transition: color 0.3s, text-decoration-color 0.3s; }

a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }

/* visually hidden, still read aloud */
.vh, .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: absolute; top: 0.75rem; left: 0.75rem; z-index: 100; padding: 0.75rem 1rem; background: var(--fg-strong); color: var(--bg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* shared type roles: small spaced capitals for labels, the sans-serif for interface text */
.hero-eyebrow, .readout dt, .entry-sky, .shelf-heading, .almanac-label, .almanac-facts dt, .guestbook__field > span { font-size: var(--text-label); font-weight: 400; letter-spacing: var(--track-label); text-transform: uppercase; }

.skip-link, .topbar, .hero-eyebrow, .readout, .hero-tools, .section-note, .poem-caption, .entry-sky, .photo-hint,
.photo figcaption, .wish-done, .wish-tag, .wish-status, .shelf-heading, .work-by, .site-footer,
.moon-more, .almanac-controls, .almanac-when, .almanac-facts dt, .guestbook__field > span, .guestbook__send, .guestbook__status,
.guestbook__note, .guestbook__meta, .guestbook__more { font-family: var(--font-sans); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* 3. Top bar: clear over the sky, solid once the page scrolls (it sits before the hero, not in it: see index.html) */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
  padding: 0 var(--gutter);
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.6s, border-color 0.6s;
}

.js .topbar:not(.is-scrolled) { background-color: rgba(6,10,20,0); border-bottom-color: transparent; }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; min-width: var(--tap); min-height: var(--tap); color: var(--fg-strong); text-decoration: none; }
.brand-star { width: 1.125rem; height: 1.125rem; fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent-glow)); transition: transform 0.9s var(--ease-out); }
.brand:hover .brand-star { transform: rotate(90deg) scale(1.2); }
.brand-name { font-family: var(--font-display); letter-spacing: 0.06em; }

.topnav { display: flex; gap: clamp(0.875rem, 3vw, 2.25rem); }

.topnav a { position: relative; display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); font-size: 0.875rem; letter-spacing: 0.06em; text-decoration: none; }

.topnav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0.6rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease-out);
}

.topnav a:hover, .topnav a[aria-current] { color: var(--fg-strong); }
.topnav a:hover::after, .topnav a[aria-current]::after { transform: none; transform-origin: left; }
.topbar-progress { position: absolute; inset: auto 0 -1px; height: 1px; background: linear-gradient(90deg, rgba(236,199,127,.2), var(--accent)); transform: scaleX(0); transform-origin: left; }

/* 4. Hero: sky, moon, title, horizon, readout */
.hero {
  position: relative;
  z-index: 10;          /* paints the hero above the sections below it */
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(70% 42% at 76% 100%, var(--horizon-glow), transparent 72%),
    radial-gradient(55% 50% at 84% 16%, rgba(74,106,170,.24), transparent 70%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 52%, var(--sky-low));
}

.hero-sky, .hero-stars, .hero-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-stars { background: var(--starfield); background-size: var(--starfield-size); transition: opacity 2s var(--ease-soft); }
.hero-canvas { opacity: 0; transition: opacity 2.4s var(--ease-soft); }
.hero.is-live .hero-canvas { opacity: 1; }
.hero.is-live .hero-stars { opacity: 0; }

/* the halo follows tonight's illumination (--lit, set by script.js) */
.moon { position: absolute; top: clamp(5.25rem, 13vh, 9rem); right: max(var(--gutter), calc(50vw - 30rem)); width: clamp(6.5rem, 4rem + 12vw, 14rem); aspect-ratio: 1; pointer-events: none; }

.moon::before {
  content: "";
  position: absolute;
  inset: -85%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(243,236,216,.2), rgba(243,236,216,.06) 42%, transparent 72%);
  opacity: calc(0.2 + var(--lit, 0.8) * 0.8);
}

.moon-disc { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.moon-night { fill: #121b30; stroke: rgba(214,226,255,.07); }
.moon-maria { fill: #a0977f; opacity: 0.3; }
.moon-crater { fill: #fffaf0; opacity: 0.55; }

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8rem var(--gutter) calc(var(--ridge-h) * 0.55 + 1rem);
}

.hero-eyebrow { display: flex; align-items: baseline; gap: 0.875rem; margin-bottom: clamp(1rem, 2.5vw, 1.75rem); color: var(--accent); line-height: 1.6; text-wrap: balance; }
.hero-eyebrow::before { content: ""; flex: none; width: 2.5rem; height: 1px; background: currentColor; opacity: 0.7; transform: translateY(-0.3em); }

.hero-title {
  max-width: 14ch;
  padding-bottom: 0.08em;
  color: var(--fg-strong);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: var(--track-title);
  text-wrap: balance;
}

@supports (-webkit-background-clip: text) {
  .hero-title { background: linear-gradient(176deg, #fffdf6 35%, #c9d3ea); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}

.hero-intro { max-width: 30em; margin-top: clamp(1.25rem, 2.5vw, 2rem); color: var(--muted); font-size: var(--text-l); line-height: 1.6; }

.hero-ground {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 0.5rem max(var(--gutter), calc(50vw - 37rem + var(--gutter))) 1.75rem;
  background: var(--bg);
}

/* wider than the screen so the hills can drift sideways (script.js moves .ridge--far and .horizon-near) */
.horizon { position: absolute; left: -2rem; bottom: calc(100% - 1px); width: calc(100% + 4rem); height: var(--ridge-h); pointer-events: none; }
.ridge, .horizon-near { position: absolute; inset: 0; width: 100%; height: 100%; }
.ridge--far { fill: var(--ridge-far); }
.ridge-fill { fill: var(--bg); }
.ridge-rim { fill: none; stroke: rgba(150,176,228,.32); vector-effect: non-scaling-stroke; }

/* the dome sits on the flat shoulder of the near ridge (x 1100-1160 of 1440) */
.dome, .dome-glow { position: absolute; left: 78.5%; transform: translateX(-50%); }
.dome { bottom: 38%; width: clamp(2.25rem, 1.5rem + 2.6vw, 4rem); overflow: visible; }
.dome-body { fill: var(--bg); stroke: rgba(150,176,228,.3); stroke-width: 0.6; }
.dome-slit, .dome-window { fill: #f6cf8a; }
.dome-scope { fill: #4d5c80; transform-origin: 29.4px 18.8px; transition: transform 1.6s var(--ease-out); }

.dome-glow {
  bottom: 30%;
  width: clamp(7rem, 4rem + 10vw, 14rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(246,207,138,.28), rgba(246,207,138,.06) 50%, transparent);
  transform: translate(-50%, 30%);
}

.readout { display: grid; grid-template-columns: repeat(2, auto); gap: 1rem 2rem; }
.readout-item { display: flex; flex-direction: column; gap: 0.25rem; }
.readout dt { color: var(--faint); }
.readout dd { color: var(--fg-strong); font-family: var(--font-display); line-height: 1.4; font-variant-numeric: tabular-nums; }
.moon-note { color: var(--muted); }
.moon-next { display: block; color: var(--faint); font-family: var(--font-sans); font-size: 0.8125rem; }
.moon-next:empty { display: none; }
.moon-more { display: block; width: fit-content; padding: 0.375rem 0; font-size: 0.8125rem; letter-spacing: 0.04em; }

/* the nights count rolls up like an odometer (script.js builds the columns) */
.odometer-col { display: inline-block; height: 1.4em; overflow: hidden; vertical-align: top; }
.odometer-col > span { display: block; white-space: pre; transition: transform 1.3s cubic-bezier(0.3, 0.1, 0.1, 1); }
.odometer.is-on .odometer-col > span { transform: translateY(calc(var(--to) * -1.4em)); }

/* quiet controls under the sky: the tap hint and the phone-tilt toggle */
.hero-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.75rem; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.04em; }
.sky-hint { transition: opacity 1.2s; }
.sky-hint.is-done { opacity: 0; }
.sky-hint::before { content: ""; display: inline-block; width: 1.5rem; height: 1px; margin-right: 0.75rem; vertical-align: middle; background: linear-gradient(90deg, transparent, var(--accent)); transform: rotate(-28deg); }

.tilt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--tap);
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline 1px var(--line-strong);
  text-underline-offset: 0.35em;
  background: none;
  border: 0;
  cursor: pointer;
}

/* a small phone that tips over when the tilt is on */
.tilt-toggle::before { content: ""; width: 0.625rem; height: 1rem; border: 1px solid currentColor; border-radius: 2px; transform: rotate(-12deg); transition: transform 0.6s var(--ease-out), background-color 0.4s; }
.tilt-toggle[aria-pressed="true"] { color: var(--accent); }
.tilt-toggle[aria-pressed="true"]::before { background: rgba(236,199,127,.3); transform: rotate(16deg); }

/* 5. Section headings: a hairline with a small star at its start */
.section { position: relative; padding-top: var(--section-pad); }
.section-head { position: relative; display: grid; gap: 1rem; padding-top: 2rem; margin-bottom: clamp(3rem, 2rem + 4vw, 5.5rem); }

.section-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--line-strong) 4rem, var(--line) 60%, transparent);
  transform-origin: left;
  transition: transform 1.6s var(--ease-out) 0.15s;
}

.section-head::after {
  content: "";
  position: absolute;
  top: -0.4375rem;
  left: -0.4375rem;
  width: 0.875rem;
  height: 0.875rem;
  background: var(--accent);
  clip-path: var(--star-shape);
  transition: transform 1.4s var(--ease-out);
}

.section-title { color: var(--fg-strong); font-size: var(--text-xl); font-weight: 400; line-height: 1.1; letter-spacing: var(--track-title); text-wrap: balance; }
.section-note { max-width: 30em; color: var(--muted); font-size: var(--text-s); line-height: 1.75; }

/* 6. Poem, seen through an eyepiece */
.poem-section { overflow: hidden; }
.poem { --size: min(122vw, 44rem); padding: 0 var(--gutter); }  /* --size: eyepiece diameter */
.poem-stage { position: relative; display: grid; place-items: center; min-height: var(--size); }

.eyepiece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 44%, rgba(30,58,118,.55), rgba(12,24,54,.6) 40%, transparent 70%), var(--starfield);
  background-size: auto, var(--starfield-size);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 90px 30px rgba(3,6,14,.9), 0 0 140px rgba(80,120,210,.16);
}

/* reticle: crosshair ticks near the rim only, so they never cross the poem */
.eyepiece::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 100% no-repeat, linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat;
  -webkit-mask-image: radial-gradient(closest-side, transparent 80%, #000 82%, #000 94%, transparent);
  mask-image: radial-gradient(closest-side, transparent 80%, #000 82%, #000 94%, transparent);
}

/* tick marks: dashes on circles whose length is set to 360 (one dash per degree step) */
.eyepiece-ring { position: absolute; inset: -3%; width: 106%; height: 106%; fill: none; }
.ring-ticks { stroke: rgba(178,196,232,.28); stroke-width: 2.5; stroke-dasharray: 0.25 2.75; }
.ring-major { stroke: var(--accent); stroke-width: 5; stroke-dasharray: 0.4 29.6; opacity: 0.75; }
.ring-edge { stroke: var(--line-strong); stroke-width: 0.4; }

.poem-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 2rem 0;
  color: var(--fg-strong);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.875rem);
  line-height: 1.7;
  text-shadow: 0 0 24px rgba(160,190,255,.25);
}

/* Chinese: vertical columns, read right to left */
:lang(zh) .poem:not(.poem--across) .poem-body { writing-mode: vertical-rl; max-height: calc(var(--size) * 0.72); gap: 0.5em; letter-spacing: 0.32em; line-height: 1.9; }

/* script.js sets --p (scroll progress 0-1), --n (line count) and --i (each line's place) */
.poem-line { --on: clamp(0, var(--p, 1) * var(--n, 1) - var(--i, 0), 1); display: block; opacity: calc(0.12 + var(--on) * 0.88); transform: translateY(calc((1 - var(--on)) * 0.6em)); }

.poem-line--step1 { padding-inline-start: 1.5em; }
.poem-line--step2 { padding-inline-start: 3em; color: var(--accent-strong); }
.poem-caption { margin-top: 1rem; color: var(--faint); font-size: var(--text-s); letter-spacing: 0.06em; text-align: center; }
.poem-caption::before, .photo figcaption::before { content: ""; display: inline-block; width: 1.5rem; height: 1px; margin-right: 0.75rem; vertical-align: middle; background: currentColor; opacity: 0.6; }

/* 7. Diary */
.diary-list { border-bottom: 1px solid var(--line); }
.entry { display: grid; gap: 0.75rem 2.5rem; padding: 2.25rem 0 2.5rem; border-top: 1px solid var(--line); }

.entry-date { color: var(--fg-strong); font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); line-height: 1.15; letter-spacing: 0.02em; }
.entry-sky { margin-bottom: 0.625rem; color: var(--faint); }
.entry-title { margin-bottom: 0.75rem; color: var(--fg-strong); font-size: var(--text-l); font-weight: 400; line-height: 1.4; }
.entry-body { max-width: 36em; }

/* 8. Almanac: the moon on any night, in a finder ring beside an observing log. Phones: date, moon,
   log. From 48rem the moon sits on the left. --lit (0-1) and --p (place in the month) come from script.js. */
.almanac-section { overflow: hidden; }  /* the moon's halo spills past its ring */
.almanac { display: grid; gap: 2.25rem; }
.almanac-controls { position: relative; z-index: 1; display: grid; gap: 0.75rem; }  /* above the moon's halo */

.almanac-date {
  justify-self: start;
  width: 100%;
  max-width: 17rem;
  min-height: 3.25rem;
  padding: 0.5rem 0.875rem;
  color: var(--fg-strong);
  font: 1.125rem/1.4 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.4s;
}

.almanac-date:hover { border-color: rgba(236,199,127,.55); }
.almanac-date::-webkit-calendar-picker-indicator { opacity: 0.8; cursor: pointer; filter: sepia(1) saturate(2.4); }
.almanac-quick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }

/* quick dates: hairline tabs with a star that turns gold for the night on show */
.almanac-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0 0.875rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.4s, border-color 0.4s, background-color 0.4s;
}

.almanac-chip::before { content: ""; flex: none; width: 0.625rem; height: 0.625rem; background: var(--line-strong); clip-path: var(--star-shape); transition: background-color 0.4s, transform 0.9s var(--ease-out); }
.almanac-chip:hover { color: var(--fg-strong); border-color: rgba(236,199,127,.55); }
.almanac-chip[aria-pressed="true"] { color: var(--accent-strong); background: rgba(236,199,127,.08); border-color: var(--accent); }
.almanac-chip[aria-pressed="true"]::before { background: var(--accent); transform: rotate(90deg) scale(1.25); }

/* only a picture: its halo and ring spill over the buttons, so taps pass straight through */
.almanac-scope { position: relative; justify-self: center; width: min(74vw, 21rem); aspect-ratio: 1; margin: 1.25rem 0; pointer-events: none; }

.almanac-scope::before {
  content: "";
  position: absolute;
  inset: -45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(243,236,216,.2), rgba(243,236,216,.05) 45%, transparent 72%);
  opacity: calc(0.08 + var(--lit, 1) * 0.92);
}

.almanac-ring { position: absolute; inset: -8%; width: 116%; height: 116%; fill: none; }
.almanac-moon { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }

.almanac-log { min-width: 0; }
.almanac-when { color: var(--accent); font-size: 0.875rem; letter-spacing: 0.06em; }
.almanac-when:empty { display: none; }
.almanac-phase { margin-top: 0.375rem; color: var(--fg-strong); font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem); line-height: 1.15; letter-spacing: var(--track-title); text-wrap: balance; }
.almanac-line { max-width: 24em; margin-top: 0.875rem; color: var(--muted); line-height: 1.75; text-wrap: pretty; }
.almanac-facts { margin-top: 1.75rem; border-top: 1px solid var(--line-strong); }
.almanac-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.125rem 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.almanac-facts dt { color: var(--faint); }
.almanac-facts dd { color: var(--fg-strong); line-height: 1.5; font-variant-numeric: tabular-nums; }

/* one lunar month on a line: new, first quarter, full, last quarter, new; the gold mark is the night */
.almanac-track { position: relative; height: 3rem; margin: 1.5rem 0.5rem 0; }
.almanac-track::before { content: ""; position: absolute; inset: 50% 0 auto; height: 1px; background: linear-gradient(90deg, var(--line-strong), rgba(236,199,127,.45), var(--line-strong)); }
.track-phase { position: absolute; top: 50%; left: 0; width: 0.75rem; height: 0.75rem; margin: -0.375rem 0 0 -0.375rem; border-radius: 50%; background: #121b30; box-shadow: 0 0 0 1px var(--line-strong); }
.track-phase:nth-child(2) { left: 25%; background: linear-gradient(90deg, #121b30 50%, #e7dcc0 50%); }
.track-phase:nth-child(3) { left: 50%; background: #e7dcc0; box-shadow: 0 0 10px rgba(243,236,216,.5); }
.track-phase:nth-child(4) { left: 75%; background: linear-gradient(90deg, #e7dcc0 50%, #121b30 50%); }
.track-phase:nth-child(5) { left: 100%; }
.track-mark { position: absolute; top: 0.375rem; bottom: 0; left: calc(var(--p, 0) * 100%); width: 1px; background: linear-gradient(var(--accent), rgba(236,199,127,.1)); }
.track-mark::before { content: ""; position: absolute; top: -0.5rem; left: -0.5rem; width: 1rem; height: 1rem; background: var(--accent-strong); clip-path: var(--star-shape); }

/* 9. Photos: one column on phones, two from 30rem, a large frame beside two small ones from 48rem */
.photo-grid { display: grid; gap: 2rem 1rem; }
.photo { display: flex; flex-direction: column; gap: 0.875rem; }

.photo-frame { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--panel); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px #000; }

.photo--large .photo-frame { aspect-ratio: 4 / 3; }
.photo-frame img, .photo-art { transition: transform 2.4s var(--ease-out), opacity 2s var(--ease-soft) 0.25s; }
.photo-frame:hover img, .photo-frame:hover .photo-art { transform: scale(1.04); }  /* the picture drifts slowly closer */
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* placeholders until real photos go in */
.photo-art { position: absolute; inset: 0; }
.photo-art svg { position: absolute; left: 0; bottom: 0; z-index: 1; width: 100%; height: 34%; }
.photo-art--trails { background: radial-gradient(circle at 70% 24%, #fff 0 1.5px, transparent 4px), radial-gradient(60% 50% at 50% 100%, rgba(236,160,98,.24), transparent), linear-gradient(#050a18, #0c1a3a 70%, #1a2b4e); }

/* star trails: two sets of rings round the pole star (70% 24% of the frame), broken into arcs.
   The boxes are oversized so the trails can sweep round the pole as the photo appears. */
.photo-art--trails::before, .photo-art--trails::after {
  --pole: 59.1% 38.2%;
  content: "";
  position: absolute;
  inset: -60%;
  background: repeating-radial-gradient(circle at var(--pole), transparent 0 8px, rgba(214,226,255,.3) 8.4px 8.9px, transparent 9.3px 17px);
  -webkit-mask-image: repeating-conic-gradient(from 20deg at var(--pole), transparent 0 14deg, #000 50deg 64deg, transparent 80deg 100deg);
  mask-image: repeating-conic-gradient(from 20deg at var(--pole), transparent 0 14deg, #000 50deg 64deg, transparent 80deg 100deg);
  transform-origin: var(--pole);
  transition: transform 3.2s var(--ease-out) 0.2s;
}

.photo-art--trails::after {
  background: repeating-radial-gradient(circle at var(--pole), transparent 0 12.5px, rgba(255,228,190,.24) 12.9px 13.4px, transparent 13.8px 22px);
  -webkit-mask-image: repeating-conic-gradient(from 75deg at var(--pole), transparent 0 20deg, #000 70deg 92deg, transparent 120deg 137deg);
  mask-image: repeating-conic-gradient(from 75deg at var(--pole), transparent 0 20deg, #000 70deg 92deg, transparent 120deg 137deg);
}

.photo-art--trails svg { fill: #04070f; }
.photo-art--sea { background: radial-gradient(circle at 34% 36%, #fbf3dc 0 7%, rgba(251,243,220,.3) 7.6%, rgba(251,243,220,.06) 22%, transparent 34%), linear-gradient(#07112a, #142a52 55%, #22385e 58.5%, #0b1630 59%, #050b18); }

/* the moon's path on the water, and faint swell lines */
.photo-art--sea::before {
  content: "";
  position: absolute;
  left: 34%;
  top: 59%;
  bottom: 0;
  width: 30%;
  transform: translateX(-50%);
  background: repeating-linear-gradient(rgba(251,243,220,.7) 0 1.5px, transparent 1.5px 6px);
  -webkit-mask-image: radial-gradient(50% 100% at 50% 0, #000, transparent);
  mask-image: radial-gradient(50% 100% at 50% 0, #000, transparent);
}

.photo-art--sea::after { content: ""; position: absolute; inset: 59% 0 0; background: repeating-linear-gradient(rgba(169,193,236,.1) 0 1px, transparent 1px 9px); }
.photo-art--city { background: radial-gradient(80% 60% at 50% 100%, rgba(236,160,98,.32), transparent 70%), radial-gradient(circle at 78% 26%, #f3ecd8 0 4%, rgba(243,236,216,.1) 9%, transparent 16%), linear-gradient(#060b1b, #13203e 70%, #2a2a44); }
.photo-art--city svg { height: 62%; }
.city-near { fill: #070b16; }

/* "your photo here" tag, bottom left so the picture's moon or pole star stays clear */
.photo-hint {
  position: absolute;
  left: 0.625rem;
  bottom: 0.625rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100% - 1.25rem);
  padding: 0.3125rem 0.625rem;
  overflow: hidden;
  color: var(--fg);
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: rgba(6,10,20,.8);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

/* a tiny camera */
.photo-hint::before { content: ""; flex: none; width: 0.875rem; height: 0.625rem; border: 1px solid var(--accent); border-radius: 2px; background: radial-gradient(circle, var(--accent) 0 1.5px, transparent 2px); }
.photo figcaption { color: var(--muted); font-size: var(--text-s); line-height: 1.6; }

/* 10. Wishes: a constellation you can light */
.constellation { --cw: 100cqw; position: relative; container-type: inline-size; display: grid; gap: 1.5rem; }  /* --cw: chart width */

.chart {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(90% 70% at 50% 115%, rgba(48,80,150,.4), transparent 70%), var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.chart-grid, .chart-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-grid { fill: none; stroke: rgba(169,193,236,.13); stroke-width: 0.18; }
.chart-ecliptic { stroke: rgba(236,199,127,.22); stroke-dasharray: 0.8 0.8; }
.chart-grid text { fill: rgba(169,193,236,.5); stroke: none; font: 2.3px var(--font-sans); }
.chart-lines line { stroke-linecap: round; }
.seg-base { stroke: rgba(169,193,236,.3); stroke-width: 0.22; stroke-dasharray: 0.5 1.1; }

/* each line is drawn in once both of its stars are lit */
.seg-lit { stroke: var(--accent); stroke-width: 0.36; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s var(--ease-out); }
.seg-lit.is-on { stroke-dashoffset: 0; }

/* the name; once every star is lit, the figure is named under it */
.chart-name { position: absolute; right: 1rem; bottom: 0.625rem; color: var(--muted); font-size: 0.9375rem; letter-spacing: 0.16em; text-align: right; transition: color 1s, text-shadow 1s; }
.chart-figure { display: block; color: var(--accent-strong); font-size: 0.8125rem; letter-spacing: 0.08em; opacity: 0; transform: translateY(0.5rem); transition: opacity 1.2s 0.9s, transform 1.6s var(--ease-out) 0.9s; }
.is-complete .chart-name { color: var(--fg-strong); text-shadow: 0 0 16px var(--accent-glow); }
.is-complete .chart-figure { opacity: 1; transform: none; }

/* a shooting star crosses the chart when the last star is lit */
.chart-meteor { position: absolute; top: 8%; left: 100%; width: 8rem; height: 1px; background: linear-gradient(90deg, #fff, transparent); opacity: 0; transform-origin: left; }
.is-celebrating .chart-meteor { animation: chart-meteor 1.5s var(--ease-soft) 1s; }

@keyframes chart-meteor {
  0% { opacity: 0; transform: rotate(-24deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(-130cqw); }
}

.wish-list { border-bottom: 1px solid var(--line); }
.wish { border-top: 1px solid var(--line); }

/* the star of each wish, drawn on the chart */
.wish-star {
  position: absolute;
  left: calc(var(--x) * var(--cw) / 100);
  top: calc(var(--y) * var(--cw) * 0.8 / 100);
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: calc(var(--tap) / -2) 0 0 calc(var(--tap) / -2);
  background: linear-gradient(90deg, transparent, rgba(255,224,163,.75), transparent) center / 0 1px no-repeat, linear-gradient(transparent, rgba(255,224,163,.75), transparent) center / 1px 0 no-repeat;
  transition: background-size 0.8s var(--ease-out);
}

.wish-star::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: #dfe6f5;
  box-shadow: 0 0 0 4px rgba(169,193,236,.08), 0 0 12px rgba(169,193,236,.55);
  transition: transform 0.6s var(--ease-out), background-color 0.5s, box-shadow 0.8s;
}

.wish-star::after { content: ""; position: absolute; inset: 0.6875rem; border: 1px solid var(--accent); border-radius: 50%; opacity: 0; }
.wish.is-lit .wish-star, .wish--done .wish-star { background-size: 100% 1px, 1px 100%; }

.wish.is-lit .wish-star::before, .wish--done .wish-star::before {
  background: var(--accent-strong);
  box-shadow: 0 0 0 5px rgba(236,199,127,.14), 0 0 16px 4px rgba(236,199,127,.55), 0 0 44px 12px rgba(236,199,127,.16);
  transform: scale(1.4);
}

/* hovering or focusing a wish (row or star) enlarges its star and names it on the chart */
.wish:hover .wish-star, .wish-btn:focus-visible .wish-star { z-index: 3; }
.wish:hover .wish-star::before, .wish-btn:focus-visible .wish-star::before { transform: scale(1.8); }
.wish.is-lit:hover .wish-star::before, .wish.is-lit .wish-btn:focus-visible .wish-star::before { transform: scale(2.1); }
.wish--done .wish-star::after { inset: 0.375rem; opacity: 0.6; }
.wish.is-bursting .wish-star::after { animation: burst 1s var(--ease-out); }
.is-celebrating .wish-star::after { animation: burst 1.2s var(--ease-out) calc(var(--k, 0) * 0.15s + 0.3s) backwards; }

@keyframes burst {
  from { opacity: 1; transform: scale(0.3); }
  to { opacity: 0; transform: scale(2.6); }
}

.wish-tag {
  position: absolute;
  top: 50%;
  left: calc(50% + 1.25rem);
  width: max-content;
  max-width: min(15rem, 42cqw);
  padding: 0.25rem 0.5rem;
  color: var(--fg-strong);
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  background: rgba(10,17,36,.92);
  border-left: 1px solid var(--accent);
  opacity: 0;
  transform: translate(-0.5rem, -50%);
  transition: opacity 0.35s, transform 0.6s var(--ease-out);
  pointer-events: none;
}

.wish-tag::before { content: ""; position: absolute; top: 50%; right: 100%; width: 0.75rem; height: 1px; background: var(--accent); opacity: 0.7; }
.wish--flip .wish-tag { left: auto; right: calc(50% + 1.25rem); text-align: right; border: 0; border-right: 1px solid var(--accent); transform: translate(0.5rem, -50%); }
.wish--flip .wish-tag::before { right: auto; left: 100%; }
.wish:hover .wish-tag, .wish-btn:focus-visible .wish-tag { opacity: 1; transform: translate(0, -50%); }

.wish-btn { display: block; width: 100%; padding: 0; color: inherit; font: inherit; text-align: start; background: none; border: 0; cursor: pointer; }
.wish-btn:focus-visible { outline-offset: -2px; }
.wish-text { position: relative; display: block; padding: 1rem 0 1rem 1.875rem; line-height: 1.55; transition: transform 0.6s var(--ease-out), color 0.4s; }

/* small star in front of each wish, gold once lit */
.wish-text::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 1.375rem;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--line-strong);
  clip-path: var(--star-shape);
  transition: background-color 0.4s, transform 0.8s var(--ease-out);
}

.wish-btn:hover .wish-text { transform: translateX(0.375rem); color: var(--fg-strong); }
.wish.is-lit .wish-text, .wish--done .wish-text { color: var(--fg-strong); }
.wish.is-lit .wish-text::before, .wish--done .wish-text::before { background: var(--accent); transform: scale(1.2); }
.wish-done { margin-inline-start: 0.5rem; color: var(--accent); font-size: var(--text-label); letter-spacing: 0.12em; white-space: nowrap; }
.wish-status { min-height: 1.75em; color: var(--muted); font-size: var(--text-s); transition: color 0.6s; }
.is-complete .wish-status { color: var(--accent); }

@supports not (width: 1cqw) {
  .wish-star { display: none; }
}

/* 11. Shelf */
.shelf { display: grid; gap: 3.5rem; }
.shelf-heading { padding-bottom: 1rem; color: var(--accent); border-bottom: 1px solid var(--line-strong); }
.work { position: relative; padding: 1.5rem 0 1.625rem 1.875rem; border-bottom: 1px solid var(--line); }

.work::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 2.0625rem;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--line-strong);
  clip-path: var(--star-shape);
  transition: background-color 0.4s, transform 0.9s var(--ease-out);
}

.work:hover::before { background: var(--accent); transform: rotate(90deg) scale(1.3); }
.work-title { margin-right: 0.75rem; color: var(--fg-strong); font-size: 1.375rem; line-height: 1.45; text-spacing-trim: trim-start; }
.work-by { color: var(--faint); font-size: 0.875rem; letter-spacing: 0.04em; }
.work-note { margin-top: 0.375rem; color: var(--muted); font-size: 1rem; line-height: 1.75; }

/* 11b. Guestbook: every message is one more star in the log. The platform script shows the section
   and renders the list (.guestbook__item, __head, __name, __meta, __body, or one .guestbook__empty) */
.guestbook-layout { display: grid; gap: 3.5rem; align-items: start; }
.guestbook__form { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1.5rem 1.25rem; }
.guestbook__field, .guestbook__note { grid-column: 1 / -1; }
.guestbook__field { display: grid; gap: 0.625rem; }
.guestbook__field > span { color: var(--faint); }

.guestbook__field :is(input, textarea) {
  width: 100%;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.625rem 0.875rem;
  color: var(--fg-strong);
  font: var(--text-m)/1.7 var(--font-display);
  background: var(--panel);
  border: 1px solid rgba(178,196,232,.5);  /* stronger than --line-strong so the field's edge reads (3:1) */
  border-radius: var(--radius);
  transition: border-color 0.4s;
}

.guestbook__field textarea { min-height: 8.5rem; resize: vertical; }
.guestbook__field :is(input, textarea):hover { border-color: rgba(236,199,127,.55); }
.guestbook__field :is(input, textarea):focus { border-color: var(--accent); }

/* the send button: a lit chip with its star */
.guestbook__send {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: var(--tap);
  padding: 0 1.25rem;
  color: var(--accent-strong);
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  background: rgba(236,199,127,.08);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.4s, background-color 0.4s;
}

.guestbook__send::before { content: ""; flex: none; width: 0.75rem; height: 0.75rem; background: var(--accent); clip-path: var(--star-shape); transition: transform 0.9s var(--ease-out); }
.guestbook__send:hover { color: var(--fg-strong); background: rgba(236,199,127,.16); }
.guestbook__send:hover::before { transform: rotate(90deg) scale(1.25); }
.guestbook__send:disabled { opacity: 0.6; cursor: progress; }

.guestbook__status { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.guestbook__status[data-state="ok"] { color: var(--accent-strong); }
.guestbook__status[data-state="error"] { color: #ffb4a6; }
.guestbook__note { max-width: 30em; color: var(--faint); font-size: 0.8125rem; line-height: 1.7; }
.guestbook__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.guestbook__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.guestbook__list > li { position: relative; padding: 1.5rem 0 1.625rem 1.875rem; border-bottom: 1px solid var(--line); }

.guestbook__list > li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 2.125rem;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--accent);
  clip-path: var(--star-shape);
}

.guestbook__item:nth-child(3n + 2)::before { transform: scale(0.7); opacity: 0.8; }
.guestbook__item:nth-child(3n)::before { transform: scale(0.85); }
.guestbook__empty { color: var(--muted); }
.guestbook__list > .guestbook__empty::before { background: var(--line-strong); }
.guestbook__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.guestbook__name { color: var(--fg-strong); font-size: 1.375rem; line-height: 1.45; }
.guestbook__meta { color: var(--faint); font-size: 0.8125rem; letter-spacing: 0.04em; }
.guestbook__time { white-space: nowrap; }
.guestbook__body { margin-top: 0.375rem; color: var(--muted); font-size: 1rem; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }

.guestbook__more {
  margin-top: 1.75rem;
  min-height: var(--tap);
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.4s, border-color 0.4s;
}

.guestbook__more:hover { color: var(--fg-strong); border-color: rgba(236,199,127,.55); }
.guestbook__more:disabled { opacity: 0.6; cursor: progress; }

/* 12. Footer */
.site-footer {
  margin-top: var(--section-pad);
  padding: clamp(5rem, 3rem + 8vw, 9rem) var(--gutter) 2.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  background: radial-gradient(50% 70% at 50% 0%, rgba(236,199,127,.08), transparent 70%);
}

.footer-star { width: 1.25rem; height: 1.25rem; margin-bottom: 2rem; fill: var(--accent); filter: drop-shadow(0 0 8px var(--accent-glow)); }
.footer-line { max-width: 16em; margin: 0 auto 3rem; color: var(--fg-strong); font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem); line-height: 1.3; letter-spacing: var(--track-title); text-wrap: balance; }
.footer-meta { color: var(--faint); font-size: 0.875rem; }
.footer-meta a, .footer-credit a { display: inline-block; padding: 0.625rem 0; }
.footer-sep { margin: 0 0.625rem; }
.footer-credit { font-size: 0.8125rem; }
.footer-credit a { color: var(--faint); }

/* 13. Motion: only with JS and when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 1.1s var(--ease-out), transform 1.3s var(--ease-out); transition-delay: calc(var(--i, 0) * 120ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .js .wish-list.reveal { transform: none; } /* a transform would pull the stars off the chart */

  /* headings: the star turns in and the hairline draws out from it */
  .js .section-head.reveal:not(.is-in)::before { transform: scaleX(0); }
  .js .section-head.reveal:not(.is-in)::after { transform: rotate(-135deg) scale(0); }

  /* photos develop: the picture rises out of the dark while the star trails sweep round */
  .js .photo.reveal:not(.is-in) :is(img, .photo-art) { opacity: 0; transform: scale(1.08); }
  .js .photo.reveal:not(.is-in) .photo-art--trails::before { transform: rotate(-70deg); }
  .js .photo.reveal:not(.is-in) .photo-art--trails::after { transform: rotate(-110deg); }

  /* the hero comes into focus like a telescope being adjusted */
  .js .topbar { animation: fade-in 1.2s var(--ease-soft) 0.2s both; }
  .js .hero-eyebrow, .js .hero-title, .js .hero-intro, .js .readout-item, .js .hero-tools { animation: focus-in 1.8s var(--ease-out) 0.35s both; }
  .js .hero-title { animation-delay: 0.5s; }
  .js .hero-intro { animation-delay: 0.8s; }
  .js .readout-item { animation-delay: 0.95s; }
  .js .readout-item + .readout-item { animation-delay: 1.05s; }
  .js .readout-item + .readout-item + .readout-item, .js .hero-tools { animation-delay: 1.15s; }
  .js .moon-disc { animation: moon-rise 2.6s var(--ease-out) 0.1s both; }
  .js .moon::before { animation: fade-in 3.2s var(--ease-soft) 0.6s both; }

  /* a new night in the almanac comes into focus, line by line */
  .almanac-log.is-fresh :is(.almanac-when, .almanac-phase, .almanac-line) { animation: focus-in 1s var(--ease-out) both; }
  .almanac-log.is-fresh .almanac-phase { animation-delay: 0.08s; }
  .almanac-log.is-fresh .almanac-line { animation-delay: 0.16s; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes focus-in { from { opacity: 0; filter: blur(14px); transform: translateY(0.5em); } }
@keyframes moon-rise { from { opacity: 0; transform: translateY(2.5rem) scale(0.94); } }

/* 14. Screen sizes */
@media (max-width: 23.99rem) {
  .topnav { gap: 0.75rem; }
  .topnav a { font-size: 0.8125rem; letter-spacing: 0; }
}

@media (max-width: 29.99rem) {
  .topnav .topnav-wide { display: none; }  /* the almanac link waits for room; the hero links to it too */
  .chart-grid text { display: none; }
  .chart-name { right: 0.75rem; font-size: 0.8125rem; letter-spacing: 0.1em; }
}

@media (min-width: 30rem) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo--large { grid-column: 1 / -1; }
  .photo:not(.photo--large) .photo-frame { aspect-ratio: 1; }
}

@media (min-width: 40rem) {
  .readout { display: flex; }
  .readout-item { padding: 0 2.25rem; border-left: 1px solid var(--line); }
  .readout-item:first-child { padding-left: 0; border-left: 0; }
}

@media (min-width: 48rem) {
  .brand-name { position: static; width: auto; height: auto; clip-path: none; }
  .entry { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .photo-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2.5rem 1.75rem; }
  .photo--large { grid-column: 1 / 8; grid-row: 1 / 3; }
  .photo--large .photo-frame { flex: 1; aspect-ratio: auto; min-height: 24rem; }
  .photo:not(.photo--large) { grid-column: 8 / 13; }
  .photo:not(.photo--large) .photo-frame { aspect-ratio: 3 / 2; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5rem; }
  .almanac { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "scope controls" "scope log"; gap: 2.5rem clamp(3rem, 7vw, 7rem); align-items: start; }
  .almanac-controls { grid-area: controls; }
  .almanac-scope { grid-area: scope; align-self: center; width: min(84%, 26rem); }
  .almanac-log { grid-area: log; }
}

@media (min-width: 60rem) {
  .section-head { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; column-gap: 4rem; }
  .diary-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); column-gap: 5rem; align-items: start; }
  .diary-layout .section-head { position: sticky; top: 7rem; grid-template-columns: 1fr; }
  .guestbook-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); column-gap: 5rem; }
  .guestbook__form { position: sticky; top: 7rem; }
  .constellation { --cw: 56cqw; grid-template-columns: 56% minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 4rem; align-items: start; }
  .chart { grid-row: 1 / 3; }
}

@media (max-height: 34rem) and (orientation: landscape) {
  .moon { top: 4.5rem; width: 5rem; }
}

/* 15. Reduced motion: everything shown at once, nothing drifts */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* flowers and photo games under the photos (platform cheer.js / play.js) */
.cheer-row { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-top: 2.5rem; }
.cheer-row__lede { margin: 0; }
.cheer-row .mc-cheer { margin: 0; }
.play { max-width: 34rem; margin: 3.5rem auto 0; text-align: center; }
.play__title { margin: 0 0 .35rem; font-size: 1.3rem; }
.play__lede { margin: 0 0 1.25rem; opacity: .8; }
.play .mc-play { text-align: left; }

/* quiz and visitor footprints (platform quiz.js / footprints.js) */
.quiz, .footprints { max-width: 36rem; margin: 3.5rem auto 0; }
.quiz__title, .footprints__title { margin: 0 0 1rem; font-size: 1.3rem; text-align: center; }
