/* MEME TO REALITY — A SALUTE Riddle Comic */

@font-face {
  font-family: "Bangers";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/bangers-400.woff2") format("woff2");
}

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/fredoka.woff2") format("woff2");
}

:root {
  --ocean: #0a0a0a;
  --fur-brown: #0a0a0a;
  --fur-dark: #0a0a0a;
  --fur-deep: #050505;
  --navy: #0a0a0a;
  --navy-2: #161616;
  --navy-3: #222222;
  --gold: #ffd646;
  --gold-soft: #ffe27a;
  --gold-deep: #c9a018;
  --green: #c6f214;
  --green-2: #8fbe00;
  --green-dim: #5a7a00;
  --orange: #ff6e14;
  --cream: #f6efe4;
  --ink: #0a0a0a;
  --muted: #b8b8a0;
  --shadow: rgba(8, 10, 16, 0.55);
  --radius: 14px;
  --header-h: 58px;
  --font-display: "Bangers", "Impact", "Haettenschweiler", "Arial Black", cursive;
  --font-ui: "Fredoka", "Segoe UI", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); }

button {
  font-family: inherit;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--green);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Hidden SVG filter well — keep a 1x1 box so filters still resolve */
.filter-defs {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* ========== HOME / FRONT PAGE ========== */
.view { display: none; }
.view.is-active { display: block; }

.view-home {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--fur-dark);
  background-image:
    radial-gradient(ellipse at 50% 18%, rgba(11, 20, 36, 0.12) 0%, rgba(11, 20, 36, 0.38) 72%, rgba(11, 20, 36, 0.55) 100%),
    url("../images/stage.webp");
  background-size: auto, 420px 420px;
  background-repeat: no-repeat, repeat;
  background-position: center top, 0 0;
}

.home-inner {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* DROP mascot peeking over the top of the page */
.drop-mascot, .ears {
  width: min(560px, 92vw);
  margin: 0 auto -8px;
  position: relative;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}
.drop-mascot img, .ears img {
  width: 100%;
  height: auto;
}
.drop-mascot.bob, .ears.bob {
  animation: ear-bob 3.6s ease-in-out infinite;
}
@keyframes ear-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.home-header {
  text-align: center;
  width: 100%;
  margin-top: -6px;
}

.fuzzy-title {
  width: min(720px, 100%);
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
  filter: drop-shadow(0 8px 0 rgba(26, 18, 12, 0.35));
}

.subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.4vw, 2.15rem);
  letter-spacing: 0.06em;
  color: var(--cream);
  margin: 2px 0 0;
  text-shadow:
    0 2px 0 var(--ink),
    0 3px 10px rgba(0, 0, 0, 0.45);
}

.cover-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 22px auto 26px;
  position: relative;
}

.cover-frame {
  background: var(--navy);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  border: 14px solid transparent;
  border-image: url("../images/stage.webp") 18% repeat;
  box-shadow:
    0 0 0 3px var(--gold),
    0 18px 50px var(--shadow),
    0 0 48px rgba(57, 255, 142, 0.22);
  transform: rotate(-0.4deg);
}

.cover-frame picture {
  display: block;
  line-height: 0;
}
.cover-frame img {
  width: auto;
  height: auto;
  display: block;
  max-width: min(520px, calc(100vw - 48px));
  max-height: calc(100dvh - 400px);
  object-fit: contain;
  margin-inline: auto;
}

.start-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 18px 28px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #7CFFB2 0%, var(--green) 42%, var(--green-2) 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.25rem);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px 0 #0c5c2c,
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(57, 255, 142, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.start-btn:hover,
.start-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 8px 0 #0c5c2c,
    0 14px 28px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(57, 255, 142, 0.7);
  outline: none;
}
.start-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #0c5c2c,
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(57, 255, 142, 0.4);
}
.start-btn .x-icon {
  width: 1.05em;
  height: 1.05em;
  color: var(--ink);
}

.home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 4px;
}

