/* Stardust Wonders. Tokens follow DESIGN.md. */

/* ---------- fonts (self-hosted, Latin only) ---------- */
@font-face {
  font-family: "Gowun Batang";
  src: url("/fonts/gowun-batang-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Ysabeau Office";
  src: url("/fonts/ysabeau-office-400-500.woff2") format("woff2");
  font-weight: 400 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fallbacks sized to the web fonts' widths and line boxes, so the swap doesn't reflow the page. */
@font-face {
  font-family: "Gowun Batang Fallback";
  src: local("Georgia");
  size-adjust: 100.6%; ascent-override: 115.3%; descent-override: 28.6%; line-gap-override: 0%;
}
@font-face {
  font-family: "Ysabeau Office Fallback";
  src: local("Gill Sans"), local("GillSans");
  size-adjust: 103.4%; ascent-override: 101.9%; descent-override: 27.9%; line-gap-override: 0%;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;

  /* ink */
  --plum: #33203c;
  --plum-soft: #5b4563;
  /* light grounds */
  --pearl: #f6f1f1;
  --blush: #efd7d3;
  --lavender: #cfc4e0;
  --mist: #e7e1ea;
  /* starlight */
  --gold: #edc77f;
  --gold-deep: #a97e33;
  --star: #fff8ea;
  /* night */
  --night: #2e2d44;
  --night-band: #54496a;
  --night-foot: #8c7089;
  /* the sky */
  --horizon-glow: #f8e0cc;
  --sky-overscroll: #cdbcd0;
  --sky-rest-zenith: #a898b6; --sky-rest-high: #bba9c3; --sky-rest-words: #c8b7cc; --sky-rest-low: #ddbfc0; --sky-rest-horizon: #e6c6ba;
  --sky-dusk-zenith: #6f6383; --sky-dusk-high: #9a88a5; --sky-dusk-words: #b6a4b4; --sky-dusk-low: #c4a7ae; --sky-dusk-horizon: #cfaea8;
  --sky-morning-zenith: #e4dcea; --sky-morning-high: #ece5ee; --sky-morning-low: #f4eeef; --sky-morning-horizon: #f9efe8;

  /* type */
  --serif: "Gowun Batang", "Gowun Batang Fallback", Georgia, serif;
  --sans: "Ysabeau Office", "Ysabeau Office Fallback", "Gill Sans", "Segoe UI", sans-serif;
  --fs-wordmark: 1.2rem;
  --fs-voice: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-reply: clamp(1.15rem, 1.05rem + .35vw, 1.35rem);
  --fs-verse: clamp(1rem, .85rem + .45vw, 1.2rem);
  --fs-reading: 1.125rem;
  --fs-body: 1rem;
  --fs-writing: 1.0625rem;
  --fs-label: .9375rem;

  /* layout and rhythm */
  --gutter: clamp(1.5rem, 6vw, 2rem);
  --column: 26rem;
  --measure-verse: 33rem;
  --measure-read: 36rem;
  --wall: 64rem;
  --step-tight: .85rem;
  --step: 1.75rem;
  --section: 4rem;
  --pause: 5rem;
  --night-fade: 6.5rem;
  --nav-rows: 1;           /* lines of links in the masthead; 2 on the narrowest screens */

  /* shape and light */
  --r-box: 1.25rem;
  --r-pill: 999px;
  --r-focus: 2px;
  --shadow-box-rest: 0 1px 2px rgb(51 32 60 / .04), 0 14px 32px -20px rgb(51 32 60 / .3);
  --shadow-box-focus: 0 0 0 3px rgb(169 126 51 / .16), 0 14px 32px -20px rgb(51 32 60 / .35);
  --glow-mark: 0 0 10px 2px rgb(237 199 127 / .55);
  --glow-point: 0 0 8px 2px rgb(237 199 127 / .55);

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-rise: cubic-bezier(.22, .61, .36, 1);
  --t-rise: 2500ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--sky-overscroll);
  scrollbar-color: rgb(51 32 60 / .35) transparent;
}
body {
  margin: 0;
  min-height: 100svh;
  color: var(--plum);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  caret-color: var(--gold-deep);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--blush); color: var(--plum); }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; text-wrap: balance; }
p { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* links on light grounds */
main a, .support a { color: var(--plum); }
main a:focus-visible, .support a:focus-visible, main button:focus-visible {
  outline: 1px solid var(--gold-deep); outline-offset: 4px; border-radius: var(--r-focus);
}
.hairline {
  display: inline-block; padding-block: .7rem;
  text-decoration: underline 1px var(--gold-deep); text-underline-offset: .35em;
}
@media (hover: hover) { .hairline:hover { text-decoration-thickness: 2px; } }

/* the skip link appears on the night, top left, only when focused */
.skip {
  position: absolute; z-index: 10; top: .5rem; left: var(--gutter);
  padding: .7rem .5rem;
  font-size: var(--fs-label); color: var(--pearl);
  text-decoration: underline 1px; text-underline-offset: .3em;
}
.skip:not(:focus) {
  width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus-visible { outline: 1px solid var(--pearl); outline-offset: 2px; border-radius: var(--r-focus); }
.skip:focus ~ .masthead { padding-top: 3.75rem; }   /* room for the skip link above the name */

/* ---------- the fixed sky: light only ---------- */
.sky { position: fixed; inset: 0 0 auto; height: 100lvh; z-index: 0; pointer-events: none; }
.sky > div { position: absolute; inset: 0; }
.sky-morning {
  background: linear-gradient(to bottom, var(--sky-morning-zenith) 0%, var(--sky-morning-high) 40%, var(--sky-morning-low) 70%, var(--sky-morning-horizon) 100%);
}
.sky > .sky-glow { inset: auto 0 0; height: 64%; overflow: hidden; }
.sky-glow::before {
  content: ""; position: absolute; inset: auto 0 0; height: 50%;
  background: linear-gradient(to top, rgb(248 224 204 / .55), rgb(248 224 204 / .16) 55%, transparent);
}
.grain { background: url("/img/grain.webp") repeat; opacity: .11; }

.masthead, main, .support { position: relative; z-index: 2; }

/* ---------- the masthead: pearl on night ---------- */
.masthead {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: 1.75rem var(--gutter) 0;
  color: var(--pearl); text-align: center;
}
.name {
  margin: 0;
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-wordmark);
  line-height: 1.5; letter-spacing: .01em;
  color: inherit; text-decoration: none;
}
.masthead nav { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.4rem; font-size: var(--fs-label); }
.masthead a { color: inherit; text-decoration: none; text-underline-offset: .35em; text-decoration-thickness: 1px; }
.masthead nav a { padding-block: .7rem; }
.masthead nav a[aria-current="page"] { text-decoration-line: underline; text-decoration-color: rgb(246 241 241 / .5); }
.masthead a:focus-visible { outline: 1px solid var(--pearl); outline-offset: 4px; border-radius: var(--r-focus); }
@media (hover: hover) {
  .masthead a:hover { text-decoration-line: underline; text-decoration-color: var(--pearl); }
}
/* Below 17rem the three links can't share a line. Rather than wrap wherever the
   text runs out, "Her messages" takes the first line and the other two the
   second, so the home page knows the masthead's height (see --nav-rows). */
@media (max-width: 17rem) {
  :root { --nav-rows: 2; }
  .masthead nav::after { content: ""; order: 1; flex-basis: 100%; }
  .masthead nav a + a { order: 2; }
}

/* On pages without a star field, the last of the night sits behind the masthead
   and lets go over --night-fade, easing in both alpha and hue toward the foot. */
.read .masthead { isolation: isolate; padding-bottom: 1rem; }
.read .masthead::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0 0 calc(-1 * var(--night-fade));
  background: linear-gradient(to bottom,
    var(--night) 0,
    var(--night-band) calc(100% - var(--night-fade)),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 75%, var(--night-foot)), transparent 4%)  calc(100% - 5.5rem),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 50%, var(--night-foot)), transparent 14%) calc(100% - 4.5rem),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 25%, var(--night-foot)), transparent 32%) calc(100% - 3.5rem),
    color-mix(in oklab, var(--night-foot), transparent 54%) calc(100% - 2.5rem),
    color-mix(in oklab, var(--night-foot), transparent 76%) calc(100% - 1.5rem),
    color-mix(in oklab, var(--night-foot), transparent 91%) calc(100% - .7rem),
    transparent);
}

/* ---------- the read pages ---------- */
.read main { padding-top: calc(var(--night-fade) + 2rem); }
.page-head {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin-inline: auto;
  text-align: center;
}
.page-head h1, .reflections h2, .dedication h2 { font-size: var(--fs-voice); line-height: 1.5; }
.lede { margin-top: var(--step-tight); text-wrap: balance; }

/* her messages: words in serif, each with a point of light above it */
.sayings {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin: var(--section) auto 0; padding: 0;
  list-style: none; text-align: center;
  font-family: var(--serif); font-size: var(--fs-reply); line-height: 1.55;
}
.sayings li { scroll-margin-top: 2rem; text-wrap: balance; }
.sayings li + li { margin-top: var(--step); }
.sayings li::before {
  content: ""; display: block;
  width: 4px; height: 4px; margin: 0 auto var(--step-tight); border-radius: 50%;
  background: var(--gold-deep);
}
.sayings li:target::before { box-shadow: var(--glow-point); transform: scale(1.5); }

