/* ============================================================
   Jelly Berry — Main Stylesheet
   ============================================================ */

@font-face {
  font-family: 'Konaru';
  src: url('../fonts/konaru-font/konaru.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Galcia';
  src: url('../fonts/GALCIA/GALCIA.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ----- Reset ------------------------------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ----- Design tokens ---------------------------------------- */
:root {
  --ac: #4ecdc4;                        /* accent / teal */
  --tx: #e8f4f8;                        /* primary text */
  --dm: #ffffff;                        /* dimmed / secondary text */
  --cb: rgba(255, 255, 255, 0.04);      /* card background */
  --br: rgba(255, 255, 255, 0.08);      /* border */
}

/* ----- Base -------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  background: rgb(16, 65, 100);
  scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: rgb(16, 65, 100);
  color: var(--tx);
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}

body::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

/* ----- Navigation ------------------------------------------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 220;
  padding: 28px 6vw 18px 7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22vh;
  z-index: -1;
  background: var(--nav-bg, linear-gradient(to bottom, #0d2b4a 60%, rgba(13, 43, 74, 0)));
  pointer-events: none;
}

.logo {
  display: flex;
  align-items: center;
}

.nl {
  display: flex;
  align-items: center;
  gap: 0;
}



.nl a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dm);
  text-decoration: none;
  transition: color 0.2s;
}

.nl a + a::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ac);
  opacity: 0.5;
  margin: 0 10px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.nl a:hover { color: var(--tx); }
.nl a.nav-active { color: var(--ac); }

/* Contact nav button — same style as .nl a, but semantic <button> */
.nl-btn {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dm);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}
.nl-btn::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ac);
  opacity: 0.5;
  margin: 0 10px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.nl-btn:hover { color: var(--tx); }

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

/* ----- Page layout ------------------------------------------ */
.pg {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  position: relative;
  z-index: 20;
}

.lc {
  width: 46%;
  padding: 0 4% 0 7vw;
  flex-shrink: 0;
  position: relative;
  z-index: 21;
}

.rc {
  width: 54%;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 22;
}

/* ----- Background canvas ------------------------------------ */
#bc {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Three.js device canvas — smooth drift when footer is active */
#cv {
  position: fixed;
  left: 40%;
  top: 0;
  width: 52vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
  transition: none; /* transform driven per-frame by device.js render loop */
  will-change: transform; /* own compositing layer — fixes Firefox mobile GPU blend bug */
}

/* LED glow overlay — behind device, forms ambient ocean ring; screen-blend = no dark fringe */
#lc {
  position: fixed;
  left: 40%;
  top: 0;
  width: 52vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9;
  mix-blend-mode: screen;
  transition: none; /* transform driven per-frame by device.js render loop */
  will-change: transform; /* own compositing layer — fixes Firefox mobile GPU blend bug */
}
body.footer-mode #lc {
  opacity: 0.6;
}
/* #cv and #lc transform is driven per-frame by device.js — footer offset applied in JS */

/* ----- Nav brand wordmark ----------------------------------- */
.brand-wordmark {
  font-family: 'Galcia', 'Konaru', 'Rounded', sans-serif;
  font-weight: normal;
  font-size: 2.5rem;
  padding-top: 0.3em;
  letter-spacing: 0.02em;
  color: var(--tx);
  white-space: nowrap;
  line-height: 1;
}
.logo > svg { display: block; height: 2.5rem; width: 2.5rem; flex-shrink: 0; }


/* ----- Sections --------------------------------------------- */
.sc {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 0 80px;
  opacity: 0.15;
  filter: blur(4px);
  transition: opacity 0.65s ease, filter 0.65s ease;
  scroll-snap-align: center;
}

#s0 {
  padding-top: 60px;
  padding-bottom: 60px;
}



#s0 .bt {
  margin-top: 2.5rem;
}

.sc.active {
  opacity: 1;
  filter: blur(0);
}

