/* =========================================================
   somniloquence
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;1,500&family=Quicksand:wght@500;600;700&family=Nunito:ital,wght@0,400;0,600;1,400&display=swap');

:root{
  --cream:      #F6F4F7;   /* moonlit linen background */
  --linen:      #ECE9F1;   /* card / cloud surface */
  --sage:       #71A87B;   /* chamomile green */
  --sage-deep:  #4F7D58;   /* deep chamomile, hover */
  --teal:       #71A897;   /* midnight moss */
  --blue:       #719EA8;   /* twilight sky */
  --blue-deep:  #4C7581;   /* deep twilight, headings on some pages */
  --ink:        #3E4256;   /* dusky indigo-charcoal text */
  --ink-soft:   #4F5468;   /* muted caption text (darkened for readability) */
  --line:       #D9D5E4;   /* hairline / dashed borders */

  --radius: 18px;
  --shadow: 0 6px 18px rgba(62, 66, 86, 0.09);
}

*{ box-sizing: border-box; }

body {
  margin: 0;
  background-color: #4C7581;
  background-image: url("index/background.png");
  background-repeat: repeat;
  background-size: auto;
  background-position: 0 0;
  /* the tile used to be pinned with `background-attachment: fixed`, which
     forces the browser to repaint the whole page on every scroll frame.
     Letting it scroll normally looks the same (the tile repeats seamlessly)
     and is dramatically cheaper. */
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  line-height: 1.65;
}

a{ color: inherit; }

/* ---------- custom cursors (site-wide) ----------
   Drop two small images into your site root:
     index/cursor.png          — the normal pointer, shown everywhere
     index/cursor-pointer.png  — the little hand, shown over clickable things
   Keep them small (32x32 is ideal; browsers cap large ones). The two
   numbers after each url() are the "hotspot" — the exact click point in
   the image, in pixels from its top-left corner. For the hand, that's
   usually the fingertip; nudge the numbers if clicking feels slightly off.
   Until the files are uploaded, the normal system cursors show instead. */
body{ cursor: url("index/cursor.png") 4 4, auto; }

a, button, summary, label, [role="button"],
.tag-btn, .subnav a, .follow-btn,
.theme-toggle, .to-top, .music-player{
  cursor: url("index/cursor-pointer.png") 6 3, pointer;
}

/* typing fields keep a normal text (I-beam) cursor */
input[type="text"], input[type="password"], textarea{ cursor: text; }

/* ---------- layout shell ---------- */
.wrap{
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---------- header ---------- */
.site-header{
  text-align: center;
  margin-bottom: 20px;
}

.sprig {
  width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.site-title{
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.7rem);
  margin: 0;
  color: #3E4256;
  letter-spacing: 0.5px;
}

.site-tagline{
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.9rem;
  font-style: italic;
  color: white;
  letter-spacing: 1.5px;
  text-transform: lowercase;
  margin-top: 6px;
}


/* (the scalloped cloud-wave divider was removed by request) */

/* ---------- compact nav (used on inner pages) ---------- */
.subnav{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 6px;
  margin-bottom: 8px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
}
.subnav a{
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed rgba(76, 117, 129, 0.5);
  color: var(--blue-deep);
  background: rgba(255,255,255,0.55);
  transition: all 0.15s ease;
}
.subnav a:hover, .subnav a.current{
  background: var(--blue);
  border: 1px dashed #fff;
  color: #fff;
}

/* ---------- homepage tag-button grid ---------- */
.tag-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 36px;
}
@media (max-width: 520px){
  .tag-grid{ grid-template-columns: 1fr; }
}

/* a wide feature button (links) that fills the whole bottom row */
.tag-btn--wide{ grid-column: 1 / -1; justify-content: center; }

