/* Nite Loom site: shared styles for the front gate and the info page.
   One committed after-dark world; phone layout first, widened at 760px and 1000px. */
:root {
  color-scheme: dark;
  --midnight: #170B2E;
  --shift:    #22133F;
  --shift-2:  #2D1A52;
  --violet:   #4B2A86;
  --ink:      #0B0614;
  --text:     #F6EEFF;
  --text-2:   #C9B6EC;
  --text-3:   #9886BD;
  --line:     rgba(201, 166, 242, 0.18);
  --gold:     #E6CC1F;
  --magenta:  #D21ACB;
  --bloom:    #F27ED9;
  --mint:     #4FC3A1;

  --f-groove: "Shrikhand", "Cooper Black", Georgia, serif;
  --f-sign:   "Saira Stencil One", Impact, "Arial Narrow", sans-serif;
  --f-body:   "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-script: "Leckerli One", "Brush Script MT", cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--midnight); color: var(--text); font: 400 17px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--midnight); }
a { color: inherit; }
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap {
  max-width: 1240px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

.eyebrow { font: 400 14px/1.2 var(--f-sign); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.room-title { font: 400 clamp(32px, 5vw, 58px)/1.04 var(--f-groove); }
.lede { font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 60ch; }
@media (max-width: 760px) { .lede { font-size: 17px; } }
.door { display: inline-flex; align-items: center; gap: 10px; }
.door::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 13px 22px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--gold); color: var(--ink); font: 700 15px/1 var(--f-body); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: rgba(23, 11, 46, .55); color: var(--text); border-color: rgba(246, 238, 255, .4); box-shadow: none; backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--text); }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(23, 11, 46, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.mark { display: inline-flex; align-items: center; flex: none; line-height: 0; text-decoration: none; }
.mark img { height: 36px; width: auto; max-width: none; display: block; }
@media (max-width: 420px) { .mark img { height: 28px; } }
.foot .mark img { height: 40px; }
.menu { display: flex; align-items: center; gap: 22px; }
.menu a:not(.btn) { font: 400 14px/1 var(--f-sign); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); text-decoration: none; }
.menu a:not(.btn):hover, .menu a[aria-current="page"] { color: var(--text); }
.menu .btn { min-height: 40px; padding: 9px 16px; font-size: 14px; }
@media (max-width: 760px) { .menu > a:not(.btn) { display: none; } }


/* phone menu: the header links fold into a dropdown under 760px */
.mnav { display: none; position: relative; }
.mnav summary { list-style: none; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  font: 400 13px/1 var(--f-sign); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.mnav summary::-webkit-details-marker { display: none; }
.mnav nav { position: absolute; right: 0; top: calc(100% + 8px); display: grid; min-width: 210px; padding: 8px; border-radius: 14px; background: var(--shift); border: 2px solid var(--ink); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.mnav nav a { padding: 12px 12px; font: 400 14px/1 var(--f-sign); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); text-decoration: none; border-radius: 8px; }
.mnav nav a:hover { background: var(--shift-2); color: var(--text); }
@media (max-width: 760px) { .mnav { display: block; } .menu { gap: 10px; } }

/* ---------- sections ---------- */
.room { padding-block: 64px; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
@media (min-width: 760px) { .room { padding-block: 88px; } }
.room-head { display: grid; gap: 16px; margin-bottom: 36px; }
.room-head .eyebrow + * { margin-top: 2px; }
.room-title + p, .room-title + .lede { margin-top: 4px; }

.foot { border-top: 1px solid var(--line); padding-block: 44px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; }
.foot p, .foot a { font: 400 13px/1.6 var(--f-sign); letter-spacing: .12em; color: var(--text-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }
.social { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); }
.social svg { width: 20px; height: 20px; }
.social:hover { border-color: var(--bloom); box-shadow: 0 0 18px rgba(242, 126, 217, .4); }

/* ---------- mushroom hunt (site.js) ---------- */
.shroom { position: absolute; z-index: 3; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 0 6px rgba(242, 126, 217, .9)); animation: shroom-glow 3.2s ease-in-out infinite; }
.shroom svg, .shroom-pill svg, .shroom-body svg { display: block; width: 100%; height: 100%; }
.shroom:hover { transform: scale(1.2) rotate(-8deg); }
.shroom.found { opacity: .35; filter: none; animation: none; }
@keyframes shroom-glow { 50% { filter: drop-shadow(0 0 14px rgba(242, 126, 217, 1)); } }
.shroom-pill { position: fixed; z-index: 50; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--shift-2); color: var(--text); font: 400 14px/1 var(--f-sign); letter-spacing: .1em; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
.shroom-pill svg { width: 24px; height: 24px; }
.shroom-dlg { width: min(420px, calc(100% - 32px)); padding: 0; border: 2px solid var(--ink); border-radius: 18px; background: var(--shift); color: var(--text); }
.shroom-dlg::backdrop { background: rgba(8, 3, 18, .8); }
.shroom-body { display: grid; justify-items: center; gap: 14px; padding: 28px 24px; text-align: center; }
.shroom-body svg { width: 64px; height: 64px; filter: drop-shadow(0 0 14px rgba(242, 126, 217, .9)); }
.shroom-body h2 { font: 400 28px/1.1 var(--f-groove); }
.shroom-body p { color: var(--text-2); }
.shroom-code { font: 400 26px/1 var(--f-sign); letter-spacing: .16em; color: var(--ink); background: var(--gold); padding: 12px 18px; border-radius: 10px; border: 2px dashed var(--ink); user-select: all; }

/* the counter glows for a few seconds after each find (and when Glimmer's card closes) */
.shroom-pill { transition: transform .2s; }
.shroom-pill.lit { border-color: var(--bloom); box-shadow: 0 4px 0 var(--ink), 0 0 0 3px rgba(242, 126, 217, .45), 0 0 26px rgba(242, 126, 217, .8); animation: pill-lit 1.1s ease-in-out 3; }
.shroom-pill.lit svg { filter: drop-shadow(0 0 6px rgba(242, 126, 217, 1)); }
.shroom-pill.done { background: var(--gold); color: var(--ink); }
@keyframes pill-lit { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.08); box-shadow: 0 4px 0 var(--ink), 0 0 0 5px rgba(242, 126, 217, .35), 0 0 38px rgba(242, 126, 217, 1); } }
.shroom-body .btn { min-width: 180px; }

