/* ============================================================
   THE FRAGMENTS OF VELUNA — Stylesheet
   ============================================================
   Fonts used:
     - Caveat          → handwriting body text
     - IM Fell English  → date headings, elegant serif
     - Cinzel           → cover title, chapter labels
   
   To swap fonts: change the font-family values in the
   :root custom properties below, and update the <link> in
   index.html.
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  /* Typography */
  --font-body: 'Caveat', cursive;
  --font-heading: 'Cinzel', serif;
  --font-date: 'IM Fell English', serif;

  /* Palette — warm sepia tones */
  --color-bg: #1a1611;
  --color-page: #e8dcc8;
  --color-page-dark: #d4c4a8;
  --color-ink: #3a2f24;
  --color-ink-faded: #7a6e5d;
  --color-accent: #8b7355;
  --color-cover: #4a3728;
  --color-cover-dark: #2e2118;
  --color-gold: #c9a84c;

  /* Layout */
  --journal-width: 580px;
  --journal-height: 780px;
  --page-padding: 50px 45px 40px 50px;
  --border-radius: 4px 12px 12px 4px;

  /* Animation */
  --flip-duration: 0.6s;
  /* Final-page illustration controls (easy to tweak) */
  --final-illustration-max-width: 86%;
  --final-illustration-max-height: 320px;
  --final-illustration-bottom: 24px;
  --final-illustration-left: 50%;
  --final-illustration-translateX: -50%;
  --final-illustration-opacity: 1;
  --final-illustration-z: 8;
  /* Generic overlay illustration controls (for non-final pages) */
  --overlay-illustration-max-width: 46%;
  --overlay-illustration-max-height: 220px;
  --overlay-illustration-bottom: 8px;
  --overlay-illustration-left: 50%;
  --overlay-illustration-translateX: -45%;
  --overlay-illustration-opacity: 1;
  --overlay-illustration-z: 6;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Intro: fade-from-black + journal approach ---------- */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 3s ease;
}
.intro-overlay.fade-out {
  opacity: 0;
}

.journal.intro-zoom {
  transform: scale(0.65) translateY(30px);
  opacity: 0;
}
.journal.intro-zoom.intro-reveal {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition: transform 3s cubic-bezier(0.22, 1, 0.36, 1), opacity 2.5s ease;
}

/* ---------- Time-of-Day: Sunlight cast on journal ---------- */
.journal-light {
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 10s linear, background 10s linear;
  mix-blend-mode: screen;
}

/* ---------- Time-of-Day: Atmosphere tint overlay ---------- */
.atmosphere-tint {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 10s linear, opacity 10s linear;
  opacity: 0;
}

/* ---------- Atmosphere / Background ---------- */
/* 
   BACKGROUND IMAGE: Place your image in assets/bg.jpg (or .png)
   and it will be used automatically. The fallback is a warm
   radial gradient. Recommended: a soft sunlit riverside scene,
   slightly blurred, ~1920x1080 or larger.
*/
.atmosphere {
  position: fixed;
  inset: 0;
  /* Fallback gradient — shows if no bg image */
  background:
    radial-gradient(ellipse at 50% 30%, #2a2218 0%, #0f0d0a 100%);
  /* Background image — your scene picture */
  background-image: url('assets/Images/Fragments%20of%20Veluna.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Soft blur so the background doesn't compete with the journal */
  filter: blur(4px);
  /* Scale up slightly to hide blurred edges */
  transform: scale(1.05);
  z-index: 0;
  pointer-events: none;
}

/* Warm overlay to unify the background with the journal palette */
.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 17, 0.25);
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 1;
  pointer-events: none;
}