.tag-btn{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,0.55);   /* translucent, like the search bars / nav pills */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tag-btn:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(62,66,86,0.16);
}
.tag-btn .leaf{
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--blue-deep);
}
.tag-btn .label{
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue-deep);
  display: block;
}
.tag-btn .sub{
  display: block;
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- generic content card ---------- */
.card{
  position: relative;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.card h2{
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  color: var(--blue-deep);
  margin-top: 0;
  font-size: 1.5rem;
}

.card h3{
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.stamp-date{
  font-family: 'Quicksand', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 700;
}

/* ---------- tag filtering (diary + dream journal) ---------- */
.filter-wrap{
  position: relative;
  display: flex;
  justify-content: center;
  margin: 26px 0 34px;
}
.filter-toggle{
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--linen);
  color: var(--blue-deep);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
}
.filter-toggle:hover{ border-color: var(--blue); }
.filter-toggle .arrow{ display: inline-block; margin-left: 4px; transition: transform 0.15s ease; }
.filter-toggle.open .arrow{ transform: rotate(180deg); }

.tag-filter{
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(90vw, 420px);
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}
.tag-filter.open{ display: flex; }

.tag-filter-btn{
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.6);
  color: var(--blue-deep);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-filter-btn:hover{
  border-color: var(--blue);
}
.tag-filter-btn.active{
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.tag-pills{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.tag-pill{
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: lowercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.3px solid var(--blue);
  background: rgba(113, 158, 168, 0.15);
  color: var(--blue-deep);
}
.tag-pill.c-sage{ border-color: var(--sage); background: rgba(113, 168, 123, 0.15); color: var(--sage-deep); }
.tag-pill.c-teal{ border-color: var(--teal); background: rgba(113, 168, 151, 0.15); color: #3F7566; }
.tag-pill.c-blue{ border-color: var(--blue); background: rgba(113, 158, 168, 0.15); color: var(--blue-deep); }

.entries-empty{
  text-align: center;
  color: var(--ink-soft);
  font-family: 'Fraunces', serif;
  font-style: italic;
}

/* ---------- dream journal specific ---------- */
.moon-rating{
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: var(--blue-deep);
}

/* ---------- wiggly wave text (page intro) ---------- */
/* Fallback: before the script splits the line into letters, the whole
   line gives a gentle bob so there's always some motion. Once the
   script has run (it sets data-waved), the per-letter wave takes over. */
.wave-text{ animation: wave-sway 2s ease-in-out infinite; }
.wave-text[data-waved]{ animation: none; }
@keyframes wave-sway{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-5px); }
}
.wave-char{
  display: inline-block;
  will-change: transform;
  animation: wave-bob 1.8s ease-in-out infinite;
}
@keyframes wave-bob{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-0.32em); }
}
@media (prefers-reduced-motion: reduce){
  .wave-text, .wave-char{ animation: none; }
}

/* ---------- placeholder boxes (for images not added yet) ---------- */
.placeholder{
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.45);
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
  padding: 30px 10px;
}

.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
/* graphics: a free wrapping wall, so blinkies / buttons of any size
   (from 20×20 pixels up to large banners) sit side by side at their
   own natural dimensions instead of being forced into equal cells. */
.graphics-grid{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.graphics-grid img{
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.graphics-grid .placeholder{
  width: 88px;
  height: 31px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  line-height: 1.1;
}
.graphics-grid .row-break{
  flex-basis: 100%;
  height: 0;
  margin: 0;
}

/* ---------- floating music player ---------- */
.music-player{
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: var(--shadow);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--blue-deep);
  cursor: pointer;
  transition: all 0.15s ease;
}
.music-player:hover{ border-color: var(--blue); transform: translateY(-2px); }
.music-player .note{ font-size: 1rem; display: inline-block; }
.music-player.playing .note{ animation: note-bob 1s ease-in-out infinite; }
@keyframes note-bob{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-3px); }
}
@media (max-width: 520px){
  .music-player{ bottom: 14px; right: 14px; padding: 8px 14px; font-size: 0.75rem; }
}

/* ---------- footer ---------- */
.site-footer{
  text-align: center;
  margin-top: 25px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.78rem;
  color: #ECE9F1;
  letter-spacing: 0.5px;
}

.back-home{
  display: inline-block;
  margin-bottom: 6px;
  text-decoration: none;
  color: #f4f3f9;
  font-weight: 700;
}
.back-home:hover{ text-decoration: underline; }

/* buttons/inputs for guestbook page */
textarea, input[type="text"]{
  width: 100%;
  font-family: 'Nunito', sans-serif;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.7);
  color: var(--ink);
}
button.tag-btn.small{
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  border: none;
  color: var(--blue-deep);
}

