/* Layout: a night sky you scroll through. Starfield canvas behind everything,
   one centered 1120px column, each topic owns one glowing colour. */
:root {
  --night: #0a0f24;
  --night-2: #111838;
  --night-3: #1a2350;
  --line: #2a3566;
  --ink: #ece9f7;
  --muted: #a3a8c9;
  --gold: #f3c55b;
  --gold-deep: #c9962a;

  --science: #5fe3c8;
  --math: #ffab6b;
  --music: #ff86bd;
  --hp: #f3c55b;
  --ai: #86c6ff;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-sign: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, #2a1f5c55, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #0f3b5a44, transparent 60%);
  color: var(--ink);
  font: 17px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
kbd {
  font: 600 0.8em var(--f-mono);
  padding: 0.1em 0.45em; border-radius: 5px;
  border: 1px solid var(--line); border-bottom-width: 3px;
  background: var(--night-2); color: var(--ink);
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.c-science { color: var(--science); } .c-math { color: var(--math); }
.c-music { color: var(--music); } .c-hp { color: var(--hp); } .c-ai { color: var(--ai); }
.c-science-bg { --c: var(--science); } .c-math-bg { --c: var(--math); }
.c-music-bg { --c: var(--music); } .c-hp-bg { --c: var(--hp); } .c-ai-bg { --c: var(--ai); }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.topbar, main, .footer { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 110px); }
.section-head { display: grid; gap: 10px; margin-bottom: 36px; }
.section-head.row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--night) 72%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font: 800 1rem var(--f-sign); color: var(--night);
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 18px #f3c55b66;
}
.brand-name { font: 600 0.95rem var(--f-sign); letter-spacing: 0.08em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: end; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 0.92rem;
  padding: 6px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--ink); background: var(--night-3); }
