/* The program's page (yumenohotori.com): a shore at night. The sky and the water are drawn by scene.js on the
   canvas behind (the stars turning about the pole star, a shooting star now and then, thin clouds); this file is the
   words, the moon, the mist and the film grain. Everything that moves is slow — about one breath in ten seconds — and
   stops for those who ask for less motion. Dark on purpose: it is read at night.
   What moves here moves by transform and opacity only, which the GPU does without drawing anything again
   (2026-11-22: the grain is one picture of noise shifted 24 times a second, as film is). */
:root {
  color-scheme: dark;
  --bg: #0b0f1c;
  --ink: #ebe5d7;
  --muted: #aaa496;
  --faint: #77736b;
  --moon: #dccb9e;
  --line: rgba(235, 229, 215, 0.12);
  --water: 0.24;              /* how much of the screen is water (scene.js reads it too) */
  --breath: 10s;              /* six breaths a minute */
  --moon-size: 52px;
}
@media (max-width: 600px) { :root { --water: 0.2; --moon-size: 60px; } }
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  background: var(--bg); color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  line-height: 2; letter-spacing: 0.04em; -webkit-font-smoothing: antialiased;
  padding-top: max(56px, env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--water) * 100vh + 24px + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(var(--water) * 100lvh + 24px + env(safe-area-inset-bottom, 0px));
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
}

/* The sky and the water (scene.js). The large viewport keeps the shore still while a phone's bars come and go. */
#scene { position: fixed; inset: 0 0 auto 0; width: 100%; height: 100vh; height: 100lvh; display: block; z-index: 0; pointer-events: none; }

/* Mist along the shore: two soft banks drifting past each other, out of step. */
.mist { position: fixed; left: -10%; right: -10%; height: 170px; z-index: 0; pointer-events: none;
  bottom: calc(var(--water) * 100vh - 80px); bottom: calc(var(--water) * 100lvh - 80px); }
.mist::before, .mist::after { content: ""; position: absolute; inset: 0; }
.mist::before { background: radial-gradient(48% 38% at 30% 55%, rgba(150, 162, 196, 0.10), transparent 70%); animation: drift 74s ease-in-out infinite alternate; }
.mist::after { background: radial-gradient(42% 32% at 72% 48%, rgba(170, 176, 204, 0.08), transparent 70%); animation: drift 97s ease-in-out -30s infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-7%); opacity: 0.6; } 50% { opacity: 1; } to { transform: translateX(7%); opacity: 0.7; } }

/* Film grain over everything, the words too: grey noise (lighter and darker specks), one picture of it a little larger
   than the screen, set somewhere else 24 times a second, as each frame of film has grain of its own. Only its place
   changes (the GPU moves it; nothing is drawn again), and it is laid on plainly, without blending, which costs
   least. Still for those who ask for less motion. */
body::after { content: ""; position: fixed; inset: -64px; z-index: 3; pointer-events: none; opacity: 0.075; will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1.6 0 0 0 -0.3 1.6 0 0 0 -0.3 1.6 0 0 0 -0.3 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(1) infinite; }
@keyframes grain {
  0% { transform: translate(0, 0); } 8.33% { transform: translate(-37px, 21px); } 16.67% { transform: translate(29px, -45px); }
  25% { transform: translate(-13px, -27px); } 33.33% { transform: translate(51px, 9px); } 41.67% { transform: translate(-49px, -11px); }
  50% { transform: translate(17px, 47px); } 58.33% { transform: translate(-23px, 39px); } 66.67% { transform: translate(41px, -19px); }
  75% { transform: translate(-55px, 33px); } 83.33% { transform: translate(7px, -53px); } 91.67% { transform: translate(35px, 27px); }
  100% { transform: translate(0, 0); }
}
/* A soft darkening at the corners, as through a lens. It never moves. */
body::before { content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, rgba(4, 6, 12, 0) 55%, rgba(4, 6, 12, 0.42) 100%); }