.hint {
  margin: 6px 0 0;
  max-width: 28rem;
  text-align: center;
  color: var(--cream);
  font-size: 0.98rem;
  font-weight: 500;
  background: rgba(11, 20, 36, 0.55);
  border: 1px dashed rgba(245, 213, 71, 0.45);
  border-radius: 999px;
  padding: 8px 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.hint em { font-style: normal; color: var(--gold-soft); }

.pdf-link {
  color: var(--gold-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(245, 213, 71, 0.45);
  padding-bottom: 1px;
  background: rgba(11, 20, 36, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(245, 213, 71, 0.35);
}
.pdf-link:hover,
.pdf-link:focus-visible {
  color: #fff;
  border-color: var(--gold);
  outline: none;
}

.site-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.site-footer a {
  color: var(--gold-soft);
  text-decoration: none;
  font-weight: 650;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0.25em 0; }

/* ========== READER ========== */
.view-reader {
  min-height: 100dvh;
  background-color: var(--navy);
  background-image:
    linear-gradient(180deg, rgba(11, 20, 36, 0.72), rgba(11, 20, 36, 0.82)),
    url("../images/stage.webp");
  background-size: auto, 520px 520px;
  color: var(--cream);
  display: none;
  flex-direction: column;
}
.view-reader.is-active {
  display: flex;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.reader-top {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #120c08 0%, #1c140e 100%);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 20;
}

.reader-top .brand {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.05rem;
  line-height: 1.1;
  text-align: center;
  flex: 1;
  min-width: 0;
}
.reader-top .brand small {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

.icon-btn,
.nav-btn,
.reveal-btn {
  appearance: none;
  border: 2px solid var(--gold);
  background: var(--navy-2);
  color: var(--cream);
  border-radius: 999px;
  font-weight: 600;
  min-height: 44px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--cream);
  font-size: 0.9rem;
  white-space: nowrap;
}
.icon-btn:hover,
.icon-btn:focus-visible,
.nav-btn:hover,
.nav-btn:focus-visible {
  background: var(--navy-3);
  color: var(--gold-soft);
  outline: none;
}
.icon-btn:disabled,
.nav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.stage-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.stage {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 12px 0;
  min-height: 0;
}

.page-figure {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: 100%;
  touch-action: pan-y;
}

.page-frame {
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(245, 213, 71, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(57, 255, 142, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-frame picture {
  display: flex;
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.page-frame img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.side-nav {
  display: none;
}

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 4px 6px;
  flex: 0 0 auto;
}

.nav-btn {
  min-width: 104px;
  padding: 10px 16px;
  font-size: 1rem;
}
.nav-btn .arrow { font-size: 1.1em; }

.page-counter {
  min-width: 7.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold-soft);
}
.page-counter .page-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.reveal-block {
  width: min(720px, calc(100% - 24px));
  margin: 0 auto 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.reveal-block[hidden] { display: none !important; }

.reveal-btn {
  background: linear-gradient(180deg, #234 0%, var(--navy-2) 100%);
  color: var(--gold);
  padding: 10px 22px;
  font-size: 1rem;
  box-shadow: 0 0 0 1px rgba(245, 213, 71, 0.15);
}
.reveal-btn:hover,
.reveal-btn:focus-visible {
  background: var(--navy-3);
  color: var(--gold-soft);
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.reveal-btn[aria-expanded="true"] {
  border-color: var(--green);
  color: var(--green);
}

.answer-panel {
  width: 100%;
  background: rgba(8, 16, 10, 0.9);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 0 24px rgba(57, 255, 142, 0.25);
  color: var(--cream);
}
.answer-panel[hidden] { display: none !important; }
.answer-panel strong {
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}
.answer-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 12px 10px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  flex: 0 0 auto;
}
.thumb {
  flex: 0 0 auto;
  width: 64px;
  padding: 0;
  border: 2px solid transparent;
  background: var(--navy-2);
  border-radius: 6px;
  overflow: hidden;
  color: var(--cream);
  font: inherit;
}
.thumb img {
  width: 64px;
  height: 86px;
  object-fit: cover;
  display: block;
}
.thumb .thumb-cap {
  display: block;
  font-size: 0.62rem;
  padding: 3px 2px 4px;
  text-align: center;
  font-weight: 600;
  line-height: 1.1;
}
.thumb.is-current {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(57, 255, 142, 0.4);
}
.thumb:hover,
.thumb:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.thumb.thumb-key {
  width: 72px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #111a14;
  color: var(--green);
  font-weight: 700;
  font-size: 0.68rem;
  text-align: center;
  padding: 6px;
  line-height: 1.2;
}

.reader-footer {
  border-top: 1px solid rgba(245, 213, 71, 0.2);
  padding: 6px 16px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  background: rgba(8, 10, 16, 0.55);
  flex: 0 0 auto;
}
.reader-footer a { color: var(--gold-soft); text-decoration: none; }
.reader-footer a:hover { text-decoration: underline; }
.reader-footer p { margin: 0.2em 0; }

.noscript-note {
  background: var(--navy);
  color: var(--cream);
  padding: 24px;
  text-align: center;
}

/* Desktop reader: side arrows, taller page */
@media (min-width: 840px) {
  .stage {
    grid-template-columns: 72px 1fr 72px;
    grid-template-rows: 1fr;
    align-items: center;
    padding: 12px 16px 0;
  }
  .side-nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .side-nav .nav-btn {
    min-width: 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: 1.6rem;
    border-radius: 50%;
  }
  .bottom-nav .nav-btn { display: none; }
  .page-frame img {
    max-height: 100%;
  }
  .thumb { width: 72px; }
  .thumb img { width: 72px; height: 96px; }
}

@media (max-width: 480px) {
  .reader-top .brand { font-size: 0.95rem; }
  .icon-btn span.label { display: none; }
  .hint { border-radius: 16px; }
  .thumb { width: 52px; }
  .thumb img { width: 52px; height: 70px; }
  .thumb.thumb-key { width: 60px; height: 92px; }
  .reader-footer p:last-child { display: none; }
}

@media (max-height: 700px) {
  .thumb img { height: 64px; }
  .reader-footer { display: none; }
}


@media (max-height: 920px) {
  .drop-mascot, .ears { width: min(320px, 48vw); margin-bottom: -24px; }
  .fuzzy-title { width: min(500px, 72%); }
  .subtitle { font-size: clamp(1.15rem, 3.8vw, 1.7rem); }
  .cover-wrap { margin: 8px auto 14px; }
  .cover-frame img { max-height: calc(100dvh - 425px); }
}

@media (max-height: 920px) and (max-width: 600px) {
  .drop-mascot, .ears { width: min(380px, 72vw); margin-bottom: -20px; }
  .home-header { margin-top: -8px; }
  .fuzzy-title { width: min(100%, 88%); }
  .start-btn { padding: 14px 22px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .drop-mascot.bob, .ears.bob { animation: none; }
  .start-btn { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .start-btn.pulse {
    animation: glow-pulse 2.4s ease-in-out infinite;
  }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 6px 0 #0c5c2c, 0 10px 24px rgba(0,0,0,.35), 0 0 28px rgba(57,255,142,.45); }
  50% { box-shadow: 0 6px 0 #0c5c2c, 0 10px 24px rgba(0,0,0,.35), 0 0 44px rgba(57,255,142,.8); }
}


/* ========== JOIN THE SALUTE COMMUNITY ========== */
.join-drop {
  width: 100%;
  margin: 28px 0 8px;
  padding: 22px 18px 18px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(20, 20, 16, 0.92) 0%, rgba(8, 8, 8, 0.95) 100%);
  border: 2px solid rgba(245, 213, 71, 0.45);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(57, 255, 142, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.35);
}
.join-drop h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: 0.05em;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(245, 213, 71, 0.25);
}
.join-lead {
  margin: 0 0 16px;
  color: var(--cream);
  font-size: 0.98rem;
  font-weight: 500;
}
.follow-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 14px 22px 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #7CFFB2 0%, var(--green) 42%, var(--green-2) 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.4vw, 1.75rem);
  letter-spacing: 0.05em;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow:
    0 5px 0 #0c5c2c,
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(57, 255, 142, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.follow-btn:hover,
.follow-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 7px 0 #0c5c2c,
    0 12px 24px rgba(0, 0, 0, 0.4),
    0 0 32px rgba(57, 255, 142, 0.65);
  outline: none;
}
.follow-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 #0c5c2c,
    0 6px 14px rgba(0, 0, 0, 0.35);
}
.follow-btn .x-mark {
  width: 0.85em;
  height: 0.85em;
  flex: 0 0 auto;
}
.join-links {
  list-style: none;
  margin: 18px 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.join-links a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 213, 71, 0.45);
  background: rgba(11, 20, 36, 0.65);
  color: var(--gold-soft);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
}
.join-links a:hover,
.join-links a:focus-visible {
  color: #fff;
  border-color: var(--gold);
  background: rgba(11, 20, 36, 0.9);
  outline: none;
}
.join-drop .nfa {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.join-drop-reader {
  width: min(760px, calc(100% - 24px));
  margin: 8px auto 16px;
  flex: 0 0 auto;
}
.join-drop-reader[hidden] { display: none !important; }

@media (max-width: 600px) {
  .join-links { flex-direction: column; align-items: stretch; }
  .join-links a { text-align: center; }
}