@media (max-width: 720px) {
  .brand-name { display: none; }
  .nav a { padding: 6px 8px; font-size: 0.85rem; }
}
@media (max-width: 520px) { .nav a[href="#about"], .nav a[href="#subjects"] { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 0.98rem var(--f-body); text-decoration: none; cursor: pointer;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: #1b1405; box-shadow: 0 6px 24px -6px #f3c55b88; }
.btn-gold:hover { box-shadow: 0 8px 32px -4px #f3c55baa; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(48px, 9vw, 120px) clamp(24px, 5vw, 60px);
}
.hero-text { display: grid; gap: 22px; min-width: 0; }
.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 4.8rem); font-weight: 800; letter-spacing: -0.03em;
}
.signature {
  font-family: var(--f-sign); font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(100deg, #fff4cf 0%, var(--gold) 30%, #fff8e0 48%, var(--gold) 62%, var(--gold-deep) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
.hero h1 .signature { display: block; font-size: 0.92em; margin-top: 0.12em; }
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.typed-line { font: 500 clamp(1rem, 2vw, 1.2rem) var(--f-mono); color: var(--muted); min-height: 1.7em; }
.typed { color: var(--ink); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 2px; vertical-align: -0.18em; background: var(--gold); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 34em; color: var(--ink); }
.lede b { font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Orbit */
.orbit-wrap {
  --size: min(360px, 78vw); --r: calc(var(--size) * 0.42);
  position: relative; width: var(--size); aspect-ratio: 1; max-width: 100%; justify-self: center;
}
.orbit-ring { position: absolute; border-radius: 50%; border: 1px dashed var(--line); }
.orbit-ring.r1 { inset: 8%; }
.orbit-ring.r2 { inset: 28%; border-style: solid; border-color: #2a356688; }
.orbit-core {
  position: absolute; inset: 36%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 50%, var(--gold-deep) 100%);
  box-shadow: 0 0 60px #f3c55b77, 0 0 140px #f3c55b33;
  animation: pulse 5s ease-in-out infinite;
}
.orbit-core span { font: 800 clamp(1.4rem, 5vw, 2.2rem) var(--f-sign); color: #2a1d05; letter-spacing: 0.04em; }
@keyframes pulse { 50% { box-shadow: 0 0 80px #f3c55b99, 0 0 180px #f3c55b44; } }
.orbit { position: absolute; inset: 0; animation: spin 40s linear infinite; }
.planet {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform: rotate(calc(var(--i) * 72deg)) translateY(calc(var(--r) * -1)) rotate(calc(var(--i) * -72deg));
}
.planet-inner {
  position: absolute; width: 54px; height: 54px; left: -27px; top: -27px;
  display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, var(--night-2));
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 40%, transparent);
  animation: spin 40s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
.planet-inner svg { width: 26px; height: 26px; color: var(--c); }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .orbit-wrap { --size: min(280px, 72vw); order: -1; }
}

/* ---------- Subjects ---------- */
.subjects { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.subject {
  --c: var(--gold);
  display: grid; gap: 16px; align-content: start; text-align: left; cursor: pointer;
  padding: 22px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 8%, var(--night-2)), var(--night-2));
  border: 1px solid var(--line); color: var(--ink); font: inherit;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.subject[data-filter="Science"] { --c: var(--science); }
.subject[data-filter="Math"] { --c: var(--math); }
.subject[data-filter="Music"] { --c: var(--music); }
.subject[data-filter="Harry Potter"] { --c: var(--hp); }
.subject[data-filter="AI"] { --c: var(--ai); }
.subject:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 16px 40px -18px var(--c); }
.subject-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
}
.subject-icon svg { width: 26px; height: 26px; }
.subject-body { display: grid; gap: 8px; min-width: 0; }
.subject-title { font: 700 1.2rem var(--f-display); }
.subject-text { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.subject-const { font-size: 0.8rem; color: var(--c); padding-top: 6px; border-top: 1px dashed var(--line); }
@media (max-width: 1000px) {
  .subjects { grid-template-columns: minmax(0, 1fr); }
  .subject { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
}

/* ---------- Blog ---------- */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px;
  background: var(--night-2); border: 1px solid var(--line); color: var(--muted);
  width: min(300px, 100%);
}
.search:focus-within { border-color: var(--gold); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink);
  font: 1rem var(--f-body); padding: 10px 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  --c: var(--gold);
  font: 600 0.9rem var(--f-body); cursor: pointer;
  padding: 7px 14px; border-radius: 999px; color: var(--muted);
  background: transparent; border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 8px; transition: all .2s;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip:hover { color: var(--ink); border-color: var(--c); }
.chip[aria-pressed="true"] { color: #10142b; background: var(--c); border-color: var(--c); }
.chip[aria-pressed="true"]::before { background: #10142b; }
.chip .count { font: 0.75rem var(--f-mono); opacity: 0.7; }

.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card {
  --c: var(--gold);
  position: relative; display: grid; gap: 12px; align-content: start;
  padding: 24px; border-radius: var(--radius); cursor: pointer; text-decoration: none; color: var(--ink);
  background: var(--night-2); border: 1px solid var(--line); min-width: 0; overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.post-card::after {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
  opacity: 0.5; transition: opacity .3s; pointer-events: none;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--c); box-shadow: 0 18px 50px -24px var(--c); }
.post-card:hover::after { opacity: 1; }
.post-card.featured { grid-column: span 2; grid-row: span 2; padding: 36px; align-content: end; min-height: 300px; }
.post-card.featured::after { width: 420px; height: 420px; inset: -30% -20% auto auto; opacity: 0.8; }
.post-card.featured p { font-size: 1.1rem; max-width: 34em; }
.post-card.featured h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 0.78rem var(--f-mono); color: var(--muted); }
.tag {
  font: 600 0.72rem var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.post-card h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
.post-card p { color: var(--muted); font-size: 0.97rem; line-height: 1.55; }
.post-card .read { font-weight: 700; font-size: 0.9rem; color: var(--c); margin-top: 4px; }
.empty { color: var(--muted); padding: 30px 0; }
@media (max-width: 900px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card.featured { grid-row: auto; min-height: 0; }
}
@media (max-width: 620px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .post-card.featured { grid-column: auto; padding: 24px; }
}

[data-cat="science"] { --c: var(--science); }
[data-cat="math"] { --c: var(--math); }
[data-cat="music"] { --c: var(--music); }
[data-cat="harry-potter"] { --c: var(--hp); }
[data-cat="ai"] { --c: var(--ai); }

/* ---------- Reader ---------- */
.reader {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  background: var(--night);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: rise .35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.reader-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px;
  padding: 12px var(--gutter); background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.reader-progress { flex: 1; height: 3px; background: var(--night-3); border-radius: 3px; overflow: hidden; }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--gold); }
.reader-article { --c: var(--gold); max-width: 720px; margin-inline: auto; padding: 48px var(--gutter) 90px; }
.reader-article .post-meta { margin-bottom: 18px; }
.reader-article h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 18px; }
.reader-article .summary { font-size: 1.2rem; color: var(--muted); padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.prose { display: grid; gap: 1.1em; font-size: 1.1rem; line-height: 1.75; }
.prose h2 { font-size: 1.6rem; margin-top: 0.8em; color: var(--c); }
.prose h3 { font-size: 1.25rem; margin-top: 0.5em; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: 0.4em; }
.prose li::marker { color: var(--c); }
.prose blockquote {
  margin: 0; padding: 16px 20px; border-radius: 10px;
  background: color-mix(in srgb, var(--c) 10%, var(--night-2)); border-left: 3px solid var(--c);
  font-style: italic;
}
.prose code { font: 0.9em var(--f-mono); background: var(--night-3); padding: 0.1em 0.4em; border-radius: 5px; }
.prose a { color: var(--c); }
.prose strong { color: #fff; }
.reader-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.reader-nav a {
  display: grid; gap: 4px; padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); background: var(--night-2);
}
.reader-nav a:hover { border-color: var(--gold); }
.reader-nav a.next { text-align: right; grid-column: 2; }
.reader-nav small { font: 0.75rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.reader-sign { margin-top: 40px; font: 700 1.3rem var(--f-sign); color: var(--gold); }

/* ---------- Piano ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(28px, 5vw, 60px); align-items: center; }
.split-text { display: grid; gap: 18px; min-width: 0; }
.split-text p { color: var(--muted); max-width: 36em; }
.split-text p b { color: var(--ink); }
.readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.readout > div { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.readout-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.readout-value { font: 700 1.5rem var(--f-display); color: var(--music); font-variant-numeric: tabular-nums; }
.readout-value.mono { font-family: var(--f-mono); font-size: 1.25rem; }
.piano-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.piano-scroll { overflow-x: auto; padding: 18px; border-radius: 18px; background: linear-gradient(180deg, #1b1330, #0e0a1d); border: 1px solid var(--line); box-shadow: inset 0 2px 0 #ffffff10, 0 30px 60px -30px #ff86bd55; }
.piano { position: relative; display: flex; height: 220px; min-width: 460px; user-select: none; -webkit-user-select: none; touch-action: none; }
.key { cursor: pointer; border: 0; padding: 0; font: 600 0.7rem var(--f-mono); display: flex; align-items: end; justify-content: center; }
.key.white {
  flex: 1; margin: 0 1px; border-radius: 0 0 8px 8px; padding-bottom: 10px;
  background: linear-gradient(180deg, #f4f1fb, #ffffff 80%, #e4e0f0); color: #8a86a3;
  box-shadow: inset 0 -6px 0 #d6d1e6;
  transition: background .08s, box-shadow .08s;
}
.key.black {
  position: absolute; top: 0; height: 60%; z-index: 2; border-radius: 0 0 6px 6px; padding-bottom: 8px;
  background: linear-gradient(180deg, #2a2340, #0d0a17); color: #6d678a;
  box-shadow: inset 0 -5px 0 #000, 0 4px 8px #0008;
}
.key.white.on { background: linear-gradient(180deg, #ffd6ea, var(--music)); box-shadow: inset 0 -2px 0 #d36a9b, 0 0 30px var(--music); color: #5a1838; }
.key.black.on { background: linear-gradient(180deg, #ff9ccb, #b8457b); box-shadow: 0 0 24px var(--music); color: #fff; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Sorting ---------- */
.sorting {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 60px);
  padding: clamp(24px, 5vw, 56px); border-radius: 24px;
  background:
    radial-gradient(600px 300px at 0% 0%, #f3c55b1f, transparent 70%),
    linear-gradient(160deg, var(--night-3), var(--night-2));
  border: 1px solid var(--line);
}
.sorting-head { display: grid; gap: 14px; align-content: start; }
.quiz { display: grid; gap: 18px; min-width: 0; }
.quiz-progress { display: flex; gap: 6px; }
.quiz-progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.quiz-progress span.done { background: var(--gold); }
.quiz-q { font: 700 1.35rem var(--f-display); }
.quiz-answers { display: grid; gap: 10px; }
.quiz-answer {
  text-align: left; font: 1rem var(--f-body); color: var(--ink); cursor: pointer;
  padding: 14px 18px; border-radius: 12px; background: var(--night); border: 1px solid var(--line);
  transition: border-color .2s, transform .15s, background .2s;
}
.quiz-answer:hover { border-color: var(--gold); transform: translateX(4px); background: #f3c55b10; }
.quiz-result { display: grid; gap: 14px; justify-items: start; animation: rise .5s ease-out; }
.crest {
  width: 84px; height: 96px; display: grid; place-items: center;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  background: linear-gradient(180deg, var(--h1), var(--h2));
  font: 800 2.2rem var(--f-sign); color: var(--h3);
}
.quiz-result h3 { font-size: 2rem; font-family: var(--f-sign); color: var(--h3b); }
.quiz-result p { color: var(--muted); max-width: 32em; }
@media (max-width: 860px) { .sorting { grid-template-columns: minmax(0, 1fr); } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-main { display: grid; gap: 18px; max-width: 40em; }
.about-main > p { color: #d7d4ea; }
.friends-title { margin-top: 18px; color: var(--gold); }
.formula {
  display: grid; gap: 10px; padding: 20px 22px; border-radius: 14px;
  background: var(--night-2); border: 1px dashed var(--gold-deep);
}
.formula-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.formula-body { font: 600 clamp(1rem, 2.4vw, 1.25rem) var(--f-mono); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.frac { display: inline-grid; text-align: center; font-size: 0.9em; }
.frac span:first-child { border-bottom: 2px solid var(--ink); padding: 0 6px 2px; }
.frac span:last-child { padding-top: 2px; }
.curiosity {
  position: sticky; top: 96px; display: grid; gap: 14px; padding: 26px; border-radius: 18px;
  background: var(--night-2); border: 1px solid var(--line);
}
.curio-tag { --c: var(--science); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); }
.curio-text { font: 700 1.3rem/1.35 var(--f-display); min-height: 5.4em; }
.curio-text.swap { animation: rise .4s ease-out; }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } .curiosity { position: static; } }

/* ---------- Footer ---------- */
.footer {
  display: grid; gap: 8px; justify-items: center; text-align: center;
  padding-block: 60px calc(110px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}
.footer-sign { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hint { font-size: 0.78rem; color: #6f75a0; }
.hint b { color: var(--gold); font-weight: 600; }

/* ---------- Owl mail + letter ---------- */
.owl-btn {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 16px 10px 12px; border-radius: 999px; font: 700 0.9rem var(--f-body);
  color: #1b1405; background: var(--gold); border: 0;
  box-shadow: 0 10px 30px -6px #f3c55b99;
  animation: bob 3s ease-in-out infinite;
}
.owl-btn svg { width: 24px; height: 24px; }
.owl-btn .seal { color: #a3262a; }
.owl-btn.read { animation: none; opacity: 0.85; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@media (max-width: 480px) { .owl-btn span { display: none; } .owl-btn { padding: 12px; } }

.letter-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: #05081acc; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}
.letter {
  --paper: #f6ecd2; --paper-ink: #3a2a14;
  width: min(560px, 100%); display: grid; gap: 14px; padding: clamp(24px, 5vw, 44px);
  background: var(--paper); color: var(--paper-ink); border-radius: 6px;
  background-image: radial-gradient(circle at 20% 10%, #fff8e6, transparent 50%), radial-gradient(circle at 90% 90%, #e8d6aa, transparent 60%);
  box-shadow: 0 30px 80px #000a;
  font-size: 1.05rem; line-height: 1.6;
  animation: unfold .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes unfold { from { opacity: 0; transform: rotateX(70deg) translateY(30px); } }
.letter-address { font-size: 0.8rem; color: #7a6440; text-align: right; line-height: 1.5; }
.letter h2 { font-size: 1.8rem; background: none; color: #6b1d1f; -webkit-text-fill-color: #6b1d1f; animation: none; }
.letter-sign { font-style: italic; text-align: right; color: #6b1d1f; }
.letter .btn { justify-self: start; }

/* ---------- Lumos ---------- */
#lumos-veil {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 50%), transparent 0, #fff6d010 55%, #02030aee 100%);
}
body.lumos #lumos-veil { opacity: 1; }
.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 70;
  padding: 10px 18px; border-radius: 999px; background: var(--night-3); border: 1px solid var(--gold);
  color: var(--gold); font: 600 0.9rem var(--f-mono); animation: rise .3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