/* =========================================================
   ADDITIONS — atmosphere, moonlight mode, entry tools
   (Everything below was added on top of the original theme.)
   ========================================================= */

/* keep page content above the star layer */
.wrap{ position: relative; z-index: 1; }

/* ---------- drifting star / mote layer ------------------ */
.sky-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- cursor sparkle ------------------------------ */
.cursor-spark{
  position: fixed;
  z-index: 90;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.7);
  animation: spark-fade 0.7s ease-out forwards;
}
@keyframes spark-fade{
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  30%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 14px)) scale(1) rotate(45deg); }
}

/* ---------- moonlight-mode toggle button ---------------- */
.theme-toggle,
.to-top{
  position: fixed;
  left: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--blue-deep);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.theme-toggle{ bottom: 20px; }
.to-top{ bottom: 74px; }                 /* sits directly on top of the moonlight toggle */
.theme-toggle:hover,
.to-top:hover{ border-color: var(--blue); transform: translateY(-2px); }
.theme-toggle .tt-icon,
.to-top .tt-icon{ line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle .tt-icon svg,
.to-top .tt-icon svg{ display: block; width: 20px; height: 20px; }
@media (max-width: 520px){
  .theme-toggle{ bottom: 14px; left: 14px; width: 40px; height: 40px; }
  .to-top{ bottom: 62px; left: 14px; width: 40px; height: 40px; }
}

/* ---------- entry controls (diary + dreams) ------------- */
.entry-controls{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 34px;
}
.entry-controls .filter-wrap{ margin: 0; flex: 0 0 auto; }

.entry-search{
  flex: 1 1 auto;
  min-width: 0;            /* lets the search shrink in narrow viewports */
  width: auto;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--linen);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
.entry-search::placeholder{ color: var(--ink-soft); }
.entry-search:focus{ outline: none; border-color: var(--blue); }

.saved-toggle{
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--linen);
  color: var(--blue-deep);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}