.reflections, .dedication, .prose {
  width: min(var(--measure-read), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.reflections { margin-top: var(--pause); text-align: center; }
.reflections article { margin-top: var(--section); scroll-margin-top: 2rem; }
.reflections h3 { font-size: var(--fs-reply); line-height: 1.55; margin-bottom: var(--step-tight); }
.reflections article:target h3::before {
  content: ""; display: block;
  width: 5px; height: 5px; margin: 0 auto var(--step-tight); border-radius: 50%;
  background: var(--gold-deep); box-shadow: var(--glow-mark);
}

/* long reading: her reflections and the dedication in serif, the site's own words in sans */
.reflections p, .dedication p, .prose p {
  font-size: var(--fs-reading); line-height: 1.7;
  text-align: left; text-wrap: pretty;
}
.reflections p, .dedication p { font-family: var(--serif); }
.reflections p + p, .dedication p + p, .prose p + p { margin-top: .85em; }

.prose { margin-top: var(--step); }
.dedication { margin-top: var(--pause); text-align: center; }
.dedication::before {
  content: ""; display: block;
  width: 5px; height: 5px; margin: 0 auto var(--step); border-radius: 50%;
  background: var(--gold-deep); box-shadow: var(--glow-mark);
}
.dedication h2 { margin-bottom: var(--step-tight); }

/* nothing here */
.lost {
  width: min(var(--column), 100% - 2 * var(--gutter));
  min-height: calc(100svh - 30rem);
  margin-inline: auto;
  display: grid; align-content: center; justify-items: center;
  text-align: center;
}
.lost h1 { font-size: var(--fs-voice); line-height: 1.5; }
.lost p { margin-top: var(--step-tight); text-wrap: balance; }
.lost .hairline { margin-top: .9rem; }
.mark {
  display: block; width: 5px; height: 5px; margin-bottom: var(--step); border-radius: 50%;
  background: var(--gold-deep); box-shadow: var(--glow-mark);
}

/* ---------- the support line, at the foot of every page ---------- */
.support {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin: var(--pause) auto 0; padding-bottom: 2.5rem;
  text-align: center; font-size: var(--fs-label); color: var(--plum-soft);
}
.support p { text-wrap: balance; }
.support a, .wall-support a {
  display: inline-block; padding: .7rem .5rem;
  text-decoration: underline 1px; text-underline-offset: .25em;
}

/* ---------- short screens (phones held sideways) ---------- */
@media (max-height: 500px) {
  .masthead { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 1.5rem; padding-top: .4rem; }
  .masthead nav a { padding-block: .6rem; }
  .read .masthead { padding-bottom: .25rem; }
  .read main { padding-top: calc(var(--night-fade) + 1.5rem); }
  .lost { min-height: 0; }
}

/* ==================== home ==================== */
:root {
  --dusk-rest: 0;          /* where the dusk settles once the light has risen */
  /* The masthead's height, so the opening fills the rest of the first screen:
     its top padding, the name's line and the gap under it, then each line of links. */
  --masthead-h: calc(1.75rem + var(--fs-wordmark) * 1.5 + .1rem + var(--nav-rows) * (var(--fs-label) * 1.6 + 1.4rem));
}
:root.late { --dusk-rest: .55; }   /* 21:00 to 05:59 local: the light rises less */
@media (prefers-color-scheme: dark) { :root { --dusk-rest: .55; } }

/* ---------- the sky: baked layers whose opacity moves ---------- */
.sky-base {
  background: linear-gradient(to bottom, var(--sky-rest-zenith) 0%, var(--sky-rest-high) 35%, var(--sky-rest-words) 55%, var(--sky-rest-low) 78%, var(--sky-rest-horizon) 100%);
}
.sky-dusk {
  background: linear-gradient(to bottom, var(--sky-dusk-zenith) 0%, var(--sky-dusk-high) 35%, var(--sky-dusk-words) 55%, var(--sky-dusk-low) 78%, var(--sky-dusk-horizon) 100%);
  animation: dusk-lift var(--t-rise) var(--ease-rise) both;
}
@keyframes dusk-lift { from { opacity: 1; } to { opacity: var(--dusk-rest); } }

/* morning follows the scroll, until the section after the opening is fully in view */
.home .sky-morning { opacity: 0; will-change: opacity; }
@supports (animation-timeline: view()) and (timeline-scope: none) {
  .home { timeline-scope: --morning; }
  .home .opening + * { view-timeline: --morning block; }
  .home .sky-morning { animation: morning linear both; animation-timeline: --morning; animation-range: entry 0% entry 100%; }
}
@keyframes morning { from { opacity: 0; } to { opacity: 1; } }

/* the horizon light rises with the dawn, in the shape of two low wings opening
   from the centre: three soft tiers a side, nothing drawn but light */
.home .sky > .sky-glow { animation: glow-rise var(--t-rise) var(--ease-rise) both; will-change: transform, opacity; }
@keyframes glow-rise { from { transform: translateY(30%); opacity: 0; } to { transform: none; opacity: 1; } }
.wing { position: absolute; inset: 0; }
.wing span {
  position: absolute; left: 50%; bottom: var(--b);
  width: var(--w); height: var(--h);
  margin-left: calc(var(--w) / -2);
  background: radial-gradient(closest-side, rgb(255 242 226 / var(--a)), rgb(252 232 214 / calc(var(--a) * .4)) 55%, transparent);
  transform: translateX(var(--dx)) rotate(var(--r));
}
.wing span:nth-child(1) { --w: max(62vw, 15rem); --h: max(9vh, 3.4rem); --b: 2%; --dx: -24vw; --r: 7deg;  --a: .5; }
.wing span:nth-child(2) { --w: max(40vw, 10rem); --h: max(8vh, 3rem);   --b: 6%; --dx: -17vw; --r: 14deg; --a: .42; }
.wing span:nth-child(3) { --w: max(22vw, 6rem);  --h: max(7vh, 2.6rem); --b: 9%; --dx: -10vw; --r: 22deg; --a: .36; }
.wing-right span:nth-child(1) { --dx: 24vw; --r: -7deg; }
.wing-right span:nth-child(2) { --dx: 17vw; --r: -14deg; }
.wing-right span:nth-child(3) { --dx: 10vw; --r: -22deg; }
@media (max-width: 40rem) {   /* on phones the wings sweep past the edges, so they never read as two ovals */
  .wing span:nth-child(1) { --w: 125vw; --h: 7vh; --b: 1%; --dx: -42vw; --r: 10deg; --a: .42; }
  .wing span:nth-child(2) { --w: 86vw;  --h: 6vh; --b: 5%; --dx: -32vw; --r: 18deg; --a: .34; }
  .wing span:nth-child(3) { --w: 50vw;  --h: 5vh; --b: 8%; --dx: -20vw; --r: 27deg; --a: .28; }
  .wing-right span:nth-child(1) { --dx: 42vw; --r: -10deg; }
  .wing-right span:nth-child(2) { --dx: 32vw; --r: -18deg; }
  .wing-right span:nth-child(3) { --dx: 20vw; --r: -27deg; }
}

#stardust {
  position: fixed; inset: 0 0 auto; z-index: 3;
  width: 100%; height: 100lvh;
  pointer-events: none;
}

/* ---------- the opening: night above with the stars, first light below with the words ---------- */
.home .masthead::before {   /* the top of the night, behind the name; the opening carries it on */
  content: ""; position: absolute; z-index: -1; inset: -3rem 0 -1px;
  background: var(--night);
}
.opening {
  position: relative; isolation: isolate;
  min-height: calc(100svh - var(--masthead-h));
  display: grid;
  grid-template-columns: 1fr min(var(--column), 100% - 2 * var(--gutter)) 1fr;
  grid-template-rows: minmax(1rem, .7fr) auto auto minmax(4rem, 1.6fr) auto;
  text-align: center;
}
.opening > * { grid-column: 2; }

/* The night belongs to the star field and scrolls away with it. It ends 2rem
   below the field, letting go over --night-fade in both alpha and hue. */
.night {
  grid-column: 1 / -1; grid-row: 1 / 3;
  margin-bottom: -2rem;
  z-index: -1;
  background: linear-gradient(to bottom,
    var(--night) 0,
    var(--night-band) clamp(2.5rem, 100% - 13rem, 100% - var(--night-fade)),
    var(--night-band) calc(100% - var(--night-fade)),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 75%, var(--night-foot)), transparent 4%)  calc(100% - 5.5rem),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 50%, var(--night-foot)), transparent 14%) calc(100% - 4.5rem),
    color-mix(in oklab, color-mix(in oklab, var(--night-band) 25%, var(--night-foot)), transparent 32%) calc(100% - 3.5rem),
    color-mix(in oklab, var(--night-foot), transparent 54%) calc(100% - 2.5rem),
    color-mix(in oklab, var(--night-foot), transparent 76%) calc(100% - 1.5rem),
    color-mix(in oklab, var(--night-foot), transparent 91%) calc(100% - .7rem),
    transparent);
}

