:root {
  color-scheme: dark;
  --ink: #100d13;
  --paper: #f0e7ec;
  --pink: #efb7d0;
  --muted: #c4b4bf;
  --listing-accent: #e9b7ce;
  --veil-hue: 0deg;
}
:root[data-accent="lilac"] { --pink: #d7bff5; --listing-accent: #c6afe3; --veil-hue: -30deg; }
:root[data-accent="silver"] { --pink: #e5e0e9; --listing-accent: #d5cdd8; }
* { box-sizing: border-box; }
html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink) url(art/stars.svg) repeat; color: var(--paper); font: 15px/1.55 Verdana, Arial, sans-serif; }
button, a { font: inherit; }
a { color: var(--pink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff1f6; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #f6c6dc; outline-offset: 4px; }
::selection { background: #f4bdd5; color: #211820; }
img { max-width: 100%; }
[hidden] { display: none !important; }
#night-sky { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
#night-sky .veil {
  position: absolute; width: min(850px,74vw); height: clamp(360px,74vh,880px);
  background: url(art/aurora.webp) center / 100% 100% no-repeat;
  filter: hue-rotate(var(--veil-hue)); transform-origin: center; opacity: .82;
}
.veil-west { left: -24vw; top: 6vh; transform: rotate(-32deg); }
.veil-east { right: -24vw; top: 24vh; transform: scaleX(-1) rotate(-26deg); }
.moving .veil-west { animation: northern-light 15s ease-in-out -4s infinite alternate; }
.moving .veil-east { animation: southern-light 21s ease-in-out -13s infinite alternate; }
@keyframes northern-light {
  from { opacity: .58; transform: translate(-3%,3%) rotate(-32deg) scaleY(.90); }
  to { opacity: .98; transform: translate(6%,-6%) rotate(-17deg) scaleY(1.18); }
}
@keyframes southern-light {
  from { opacity: .94; transform: translate(2%,-3%) scaleX(-1) rotate(-30deg); }
  to { opacity: .47; transform: translate(-7%,6%) scale(-1.09,1.19) rotate(-13deg); }
}
[data-sky="stars"] .veil, [data-sky="still"] .veil { display: none; }
[data-accent="silver"] #night-sky .veil { filter: saturate(.16); }
.moving #night-sky .veil { translate: var(--gaze-x,0px) var(--gaze-y,0px); transition: translate 1s ease-out; }
#sky-charms { margin: 0 auto 18px; width: min(520px,calc(100% - 40px)); display: flex; align-items: start; justify-content: space-evenly; gap: 14px; }
.sky-figure { appearance: none; border: none; background: none; color: #c9a7be; display: grid; place-items: center; padding: 4px; width: 94px; min-height: 48px; border-radius: 35%; -webkit-tap-highlight-color: transparent; }
.sky-figure svg { width: 100%; display: block; overflow: visible; }
.sky-figure span { font: italic 13px Georgia,serif; color: var(--pink); opacity: 0; }
.sky-outline, .sky-line { stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: .86; fill: transparent; opacity: .42; }
.sky-line { opacity: .24; }
.sky-node { fill: #e2cedf; }
.sky-glow { fill: #f7ddeb; opacity: .66; }
.sky-figure:is(:focus-visible,[aria-pressed="true"]) :is(.sky-line,.sky-outline,.sky-glow,span) { opacity: 1; }
.sky-figure:is(:focus-visible,[aria-pressed="true"]) .sky-outline { fill: #e5b3d51a; stroke: var(--pink); }
@media (hover:hover) {
  .sky-figure:hover :is(.sky-outline,.sky-line,.sky-glow,span) { opacity: 1; }
  .sky-figure:hover .sky-outline { fill: #e5b3d51a; stroke: var(--pink); }
  .moving .sky-figure:hover .sky-outline { stroke-dasharray: 1; animation: trace-sky .85s ease-out both; }
}
.moving .sky-figure[aria-pressed="true"] .sky-outline { stroke-dasharray: 1; animation: trace-sky .85s ease-out both; }
@keyframes trace-sky { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (min-width: 1100px) {
  #sky-charms { margin: 0; width: 0; height: 0; }
  .sky-figure { position: fixed; width: clamp(86px,10vw,163px); }
  .sky-figure.pony { left: max(8px,calc(50% - 650px)); top: 18vh; rotate: -12deg; }
  .sky-figure.puppy { right: max(11px,calc(50% - 660px)); top: 44vh; rotate: 14deg; }
  .sky-figure.ribbon { left: max(12px,calc(50% - 615px)); top: 69vh; width: clamp(79px,7vw,114px); rotate: 10deg; }
}
@media (max-width: 600px) {
  #night-sky .veil { width: 120vw; height: 70vh; opacity: .55; }
  .veil-west { left: -80vw; top: 1%; }
  .veil-east { right: -83vw; top: 46%; }
}
.moving #night-sky i {
  position: absolute; width: var(--size); height: var(--size); background: #e7dce4;
  animation: twinkle var(--period) ease-in-out var(--delay) infinite alternate;
}
.moving #night-sky i.flare::before, .moving #night-sky i.flare::after { content: ''; position: absolute; background: #e6cddc; }
.moving #night-sky i.flare::before { top: 0; left: -2px; width: 5px; height: 1px; }
.moving #night-sky i.flare::after { left: 0; top: -2px; width: 1px; height: 5px; }
@keyframes twinkle {
  0% { opacity: .15; transform: translate(0,0); }
  55% { opacity: .74; }
  100% { opacity: .29; transform: translate(var(--drift),-5px); }
}
.moving #night-sky::after {
  content: ''; position: absolute; right: 8%; top: 11%; width: 42px; height: 1px;
  background: linear-gradient(90deg, #f0cadb, #a29aa9 25%, transparent);
  animation: falling-star 27s linear -12s infinite;
}
@keyframes falling-star {
  0%, 89% { opacity: 0; transform: translate(30px,-19px) rotate(-27deg); }
  90% { opacity: .78; }
  94%, 100% { opacity: 0; transform: translate(-86px,39px) rotate(-27deg); }
}
.page { width: min(860px, calc(100% - 52px)); margin: 0 auto; }
.skip { position: absolute; top: -80px; left: 14px; z-index: 4; padding: 6px 12px; background: var(--pink); color: var(--ink); }
.skip:focus { top: 8px; }

.mast { position: relative; isolation: isolate; min-height: 267px; display: grid; place-items: center; }
.nightprint {
  position: absolute; z-index: -1; inset: 0 -3% -2%; pointer-events: none;
  background: url(art/treeline.webp) center / 100% 100% no-repeat;
}
.moving .nightprint::after {
  content: ''; position: absolute; inset: 67.3333% 0 0;
  background: url(art/water.webp) 50% 0 / 100% 800% no-repeat;
  animation: water 3.2s steps(8,end) infinite;
}
@keyframes water { to { background-position-y: 114.285714%; } }
.mast-art { width: 85%; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 20px 4% 10px 0; }
.portrait { display: block; flex: 0 0 auto; width: clamp(96px, 20vw, 174px); height: auto; transform: rotate(-9deg); filter: drop-shadow(2px 3px 0 #0d0911cc); }
.signature { flex: 1; min-width: 0; padding-bottom: 3px; }
.signature h1 { margin: 0; line-height: 0; }
.signature h1 img { display: block; width: 100%; height: auto; filter: drop-shadow(1px 2px 1px #171018); }
.signature p { margin: 3px 0 0 8%; font: 13px/1.55 Verdana, Arial, sans-serif; color: #f6e5ec; text-shadow: 0 1px 3px #0a070d, 0 1px 1px #0a070d; }
.moth-door { position: absolute; right: 5%; bottom: 14%; width: 44px; height: 44px; padding: 6px; border: 0; background: none; opacity: .82; transform: rotate(13deg); transition: transform .22s ease, opacity .22s; }
.moth-door img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.moth-door:hover, .moth-door:focus-visible { opacity: 1; transform: translateY(-4px) rotate(-12deg); }
.cursor-glint { position: absolute; pointer-events: none; color: #ffe8f2; font: 13px/1 Georgia, serif; animation: dust .6s ease-out forwards; }
@keyframes dust { to { opacity: 0; transform: translate(-5px,12px) scale(.5); } }

#drawer { scroll-margin-top: 14px; }
.music-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid #6e5568; padding: 0 1px 9px; margin: 9px 0 17px; }
.music-heading h2, .dialog-head h2 { font: italic 700 30px/1.05 Georgia, serif; letter-spacing: -.055em; margin: 0; }
.extras { display: flex; gap: 14px; align-items: center; }
#toggle-motion { padding: 6px 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.music-heading nav, footer nav { font: 13px/1.5 Verdana, Arial, sans-serif; }
footer { border-top: 1px dotted #66525f; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 21px 0 32px; padding: 15px 0 2px; }
.contact p { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.contact nav { gap: 15px; }
.post-office { width: min(565px,calc(100% - 36px)); margin: clamp(38px,13vh,120px) auto 50px; }
.post-nav, .post-foot { font-size: 13px; }
.post-nav { margin-bottom: 20px; }
.letter {
  position: relative; isolation: isolate; padding: clamp(30px,6vw,48px);
  color: #392833; background: radial-gradient(circle at 90% 15%,#fff3ed55,transparent 80%),repeating-linear-gradient(0deg,#805e6c09 0 1px,transparent 1px 4px),#ebdbe0;
  border: 1px solid #cfb8c4; box-shadow: 3px 4px 0 #392e39, 4px 5px 0 #8b7485, 0 12px 24px #0e091350;
}
.letter::before { content: ''; position: absolute; inset: 5px; border: 1px solid #a1819290; pointer-events: none; }
.letter h1 { margin: 0 0 25px; font: italic 700 36px/1.05 Georgia,serif; letter-spacing: -.05em; }
.sender { margin: 0; font-size: 14px; line-height: 1.5; }
.postmark { position: absolute; z-index: -1; top: 20px; right: 22px; width: 106px; height: 92px; }
.postmark img { position: absolute; right: 1px; top: 0; width: 55px; height: 69px; object-fit: contain; padding: 3px; border: 3px dotted #fbebee; outline: 1px solid #bc9bad; background: #b990a5; transform: rotate(6deg); }
.postmark span { position: absolute; right: 35px; top: 24px; width: 63px; height: 34px; border: 1px solid #866e8180; outline: 1px dashed #866e8170; outline-offset: 3px; border-radius: 50%; transform: rotate(-16deg); }
.letter-address { margin: 22px 0 12px; border-bottom: 1px solid #b298a6; padding: 0 0 12px; }
.letter-address a { font: 600 clamp(18px,4.6vw,28px)/1.3 Georgia,serif; color: #4e3245; overflow-wrap: anywhere; text-decoration: none; }
.letter-address a:hover { text-decoration: underline; }
.letter :focus-visible { outline-color: #763753; }
#copy-address { border: 1px solid #aa8a9c; padding: 6px 10px; color: #442e40; background: #f3e6eb; font-size: 12px; }
#copy-status { margin-left: 10px; font-size: 12px; }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; }
#open-stickers { display: inline-flex; align-items: center; gap: 5px; color: var(--pink); font: 12px/1.5 Verdana, Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px; border: 0; background: none; padding: 2px 5px; }
#open-stickers img { width: 30px; height: auto; transform: rotate(-8deg); }
#open-stickers:hover img { transform: rotate(4deg); }

dialog { padding: 0; width: min(460px,calc(100% - 26px)); max-height: calc(100dvh - 32px); border: 1px solid #b497a9; background: #1b171e; color: var(--paper); box-shadow: 3px 5px 0 #070509; }
dialog::backdrop { background: #0d0911d9; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; }
.dialog-head h2 { font-size: 24px; }
.close { min-width: 36px; min-height: 36px; border: 0; color: #f1dde7; background: transparent; font-size: 23px; line-height: 1; }
.cutting-board { padding: 18px 8%; background: linear-gradient(90deg,#aa95a915 1px,transparent 1px), linear-gradient(#aa95a915 1px,transparent 1px), #29252c; background-size: 14px 14px; }
.tape-art { position: relative; margin: auto; max-width: 350px; transform: rotate(-3deg); filter: drop-shadow(3px 4px 2px #06040980); }
.blank-tape { display: block; width: 100%; height: auto; }
.stamp { position: absolute; padding: 0; border: 0; background: none; aspect-ratio: 1; transform: translate(-50%,-50%) rotate(var(--tilt)); touch-action: none; cursor: grab; }
.stamp:active { cursor: grabbing; }
.stamp img, .stickers img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(1px 0 white) drop-shadow(-1px 0 white) drop-shadow(0 1px white) drop-shadow(1px 2px #3d26354d); pointer-events: none; user-select: none; }
.peel-sheet { padding: 14px 18px 17px; background: #e8d7dc; color: #302531; }
.peel-sheet :focus-visible { outline-color: #753453; }
.peel-sheet p { font-size: 12px; margin: 0; }
.stickers { display: flex; gap: 10px; margin: 10px 0 14px; }
.stickers button { width: 52px; height: 56px; padding: 4px; background: none; border: 0; }
.stickers button:hover { transform: rotate(-6deg); }
.mat-actions { display: flex; gap: 10px; }
.mat-actions button { border: 1px solid #826b7b; background: transparent; color: #3d2939; padding: 5px 10px; font-size: 12px; }
.mat-actions #save-label { background: #382b37; color: #fff3f6; }
#mat-status:not(:empty) { margin-top: 8px; }

#subconscious { width: min(545px,calc(100% - 26px)); padding: 32px 18px 12px; text-align: center; background: #1c1620 url(art/moonlake.png) center / cover; text-shadow: 0 2px 3px #170e18; }
#subconscious .close { position: absolute; right: 2px; top: 2px; }
#subconscious h2 { font: italic 24px/1.25 Georgia,serif; margin: 5px auto; }
#dream-status { font-size: 12px; margin: 5px 0 12px; }
.constellation { position: relative; max-width: 365px; height: 103px; margin: auto; }
.constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: #efd9df; stroke-dasharray: 1 5; fill: none; }
.constellation button { position: absolute; transform: translate(-50%,-50%); width: 44px; height: 44px; border: 0; background: transparent; color: #fff3f0; font: 25px/1 Georgia,serif; }
.constellation button:nth-of-type(1) { left: 8%; top: 70%; }
.constellation button:nth-of-type(2) { left: 27.5%; top: 28%; }
.constellation button:nth-of-type(3) { left: 49.5%; top: 50%; }
.constellation button:nth-of-type(4) { left: 65.5%; top: 16%; }
.constellation button:nth-of-type(5) { left: 91%; top: 65%; }
.constellation button.lit { text-shadow: 0 0 14px #ffc2de; color: #ffc2de; }
@media (max-width: 600px) {
  .letter { padding-inline: clamp(17px,5.5vw,30px); }
  .letter-address a { font-size: clamp(16px,4.7vw,25px); }
  .page { width: calc(100% - 32px); }
  .mast { min-height: clamp(165px,38vw,222px); }
  .nightprint { inset: 0 -3% -4%; }
  .mast-art { width: 98%; gap: 0; padding: 16px 0 7px; }
  .portrait { width: 24%; }
  .signature p { margin: 2px 0 0 5%; font-size: clamp(10px,2.65vw,13px); }
  .moth-door { right: 0; bottom: 2%; width: 33px; height: 33px; }
  .music-heading { margin: 5px 0 12px; padding-bottom: 7px; }
  .music-heading h2 { font-size: 26px; }
  nav { gap: 13px; }
  .music-heading nav, footer nav { font-size: 12px; }
  footer { margin-top: 17px; }
  .extras { flex-direction: column; align-items: flex-end; gap: 0; }
  #toggle-motion { padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .moth-door { transition: none; }
  .cursor-glint { animation-duration: .01ms; }
}