main { position: relative; z-index: 1; width: 100%; max-width: 30rem; display: grid; gap: 28px; text-align: center; }
/* The words come up slowly, one after another, the way eyes adjust to the dark. */
main > * { animation: rise 2.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
main > :nth-child(2) { animation-delay: 0.35s; }
main > :nth-child(3) { animation-delay: 0.7s; }
main > :nth-child(4) { animation-delay: 1.1s; }
main > :nth-child(5) { animation-delay: 1.5s; }
main > :nth-child(n+6) { animation-delay: 1.9s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* The moon: a crescent that sways a little, with two halos of light about it: one that breathes with the water's
   light (scene.js, one breath in ten seconds) and a wider, fainter one that swells and ebbs out of step with it, so
   the light about the moon is never quite the same. .glow is dimmed by scene.js while a cloud passes the moon. */
.moon { position: relative; width: var(--moon-size); height: var(--moon-size); margin: 0 auto 6px; }
.moon .glow { position: absolute; inset: 0; display: block; transition: opacity 0.8s linear; }
.moon .glow::before, .moon .glow::after { content: ""; position: absolute; border-radius: 50%; will-change: transform, opacity; }
.moon .glow::before { inset: calc(var(--moon-size) * -0.95);
  background: radial-gradient(circle, rgba(220, 203, 158, 0.24) 0%, rgba(220, 203, 158, 0.08) 38%, transparent 68%);
  animation: breathe var(--breath) ease-in-out infinite; }
.moon .glow::after { inset: calc(var(--moon-size) * -2.1);
  background: radial-gradient(circle, rgba(220, 203, 158, 0.11) 0%, rgba(220, 203, 158, 0.04) 36%, transparent 66%);
  animation: leak 23s ease-in-out -6s infinite; }
/* Lit on its lower right, the horns up and to the left, as a crescent shows in the evening sky (2026-11-20: it was lit
   above, the horns pointing down). */
.moon i { position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset calc(var(--moon-size) * -0.19) calc(var(--moon-size) * -0.19) 0 0 var(--moon);
  filter: drop-shadow(0 0 7px rgba(220, 203, 158, 0.38)); animation: sway 17s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(0.82); opacity: 0.5; } 50% { transform: scale(1.14); opacity: 1; } }
@keyframes leak { 0%, 100% { transform: scale(0.78); opacity: 0.3; } 38% { transform: scale(1.18); opacity: 1; } 68% { transform: scale(0.95); opacity: 0.55; } }
@keyframes sway { 0%, 100% { transform: translate(-1.5px, 0.5px) rotate(-3.5deg); } 50% { transform: translate(1.5px, -1px) rotate(3deg); } }
.art { width: min(100%, 16rem); height: auto; aspect-ratio: 1; margin: 0 auto; border-radius: 10px; display: block; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }

/* The name and what it is, larger than what follows, so the moon, the name and the line under it read as one
   heading and the paragraphs as the text (2026-11-22: on a phone all four looked the same weight). */
h1 { margin: 0; font-weight: 500; font-size: clamp(2.45rem, 11.6vw, 3rem); letter-spacing: 0.3em; text-indent: 0.3em; line-height: 1.5;
  text-shadow: 0 0 30px rgba(220, 203, 158, 0.2); }
.tag { margin: -16px 0 8px; color: var(--muted); font-size: clamp(1rem, 4.1vw, 1.06rem); letter-spacing: 0.14em; }
/* What the program is: a paragraph to a line, every line in the middle. */
.about { display: grid; gap: 0.8em; font-size: clamp(0.88rem, 3.7vw, 0.98rem); line-height: 1.95; color: rgba(235, 229, 215, 0.88); }
.about p { margin: 0; text-wrap: balance; }
.about .credit { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; }
/* Japanese breaks only between the phrases build-site marks with <wbr>, never inside a word (2026-11-22). */
.ja { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
.soon { margin: 0; color: var(--moon); font-size: 0.95rem; letter-spacing: 0.14em; }
.where { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.go { color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 18px; font-size: 0.92rem;
  background: rgba(11, 15, 28, 0.35); transition: border-color 0.4s, color 0.4s; }
.go:hover, .go:focus-visible { border-color: var(--moon); color: var(--moon); outline: none; }
/* The newest stories (filled in by the worker, only those already out): a short list, quiet like the rest. */
.news { display: grid; gap: 6px; }
.news[hidden] { display: none; }
.news h2 { margin: 0 0 2px; font-weight: 500; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.24em; text-indent: 0.24em; }
.news ol { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.news a { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; text-align: left; transition: color 0.4s; }
.news a:hover, .news a:focus-visible { color: var(--moon); outline: none; }
.news .t { min-width: 0; overflow-wrap: anywhere; font-size: 0.98rem; line-height: 1.7; }
.news .m { flex: none; color: var(--faint); font-size: 0.78rem; letter-spacing: 0.06em; }
.news + .note { border-top: 0; padding-top: 0; }   /* the list's own last line is enough */
.note { margin: 0; color: var(--faint); font-size: 0.8rem; line-height: 1.9; text-wrap: balance; border-top: 1px solid var(--line); padding-top: 18px; }
footer { color: var(--faint); font-size: 0.75rem; letter-spacing: 0.1em; }
footer a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
footer a:hover, footer a:focus-visible { color: var(--moon); outline: none; }
footer .sep { margin: 0 0.6em; }

/* A page of text (the privacy policy): no shore, the words left-aligned and easy to read. */
body.doc { place-items: start center; padding-top: max(48px, env(safe-area-inset-top, 0px)); padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
main.doc { max-width: 40rem; gap: 0; text-align: left; font-size: 0.98rem; line-height: 2; }
main.doc > * { animation: none; }
body.doc::after { animation: none; }   /* a page to read: the grain stays still, and no darkening at the corners */
body.doc::before { display: none; }
main.doc h1 { font-size: clamp(1.5rem, 6vw, 1.9rem); letter-spacing: 0.16em; text-indent: 0; margin: 6px 0 22px; }
main.doc h2 { margin: 34px 0 8px; font-size: 1.05rem; font-weight: 500; color: var(--moon); letter-spacing: 0.1em; }
main.doc p, main.doc ul { margin: 0 0 14px; }
main.doc ul { padding-left: 1.3em; display: grid; gap: 8px; }
main.doc a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(220, 203, 158, 0.45); overflow-wrap: anywhere; }
main.doc a:hover, main.doc a:focus-visible { color: var(--moon); outline: none; }
main.doc .back { font-size: 0.85rem; letter-spacing: 0.14em; color: var(--muted); }
main.doc .date { color: var(--muted); font-size: 0.88rem; margin-top: 26px; }
main.doc footer { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  main > *, .moon .glow::before, .moon .glow::after, .moon i, .mist::before, .mist::after, body::after { animation: none; }
}