/* the star field: nine points, close together, each with a 44px target */
.stars { grid-row: 2; position: relative; height: clamp(11rem, 26vh, 14rem); }
.stars > div { position: absolute; left: var(--x); top: var(--y); }
.stars > :nth-child(1) { --x: 9%;  --y: 56%; --s: 3px; --t: 8s; }
.stars > :nth-child(2) { --x: 22%; --y: 22%; --s: 2px; --t: 6.5s; --delay: -2s; }
.stars > :nth-child(3) { --x: 31%; --y: 72%; --s: 4px; --t: 9s;   --delay: -4s; }
.stars > :nth-child(4) { --x: 44%; --y: 10%; --s: 3px; --t: 7s;   --delay: -1s; }
.stars > :nth-child(5) { --x: 52%; --y: 46%; --s: 5px; --t: 8.5s; --delay: -3s; }
.stars > :nth-child(6) { --x: 63%; --y: 70%; --s: 2px; --t: 6s;   --delay: -5s; }
.stars > :nth-child(7) { --x: 70%; --y: 26%; --s: 3px; --t: 7.5s; --delay: -2.5s; }
.stars > :nth-child(8) { --x: 83%; --y: 58%; --s: 4px; --t: 9s;   --delay: -6s; }
.stars > :nth-child(9) { --x: 93%; --y: 16%; --s: 2px; --t: 6.8s; --delay: -1.5s; }

.star {
  display: block; position: relative;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  padding: 0; border: 0; border-radius: 50%; background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.star::before, .star::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; }