/* Glimmer's intro card: slides up from the corner the counter lives in */
.hunt-intro { position: fixed; z-index: 60; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: min(370px, calc(100% - 32px)); display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 18px 18px 18px 14px; border: 2px solid var(--ink); border-radius: 18px; background: var(--shift);
  box-shadow: 6px 6px 0 var(--ink), 0 0 40px -6px rgba(180, 140, 255, .7);
  opacity: 0; transform: translateY(24px) scale(.96); transition: opacity .35s ease, transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.hunt-intro.in { opacity: 1; transform: none; }
.hunt-intro img { width: 92px; height: auto; margin-top: 4px; filter: drop-shadow(0 0 14px rgba(180, 140, 255, .75)); animation: flutter 3.4s ease-in-out infinite; }
@keyframes flutter { 50% { transform: translateY(-5px) rotate(-3deg); } }
.hunt-intro > div { display: grid; gap: 8px; justify-items: start; padding-right: 22px; }
.hunt-intro h2 { font: 400 22px/1.1 var(--f-groove); color: var(--gold); }
.hunt-intro p { font-size: 15px; line-height: 1.45; color: var(--text-2); }
.hunt-intro .btn { min-height: 40px; padding: 9px 16px; font-size: 14px; margin-top: 4px; }
.hunt-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--text-2); font: 700 22px/1 var(--f-body); cursor: pointer; }
.hunt-x:hover { color: var(--text); background: var(--shift-2); }

/* "Leaving?" card: Bobbin offers drop alerts once per visit */
.leave-dlg { width: min(420px, calc(100% - 32px)); padding: 0; border: 2px solid var(--ink); border-radius: 20px; background: var(--shift); color: var(--text);
  box-shadow: 8px 8px 0 var(--ink), 0 0 60px -10px rgba(210, 26, 203, .6); }
.leave-dlg::backdrop { background: rgba(8, 3, 18, .8); }
.leave-body { position: relative; display: grid; justify-items: center; gap: 12px; padding: 26px 22px 22px; text-align: center;
  background: radial-gradient(80% 60% at 50% 0%, rgba(230, 204, 31, .14), transparent 70%); }
.leave-body img { width: 132px; height: auto; margin-top: -6px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); animation: breathe 3s ease-in-out infinite; transform-origin: 50% 100%; }
.leave-body h2 { font: 400 30px/1.05 var(--f-groove); }
.leave-body p:not(.drops-status) { color: var(--text-2); max-width: 32ch; }
.leave-body input { width: 100%; min-height: 48px; padding: 11px 16px; border-radius: 999px; border: 2px solid var(--ink); background: var(--midnight); color: var(--text); font: 400 16px/1.4 var(--f-body); box-shadow: inset 0 0 0 1px var(--line); }
.leave-body .btn { width: 100%; }
.leave-no { min-height: 40px; padding: 8px 14px; border: 0; background: none; color: var(--text-3); font: 600 14px/1 var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.leave-no:hover { color: var(--text); }
.leave-body .drops-status:empty { display: none; }


/* ---------- magic layer: drifting motes behind every page, shimmering titles, glowing controls ---------- */
main, .foot { position: relative; z-index: 1; }
.motes { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.motes i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); box-shadow: 0 0 calc(var(--s) * 3) var(--c);
  opacity: 0; animation: mote var(--t) ease-in-out infinite; animation-delay: var(--d); }