/* Section children — default (hidden, shifted down, slightly blurred) */
.sc h1,
.sc h2,
.sc .ld,
.sc .bt,
.sc .ey {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(3px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

/* Section children — exiting (blur dissolve into depth) */
.sc.exiting h1,
.sc.exiting h2,
.sc.exiting .ld,
.sc.exiting .bt,
.sc.exiting .ey {
  opacity: 0;
  transform: translateY(0);
  filter: blur(10px);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* Section children — active (revealed, sharpens into focus) */
.sc.active h1,
.sc.active h2 {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.05s;
}

.sc.active .ey {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0s;
}

.sc.active .ld {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.15s;
}

.sc.active .bt {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.25s;
}

/* ----- Typography ------------------------------------------- */
.sc h1 {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  line-height: 1;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.sc h2,
.mode-panel h2 {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.ld {
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  line-height: 1.6;
  color: var(--dm);
  max-width: 480px;
  margin-bottom: 48px;
}

/* ----- CTA button ------------------------------------------- */
.bt {
  display: inline-block;
  padding: 14px 32px;
  background: var(--ac);
  color: #0d2b4a;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--ac);
  cursor: pointer;
  width: fit-content;
  margin-top: 28px;
  box-shadow: 0 0 28px rgba(78, 205, 196, 0.5);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s, background 0.2s;
}

.bt:hover {
  transform: translateY(-4px) !important;
  background: #6ee7e0;
  border-color: #6ee7e0;
  box-shadow: 0 0 42px rgba(78, 205, 196, 0.75);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

/* ----- Eyebrow / mode label --------------------------------- */
.ey {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 16px;
}

.bd {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* ----- Join modal ------------------------------------------- */
.jm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.jm-overlay.open { opacity: 1; pointer-events: all; }
.jm-panel {
  position: relative;
  background: rgba(8,22,42,0.60);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 48px 44px 44px;
  width: min(480px, 92vw);
  box-shadow: 0 0 0 0.5px rgba(78,205,196,0.2), 0 0 60px rgba(78,205,196,0.08), 0 30px 80px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.07);
  transform: translateY(24px);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}
.jm-overlay.open .jm-panel { transform: translateY(0); }
.jm-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; padding: 8px; line-height: 0;
  color: rgba(255,255,255,0.35); cursor: pointer; transition: color 0.2s;
}
.jm-close:hover { color: var(--ac); }
.jm-ey { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ac); margin-bottom: 12px; }
.jm-panel h3 {
  font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.05;
  margin-bottom: 28px; color: var(--tx);
}
.jm-panel h3 span { color: var(--ac); }
.jm-field { margin-bottom: 20px; }
.jm-field label {
  display: block; font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-bottom: 8px;
}
.jm-field input,
.jm-field select {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 14px 18px;
  color: white; font-family: inherit; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
}
.jm-field input::placeholder { color: rgba(255,255,255,0.32); }
.jm-field input:focus, .jm-field select:focus { border-color: var(--ac); }
.jm-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.45)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 40px; cursor: pointer;
}
.jm-field select option { background: #0d2b4a; color: white; }
.jm-error { min-height: 1.2em; font-size: 0.85rem; color: #ff7b7b; margin-bottom: 12px; }
.jm-btn {
  width: 100%; padding: 16px;
  background: var(--ac); color: #0d2b4a;
  border: 1.5px solid var(--ac); border-radius: 10px;
  font-family: inherit; font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 0 28px rgba(78,205,196,0.4);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px;
}
.jm-btn:hover { background: #6ee7e0; border-color: #6ee7e0; box-shadow: 0 0 40px rgba(78,205,196,0.65); transform: translateY(-3px); }
.jm-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.jm-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(13,43,74,0.3); border-top-color: #0d2b4a;
  border-radius: 50%; animation: jm-spin 0.7s linear infinite;
}
@keyframes jm-spin { to { transform: rotate(360deg); } }
.jm-star { font-size: 2.8rem; color: var(--ac); margin-bottom: 16px; }
@keyframes jm-pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.65; transform:scale(1.2); } }
.jm-success-body { color: var(--dm); line-height: 1.65; font-size: 1rem; margin-bottom: 16px; }
.jm-mailto { color: var(--ac); text-decoration: none; border-bottom: 1px solid rgba(78,205,196,0.35); transition: border-color 0.2s; }
.jm-mailto:hover { border-color: var(--ac); }
.jm-privacy { margin-top: 14px; font-size: 0.72rem; color: rgba(180,210,230,0.45); text-align: center; letter-spacing: 0.01em; }
.jm-done-btn { margin-top: 24px; }

/* ── Share modal ─────────────────────────────────────────── */
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.sm-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  color: var(--tx); font-family: inherit; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.sm-btn:hover {
  background: rgba(78,205,196,0.1);
  border-color: rgba(78,205,196,0.55);
  box-shadow: 0 0 20px rgba(78,205,196,0.18);
}
.sm-icon { width: 28px; height: 28px; opacity: 0.85; }
.sm-copy-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 14px 18px; margin-top: 4px;
}
.sm-copy-url {
  flex: 1; font-size: 0.88rem; color: rgba(255,255,255,0.45);
  font-family: 'Inter', monospace; letter-spacing: 0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-copy-btn {
  background: none; border: none; color: var(--ac); font-family: inherit;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; cursor: pointer; padding: 0;
  transition: color 0.2s; white-space: nowrap; flex-shrink: 0;
}
.sm-copy-btn:hover { color: #6ee7e0; }
.sm-hint {
  min-height: 1.4em; font-size: 0.8rem;
  color: rgba(78,205,196,0.75); text-align: center;
  margin-top: 12px; letter-spacing: 0.01em;
}

/* ── Contact modal ───────────────────────────────────────────── */
.ct-intro { font-size: 0.95rem; color: rgba(255,255,255,0.65); line-height: 1.65; margin-bottom: 24px; }
.ct-textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 14px 18px;
  color: white; font-family: inherit; font-size: 0.95rem;
  outline: none; resize: vertical; min-height: 108px;
  transition: border-color 0.2s;
}
.ct-textarea::placeholder { color: rgba(255,255,255,0.32); }
.ct-textarea:focus { border-color: var(--ac); }
.ct-send-btn:hover { transform: none; }
.ct-email-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 14px 18px; margin-top: 60px;
}
.ct-email-addr {
  flex: 1; font-size: 0.88rem; color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
}

/* ----- Section progress dots -------------------------------- */
.pds {
  position: fixed;
  right: 4vw;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 200;
}

.pd {
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.pd.on {
  background: #ffd166;
  border-color: #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.7), 0 0 18px rgba(255, 209, 102, 0.3);
}

/* ----- Scroll hint ------------------------------------------ */
.hn {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  z-index: 100;
  transition: opacity 0.5s, transform 0.5s;
  text-shadow: 0 0 12px rgba(78, 205, 196, 0.7), 0 0 28px rgba(78, 205, 196, 0.35);
  filter: drop-shadow(0 0 6px rgba(78, 205, 196, 0.6)) drop-shadow(0 0 18px rgba(78, 205, 196, 0.25));
}

.hn.gone {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* ----- Laptop / large tablet (768–1099px) ------------------- */
@media (max-width: 1099px) {
  .lc { width: 55%; padding: 0 3% 0 5vw; }
  .rc { width: 45%; }
  #cv { left: 44%; width: 45vw; }
  .sc { padding: 80px 0 60px; }
  .brand-wordmark { font-size: 2rem; }
}

/* ----- Tablet / mobile (< 768px) ---------------------------- */
@media (max-width: 767px) {
  /* Layout collapse */
  .pg { flex-direction: column; }
  .lc { width: 100%; padding: 0 6vw; z-index: 30; }
  .rc { display: none; }

  /* Canvas: full-width, top half of screen */
  #cv {
    left: 0;
    width: 100vw;
    height: 45vh;
    top: 0;
  }
  /* LED overlay: must match #cv on mobile — desktop left:40% rule does not apply */
  #lc {
    left: 0;
    width: 100vw;
    height: 45vh;
  }

  nav::before { height: 14vh; } /* shorter gradient on mobile — less device overlap */

  /* Sections: text flows below the device canvas */
  .sc {
    min-height: 100vh;
    padding: 47vh 0 32px;
    justify-content: flex-start;
  }

  /* #s0: single-screen hero — exactly fills viewport, button pinned at bottom */
  #s0 { height: 100svh; min-height: unset; padding-top: 45vh; padding-bottom: 24px; box-sizing: border-box; overflow: hidden; }
  #s0 h1 { margin-bottom: 8px; }
  #s0 .ld { margin-bottom: 8px; }
  #s0 .bt { margin-top: auto; }

  /* Nav: logo only */
  nav .nl { display: none; }
  nav { padding: 20px 5vw 14px 6vw; }

  /* Progress dots: smaller, keep visible */
  .pds { right: 3vw; gap: 8px; }
  .pd  { width: 5px; height: 5px; }

  /* Typography */
  .ld { max-width: 100%; margin-bottom: 32px; }
  .hn { display: none; } /* unnecessary on touch devices */

  /* Button: full width */
  .bt { width: 100%; text-align: center; box-sizing: border-box; }

  /* Footer: push content below the 45vh device canvas, stack top-down */
  .ft { padding-top: 47vh; justify-content: flex-start; min-height: 100svh; }
}

/* ----- Small mobile (< 480px) ------------------------------- */
@media (max-width: 479px) {
  .lc { padding: 0 5vw; }
  .sc { padding: 46vh 0 20px; min-height: calc(46vh + 340px); }
  #s0 { height: 100svh; min-height: unset; padding-top: 44vh; padding-bottom: 16px; }
  nav { padding: 16px 4vw 12px 5vw; }
  .brand-wordmark { font-size: 1.6rem; }
  .bt { padding: 14px 24px; }
  .modes-sticky .lc { padding-top: 0; } /* mode-panel handles its own top padding */
}

/* ── Depth vignette — fixed gradient, long soft fade like the header glow ── */
/* ----- Modes chapter — sticky horizontal carousel ---------- */
.modes-chapter {
  position: relative;
  height: 600vh;
  scroll-snap-align: start;
  z-index: 20;
}

.modes-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.modes-sticky .lc {
  width: 46%;
  padding: 0 4% 0 7vw;
  position: relative;
  z-index: 21;
  overflow: hidden;
}
@media (max-width: 767px) {
  /* Higher-specificity override for modes chapter text column */
  .modes-sticky .lc {
    width: 100%;
    padding: 0 6vw;
  }
  .mode-panel {
    justify-content: flex-start;
    padding-top: 47vh;
  }
}

.modes-panels {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.mode-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  /* Base transition — used for the slipstream entry (slow settle) */
  transition: transform 0.72s cubic-bezier(0.05, 0.7, 0.1, 1.0), opacity 0.5s ease;
  will-change: transform, opacity;
}

/* Position off-screen instantly — opacity:1 so browser has a valid from-state for transition */
.mode-panel.slide-from-right { transform: translateX(110%);  transition: none; opacity: 1; }
.mode-panel.slide-from-left  { transform: translateX(-110%); transition: none; opacity: 1; }

/* Active — slipstream entry uses base transition from above */
.mode-panel.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Exit — fast ease-in, sucked away by the current. No opacity fade — pure slide. */
.mode-panel.exit-left {
  transform: translateX(-110%);
  opacity: 1;
  transition: transform 0.30s cubic-bezier(0.4, 0, 1, 1);
}
.mode-panel.exit-right {
  transform: translateX(110%);
  opacity: 1;
  transition: transform 0.30s cubic-bezier(0.4, 0, 1, 1);
}
/* Hold children at their revealed state during exit — prevents fade-back flicker */
.mode-panel.exit-left h2, .mode-panel.exit-left .ld, .mode-panel.exit-left .ey,
.mode-panel.exit-right h2, .mode-panel.exit-right .ld, .mode-panel.exit-right .ey {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

/* Reveal children — stagger after panel has swept in */
.mode-panel h2,
.mode-panel .ld,
.mode-panel .ey {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(3px);
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
.mode-panel.active .ey { opacity: 1; transform: none; filter: none; transition-delay: 0.14s; }
.mode-panel.active h2  { opacity: 1; transform: none; filter: none; transition-delay: 0.24s; }
.mode-panel.active .ld { opacity: 1; transform: none; filter: none; transition-delay: 0.38s; }

/* Mode-chapter panel dots (inside the sticky pane) */
.mode-dots {
  position: fixed;
  bottom: 40px;
  left: 7vw;
  display: flex;
  gap: 10px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mode-dots.visible {
  opacity: 1;
  pointer-events: auto;
}

.mode-dot {
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, width 0.3s;
}

.mode-dot.on {
  background: var(--ac);
  width: 42px;
  box-shadow: 0 0 8px rgba(78, 205, 196, 0.7);
}

/* ── Footer — full-height snap section, content at bottom ─── */
.ft {
  position: relative;
  z-index: 20;
  background: transparent;
  width: 100%;
  flex: 0 0 100%;
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(24px, 6vw, 80px) 0;
}

/* Footer body — all content bottom-aligned below the device */
.ft-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: clamp(124px, calc(5vh + 100px), 148px);
  gap: clamp(20px, 4vh, 40px);
}

.ft-tag {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(78, 205, 196, 0.85);
  text-shadow: 0 0 30px rgba(78, 205, 196, 0.4), 0 0 70px rgba(78, 205, 196, 0.15);
  line-height: 1.3;
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.7s ease 0.15s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.ft.active .ft-tag {
  opacity: 1;
  transform: translateY(0);
}

@keyframes breathe-glow {
  0%, 100% { box-shadow: 0 0 22px rgba(78, 205, 196, 0.45); }
  50%       { box-shadow: 0 0 55px rgba(78, 205, 196, 1), 0 0 100px rgba(78, 205, 196, 0.4); }
}

.ft.active #shareBtn {
  animation: breathe-glow 3.5s ease-in-out infinite;
  animation-delay: 0.6s;
  margin-top: 0;
}

.ft #shareBtn:hover {
  transform: none;
}

/* Legal row — pinned to footer bottom-right */
.ft-legal {
  position: absolute;
  bottom: clamp(16px, 3vh, 28px);
  right: clamp(24px, 6vw, 80px);
}

.ft-legal a, .ft-legal span {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 0.3s;
}
.ft-legal a:hover { color: rgba(78, 205, 196, 0.7); }
.ft-legal-dot { color: rgba(78,205,196,0.15); }