/* ---------- Journal Container ---------- */
.journal {
  position: relative;
  width: var(--journal-width);
  height: var(--journal-height);
  z-index: 10;
  perspective: 1800px;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Click Zones (left/right page edges) ---------- */
.click-zone {
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  z-index: 30;
  cursor: pointer;
}
.click-zone--left {
  left: 0;
}
.click-zone--right {
  right: 0;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ---------- Pages ---------- */
.page {
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: left center;
  /* Paper texture via CSS */
  background:
    /* subtle noise */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(0,0,0,0.015) 28px,
      rgba(0,0,0,0.015) 29px
    ),
    /* warm paper gradient */
    linear-gradient(
      170deg,
      var(--color-page) 0%,
      var(--color-page-dark) 60%,
      #c8b898 100%
    );
  box-shadow:
    2px 3px 12px rgba(0,0,0,0.35),
    inset -2px 0 8px rgba(0,0,0,0.06),
    inset 0 0 40px rgba(139,115,85,0.08);
}

/* Faint stain / imperfections overlay */
.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 70%, rgba(120,100,60,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(100,80,40,0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 90%, rgba(80,60,30,0.04) 0%, transparent 45%);
  pointer-events: none;
}

/* Spine edge shadow */
.page::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.12), transparent);
  pointer-events: none;
}

/* Inner padding container */
.page__inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: var(--page-padding);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Content styles */
.page__content {
  flex: 1;
  overflow: hidden;
  line-height: 1.7;
  font-size: 1.3rem;
}

/* ---------- Page State Classes ---------- */
.page--current {
  z-index: 15;
}

.page--flip {
  z-index: 20;
  transition: transform var(--flip-duration) ease-in-out;
  pointer-events: none;
}

.page--flip.flipping-forward {
  animation: flipForward var(--flip-duration) ease-in-out forwards;
}

.page--flip.flipping-backward {
  animation: flipBackward var(--flip-duration) ease-in-out forwards;
}

/* ---------- Flip Animations ---------- */
/* Smooth easing curve to avoid abrupt start/end */
@keyframes flipForward {
  0% {
    transform: rotateY(0deg) scale(1);
    box-shadow: 2px 3px 12px rgba(0,0,0,0.35);
  }
  30% {
    transform: rotateY(-50deg) scale(1.02);
    box-shadow: -6px 6px 25px rgba(0,0,0,0.5);
  }
  70% {
    transform: rotateY(-130deg) scale(1.02);
    box-shadow: -4px 4px 20px rgba(0,0,0,0.45);
  }
  100% {
    transform: rotateY(-180deg) scale(1);
    box-shadow: 2px 3px 12px rgba(0,0,0,0.35);
  }
}

@keyframes flipBackward {
  0% {
    transform: rotateY(-180deg) scale(1);
    box-shadow: 2px 3px 12px rgba(0,0,0,0.35);
  }
  30% {
    transform: rotateY(-130deg) scale(1.02);
    box-shadow: -6px 6px 25px rgba(0,0,0,0.5);
  }
  70% {
    transform: rotateY(-50deg) scale(1.02);
    box-shadow: -4px 4px 20px rgba(0,0,0,0.45);
  }
  100% {
    transform: rotateY(0deg) scale(1);
    box-shadow: 2px 3px 12px rgba(0,0,0,0.35);
  }
}

/* ---------- Cover Page Style ---------- */
.page--cover {
  background:
    linear-gradient(
      160deg,
      var(--color-cover) 0%,
      var(--color-cover-dark) 70%,
      #1c140e 100%
    );
  box-shadow:
    3px 4px 16px rgba(0,0,0,0.5),
    inset 0 0 60px rgba(0,0,0,0.3),
    inset 2px 2px 4px rgba(201,168,76,0.08);
}

.page--cover::before {
  background:
    radial-gradient(ellipse at 40% 50%, rgba(201,168,76,0.06) 0%, transparent 60%);
}

.page--cover::after {
  background: linear-gradient(to right, rgba(0,0,0,0.2), transparent);
}

.page--cover .page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-gold);
}

/* ---------- Content Typography ---------- */

/* Cover title */
.cover-title {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: 12px;
}

.cover-subtitle {
  font-family: var(--font-date);
  font-style: italic;
  font-size: 1rem;
  color: #a08860;
  letter-spacing: 0.05em;
}

.cover-ornament {
  margin: 24px 0;
  font-size: 1.6rem;
  opacity: 0.4;
  color: var(--color-gold);
}

/* Entry date heading */
.entry-date {
  font-family: var(--font-date);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-ink-faded);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 8px;
}

/* Entry title */
.entry-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  color: var(--color-ink);
}

