:root {
  --ink: #3a2466;
  --ink-soft: #5d4a8a;
  --ink-faint: #8b7bb3;
  --lav: #cbb8f7;
  --lav-deep: #a58bea;
  --pink: #ffc6e0;
  --rose: #ff8fb8;
  --peach: #ffd9c2;
  --mint: #b8f3e0;
  --butter: #fff1b8;
  --cream: #fffaf3;
  --door: #c9b5f6;
  --display: 'Fraunces', 'Georgia', serif;
  --body: 'Nunito', system-ui, sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-soft: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #f7e6f3; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.hidden { opacity: 0 !important; pointer-events: none !important; visibility: hidden; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#scroll-space { height: 1650vh; width: 1px; } /* journey.js sets the real height: 1400vh × SCROLL_LENGTH (layout.js) */

/* ───────────── Dialogue ───────────── */
#dialogue {
  position: fixed; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(780px, calc(100vw - 28px)); z-index: 60;
  transition: opacity .35s, transform .5s var(--ease-pop), visibility .35s;
}
#dialogue.hidden { transform: translateX(-50%) translateY(30px) scale(.96); }
.dlg-box {
  position: relative; background: var(--cream); border-radius: 26px; padding: 30px 34px 28px;
  border: 4px solid #fff; outline: 3px solid var(--lav-deep); outline-offset: 0;
  box-shadow: 0 20px 50px rgba(74, 38, 140, .28), inset 0 0 0 2px rgba(165, 139, 234, .25);
  min-height: 112px; cursor: pointer;
}
.dlg-name {
  position: absolute; top: -20px; left: 26px; padding: 6px 20px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #b89cf5, #ff9fcb); color: #fff; font-weight: 800; letter-spacing: .08em; font-size: 14px;
  border: 3px solid #fff; box-shadow: 0 6px 14px rgba(120, 70, 200, .3);
}
.dlg-text { font-size: clamp(17px, 2.2vw, 22px); line-height: 1.5; font-weight: 700; color: var(--ink); min-height: 2.9em; }

/* compact mode: Pixie chatting while you explore */
#dialogue.compact { left: max(22px, env(safe-area-inset-left)); transform: none; width: min(430px, calc(100vw - 28px)); bottom: max(28px, env(safe-area-inset-bottom)); }
#dialogue.compact.hidden { transform: translateY(24px) scale(.96); }
#dialogue.compact .dlg-box { padding: 24px 24px 18px; min-height: 0; border-radius: 22px; cursor: default; background: rgba(255, 250, 243, .92); backdrop-filter: blur(10px); }
#dialogue.compact .dlg-text { font-size: 16px; min-height: 0; }
#dialogue.compact .dlg-name { font-size: 12px; top: -16px; padding: 4px 14px 5px; }

#flash { position: fixed; inset: 0; z-index: 45; background: radial-gradient(circle, #ffffff 30%, #fff4dc 100%); opacity: 0; pointer-events: none; }