.star::after {   /* the light falling off the point */
  width: calc(var(--s) * 15); height: calc(var(--s) * 15);
  background: radial-gradient(circle, rgb(255 236 196 / .55) 0%, rgb(237 199 127 / .18) 32%, transparent 68%);
  transform: translate(-50%, -50%) scale(.6);
  opacity: .75;
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out);
}
.star::before {  /* the point */
  z-index: 1;
  width: var(--s); height: var(--s);
  background: var(--star);
  box-shadow: 0 0 calc(var(--s) * 1.4) rgb(255 228 170 / .9);
  transform: translate(-50%, -50%);
  animation: breathe var(--t, 7s) ease-in-out var(--delay, 0s) infinite;
  transition: transform .5s var(--ease-out);
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
.star.is-open::after, .star:focus-visible::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.star.is-open::before { transform: translate(-50%, -50%) scale(1.5); }
@media (hover: hover) {
  .star:hover::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .star:hover::before { transform: translate(-50%, -50%) scale(1.5); }
}
.star:focus-visible { outline: 1px solid rgb(246 241 241 / .8); outline-offset: -8px; border-radius: 50%; }   /* a ring of r 14 */

/* her words: the greeting and the message share one cell, so the greeting's height stays as a floor */
.voice { grid-row: 3; display: grid; padding-top: 3.5rem; }
.voice > .greeting, .voice > .message { grid-area: 1 / 1; }
.welcome, .words {
  font-family: var(--serif); font-size: var(--fs-voice); line-height: 1.5;
  text-wrap: balance;
}
.hint { margin-top: var(--step-tight); text-wrap: balance; }
.hint-keys { display: none; }
.stars:has(.star:focus-visible) ~ .voice .hint { display: none; }
.stars:has(.star:focus-visible) ~ .voice .hint-keys { display: block; }
.greeting { transition: opacity .4s var(--ease-out), visibility .4s; }
.voice.has-message .greeting { opacity: 0; visibility: hidden; transition-duration: .25s; }
.message { display: grid; justify-items: center; }
.message[hidden] { display: none; }
.close {
  margin-top: .9rem; min-height: 44px; padding: .6rem .5rem;
  font: inherit; font-size: var(--fs-label); color: var(--plum);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline 1px rgb(51 32 60 / .45); text-underline-offset: .3em;
}

/* the ray and the halo ring */
.rays {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; overflow: visible; pointer-events: none;
}
.ray { fill: none; stroke: url(#ray-light); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.halo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.halo-glow { fill: none; stroke: rgb(255 232 190 / .3); stroke-width: 5; }
.halo-ring { fill: none; stroke: rgb(255 240 214 / .38); stroke-width: .75; }

/* one line of light: star, ray, words, then the thread down to the mark */
.thread {
  grid-row: 4; justify-self: center; align-self: stretch;
  width: 1px; margin-top: 1.25rem;
  background: linear-gradient(transparent, var(--gold-deep) 25%);
}
.opening .mark { grid-row: 5; justify-self: center; margin: 0 0 2.5rem; }

/* ---------- others' words, drifting faintly across the night ----------
   Lanes sit in the air above the stars and the top of the field, never across the cluster. */
.drift {
  grid-column: 1 / -1; grid-row: 1 / 3;
  position: relative; overflow: hidden; pointer-events: none;
}
.drift-line {
  position: absolute; left: 0; top: var(--lane);
  white-space: nowrap;
  font: 400 var(--fs-label)/1.4 var(--sans); letter-spacing: .01em;
  color: rgb(246 241 241 / .44);
  font-variant-ligatures: none;   /* each letter its own glyph, so each can come apart */
  transform: translateX(100vw);   /* off to the right until its crossing begins */
}
.lane-1 { --lane: 4%; }
.lane-2 { --lane: 16%; }
.lane-3 { --lane: 28%; }
@media (max-width: 699.98px) {
  .lane-1 { --lane: 5%; }
  .lane-2 { --lane: 19%; }
}
@media (max-height: 500px) { .lane-1 { --lane: 0%; } }

/* ---------- your message to the angel ---------- */
.angel {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin-inline: auto; padding-block: 4.5rem 3rem;
  text-align: center;
}
.angel h2 { margin-bottom: var(--step-tight); font-size: var(--fs-voice); line-height: 1.4; }
.angel-intro { max-width: 22rem; margin: 0 auto 2.25rem; text-wrap: balance; }

/* the thread: their words, then her reply beneath a point of light */
.angel-thread { display: grid; }
.bubble.you {        /* their voice: sans, left, a span per letter, a .w per word */
  margin-bottom: var(--step); overflow: hidden;
  text-align: left; font-size: var(--fs-writing); line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-variant-ligatures: none;   /* ligatures span two letters; each letter comes apart alone */
}
.bubble.her {        /* hers: serif, centred */
  display: grid; justify-items: center; margin-bottom: 2.25rem;
  font-family: var(--serif); font-size: var(--fs-reply); line-height: 1.55;
}
.bubble.her::before {
  content: ""; width: 4px; height: 4px; margin-bottom: 1rem; border-radius: 50%;
  background: var(--gold-deep); box-shadow: var(--glow-point);
}
.her-words { text-wrap: balance; }
.support-links { margin-top: .5rem; font: 400 var(--fs-label)/1.6 var(--sans); }
.reply-help {        /* the quiet line under her other replies */
  margin-top: .75rem; font: 400 var(--fs-label)/1.6 var(--sans); color: var(--plum-soft); text-wrap: balance;
}
.support-links a, .reply-help a {
  display: inline-block; padding: .7rem .5rem;
  text-decoration: underline 1px; text-underline-offset: .25em;
}
.angel-thread .note { margin-bottom: var(--step); text-wrap: balance; }
.note .support-links { display: block; }   /* the helplines under a failed send */

/* the box, the consent line and the release button */
.angel-form { display: grid; justify-items: center; }
.angel-form textarea, .field {
  display: block; width: 100%;
  min-height: 7.5rem; max-height: 18rem; field-sizing: content; resize: none;
  padding: 1rem 1.15rem;
  font: 400 var(--fs-writing)/1.6 var(--sans); color: var(--plum); text-align: left;
  background: rgb(255 252 249 / .55);
  border: 1px solid rgb(51 32 60 / .22); border-radius: var(--r-box);
  box-shadow: var(--shadow-box-rest);
  transition: border-color .4s var(--ease-out), box-shadow .4s var(--ease-out), background-color .4s var(--ease-out);
}
.angel-form textarea::placeholder, .field::placeholder { color: var(--plum-soft); opacity: 1; }
.angel-form textarea:focus, .field:focus {
  outline: 1px solid transparent;   /* shows in forced colours; the gold border carries focus otherwise */
  border-color: var(--gold-deep); background-color: rgb(255 253 251 / .8);
  box-shadow: var(--shadow-box-focus);
}
.angel-consent { max-width: 22rem; margin-top: .75rem; font-size: var(--fs-label); color: var(--plum-soft); text-wrap: balance; }
.angel-turnstile:empty { display: none; }
.angel-form button[hidden] { display: none; }   /* until angel.js runs */
.noscript { max-width: 22rem; margin-top: 1rem; font-size: var(--fs-label); color: var(--plum-soft); text-wrap: balance; }
.angel-form button, .release {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 44px; margin-top: 1rem; padding: .75rem 1.5rem .75rem 1.3rem;
  font: 500 var(--fs-label)/1 var(--sans); color: var(--plum);
  background: transparent; border: 1px solid rgb(51 32 60 / .35); border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color .4s var(--ease-out), border-color .4s var(--ease-out), opacity .4s;
}
.angel-form button::before, .release::before {   /* a small light, released */
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-deep); box-shadow: 0 0 6px 1px rgb(237 199 127 / .7);
}
@media (hover: hover) {
  :is(.angel-form button, .release):not(:disabled, [aria-disabled="true"]):hover { background-color: rgb(239 215 211 / .55); border-color: var(--plum); }
}
.angel-form button:is(:disabled, [aria-disabled="true"]), .release:is(:disabled, [aria-disabled="true"]) { opacity: .45; cursor: default; }
.angel-form button:focus-visible, .release:focus-visible { outline-offset: 3px; border-radius: var(--r-pill); }

/* the words in the sky, readable and reportable: label type in quiet plum, no box */
.drift-list { margin-top: 2.25rem; font-size: var(--fs-label); color: var(--plum-soft); }
.drift-list summary {
  display: inline-block; padding: .7rem .5rem; cursor: pointer; list-style: none;
  text-decoration: underline 1px rgb(91 69 99 / .45); text-underline-offset: .3em;
}
.drift-list summary::-webkit-details-marker { display: none; }
.drift-list summary:focus-visible { outline: 1px solid var(--gold-deep); outline-offset: 4px; border-radius: var(--r-focus); }
.drift-list ul { margin: .5rem 0 0; padding: 0; list-style: none; text-align: left; }
.drift-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.drift-list li + li { margin-top: .25rem; }
.drift-words { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drift-report {
  flex: none; min-height: 44px; padding: .6rem .5rem;
  font: inherit; color: var(--plum);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline 1px rgb(51 32 60 / .45); text-underline-offset: .3em;
}
.drift-report[aria-disabled="true"] { color: var(--plum-soft); text-decoration: none; cursor: default; }

/* ---------- the poem: centred, nine plain lines ---------- */
.poem {
  width: min(var(--measure-verse), 100% - 2 * var(--gutter));
  min-height: 100svh;
  margin-inline: auto; padding-block: var(--section);
  display: grid; align-content: center;
  text-align: center;
}
.poem p { font-family: var(--serif); font-size: var(--fs-verse); line-height: 1.5; }
.poem span { display: block; margin-block: .7em; text-wrap: balance; }
@media (max-width: 30rem) { .poem span { line-height: 1.38; margin-block: .95em; } }

/* ---------- the invitation to the wall ---------- */
.invite { padding: var(--section) var(--gutter) 0; text-align: center; }
.invite p { margin-bottom: .25rem; font-family: var(--serif); font-size: var(--fs-verse); text-wrap: balance; }

/* ---------- home on short screens (phones held sideways) ---------- */
@media (max-height: 500px) {
  :root { --masthead-h: 3.1rem; }
  .opening { grid-template-rows: minmax(.5rem, .5fr) auto auto minmax(1.25rem, 1fr) auto; }
  .stars { height: 8.5rem; }
  .night { margin-bottom: -1.25rem; }
  .voice { padding-top: 2.25rem; }
  .hint { margin-top: .5rem; }
  .thread { margin-top: .6rem; }
  .opening .mark { margin-bottom: .9rem; }
}

/* ---------- home with reduced motion: explicit end states ---------- */
@media (prefers-reduced-motion: reduce) {
  .sky-dusk { animation: none; opacity: var(--dusk-rest); }
  .home .sky > .sky-glow { animation: none; }
  .star::before { animation: none; opacity: 1; transition: none; }
  .star::after { transition: opacity .2s ease-out; }
  .greeting, .voice.has-message .greeting { transition: opacity .2s ease-out, visibility .2s; }
  .angel-form textarea, .angel-form button { transition: none; }
}

/* ==================== the wall ==================== */

/* the share form: the conversation box's grammar, applied to sharing */
.share {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin: 2.25rem auto 0;
  display: grid; justify-items: center;
  text-align: center;
}
.release[hidden], .share-form[hidden], .more[hidden] { display: none; }
.share .release { margin-top: 0; }
.share-form { width: 100%; display: grid; text-align: left; }

/* the three prompts: label text with a point that turns gold, on a lavender wash */
.prompts { min-width: 0; margin: 0; padding: 0; border: 0; }
.prompts legend { width: 100%; padding: 0; margin-bottom: .5rem; text-align: center; text-wrap: balance; }
.prompt-list { display: grid; justify-content: center; }
.prompt {
  position: relative;
  display: flex; align-items: center; gap: .75rem;
  min-height: 44px; padding: .35rem 1.4rem .35rem 1rem;
  font-size: var(--fs-label); cursor: pointer;
  border-radius: var(--r-focus);
}
.prompt input {   /* the real radio, over the whole label, so a tap anywhere on it chooses */
  position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.prompt::before {
  content: ""; flex: none;
  width: 4px; height: 4px; border-radius: 50%;
  background: rgb(91 69 99 / .55);
  transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out), transform .4s var(--ease-out);
}
.prompt:has(:checked) { background: radial-gradient(farthest-side, rgb(207 196 224 / .85), rgb(207 196 224 / .5) 60%, rgb(207 196 224 / 0)); }
.prompt:has(:checked)::before { background: var(--gold-deep); box-shadow: var(--glow-point); transform: scale(1.25); }
@media (hover: hover) {
  .prompt:not(:has(:checked)):hover { background: radial-gradient(farthest-side, rgb(207 196 224 / .45), rgb(207 196 224 / 0)); }
}
.prompt:has(:focus-visible) { outline: 1px solid var(--gold-deep); outline-offset: 2px; }
@media (forced-colors: active) {   /* backgrounds are dropped there, so show the real radio */
  .prompt input { position: static; width: auto; height: auto; opacity: 1; }
  .prompt::before { display: none; }
}

/* their words and their name, in the box style */
.field-label { justify-self: start; margin: 1.25rem 0 .45rem .2rem; font-size: var(--fs-label); }
input.field { min-height: 0; max-height: none; field-sizing: fixed; padding-block: .7rem; }
.share-under { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1rem; margin-top: .1rem; }
.share-count {
  margin: 0 .2rem 0 auto;
  font-size: var(--fs-label); color: var(--plum-soft);
  font-variant-numeric: tabular-nums;
}

/* the emoji box: a quiet text button and, when open, a small grid of emoji in the system's own emoji face */
.emoji-box { display: grid; grid-template-columns: repeat(auto-fill, 2.75rem); margin: .15rem 0 0 -.3rem; }
.emoji-box[hidden] { display: none; }
.emoji {
  width: 2.75rem; height: 2.75rem; padding: 0;
  font: 1.3rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: none; border: 0; border-radius: 50%; cursor: pointer;
}
@media (hover: hover) {
  .emoji:hover { background: radial-gradient(closest-side, rgb(207 196 224 / .7), rgb(207 196 224 / 0)); }
}
main .emoji:focus-visible { outline-offset: -3px; }
.share-turnstile { justify-self: center; margin-top: 1rem; }
.share-turnstile:empty { display: none; }
.share-form .release { justify-self: center; margin-top: 1.75rem; }

/* what the form says back, and the support line under it */
.share-status { width: 100%; }
.share-status .note { margin-top: 1rem; text-wrap: balance; }
.wall-support { margin-top: var(--step); font-size: var(--fs-label); color: var(--plum-soft); }
.share-form[hidden] ~ .wall-support { display: none; }   /* only while writing (owner decision, 24 Oct); the footer always carries it */
.wall-support p { text-wrap: balance; }

/* the notes: a loose constellation, newest first. One column on phones, two
   or three staggered columns wider up, each note a little off its neighbour. */
.cards {
  width: min(var(--wall), 100% - 2 * var(--gutter));
  margin: var(--pause) auto 0; padding: 0;
  list-style: none;
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
  column-gap: 3rem; row-gap: 2.75rem;
}
.cards:empty { display: none; }
.card { min-width: 0; max-width: calc(100% - 2rem); }
.card:nth-child(5n + 2) { margin-inline-start: 2rem; }
.card:nth-child(5n + 3) { margin-inline-start: .75rem; }
.card:nth-child(5n + 4) { margin-inline-start: 1.5rem; }
.card:nth-child(5n)     { margin-inline-start: .35rem; }
/* Wider up, 19rem columns: two from 45rem, three from 67rem. A wall of one or
   two notes stays centred under the form, since empty columns fold away. */
@media (min-width: 45rem) {
  .cards { grid-template-columns: repeat(auto-fit, 19rem); justify-content: center; }
  .card:nth-child(2n) { margin-top: 2.5rem; }
}
@media (min-width: 67rem) {
  .card:nth-child(2n) { margin-top: 0; }
  .card:nth-child(3n + 2) { margin-top: 3.25rem; }
  .card:nth-child(3n)     { margin-top: 1.25rem; }
}
/* A focused note (a new one, or the first of a page shown with Show more) is
   underlined in Deep Gold, like a hairline link, rather than framed. */
.card:focus-visible { outline: none; }
.card:focus-visible .card-words { text-decoration: underline 1px var(--gold-deep); text-underline-offset: .35em; }
@media (forced-colors: active) {   /* there the gold is gone, so focus keeps a system outline */
  .card:focus-visible { outline: 1px solid Highlight; outline-offset: 8px; }
}
.card-point {
  display: block; width: 4px; height: 4px; margin-bottom: .8rem; border-radius: 50%;
  background: var(--gold-deep); box-shadow: 0 0 6px 1px rgb(237 199 127 / .45);
}
.card-words { white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }
.card-meta { margin-top: .3rem; font-size: var(--fs-label); color: var(--plum-soft); overflow-wrap: anywhere; }
.card .note { margin-top: .3rem; font-size: var(--fs-label); }

/* quiet buttons: Report, Show more, Add an emoji, and the keeper's Hide and Restore */
.card-report, .more, .emoji-open, .keeper-act {
  min-height: 44px; padding: .6rem .5rem;
  font: inherit; color: var(--plum);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline 1px rgb(51 32 60 / .45); text-underline-offset: .3em;
}
.card-report {   /* inline at the end of the line, its 44px target reaching past the text */
  display: inline-block; min-height: 0; margin: -.6rem -.4rem; padding: .6rem .4rem;
  color: var(--plum-soft); text-decoration-color: rgb(91 69 99 / .4);
}
main .card-report:focus-visible { outline-offset: -.3rem; }
:is(.card-report, .more, .keeper-act)[aria-disabled="true"] { color: var(--plum-soft); text-decoration: none; cursor: default; }
.more { display: block; margin: var(--section) auto 0; font-size: var(--fs-label); }
.emoji-open {
  margin-inline-start: -.3rem; padding-inline: .3rem;
  font-size: var(--fs-label); color: var(--plum-soft); text-decoration-color: rgb(91 69 99 / .4);
}

.wall-note {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin: var(--step) auto 0;
  text-align: center; color: var(--plum-soft); text-wrap: balance;
}
.cards:empty + .wall-note { margin-top: var(--pause); }

@media (prefers-reduced-motion: reduce) {
  .release, .field, .prompt::before { transition: none; }
}

/* ==================== the keeper (private) ==================== */
.keeper { width: min(var(--wall), 100% - 2 * var(--gutter)); margin: var(--section) auto 0; }
.keeper-status .note { margin-bottom: var(--step); text-align: center; }
.keeper-part + .keeper-part { margin-top: var(--section); }
.keeper-part h2 { margin-bottom: var(--step-tight); font-size: var(--fs-reply); line-height: 1.5; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline: 1px solid var(--gold-deep); outline-offset: 4px; border-radius: var(--r-focus); }
.keeper-table {
  width: 100%; min-width: 46rem; border-collapse: collapse;
  font-size: var(--fs-label); text-align: left;
  font-variant-numeric: tabular-nums;
}
.keeper-table th { padding: .5rem .75rem; font-weight: 500; vertical-align: bottom; border-bottom: 1px solid rgb(51 32 60 / .3); }
.keeper-table td { padding: .35rem .75rem; vertical-align: baseline; border-bottom: 1px solid rgb(51 32 60 / .12); }
.keeper-text { min-width: 14rem; max-width: 30rem; white-space: pre-line; overflow-wrap: anywhere; }
.keeper-act { margin-inline-start: -.5rem; }
.keeper-act + .keeper-act { margin-inline-start: .5rem; }