@keyframes mote { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .7; } 80% { opacity: .5; } 100% { opacity: 0; transform: translate(var(--x), -40vh); } }
.room-title { background: linear-gradient(100deg, var(--text) 0 38%, #FFE9A8 45%, #F9B8EC 50%, var(--text) 57% 100%); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0 0; } }
.btn { position: relative; }
.btn:not(.ghost) { animation: btn-glow 3.5s ease-in-out infinite; }
@keyframes btn-glow { 50% { box-shadow: 0 4px 0 var(--ink), 0 0 22px rgba(230, 204, 31, .55); } }
.btn:not(.ghost):hover { box-shadow: 0 6px 0 var(--ink), 0 0 28px rgba(230, 204, 31, .8); }
.door::before { animation: shroom-glow 2.6s ease-in-out infinite; }
.mark img { animation: mark-glow 5s ease-in-out infinite; }
@keyframes mark-glow { 50% { filter: drop-shadow(0 0 10px rgba(230, 204, 31, .55)); } }
/* glowing edges on cards when you hover them */
.model, .badge, details { transition: box-shadow .3s, border-color .3s, transform .3s; }
.model:hover, details:hover, details[open] { box-shadow: 0 0 0 1px rgba(242, 126, 217, .6), 0 0 32px rgba(210, 26, 203, .35); }
.badge:hover { transform: translateY(-4px); box-shadow: 6px 6px 0 var(--ink), 0 0 36px rgba(210, 26, 203, .45); }


/* ---------- drop alerts band ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.drops { position: relative; z-index: 1; border-top: 1px solid var(--line); padding-block: 56px;
  background: radial-gradient(60% 120% at 20% 100%, rgba(210, 26, 203, .22), transparent 70%), radial-gradient(50% 100% at 90% 0%, rgba(79, 195, 161, .16), transparent 70%); }
.drops-in { display: grid; gap: 24px; align-items: end; }
@media (min-width: 760px) { .drops-in { grid-template-columns: auto minmax(0, 1fr); gap: 40px; } }
.drops-kandi { height: 190px; width: auto; justify-self: center; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); animation: breathe 3s ease-in-out infinite; transform-origin: 50% 100%; }
.drops-kandi.awake { animation: kandi-pop .5s cubic-bezier(.3, 1.8, .5, 1); height: 170px; }
@keyframes breathe { 50% { transform: scaleY(1.03); } }
@keyframes kandi-pop { from { transform: scale(.6); } to { transform: scale(1); } }
.drops-copy { display: grid; gap: 12px; max-width: 620px; }
.drops-copy h2 { font: 400 clamp(28px, 4vw, 40px)/1.05 var(--f-groove); }
.drops-copy > p:not(.eyebrow):not(.drops-status) { color: var(--text-2); }
.drops-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.drops-form input { flex: 1 1 220px; min-height: 48px; padding: 11px 16px; border-radius: 999px; border: 2px solid var(--ink); background: var(--midnight); color: var(--text); font: 400 16px/1.4 var(--f-body); box-shadow: inset 0 0 0 1px var(--line); }
.drops-form input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.drops-status { font: 400 15px/1.4 var(--f-sign); letter-spacing: .06em; color: var(--mint); min-height: 1.4em; }

/* ---------- night sounds toggle ---------- */
.sound-btn { position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px 8px 12px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--shift-2); color: var(--text-2); font: 400 13px/1 var(--f-sign); letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 4px 0 var(--ink); }
.sound-btn svg { width: 20px; height: 20px; }
.sound-btn .w { opacity: .3; }
.sound-btn[aria-pressed="true"] { color: var(--ink); background: var(--mint); }
.sound-btn[aria-pressed="true"] .w { opacity: 1; animation: waves 1.2s ease-in-out infinite; }
.sound-btn.remembered { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px rgba(79, 195, 161, .5); }
@keyframes waves { 50% { opacity: .35; } }
@media (max-width: 480px) { .sound-btn span { display: none; } .sound-btn { padding: 8px 12px; } }

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