.saved-toggle:hover{ border-color: var(--blue); }
.saved-toggle.active{ background: var(--blue); border-color: var(--blue); color: #fff; }

/* mobile: search spans the full width, filter + saved share the row underneath */
@media (max-width: 560px){
  .entry-controls{ flex-wrap: wrap; }
  .entry-search{ flex: 1 1 100%; }
  .entry-controls .filter-wrap{ flex: 1 1 auto; }   /* filter grows to fill the row */
  .filter-toggle{ width: 100%; text-align: center; }
  .saved-toggle{ flex: 0 0 auto; }                  /* saved shrinks to its label */
}

/* ---------- per-entry bookmark -------------------------- */
.bookmark-btn{
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--blue-deep);
  opacity: 0.55;
  transition: transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.bookmark-btn:hover{ transform: scale(1.15); opacity: 1; color: #E3A83C; }
.bookmark-btn.saved{ color: #E3A83C; opacity: 1; }
.card .stamp-date{ display: inline-block; padding-right: 34px; }


/* =========================================================
   MOONLIGHT (dark) MODE
   ========================================================= */
body.night{
  --linen:      #363a5c;
  --sage:       #8fc09b;
  --sage-deep:  #b2d6ba;
  --teal:       #8ac3b1;
  --blue:       #9aa0e0;   /* moonlit periwinkle accent */
  --blue-deep:  #c7cbf3;   /* soft lilac for headings + links */
  --ink:        #e8e6f4;
  --ink-soft:   #b4b2d2;
  --line:       #4b4f7a;
  --shadow:     0 6px 18px rgba(0, 0, 0, 0.35);

  background-color: #3e4256;                    /* moonlight base colour (fallback tint) */
  background-image: url("index/background-night.png"); /* your own tiled background */
  background-repeat: repeat;
  background-size: auto;
  color: var(--ink);
}
body.night .site-title{ color: #eceafb; }
body.night .card{ background: rgba(42, 45, 74, 0.62); }
body.night .subnav a{ background: rgba(42, 45, 74, 0.55); border: 1px dashed #3d4066; }
body.night .subnav a:hover, body.night .subnav a.current{
  background: var(--blue-deep);
  color: #2a2d4a;
  border: 1px dashed #2c3a75;
}
body.night .placeholder{ background: rgba(42, 45, 74, 0.42); }
body.night .tag-filter-btn{ background: rgba(42, 45, 74, 0.6); }
body.night .tag-filter-btn.active{ background: #c7cbf3; border-color: #c7cbf3; color: #2a2d4a; }
body.night .entry-search{ background: rgba(42, 45, 74, 0.7); }
body.night textarea,
body.night input[type="text"]{ background: rgba(42, 45, 74, 0.7); }
body.night code[style]{ background: rgba(255,255,255,0.07) !important; color: var(--ink); }
body.night iframe{ background: rgba(42, 45, 74, 0.4) !important; }
body.night .tag-pill{ background: rgba(113, 158, 168, 0.22); }
body.night .tag-pill.c-sage{ background: rgba(134, 189, 145, 0.20); }
body.night .tag-pill.c-teal{ background: rgba(131, 189, 169, 0.20); color: #9ad3c0; }

/* flatten shadows in moonlight (landing tiles, diary/dream controls + entries, colour tabs) */
body.night .tag-btn,
body.night .card,
body.night .entry-search,
body.night .filter-toggle,
body.night .saved-toggle,
body.night .tag-filter,
body.night .drawer{ box-shadow: none; }
body.night .entries .card{ border: 1px dashed var(--line); }
body.night .tag-btn{ background: var(--linen); }   /* keep moonlight tiles solid */

/* =========================================================
   REDUCED MOTION — respect the visitor's system setting
   ========================================================= */
@media (prefers-reduced-motion: reduce){
  .music-player.playing .note{ animation: none; }
  .tag-btn:hover,
  .music-player:hover,
  .theme-toggle:hover{ transform: none; }
}

/* =========================================================
   MORE ADDITIONS — header box, page intros, polaroids
   ========================================================= */

/* ---------- dotted box around title + menu -------------- */
.header-box{
  border: 2px dotted rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 20px 24px 20px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.05);
}
.header-box .site-header{ margin-bottom: 16px; }
.header-box .subnav{ margin-bottom: 0; }
body.night .header-box{
  border-color: rgba(190, 196, 235, 0.42);
  background: rgba(255, 255, 255, 0.03);
}

/* ---------- little date/time strip above the header box - */
.info-bar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 16px;
  margin: -24px 0 12px;
  padding-left: 10px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  color: #f4f3f9;
}
.info-clock{ white-space: nowrap; }

@media (max-width: 420px){
  .info-bar{ font-size: 0.7rem; gap: 2px 12px; }
}

/* ---------- centred intro line that sits on the page bg -- */
.page-intro{
  text-align: center;
  color: #f4f3f9;
  font-style: italic;
  font-family: 'Fraunces', serif;
  margin: -5px 0 20px;
}

/* ---------- interests subpages: back button --------- */
.sub-intro{
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 30px;
}
.sub-intro .page-intro{ flex: 1 1 auto; margin: 0; }
.back-btn{
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px dashed rgba(76, 117, 129, 0.5);
  background: rgba(255,255,255,0.55);
  color: var(--blue-deep);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.back-btn:hover{ background: var(--blue); border: 1px dashed #fff; color: #fff; }
body.night .back-btn{ background: rgba(42,45,74,0.55); border: 1px dashed rgba(190, 196, 235, 0.42); }
body.night .back-btn:hover{ background: var(--blue-deep); border: 1px dashed #2c3a75; color: #2a2d4a; }

@media (max-width: 560px){
  .sub-intro{ display: block; text-align: center; min-height: 0; }
  .back-btn{ position: static; transform: none; margin-bottom: 10px; }
}

/* ---------- polaroid gallery ---------------------------- */
.polaroid-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 14px;
}
.polaroid{
  background: #fbfaf6;
  padding: 12px 12px 0;
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(30, 32, 52, 0.30);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.polaroid:nth-child(odd){ transform: rotate(-1.6deg); }
.polaroid:nth-child(even){ transform: rotate(1.6deg); }
.polaroid:hover{
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 14px 26px rgba(30, 32, 52, 0.38);
}
.polaroid .photo{
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #e7e3ee 0%, #d7dbe4 100%);
  color: #8a8ea4;
  font-size: 0.8rem;
  text-align: center;
}
.polaroid .photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.polaroid .caption{
  font-family: 'Fraunces', serif;
  font-style: italic;
  text-align: center;
  color: #3E4256;
  padding: 12px 8px 16px;
  font-size: 0.92rem;
  line-height: 1.4;
  min-height: 1.2em;
}
@media (prefers-reduced-motion: reduce){
  .polaroid:nth-child(odd),
  .polaroid:nth-child(even){ transform: none; }
  .polaroid:hover{ transform: translateY(-4px); }
}

/* =========================================================
   NEW COMPONENTS (added on request)
   ========================================================= */

/* ---------- index: bare header (no dotted box) ---------- */
.header-box--home{
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 24px;
}
body.night .header-box--home{ border: none; background: none; }

/* homepage: more air between the button grid and the footer */
.tag-grid + .site-footer{ margin-top: 52px; }

/* ---------- favourites: 4 image slots ------------------- */
.fav-slots{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 30px;
}
@media (max-width: 520px){ .fav-slots{ grid-template-columns: 1fr; } }

.fav-slot{
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease;
}
.fav-slot:hover{ transform: translateY(-4px); }

.fav-photo{
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e7e3ee 0%, #d7dbe4 100%);
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease;
}
.fav-photo::before{                 /* fallback shown until you add an image */
  content: "add an image";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}
.fav-photo img{
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fav-slot:hover .fav-photo{ box-shadow: 0 12px 24px rgba(30,32,52,0.28); }

/* the title now sits over the image and fades in on hover */
.fav-cap{
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: rgba(30, 32, 52, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.fav-slot:hover .fav-cap,
.fav-slot:focus-visible .fav-cap{ opacity: 1; }

.fav-title{
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  text-transform: lowercase;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.fav-sub{
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #e2e3ef;
}

/* ---------- music: album covers with slide-out vinyl ---- */
.music-hint, .page-hint{
  text-align: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: #f4f3f9;
  margin: 2px 0 28px;
  font-size: 0.95rem;
}

/* 3-up grid. Hovering an album grows its own grid row, so the albums
   below slide down to make room instead of being covered by the popout. */
.album-shelf{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;             /* only the hovered card grows; the rest stay put */
  gap: 28px 20px;
  margin-top: 12px;
}

.album{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* square cover, fills its column */
.album-art{ position: relative; width: 100%; z-index: 3; }
.album-cover{
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #e7e3ee 0%, #cfd9d6 100%);
  box-shadow: 0 8px 20px rgba(30,32,52,0.28);
}
.album-cover img{ width: 100%; height: 100%; object-fit: cover; display: block; }

/* the panel drops straight down from under the cover on hover.
   grid-template-rows: 0fr -> 1fr gives a smooth height animation. */
.album-reveal{
  width: 100%;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(.22,.61,.36,1);
}
.album:hover .album-reveal{ grid-template-rows: 1fr; }

.album-reveal-inner{
  overflow: hidden;
  min-height: 0;                  /* required for the 0fr -> 1fr height trick */
}

/* the actual bordered box (tracklist + vinyl) */
.album-panel{
  margin-top: 12px;
  padding: 16px 16px 18px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s ease 0.05s,
              transform 0.5s cubic-bezier(.22,.61,.36,1);
}
.album:hover .album-panel{ opacity: 1; transform: translateY(0); }

.album-meta{ margin: 0 0 10px; line-height: 1.3; }
.album-name{
  display: block;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--blue-deep);
}
.album-artist{
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 700;
}

/* dot-point tracklist, centred as a block but left-aligned inside */
.tracklist{
  margin: 0 auto 14px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink);
  display: inline-block;
  text-align: left;
}
.tracklist li{
  position: relative;
  margin: 3px 0;
  padding-left: 15px;
}
.tracklist li::before{
  content: "\2022";               /* • */
  position: absolute;
  left: 0;
  color: var(--sage-deep);
}

/* the vinyl. spins one full turn as the panel opens, landing straight/upright. */
.disc{
  display: block;
  position: relative;
  width: 118px;
  height: 118px;
  margin: 4px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f4f3f9 0 5%, transparent 5.4%),
    radial-gradient(circle at 50% 50%, var(--blue) 5.4% 24%, transparent 24.4%),
    repeating-radial-gradient(circle at 50% 50%, #24263a 0 2px, #30334a 2px 3.5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  transform: rotate(0deg);
  transition: transform 0.9s ease;
}
.album:hover .disc{ transform: rotate(360deg); }

/* once a CD image is dropped in, hide the vinyl placeholder underneath it */
.disc:has(.disc-img){ background: none; box-shadow: 0 6px 16px rgba(0,0,0,0.25); }

.disc-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px){
  .album-shelf{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 460px){
  /* touch screens: no hover, so every panel stays open and full-width,
     lining its box up with the right edge of the navigation bar */
  .album-shelf{ grid-template-columns: 1fr; gap: 24px; }
  .album-reveal{ grid-template-rows: 1fr; }
  .album-panel{ opacity: 1; transform: none; }
  .disc{ transform: rotate(360deg); }
}

/* ---------- games: alternating blocks, 2x2 shots -------- */
.game-list{ display: flex; flex-direction: column; gap: 30px; margin-top: 12px; }
.game-block{
  display: flex;
  align-items: center;
  gap: 26px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.game-block:nth-child(even){ flex-direction: row-reverse; }

.game-shots{
  flex: 0 0 auto;
  width: 292px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
}
.shot{
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #e7e3ee 0%, #d3dad7 100%);
  box-shadow: 0 3px 8px rgba(30,32,52,0.14);
}
.shot img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.game-story{ flex: 1 1 auto; text-align: left; }
.game-block:nth-child(even) .game-story{ text-align: right; }
.game-story h2{
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  color: var(--blue-deep);
  margin: 0 0 8px;
  font-size: 1.4rem;
}
.game-story p{ margin: 0; }
.star-rating{
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: 3px;
  color: var(--blue-deep);
}

@media (max-width: 600px){
  .game-block, .game-block:nth-child(even){ flex-direction: column; align-items: stretch; }
  .game-shots{ width: 100%; }
  .game-story, .game-block:nth-child(even) .game-story{ text-align: left; }
}

/* ---------- graphics: colour spoiler drawers ------------ */
.blinkie-drawers{ display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.drawer{
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.drawer > summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  user-select: none;
}
.drawer > summary::-webkit-details-marker{ display: none; }
.drawer .swatch{
  width: 18px; height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55) inset;
  border: 1px solid rgba(0,0,0,0.08);
}
.drawer .drawer-name{ text-transform: lowercase; letter-spacing: 0.4px; }
.drawer .chevron{ margin-left: auto; transition: transform 0.2s ease; color: var(--ink-soft); }
.drawer[open] .chevron{ transform: rotate(180deg); }
.drawer .graphics-grid{ padding: 2px 16px 16px; margin-top: 0; }

.d-red    .swatch{ background:#e2857f; }
.d-orange .swatch{ background:#e6a86b; }
.d-yellow .swatch{ background:#e6cf72; }
.d-green  .swatch{ background:#8fc48b; }
.d-blue   .swatch{ background:#7fa8c4; }
.d-purple .swatch{ background:#a68bc4; }
.d-pink   .swatch{ background:#dda0c4; }
.d-white  .swatch{ background:#ffffff; border-color: rgba(0,0,0,0.18); }
.d-black  .swatch{ background:#2b2b33; }
.d-rainbow .swatch{
  background: conic-gradient(from 210deg,
    #e2857f, #e6a86b, #e6cf72, #8fc48b, #7fa8c4, #a68bc4, #dda0c4, #e2857f);
}

.d-red[open]{    border-color:#e2857f; }
.d-orange[open]{ border-color:#e6a86b; }
.d-yellow[open]{ border-color:#e6cf72; }
.d-green[open]{  border-color:#8fc48b; }
.d-blue[open]{   border-color:#7fa8c4; }
.d-purple[open]{ border-color:#a68bc4; }
.d-pink[open]{   border-color:#dda0c4; }
.d-white[open]{  border-color:#cfc9dd; }
.d-black[open]{  border-color:#3a3a46; }
.d-rainbow[open]{ border-color:#b58fca; }

/* ---------- links page: tidy link lists + code snippet --- */
.link-list{ list-style: none; margin: 0; padding: 0; }
.link-list li{ padding: 9px 0; border-bottom: 1px dashed var(--line); }
.link-list li:last-child{ border-bottom: none; padding-bottom: 0; }
.link-list a{
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: var(--blue-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.link-list a:hover{ border-bottom-color: var(--blue); }
.link-list .link-note{
  display: block;
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 1px;
}
.copy-code{
  display: block;
  font-family: ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  margin-top: 10px;
}

/* ---------- floating music player: gif + speech bubble --- */
/* (overrides the pill styling defined earlier) */
.music-player{ background: none; border: none; box-shadow: none; padding: 0; gap: 10px; }
.music-player:hover{ transform: none; border-color: transparent; }

.speech-bubble{
  position: relative;
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px 13px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--blue-deep);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.speech-bubble::after{
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--linen);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.player-gif{
  position: relative;
  display: inline-block;
  line-height: 0;
  transition: transform 0.15s ease;
}
.music-player:hover .player-gif{ transform: translateY(-2px); }
.player-gif img{
  display: block;
  width: 64px;
  height: auto;
}
/* show only the gif that matches the current state (higher specificity than .player-gif img) */
.player-gif .gif-playing{ display: none; }
.music-player.playing .player-gif .gif-idle{ display: none; }
.music-player.playing .player-gif .gif-playing{ display: block; }
.music-player.playing .player-gif{ animation: note-bob 1s ease-in-out infinite; }

@media (max-width: 520px){
  .music-player{ bottom: 14px; right: 14px; padding: 0; gap: 8px; }
  .player-gif img{ width: 54px; }
  .speech-bubble{ font-size: 0.72rem; padding: 6px 11px; }
}

/* ---------- night-mode tweaks for the new pieces -------- */
body.night .game-block{ background: rgba(42, 45, 74, 0.62); }
body.night .album-panel{ background: rgba(42, 45, 74, 0.62); }
body.night .drawer{ background: rgba(42, 45, 74, 0.55); }
body.night .fav-photo,
body.night .album-cover,
body.night .shot{ background: linear-gradient(135deg, #343758 0%, #2b2e49 100%); }

/* ---------- reduced motion for the new pieces ----------- */
@media (prefers-reduced-motion: reduce){
  .music-player.playing .player-gif{ animation: none; }
  .fav-slot:hover,
  .album:hover .disc{ transform: none; }
  .album-reveal,
  .album-panel{ transition: none; }
}

/* ---------- kaomoji: keep box-drawing faces rendering consistently ----- */
/* Wrap faces like (╥﹏╥) in <span class="kaomoji">…</span>. */
.kaomoji{
  font-family: 'Cascadia Code', 'Consolas', 'DejaVu Sans Mono', 'Menlo', 'Segoe UI Symbol', monospace;
  white-space: nowrap;
}

/* ---------- follow button (sits on the dotted nav box corner) ---------- */
.header-box{ position: relative; }
.follow-btn{
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px dashed rgba(76, 117, 129, 0.5);
  background: var(--linen);
  color: var(--blue-deep);
  font-size: 1rem;
  line-height: 1;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}
.follow-btn:hover{
  background: var(--blue);
  border-color: #fff;
  color: #fff;
}
body.night .follow-btn{ border-color: #3d4066; }
body.night .follow-btn:hover{
  background: var(--blue-deep);
  border-color: #2c3a75;
  color: #2a2d4a;
}

/* ---------- charms dangling under the nav bar -----------------------
   The IMAGES are listed in somniloquence.js — search for NAV_CHARMS.

     height  -> how big it is
     bottom  -> how far it hangs BELOW the nav box (more negative = lower)
     left    -> how far across the box it sits (% keeps it in place on
                any screen size)
   --------------------------------------------------------------------- */
.nav-charm{
  position: absolute;
  z-index: 3;
  width: auto;
  pointer-events: none;   /* never blocks a nav link's click or hover */
}

/* >>> POSITION + SIZE OF EACH NAV CHARM — EDIT THESE <<< */
.nav-charm-1{ height: 120px; bottom: -120px; left: 1%; }
.nav-charm-2{ height: 120px; bottom: -120px; left: 68%; }
.nav-charm-3{ height: 65px; bottom: -40px; left: 88%; }

/* on phones the charms would crowd the wrapped nav — hide them there.
   delete this block if you'd rather keep them. */
@media (max-width: 620px){
  .nav-charm{ display: none; }
}