/* ───────────── HUD ─────────────
   The brand sits top left. Everything else hangs on the garland, top right: one menu button (three ribbons), and when you press it a thread
   unrolls to the left with the chapters, the door home, the sky switch and the sound strung along it like beads. Each bead
   springs out of the button (--dx/--dy are measured by hud.js) with a delay that grows with its distance, so the nearest pops first
   and the whole string ripples open; folding runs the ripple the other way. Under 820px the thread hangs down instead. */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center; gap: 18px; pointer-events: none;
  padding: max(18px, env(safe-area-inset-top)) 26px 18px; transition: opacity .8s, visibility .8s;
}
#hud > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 22px; font-variation-settings: 'SOFT' 100; text-shadow: 0 1px 12px rgba(255,255,255,.8); }
#garland { margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; --far: 400; }
#garland .thread { position: absolute; z-index: -1; left: 21px; right: 21px; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; transform-origin: 100% 50%; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.95) 30%); box-shadow: 0 1px 6px rgba(120, 80, 180, .25); transition: transform .7s var(--ease-soft) .05s; }
#garland.folded .thread { transform: scaleX(0); transition: transform .45s var(--ease-soft) .15s; }
#garland .knot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 0 0 2px rgba(200, 180, 255, .45); flex: none; transition: transform .5s var(--ease-pop) .25s, opacity .3s .2s; }
#garland.folded .knot { transform: scale(0); opacity: 0; transition-delay: 0s; }
#chapters { display: flex; gap: 6px; }
.bead, #chapters button {
  position: relative; border-radius: 999px; background: rgba(255,255,255,.55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(120, 80, 180, .12); color: var(--ink-soft);
  transition: transform .6s var(--ease-pop) calc(var(--dist, 0) * .9ms), opacity .35s ease calc(var(--dist, 0) * .9ms + .05s), background .3s, color .3s, border-color .3s;
}
#chapters button { padding: 9px 16px; font-weight: 800; font-size: 13px; letter-spacing: .06em; }
#chapters button:hover, .bead:hover { color: var(--ink); background: rgba(255,255,255,.78); }
#chapters button.active { background: linear-gradient(135deg, #b89cf5, #ff9fcb); border-color: rgba(255,255,255,.7); color: #fff; box-shadow: 0 4px 12px rgba(160, 100, 220, .35); }
.bead { width: 42px; height: 42px; display: grid; place-items: center; }
#garland.folded :is(.bead, #chapters button) { transform: translate(calc(var(--dx, 0) * 1px), calc(var(--dy, 0) * 1px)) scale(.25); opacity: 0; pointer-events: none; transition-delay: calc((var(--far) - var(--dist, 0)) * .7ms), calc((var(--far) - var(--dist, 0)) * .7ms + .12s), 0s, 0s, 0s; }
/* a little label under the icon beads */
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 9px); left: 50%; transform: translate(-50%, -4px); padding: 5px 10px; border-radius: 999px; font: 800 11px/1 var(--body); letter-spacing: .05em; white-space: nowrap; color: var(--ink); background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 8px 20px rgba(100, 60, 170, .18); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease-pop); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
#leave svg { width: 20px; height: 20px; }
#leave:hover svg { animation: step-out .6s var(--ease-pop); }
@keyframes step-out { 50% { transform: translateX(3px); } }
/* the menu button: pressed, it turns and its ribbons fold into a small cross */
#fold { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255, 236, 250, .85)); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 10px 26px rgba(120, 80, 180, .22), inset 0 1px 0 #fff; transition: transform .5s var(--ease-pop), box-shadow .4s, background .4s; }
#fold:hover { transform: scale(1.08); box-shadow: 0 14px 30px rgba(120, 80, 180, .3), inset 0 1px 0 #fff; }
#fold svg { width: 24px; height: 24px; overflow: visible; transition: transform .7s var(--ease-pop); }
/* the menu: three ribbons in the valley's colours, swaying out of step like bunting in a breeze; they fold into a cross when open */
#fold .waves path { fill: none; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; transform-origin: 0 50%; animation: sway 3.2s ease-in-out infinite; transition: transform .5s var(--ease-pop), opacity .25s; }
#fold .w1 { stroke: #9a78ee; } #fold .w2 { stroke: #ff7fb6; animation-delay: -1.1s; } #fold .w3 { stroke: #48c49f; animation-delay: -2.2s; }
@keyframes sway { 0%, 100% { transform: translateX(0) scaleY(1); } 50% { transform: translateX(.9px) scaleY(-1); } }
#fold:hover .waves path { animation-duration: 1.4s; }
#fold .cross { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transform-origin: 12px 12px; transform: scale(.2) rotate(-90deg); opacity: 0; transition: transform .6s var(--ease-pop), opacity .25s; }
#fold[aria-expanded="true"] svg { transform: rotate(135deg); }
#fold[aria-expanded="true"] .waves path { animation: none; transform: scaleX(.2); opacity: 0; }
#fold[aria-expanded="true"] .cross { transform: none; opacity: 1; transition-delay: .15s, .1s; }
#garland:not(.folded) #fold { background: linear-gradient(135deg, #b89cf5, #ff9fcb); color: #fff; border-color: rgba(255,255,255,.7); }
/* the sky switch: a little sun by day, a crescent with two stars by night; they trade places with a turn */
#sky svg { width: 22px; height: 22px; overflow: visible; }
#sky .sky-sun { fill: #ffb347; stroke: #ff9f3a; stroke-width: 1.6; stroke-linecap: round; transform-origin: 12px 12px; transition: transform .7s var(--ease-pop), opacity .35s; }
#sky .sky-rays { fill: none; stroke: #ffb347; transform-origin: 12px 12px; animation: turn 24s linear infinite; }
#sky .sky-moon { fill: #f4efff; stroke: #cbb8f7; stroke-width: 1; stroke-linejoin: round; transform-origin: 12px 12px; transform: rotate(-90deg) scale(.4); opacity: 0; transition: transform .7s var(--ease-pop), opacity .35s; }
#sky .sky-star { fill: #fff0b0; stroke: none; }
#sky[aria-pressed="true"] .sky-sun { transform: rotate(90deg) scale(.4); opacity: 0; }
#sky[aria-pressed="true"] .sky-moon { transform: none; opacity: 1; }
@keyframes turn { to { transform: rotate(360deg); } }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.bars i { width: 3px; border-radius: 2px; background: var(--ink-soft); height: 100%; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.bars i:nth-child(2) { animation-delay: -.3s; } .bars i:nth-child(3) { animation-delay: -.6s; } .bars i:nth-child(4) { animation-delay: -.15s; }
#sound[aria-pressed="false"] .bars i { animation: none; transform: scaleY(.2); }
@keyframes eq { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
#secrets { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 30; padding: 9px 20px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--ink); background: rgba(255,255,255,.82); border: 1.5px solid rgba(255,255,255,.95); box-shadow: 0 12px 30px rgba(100, 60, 170, .2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: opacity .4s, transform .4s; pointer-events: none; }
#secrets.hidden { transform: translate(-50%, -10px); }
#progress { position: fixed; left: 0; right: 0; bottom: 0; height: 4px; z-index: 30; background: rgba(255,255,255,.35); }
#progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #a98bf3, #ff8fc1, #ffc39a, #b8f3e0); }

/* ───────────── Hero ───────────── */
#hero { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; text-align: center; padding: 0 22px; pointer-events: none; transition: opacity 1.2s, visibility 1.2s; }
.hero-eyebrow { font-weight: 800; letter-spacing: .4em; text-transform: uppercase; font-size: clamp(11px, 1.3vw, 14px); color: var(--ink-soft); margin-bottom: 18px; }
.hero-title { font-family: var(--display); font-weight: 500; font-size: clamp(52px, 10vw, 148px); line-height: .95; letter-spacing: -.02em; color: #fff; font-variation-settings: 'SOFT' 100, 'WONK' 1; text-shadow: 0 3px 0 rgba(150, 100, 220, .35), 0 8px 28px rgba(120, 60, 200, .45); }
.hero-title em { font-style: italic; color: #fff7d6; }
.hero-sub { margin-top: 22px; font-size: clamp(15px, 1.7vw, 20px); font-weight: 700; color: var(--ink); max-width: 560px; margin-inline: auto; text-shadow: 0 1px 16px rgba(255,255,255,.9); }

#scroll-hint { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--ink); text-shadow: 0 1px 10px #fff; transition: opacity .8s, visibility .8s; }
.mouse { width: 24px; height: 38px; border-radius: 14px; border: 2.5px solid var(--ink); display: block; position: relative; background: rgba(255,255,255,.4); }
.mouse i { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 3px; background: var(--rose); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80%,100% { transform: translateY(12px); opacity: 0; } }

/* ───────────── Story card ───────────── */
#card, #letter {
  position: fixed; right: clamp(16px, 5vw, 80px); top: 50%; z-index: 22; width: min(430px, calc(100vw - 32px));
  transform: translateY(-50%); transition: opacity .45s, transform .6s var(--ease-soft), visibility .45s;
}
#card.hidden, #letter.hidden { transform: translateY(-46%) translateX(30px); }
#card {
  padding: 34px 34px 32px; border-radius: 30px;
  background: linear-gradient(160deg, rgba(255,255,255,.78), rgba(255, 246, 252, .6));
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1.5px solid rgba(255,255,255,.95);
  box-shadow: 0 30px 70px rgba(100, 60, 170, .22), inset 0 1px 0 #fff;
}
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--rose); margin-bottom: 12px; }
#card h2, #letter h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.04; letter-spacing: -.015em; color: var(--ink); margin-bottom: 16px; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
#card h2 em, #letter h2 em { font-style: italic; color: var(--lav-deep); }
#card p.body { font-size: 16.5px; line-height: 1.65; color: var(--ink-soft); font-weight: 600; }
#card .role { font-weight: 800; color: var(--lav-deep); margin: -8px 0 14px; font-size: 15px; letter-spacing: .04em; }
#card .stats { display: flex; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1.5px dashed rgba(165, 139, 234, .45); }
#card .stats div { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
#card .stats b { display: block; font-family: var(--display); font-size: 32px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; text-transform: none; }
#card .meta { list-style: none; margin-top: 18px; display: grid; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
#card .meta b { color: var(--ink-faint); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; display: inline-block; min-width: 70px; }
#card .fun { margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 241, 184, .55); font-size: 14px; font-weight: 700; color: #7a5a2a; }
.btn { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 13px 24px; border-radius: 999px; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #a98bf3, #ff8fc1); box-shadow: 0 10px 24px rgba(160, 100, 220, .35); transition: transform .3s var(--ease-pop), box-shadow .3s; text-decoration: none; }
.btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 30px rgba(160, 100, 220, .45); }
#card .contact-list { list-style: none; display: grid; gap: 14px; margin-top: 6px; }
#card .contact-list li { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; font-weight: 700; color: var(--ink); font-size: 16px; }
#card .contact-list i { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-style: normal; font-size: 18px; background: linear-gradient(135deg, #efe5ff, #ffe3f0); }
#card .contact-list small { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 800; }
#card .who { display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center; margin: 0 0 14px; font-size: inherit; color: inherit; }
#card .who .avatar { width: 76px; height: 76px; border-radius: 26px; }   /* (site.css has a small round .who img for blog bylines) */
#card .who h2 { margin-bottom: 6px; font-size: clamp(26px, 2.8vw, 36px); }
#card .who .role { margin: 0; }
.avatar { width: 76px; height: 76px; border-radius: 26px; object-fit: cover; background: linear-gradient(135deg, #efe5ff, #ffe3f0); border: 3px solid #fff; box-shadow: 0 8px 20px rgba(100, 60, 170, .2); }
.avatar:not([src]), .avatar[src=""] { visibility: hidden; }
#card .btn { margin-top: 18px; }
.btn.ghost { background: rgba(255,255,255,.75); color: var(--ink-soft); border: 1.5px solid rgba(165,139,234,.4); box-shadow: none; }
#card a { color: inherit; text-decoration-color: var(--rose); text-underline-offset: 3px; }
#card .contact-list i svg { color: var(--lav-deep); }
#card .contact-list + .contact-actions, .contact-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
#card .contact-actions .btn { margin-top: 16px; padding: 12px 20px; font-size: 14px; }
#card .socials { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
#card .socials a { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: 13px; font-weight: 800; text-decoration: none; color: var(--ink-soft); border: 1px solid rgba(165,139,234,.3); }
#card .socials a:hover { background: #fff; color: var(--ink); }

/* ───────────── Letter form ───────────── */
#letter {
  border-radius: 26px; padding: 8px; background: repeating-linear-gradient(135deg, #ff9fcb 0 14px, #fff 14px 28px, #a9c8ff 28px 42px, #fff 42px 56px);
  box-shadow: 0 30px 70px rgba(100, 60, 170, .3);
}
.letter-body, .letter-done { background: var(--cream); border-radius: 20px; padding: 28px 28px 26px; }
.letter-stamp { position: absolute; right: 26px; top: 26px; width: 52px; height: 60px; border-radius: 6px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(135deg, #a98bf3, #ff8fc1); outline: 2px dashed #fff; outline-offset: -5px; transform: rotate(6deg); box-shadow: 0 4px 10px rgba(120,70,200,.25); z-index: 2; }
#letter h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; padding-right: 60px; }
#letter label { display: block; margin-top: 12px; }
#letter label span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
#letter input, #letter select, #letter textarea {
  width: 100%; font: 700 16px var(--body); color: var(--ink); background: transparent; border: 0; border-bottom: 2px dashed rgba(165, 139, 234, .55);
  padding: 7px 2px; outline: none; border-radius: 0; resize: none; transition: border-color .25s;
}
#letter input:focus, #letter select:focus, #letter textarea:focus { border-bottom: 2px solid var(--rose); }
#letter ::placeholder { color: rgba(93, 74, 138, .38); font-style: italic; }
#letter .btn { width: 100%; justify-content: center; margin-top: 20px; }
.letter-error { min-height: 1.2em; margin-top: 8px; font-size: 13px; font-weight: 800; color: #e0508a; text-align: center; }
.letter-done { display: none; text-align: center; padding: 50px 30px; }
.letter-done p { color: var(--ink-soft); font-weight: 600; line-height: 1.6; }
#letter.sent .letter-body, #letter.sent .letter-stamp { display: none; }
#letter.sent .letter-done { display: block; animation: pop .6s var(--ease-pop); }
#letter.flying { transition: transform 1.1s cubic-bezier(.5,-0.3,.8,.4), opacity 1.1s; transform: translate(-60vw, -120vh) rotate(-40deg) scale(.1) !important; opacity: 0 !important; }

/* ───────────── Reel ───────────── */
/* ───────────── Team profile ───────────── */
#profile { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(58, 36, 102, .45); backdrop-filter: blur(12px); transition: opacity .4s, visibility .4s; padding: 20px; }
.profile-frame { position: relative; width: min(980px, 100%); max-height: min(88vh, 760px); overflow: auto; border-radius: 32px; padding: 34px; background: linear-gradient(160deg, #fff, #fff6fc); box-shadow: 0 40px 100px rgba(40, 10, 90, .5); transition: transform .5s var(--ease-pop); }
#profile.hidden .profile-frame { transform: scale(.88) translateY(20px); }
.profile-frame .reel-close { position: sticky; float: right; top: 0; right: 0; margin: -14px -14px 0 0; }
.profile-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 34px; align-items: start; }
.profile-main { margin: 0; position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 4/3.4; background: linear-gradient(135deg, #efe5ff, #ffe3f0); }
.profile-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-main figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.85); font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.profile-main figcaption:empty { display: none; }
.profile-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.profile-thumbs button { padding: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; border: 3px solid transparent; opacity: .75; transition: opacity .25s, border-color .25s, transform .25s; background: #efe5ff; }
.profile-thumbs button:hover, .profile-thumbs button.active { opacity: 1; border-color: var(--lav-deep); transform: translateY(-2px); }
.profile-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-text h2 { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -.015em; color: var(--ink); margin-bottom: 8px; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
.profile-text .role { font-weight: 800; color: var(--lav-deep); font-size: 15px; letter-spacing: .04em; margin-bottom: 16px; }
.profile-text blockquote { margin: 0 0 16px; padding: 14px 18px; border-radius: 18px; background: linear-gradient(135deg, #f3ecff, #ffeaf4); font-family: var(--display); font-style: italic; font-size: 18px; line-height: 1.4; color: var(--ink); }
.profile-text .body { font-size: 16px; line-height: 1.65; color: var(--ink-soft); font-weight: 600; }
.profile-text .meta { list-style: none; margin-top: 18px; display: grid; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.profile-text .meta b { color: var(--ink-faint); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; display: inline-block; min-width: 92px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips span { padding: 6px 12px; border-radius: 999px; background: #efe5ff; color: var(--ink-soft); font-size: 12.5px; font-weight: 800; }
.profile-text .fun { margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 241, 184, .55); font-size: 14px; font-weight: 700; color: #7a5a2a; }
.profile-thumbs.three { grid-template-columns: repeat(3, 1fr); }
.profile-thumbs.three button { aspect-ratio: 4/3; }
.profile-photos .btn { width: 100%; justify-content: center; margin-top: 14px; }
.profile-text .body + blockquote { margin-top: 16px; }
.profile-text .label { margin-top: 20px; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.profile-text .label + .chips { margin-top: 8px; }
.makers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.makers button { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #fff; border: 1.5px solid rgba(165,139,234,.35); text-align: left; transition: transform .25s var(--ease-pop), border-color .25s; }
.makers button:hover { transform: translateY(-2px); border-color: var(--lav-deep); }
.makers img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #efe5ff, #ffe3f0); }
.makers span { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); line-height: 1.25; }
.makers b { display: block; font-size: 14px; font-weight: 800; color: var(--ink); }
.profile-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
@media (max-width: 760px) { .profile-frame { padding: 22px; } .profile-body { grid-template-columns: 1fr; gap: 20px; } }
.dlg-box .dlg-name { transition: background .3s; }
#dialogue.guest .dlg-name { background: linear-gradient(135deg, #ffb8a0, #ff9fbf); }

#reel { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(58, 36, 102, .45); backdrop-filter: blur(12px); transition: opacity .4s, visibility .4s; padding: 20px; }
.reel-frame { position: relative; width: min(900px, 100%); aspect-ratio: 16/9; border-radius: 28px; padding: 10px; background: #fff; box-shadow: 0 40px 100px rgba(40, 10, 90, .5); transition: transform .5s var(--ease-pop); }
#reel.hidden .reel-frame { transform: scale(.85); }
.reel-screen { width: 100%; height: 100%; border-radius: 20px; overflow: hidden; background: #1d1233; }
.reel-screen iframe, .reel-screen video { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #1d1233; }
.reel-close { position: absolute; right: -10px; top: -10px; width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 26px; color: var(--ink); box-shadow: 0 8px 20px rgba(60, 20, 120, .3); z-index: 2; }

/* ───────────── Small screens ───────────── */
@media (max-width: 820px) {
  #hud { padding-inline: 14px; gap: 10px; align-items: flex-start; }
  /* the garland hangs down from the menu button on a phone: same beads, same ripple, on a vertical thread */
  #garland { flex-direction: column; align-items: flex-end; gap: 8px; }
  #garland #fold { order: -1; }
  #garland .thread { left: auto; right: 22px; top: 23px; bottom: 21px; width: 2px; height: auto; margin: 0; transform-origin: 50% 0; background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0)); }
  #garland.folded .thread { transform: scaleY(0); }
  #garland .knot { margin-right: 20px; }
  #chapters { flex-direction: column; align-items: flex-end; gap: 6px; }
  #chapters button { padding: 8px 14px; font-size: 12px; }
  .bead { width: 40px; height: 40px; }
  [data-tip]::after { top: 50%; left: auto; right: calc(100% + 10px); transform: translate(4px, -50%); }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { transform: translate(0, -50%); }
  /* the card sits under the top bar and ends above Pixie's dialogue box (it used to stop at 46vh, which cut off its buttons) */
  #card, #letter { right: 16px; left: 16px; width: auto; top: 76px; transform: none; max-height: calc(100svh - 76px - 150px); overflow: auto; overscroll-behavior: contain; }
  #card.hidden, #letter.hidden { transform: translateY(-16px); }
  #dialogue.compact { left: 14px; right: 14px; width: auto; bottom: 18px; }
  #hero { padding-bottom: 120px; }                   /* centred in the space above Pixie's dialogue box */
  #scroll-hint { bottom: 156px; white-space: nowrap; }                    /* (at 40px it hid behind the dialogue box) */
}
/* phones and short windows: the same cards, tighter */
@media (max-width: 820px), (max-height: 520px) {
  #card { padding: 22px 22px 20px; border-radius: 24px; }
  #card h2 { font-size: 27px; margin-bottom: 10px; }
  #card p.body { font-size: 14.5px; line-height: 1.55; }
  #card .stats { margin-top: 14px; padding-top: 12px; } #card .stats b { font-size: 24px; }
  #card .fun { margin-top: 12px; padding: 10px 14px; font-size: 13.5px; }
  #card .btn { margin-top: 14px; padding: 11px 20px; font-size: 14px; }
  #card .meta { margin-top: 12px; gap: 5px; }
  #card .contact-list { gap: 8px; }
  #card .contact-list li { grid-template-columns: 34px 1fr; gap: 10px; font-size: 14.5px; }
  #card .contact-list i { width: 34px; height: 34px; border-radius: 11px; }
  #card .contact-actions { display: flex; flex-wrap: wrap; gap: 0 8px; }
  #card .contact-actions .btn { margin-top: 12px; padding: 10px 16px; font-size: 13.5px; }
  #card .socials { margin-top: 14px; gap: 6px; } #card .socials a { padding: 6px 12px; font-size: 12.5px; }
  .letter-body { padding: 18px 20px 16px; }
  .letter-stamp { right: 22px; top: 22px; width: 44px; height: 50px; }
  #letter h2 { margin-bottom: 6px; padding-right: 52px; }
  #letter label { margin-top: 8px; }
  #letter input, #letter select, #letter textarea { padding: 5px 2px; }
  #letter textarea { height: 3.6em; }
  #letter .btn { margin-top: 14px; padding-block: 12px; }
  .letter-error { margin-top: 4px; }
  #dialogue.compact .dlg-text { font-size: 14.5px; }
  .dlg-box { padding: 26px 22px 24px; }
}
@media (max-width: 820px) and (max-height: 740px), (max-height: 520px) { #card .socials { display: none; } }   /* short screens: the links are on the website too */
/* a phone on its side: the card on the right under the top bar, Pixie's dialogue on the left, nothing on top of anything */
@media (orientation: landscape) and (max-height: 520px) {
  #card, #letter { left: auto; right: 12px; top: 64px; width: min(430px, 52vw); max-height: calc(100svh - 76px); transform: none; overflow: auto; overscroll-behavior: contain; }
  #card.hidden, #letter.hidden { transform: translateX(24px); }
  #card .who { grid-template-columns: 56px 1fr; gap: 12px; margin-bottom: 10px; } #card .who .avatar { width: 56px; height: 56px; border-radius: 18px; }
  #dialogue.compact { left: 14px; right: auto; bottom: 12px; width: min(400px, calc(100vw - min(430px, 52vw) - 58px)); }
  #dialogue.compact .dlg-box { padding: 20px 18px 14px; }
  #hero { padding: 40px 22px 0; place-content: start center; padding-top: 12vh; }
  .hero-title { font-size: min(clamp(52px, 10vw, 148px), 19vh); }
  .hero-eyebrow { margin-bottom: 8px; }
  .hero-sub { margin-top: 10px; font-size: 14.5px; }
  #scroll-hint { left: auto; right: 24px; bottom: 16px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bars i { animation: none; }
  #fold .waves path, #sky .sky-rays { animation: none; }
}

/* the last screen: a quiet title over the sea */
#outro { position: fixed; left: 50%; bottom: clamp(84px, 12vh, 130px); transform: translateX(-50%); z-index: 24; text-align: center; width: min(94vw, 1040px); transition: opacity .9s ease, transform .9s var(--ease-pop); }
#outro.hidden { transform: translate(-50%, 24px); }
body:has(#outro:not(.hidden)) #scroll-hint { opacity: 0; }
#outro .eyebrow { color: #fff; text-shadow: 0 2px 14px rgba(120, 70, 180, .55); margin-bottom: 10px; }
#outro h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4.3vw, 58px); line-height: 1.02; letter-spacing: -.02em; color: #fff; text-shadow: 0 4px 30px rgba(120, 70, 180, .45); font-variation-settings: 'SOFT' 100, 'WONK' 1; }
#outro h2 em { font-style: italic; color: #fff3c4; }
.outro-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 820px) { #outro { bottom: 160px; } }                            /* above Pixie's dialogue box, not under it */
@media (orientation: landscape) and (max-height: 520px) { #outro { bottom: auto; top: 14vh; } #outro h2 { font-size: min(clamp(30px, 4.3vw, 58px), 11vh); } }

/* ───────────── Night ─────────────
   html.night is set by daynight.js (only when the visitor presses the sky switch in the HUD). The same interface, on dark glass:
   the ink turns to cream, the cream to deep indigo, and every white edge to a lavender one. */
html.night {
  --ink: #fff6ff; --ink-soft: #dccfff; --ink-faint: #a99bd8; --cream: #2a2352; --door: #3a2f73;
  --edge: #4d4390; --glass: rgba(44, 36, 92, .62); --glass-strong: rgba(44, 36, 92, .9);
  background: #1c1740;
}
html.night .brand, html.night .hero-sub, html.night #scroll-hint { text-shadow: 0 1px 14px rgba(20, 10, 60, .9); }
html.night .hero-eyebrow { color: var(--ink-soft); }
html.night .hero-title { text-shadow: 0 3px 0 rgba(60, 30, 120, .5), 0 8px 28px rgba(0, 0, 40, .55); }
html.night :is(.bead, #chapters button:not(.active), #secrets), html.night [data-tip]::after { background: var(--glass); border-color: rgba(190, 170, 255, .35); box-shadow: 0 8px 24px rgba(0, 0, 30, .3); }
html.night #garland.folded #fold { background: var(--glass-strong); border-color: rgba(190, 170, 255, .45); box-shadow: 0 10px 26px rgba(0, 0, 30, .4); }
html.night #garland .thread { background: linear-gradient(90deg, rgba(190, 170, 255, 0), rgba(190, 170, 255, .8) 30%); }
html.night #garland .knot { background: #dccfff; }
html.night :is(.bead, #chapters button:not(.active)):hover { background: rgba(120, 100, 200, .35); color: var(--ink); }
html.night #progress { background: rgba(255,255,255,.12); }
html.night .mouse { background: rgba(40, 30, 80, .5); }
html.night #card { background: linear-gradient(160deg, rgba(48, 38, 100, .82), rgba(36, 28, 78, .7)); border-color: rgba(190, 170, 255, .4); box-shadow: 0 30px 70px rgba(0, 0, 30, .45), inset 0 1px 0 rgba(255,255,255,.18); }
html.night .dlg-box { border-color: var(--edge); box-shadow: 0 20px 50px rgba(0, 0, 30, .5), inset 0 0 0 2px rgba(165, 139, 234, .18); }
html.night .dlg-name { border-color: var(--edge); }
html.night #dialogue.compact .dlg-box { background: var(--glass-strong); }
html.night #letter { background: repeating-linear-gradient(135deg, #ff9fcb 0 14px, #2a2352 14px 28px, #a9c8ff 28px 42px, #2a2352 42px 56px); box-shadow: 0 30px 70px rgba(0, 0, 30, .5); }
html.night #letter ::placeholder { color: rgba(220, 207, 255, .4); }
html.night #letter input, html.night #letter select, html.night #letter textarea { border-bottom-color: rgba(190, 170, 255, .5); }
html.night #letter select option { background: var(--cream); color: var(--ink); }
html.night .btn.ghost { background: rgba(60, 48, 120, .7); color: var(--ink); border-color: rgba(190, 170, 255, .35); }
html.night #card .fun, html.night .profile-text .fun { background: rgba(255, 241, 184, .14); color: #ffe9a8; }
html.night #card .contact-list i, html.night .avatar, html.night .profile-main, html.night .makers img { background: linear-gradient(135deg, #3d3480, #4a3676); }
html.night .avatar { border-color: var(--edge); }
html.night #card .socials a, html.night .makers button { background: rgba(60, 48, 120, .7); color: var(--ink-soft); border-color: rgba(190, 170, 255, .3); }
html.night #card .socials a:hover { background: #4a3f96; color: var(--ink); }
html.night .profile-frame { background: linear-gradient(160deg, #2e2660, #261f50); box-shadow: 0 40px 100px rgba(0, 0, 20, .7); }
html.night .profile-text blockquote { background: linear-gradient(135deg, #3d3480, #4a3676); }
html.night .chips span, html.night .profile-thumbs button { background: #3d3480; }
html.night .profile-main figcaption { background: rgba(40, 30, 80, .85); color: var(--ink-soft); }
html.night .reel-close { background: #3d3480; }
html.night .reel-frame { background: #2a2352; }
html.night #flash { background: radial-gradient(circle, #ffffff 30%, #dcd2ff 100%); }