/* Body text */
.entry-body {
  font-family: var(--font-body);
  font-size: 1.3rem;
  line-height: 1.75;
  color: var(--color-ink);
}

.entry-body p {
  margin-bottom: 12px;
}

/* Closing / signature inline row (right-aligned on same line) */
.closing-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}
.closing-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--color-ink);
}
.signature-inline {
  flex: 0 0 auto;
  text-align: right;
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--color-ink);
  opacity: 0.95;
}
.signature-inline .name {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  margin-left: 6px;
}

/* When the closing is a single paragraph, make it a flex container */
.closing {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 0.6rem;
}

@media (max-width: 480px) {
  .closing-row { display: block; }
  .closing { display: block; }
  .signature-inline { text-align: left; margin-top: 8px; display: block; }
}

/* Emphasized / key lines */
.faded-ink {
  color: var(--color-ink-faded);
  font-style: italic;
}

.emphasis-line {
  font-weight: 600;
  font-size: 1.35rem;
  position: relative;
  display: inline-block;
  color: #2e2518;
}

/* Subtle underline on emphasis */
.emphasis-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(58,47,36,0.3),
    transparent
  );
}

/* Faded note style */
.margin-note {
  font-size: 1rem;
  color: var(--color-ink-faded);
  font-style: italic;
  margin-top: 16px;
  padding-left: 12px;
  border-left: 2px solid rgba(139,115,85,0.2);
}

/* Final page styling — apply faded typography only when page type is `final` */
.page--final .entry-body {
  font-style: italic;
  color: var(--color-ink-faded);
}

.page--final .emphasis-line {
  color: var(--color-ink);
}

/* Small utility: apply "final page" text style to a block rather than whole page */
.final-text {
  font-style: italic;
  color: var(--color-ink-faded);
}
.final-text .emphasis-line {
  color: var(--color-ink);
}

/* Older metadata styling for final page (appears greyed/aged) */
.older-text {
  color: var(--color-ink-faded);
  font-style: normal;
  opacity: 0.94;
  margin-top: 8px;
  font-size: 0.98rem;
}

/* ---------- Page Illustrations ---------- */
/*
   Small paintings / sketches embedded in journal pages.
   Add "illustration" to a page's data object in script.js.
   Images should be placed in the assets/ folder.
   Recommended size: 200–400px wide, PNG with transparency
   or soft-edged JPG to blend with the paper.
*/
.page-illustration {
  text-align: center;
  margin-top: 14px;
  margin-bottom: 6px;
  position: relative;
}

.page-illustration img {
  max-width: 65%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
  /* Blend into the aged paper */
  opacity: 0.82;
  filter: sepia(0.2) saturate(0.85) contrast(0.95);
  /* Soft torn-edge feel */
  mask-image: radial-gradient(ellipse at center, black 60%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 60%, transparent 100%);
  transition: opacity 0.3s;
  cursor: zoom-in;
}

.page-illustration img:hover {
  opacity: 0.95;
}

/* Position: top — illustration above the text */
.page-illustration--top {
  margin-top: 0;
  margin-bottom: 16px;
  order: -1;
}

/* Position: center — illustration mid-page (use with short text) */
.page-illustration--center {
  margin-top: auto;
  margin-bottom: auto;
}

/* Caption under the illustration */
.illustration-caption {
  display: block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink-faded);
  font-style: italic;
  margin-top: 4px;
  opacity: 0.7;
}

/* On mobile, make illustrations a bit larger relative to the page */
@media (max-width: 480px) {
  .page-illustration img {
    max-width: 80%;
    max-height: 140px;
  }
}

/* Final page: keep illustration inside the page and scale to fit */
.page--final {
  /* Keep the final page clipped so the image remains inside the page bounds */
  overflow: hidden;
}
.page--final .page__inner,
.page--final .page__content {
  overflow: hidden;
}
.final-page .page-illustration {
  /* Position the illustration absolutely inside the page so it doesn't
     affect the document flow (won't push text down). Adjust the
     variables in :root to change these values. */
  position: absolute;
  left: var(--final-illustration-left);
  bottom: var(--final-illustration-bottom);
  transform: translateX(var(--final-illustration-translateX));
  pointer-events: none; /* allow clicking/selecting text beneath */
  z-index: var(--final-illustration-z);
  width: 100%;
  text-align: center;
}
.final-page .page-illustration img {
  display: inline-block;
  vertical-align: bottom;
  max-width: var(--final-illustration-max-width);
  max-height: var(--final-illustration-max-height);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: var(--final-illustration-opacity);
  filter: none;
  mask-image: none;
  -webkit-mask-image: none;
  border-radius: 4px;
  box-shadow: none;
  transition: transform 0.18s ease, opacity 0.18s;
  transform-origin: center bottom;
  pointer-events: auto; /* allow clicking the image itself */
  cursor: pointer;
}

@media (max-width: 750px) {
  .final-page .page-illustration img {
    max-height: calc(var(--final-illustration-max-height) * 0.7);
    max-width: 92%;
  }
}

/* Overlay illustrations inside pages when page content has `.overlay` class */
.page__content.overlay { position: relative; }
.page__content.overlay .page-illustration {
  position: absolute;
  left: var(--overlay-illustration-left);
  bottom: var(--overlay-illustration-bottom);
  transform: translateX(var(--overlay-illustration-translateX));
  pointer-events: none;
  z-index: var(--overlay-illustration-z);
  width: 100%;
  text-align: center;
}
.page__content.overlay .page-illustration img {
  max-width: var(--overlay-illustration-max-width);
  max-height: var(--overlay-illustration-max-height);
  opacity: var(--overlay-illustration-opacity);
  display: inline-block;
  pointer-events: auto; /* image should receive clicks even if wrapper is pointer-events:none */
  cursor: pointer;
}

/* Clickable inline reveal trigger (e.g. the word "strength") */
.reveal-trigger {
  /* Keep the trigger visually identical to surrounding text so it remains secret */
  text-decoration: none;
  color: inherit;
  font-weight: inherit;
  padding: 0;
  border: none;
  cursor: inherit;
}
.reveal-trigger:focus-visible {
  /* Maintain keyboard focus outline for accessibility only when focused via keyboard */
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Braille clue styling — subtle, small, spaced to read the braille dots */
.braille-clue {
  margin-top: 8px;
  font-family: monospace;
  font-size: 1.05rem;
  color: rgba(58,47,36,0.7);
  letter-spacing: 0.18em;
  line-height: 1.2;
}
.braille-clue .braille-text {
  display: inline-block;
  font-size: 1.12rem;
  letter-spacing: 0.22em;
}

/* Morse clue styling — centered on the page, monospace for clarity */
.morse-clue {
  margin-top: 12px;
  text-align: center;
  font-family: monospace;
  font-size: 1.05rem;
  color: rgba(58,47,36,0.85);
  letter-spacing: 0.16em;
}
.morse-clue .morse-text {
  display: inline-block;
  background: rgba(250,250,250,0.02);
  padding: 6px 10px;
  border-radius: 6px;
}

/* City view overlay that fades in over the page temporarily */
.city-overlay {
  position: absolute;
  inset: 6% 6%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 75;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease, transform 0.9s ease;
  transform: scale(0.98);
  background: transparent;
  overflow: visible;
}
.city-overlay img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: none;
  border-radius: 0;
  transform-origin: center;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.9s ease, transform 0.9s ease;
  pointer-events: auto; /* allow clicking the picture to dismiss */
}
.city-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Small fading notification used when an item becomes visible (e.g. glow discovery) */
.reveal-notice {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%) scale(0.98);
  z-index: 80;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.9s ease, transform 0.9s ease;
  background: rgba(26,22,17,0.9);
  color: var(--color-page);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.reveal-notice.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.city-overlay.visible img {
  opacity: 1;
  transform: scale(1);
}

/* When overlay is active, blur and slightly dim the page content behind it */
.page-wrapper.overlay-blur {
  filter: blur(6px) brightness(0.92);
  transition: filter 0.9s ease;
}

/* ---------- Image Zoom Overlay (click any page illustration to enlarge) ---------- */
.image-zoom-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,6,4,0.82);
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}
.image-zoom-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.image-zoom-overlay .zoom-img {
  max-width: calc(100% - 4rem);
  max-height: calc(100% - 6rem);
  width: auto;
  height: auto;
  box-shadow: 0 18px 48px rgba(0,0,0,0.6);
  border-radius: 6px;
  transform-origin: center;
  transition: transform 260ms ease, opacity 260ms ease;
  cursor: zoom-out;
}
.image-zoom-overlay:focus {
  outline: none;
}


/* Secret page styling */
.page__content.secret {
  text-align: center;
}
.page__content.secret .entry-body {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-ink);
}
.page__content.secret .emphasis-line {
  font-size: 1.4rem;
  color: var(--color-ink);
}
.page__content.secret strong {
  background: linear-gradient(90deg, rgba(201,168,76,0.12), transparent);
  padding: 2px 6px;
  border-radius: 4px;
}


@media (max-width: 480px) {
  .final-page .page-illustration img {
    max-height: calc(var(--final-illustration-max-height) * 0.45);
    max-width: 94%;
  }
}

/* ---------- Navigation Buttons ---------- */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(74, 55, 40, 0.6);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--color-gold);
  width: 40px;
  height: 60px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 40;
  transition: opacity 0.3s, background 0.3s;
  border-radius: 4px;
  opacity: 0.5;
}

.nav-btn:hover {
  opacity: 1;
  background: rgba(74, 55, 40, 0.85);
}

.nav-btn:disabled {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

.nav-btn--prev {
  left: -55px;
}

.nav-btn--next {
  right: -55px;
}

/* ---------- Page Counter ---------- */
.page-counter {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-date);
  font-size: 0.8rem;
  color: rgba(160,136,96,0.5);
  letter-spacing: 0.1em;
}

/* ---------- Hint ---------- */
.hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-date);
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(160,136,96,0.45);
  z-index: 50;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.hint.hidden {
  opacity: 0;
}

/* ---------- Responsive ---------- */

/* Tablets and smaller desktops */
@media (max-width: 750px) {
  :root {
    --journal-width: 92vw;
    --journal-height: 85vh;
    --page-padding: 36px 30px 30px 36px;
  }

  .page__content {
    font-size: 1.15rem;
  }

  .cover-title {
    font-size: 1.7rem;
  }

  .nav-btn--prev {
    left: -8px;
    opacity: 0.35;
    width: 32px;
    height: 48px;
    font-size: 0.8rem;
  }
  .nav-btn--next {
    right: -8px;
    opacity: 0.35;
    width: 32px;
    height: 48px;
    font-size: 0.8rem;
  }
}

/* Phones */
@media (max-width: 480px) {
  :root {
    --journal-width: 96vw;
    --journal-height: 88vh;
    --page-padding: 28px 22px 22px 28px;
  }

  .page__content {
    font-size: 1.05rem;
  }

  .entry-body {
    font-size: 1.1rem;
    line-height: 1.65;
  }

  .cover-title {
    font-size: 1.4rem;
  }

  .cover-subtitle {
    font-size: 0.85rem;
  }

  .nav-btn {
    width: 28px;
    height: 42px;
    font-size: 0.7rem;
  }

  .nav-btn--prev { left: 2px; }
  .nav-btn--next { right: 2px; }

  .click-zone {
    width: 45px;
  }

  .page-counter {
    font-size: 0.7rem;
    bottom: -24px;
  }
}

/* Very tall / narrow phones */
@media (max-height: 600px) {
  :root {
    --journal-height: 92vh;
    --page-padding: 20px 18px 16px 20px;
  }
}

/* ---------- (Page settle removed — layered flip is seamless) ---------- */

/* Reduce particles at night via the atmosphere system (JS toggles this) */
@media (prefers-reduced-motion: reduce) {
  /* Hide particles entirely for users who prefer reduced motion */
  .pollen-container { display: none !important; }
}

/* ---------- Accessibility: focus outlines ---------- */
.click-zone:focus-visible,
.nav-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- Print (just in case) ---------- */
@media print {
  .atmosphere, .vignette, .nav-btn, .click-zone, .hint, .page-counter { display: none; }
  .journal { width: 100%; height: auto; }
  .page { position: relative; page-break-after: always; box-shadow: none; }
}
