
:root {
  --sky: #dff4ff;
  --sky-deep: #9ed8ff;
  --ink: #13314d;
  --accent: #ff8a2b;
  --accent-dark: #eb6d09;
  --white: #ffffff;
  --card: rgba(255,255,255,0.84);
  --shadow: 0 20px 40px rgba(25, 74, 120, 0.15);
  --radius: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #cfefff 0%, #eaf9ff 50%, #d8f1ff 100%);
  min-height: 100vh;
  position: relative;
}
body::before,
body::after,
.sky-overlay::before,
.sky-overlay::after {
  content: "";
  position: fixed;
  inset: auto;
  background: rgba(255,255,255,0.8);
  border-radius: 999px;
  filter: blur(2px);
  z-index: -1;
}
body::before { width: 280px; height: 90px; top: 90px; left: 6%; box-shadow: 70px 10px 0 20px rgba(255,255,255,0.72), 150px 20px 0 10px rgba(255,255,255,0.74); }
body::after { width: 250px; height: 80px; top: 240px; right: 8%; box-shadow: 60px 12px 0 18px rgba(255,255,255,0.7), 130px 18px 0 10px rgba(255,255,255,0.66); }
.sky-overlay::before { width: 220px; height: 70px; bottom: 120px; left: 12%; box-shadow: 65px 10px 0 16px rgba(255,255,255,0.7), 120px 18px 0 8px rgba(255,255,255,0.65); }
.sky-overlay::after { width: 240px; height: 78px; bottom: 220px; right: 10%; box-shadow: 60px 8px 0 20px rgba(255,255,255,0.72), 135px 18px 0 10px rgba(255,255,255,0.7); }
.site-header, main, .site-footer, .reader-header, .reader-main, .page-header, .page-main { position: relative; z-index: 1; }
.site-header, .reader-header, .page-header { padding: 28px 24px 0; }
main, .reader-main, .page-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 32px; }
.card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand-wrap, .reader-header, .page-header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.brand-wrap { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 700; color: #2d6a97; margin: 0 0 10px; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.05; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
p { margin: 0; line-height: 1.6; }
.subhead { max-width: 720px; }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; }
.nav-links a, .text-link { color: #255f89; text-decoration: none; font-weight: 700; }
.nav-links a:hover, .text-link:hover { text-decoration: underline; }
.hero, .latest, .explorer, .characters, .site-footer, .cloud-guide, .library-intro, .library-grid, .reader-intro { padding: 28px; margin-top: 24px; }
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: center; }
.hero-art img, .comic-page img, .feature-art img { width: 100%; display: block; border-radius: 22px; }
.hero-art img { max-height: 460px; object-fit: cover; }
.button-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.button-row.centered { justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(30,82,126,0.18); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); color: white; }
.btn-secondary { background: white; color: var(--ink); border: 1px solid rgba(19,49,77,0.12); }
.section-heading { margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-up { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact .mini-card { padding: 18px; }
.mini-card, .cloud-card, .feature-card {
  background: rgba(255,255,255,0.88);
  border-radius: 22px;
  padding: 22px;
  min-height: 190px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 12px 24px rgba(25,74,120,0.08);
}
.feature-card { display: grid; gap: 18px; align-items: start; }
.feature-card img { width: 100%; border-radius: 20px; display:block; }
.cloud-card { transition: transform 0.25s ease, background 0.25s ease; }
.cloud-card:hover { transform: translateY(-6px); background: rgba(255,255,255,0.97); }
.cloud-back { margin-top: 12px; font-weight: 700; color: #1f5d8a; }
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.reader-body .reader-main { width: min(940px, calc(100% - 24px)); }
.reader-header, .page-header-inner { padding: 28px; margin-top: 24px; }
.comic-stack { display: grid; gap: 22px; margin-top: 24px; }
.comic-page { padding: 16px; }
.comic-page figcaption { text-align: center; margin-top: 10px; font-weight: 700; color: #295a83; }
.text-page { padding: 0; overflow: hidden; }
.text-page-inner {
  padding: 40px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(229,245,255,0.92));
  min-height: 420px;
  display: grid;
  gap: 14px;
  align-content: center;
  text-align: center;
}
.story-note { font-weight: 700; color: #255f89; }
.badge-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.badge { background: rgba(37,95,137,0.1); color:#255f89; padding:8px 14px; border-radius:999px; font-weight:700; font-size:0.92rem; }
@media (max-width: 900px) {
  .hero, .site-footer, .brand-wrap, .two-up { grid-template-columns: 1fr; display: grid; }
  .three-up, .four-up { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  main, .reader-main, .brand-wrap, .site-footer, .page-header-inner { width: min(100% - 18px, 1180px); }
  .hero, .latest, .explorer, .characters, .site-footer, .reader-header, .cloud-guide, .library-intro, .library-grid, .reader-intro { padding: 20px; }
  .three-up, .four-up, .two-up { grid-template-columns: 1fr; }
  .button-row { flex-direction: column; }
  .btn { width: 100%; }
}


.character-card img {
  width: 100%;
  display: block;
  border-radius: 18px;
  background: linear-gradient(180deg, #e8f8ff, #d6f0ff);
  margin-bottom: 16px;
}
.character-card h4 {
  margin-top: 4px;
}


.character-feature-grid { align-items: stretch; }
.character-feature { grid-template-columns: minmax(220px, 320px) 1fr; gap: 22px; }
.character-feature img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 20px;
  background: linear-gradient(180deg, #eef9ff, #d8f1ff);
  padding: 16px;
}
@media (max-width: 900px) {
  .character-feature { grid-template-columns: 1fr; }
}


.subtle-counter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(37,95,137,0.12);
  box-shadow: 0 8px 18px rgba(25,74,120,0.08);
  font-size: 0.92rem;
  font-weight: 700;
  color: #255f89;
}
.counter-label { opacity: 0.82; }
#visitor-count { color: var(--ink); }

.hero-copy, .hero-art { min-width: 0; }
.nav-links { justify-content: flex-end; }
.hero-art img { height: auto; }
.mini-card img, .comic-page img, .feature-card img { max-width: 100%; height: auto; }

@media (max-width: 1100px) {
  .brand-wrap { align-items: start; }
  .nav-links { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .site-header, .reader-header, .page-header { padding: 18px 16px 0; }
  .brand-wrap { gap: 16px; }
  .hero { gap: 20px; }
  .hero-art { order: -1; }
  .hero-art img { max-height: none; }
}

@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .site-header, .reader-header, .page-header { padding: 14px 10px 0; }
  main, .reader-main, .brand-wrap, .site-footer, .page-header-inner { width: calc(100% - 12px); }
  .brand-wrap, .site-footer { gap: 14px; }
  .nav-links { gap: 12px; }
  .hero, .latest, .explorer, .characters, .site-footer, .reader-header, .cloud-guide, .library-intro, .library-grid, .reader-intro, .junior-aviators { padding: 16px; }
  .mini-card, .cloud-card, .feature-card, .comic-page { padding: 16px; }
  .button-row { gap: 10px; }
  .btn { min-height: 44px; }
  .subtle-counter { font-size: 0.88rem; padding: 8px 12px; }
  .badge-row { gap: 8px; }
  .badge { font-size: 0.84rem; padding: 7px 11px; }
  .text-page-inner { padding: 28px 18px; min-height: 320px; }
}


.poster-figure {
  margin: 22px 0 0;
}
.poster-figure img {
  width: 100%;
  display: block;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(16,59,105,0.14);
}
.character-card .eyebrow {
  margin-bottom: 6px;
}
.character-feature p strong {
  color: #1a4b76;
}
.text-link {
  color: #1f5d8a;
  font-weight: 700;
  text-decoration: none;
}
.text-link:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .poster-figure img {
    border-radius: 18px;
  }
}


.cloud-head-float {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 10;
  width: min(180px, 28vw);
  display: grid;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  transform-origin: center;
  animation: cloudBob 4.5s ease-in-out infinite;
}
.cloud-head-float img {
  width: 100%;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.95), rgba(221,242,255,0.95));
  box-shadow: 0 16px 36px rgba(16,59,105,0.18);
}
.cloud-head-float span {
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 20px rgba(16,59,105,0.12);
}
.cloud-head-float:hover { transform: scale(1.03); }
@keyframes cloudBob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.home-character-grid .character-card { transition: transform 0.22s ease, box-shadow 0.22s ease; }
.home-character-grid .character-card:hover, .interactive-card:hover { transform: translateY(-6px); box-shadow: 0 18px 32px rgba(16,59,105,0.14); }
.character-toolbar { display:flex; flex-wrap:wrap; gap:12px; margin-top:18px; }
.chip-btn {
  border: 1px solid rgba(37,95,137,0.14);
  background: rgba(255,255,255,0.9);
  color: #255f89;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.chip-btn.is-active { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); color: white; border-color: transparent; }
.interactive-card { cursor: pointer; }
.poster-figure-interactive img { background: linear-gradient(180deg, #eff9ff, #d9f1ff); }
.modal-shell {
  position: fixed; inset: 0; background: rgba(8,22,40,0.52); display:none; align-items:center; justify-content:center; padding:18px; z-index: 30;
}
.modal-shell.is-open { display:flex; }
.modal-card {
  width: min(980px, 100%);
  background: rgba(255,255,255,0.97);
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(8,22,40,0.24);
  padding: 24px;
  position: relative;
}
.modal-layout { display:grid; grid-template-columns: minmax(220px, 320px) 1fr; gap:22px; align-items:start; }
.modal-layout img { width:100%; border-radius:22px; background: linear-gradient(180deg, #eef9ff, #d8f1ff); padding: 16px; }
.modal-close { position:absolute; top:14px; right:16px; border:0; background:transparent; font-size:2rem; line-height:1; cursor:pointer; color:#255f89; }
.quick-facts { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; margin-top:18px; }
.quick-facts div { background: rgba(233,246,255,0.92); border-radius: 18px; padding: 14px; }
.quick-facts strong { display:block; margin-bottom:4px; color:#1a4b76; }
body.modal-open { overflow:hidden; }
@media (max-width: 900px) {
  .home-character-grid { grid-template-columns: 1fr 1fr; }
  .cloud-head-float { top: 8px; right: 10px; width: 132px; }
  .modal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cloud-head-float { position: sticky; top: 8px; right: auto; left: calc(50% - 60px); width: 120px; margin-bottom: 8px; }
  .home-character-grid, .quick-facts { grid-template-columns: 1fr; }
  .modal-card { padding: 18px; border-radius: 22px; }
}


/* Junior Aviator Academy styles restored for V15.6 */
.academy-shell, .viewer-shell, .certificate-shell { position: relative; overflow: hidden; }
.academy-highlight-grid { align-items: stretch; }
.academy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1f5d8a, #f9c53d);
  color: white;
  box-shadow: 0 18px 32px rgba(20, 75, 120, 0.18);
  margin: 8px 0 14px;
  text-align: center;
}
.academy-badge strong, .academy-badge span { display: block; }
.academy-badge .badge-wing { font-size: 1.4rem; }
.academy-list { margin: 14px 0 0; padding-left: 20px; line-height: 1.7; }
.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 240px;
  gap: 20px;
  align-items: start;
}
.viewer-stage {
  background: rgba(255,255,255,0.88);
  border-radius: 24px;
  padding: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 12px 24px rgba(25,74,120,0.08);
}
.viewer-stage img {
  width: 100%;
  max-height: 840px;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(235,248,255,0.9);
}
.viewer-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 16px; }
.viewer-thumbs { display: grid; gap: 12px; }
.viewer-thumb {
  border: 1px solid rgba(31,93,138,0.14);
  background: rgba(255,255,255,0.85);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  color: #255f89;
  cursor: pointer;
}
.viewer-thumb.is-active { background: linear-gradient(180deg, #f9c53d, #efb31c); color: #13314d; }
.certificate-grid { align-items: start; }
.certificate-form { display: grid; gap: 14px; }
.certificate-form label { display: grid; gap: 8px; font-weight: 700; color: #255f89; }
.certificate-form input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(31,93,138,0.18);
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: rgba(255,255,255,0.95);
}
.certificate-preview-wrap { min-width: 0; }
.certificate-preview {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(228,245,255,0.95));
  border: 6px solid rgba(249,197,61,0.85);
  border-radius: 26px;
  padding: 28px;
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 16px 32px rgba(20,75,120,0.12);
}
.certificate-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 800; color: #2d6a97; }
.certificate-preview h2 { margin: 4px 0; }
.certificate-signoff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 10px;
}
.certificate-signoff span { display:block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: #2d6a97; }
.certificate-signoff strong { display:block; margin-top: 6px; }
@media (max-width: 980px) {
  .viewer-layout { grid-template-columns: 1fr; }
  .viewer-thumbs { grid-template-columns: repeat(5, minmax(110px, 1fr)); }
}
@media (max-width: 700px) {
  .viewer-thumbs { grid-template-columns: 1fr 1fr; }
  .certificate-signoff { grid-template-columns: 1fr; }
}
@media print {
  body * { visibility: hidden !important; }
  #certificate-preview, #certificate-preview * { visibility: visible !important; }
  #certificate-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% - 24px);
    margin: 12px;
    box-shadow: none;
    border-width: 4px;
    min-height: auto;
  }
}


.store-preview-shell { margin-top: 24px; padding: 28px; }
.store-preview-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; align-items: stretch; }
.store-product-card, .store-mini-card { background: rgba(255,255,255,0.92); border-radius: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.82), 0 14px 28px rgba(25,74,120,0.10); overflow: hidden; }
.store-product-card.featured { display: grid; grid-template-columns: 0.92fr 1.08fr; }
.store-product-image-wrap { position: relative; min-height: 100%; background: linear-gradient(180deg, #eef9ff, #d8f1ff); }
.store-product-image-wrap img, .store-mini-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.store-tag { position: absolute; top: 16px; left: 16px; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); color: white; padding: 8px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; box-shadow: 0 10px 20px rgba(235,109,9,0.24); }
.store-product-copy { padding: 24px; display: grid; gap: 10px; align-content: center; }
.price-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; color: #255f89; font-weight: 700; }
.price-row strong { font-size: 1.35rem; color: var(--ink); }
.store-mini-card { padding: 18px; display: grid; gap: 16px; }
.store-mini-card img { border-radius: 18px; max-height: 220px; object-fit: cover; }
.store-mini-card span { display: inline-block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 700; color: #2d6a97; }
.store-mini-card strong { display: block; margin-bottom: 8px; font-size: 1.12rem; }
.store-cta-strip { width: min(1180px, calc(100% - 32px)); margin: 0 auto 34px; padding: 24px 28px; border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(223,244,255,0.95)); border: 1px solid rgba(255,255,255,0.78); box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.store-cta-copy { max-width: 720px; }
@media (max-width: 980px) { .store-preview-grid { grid-template-columns: 1fr; } .store-product-card.featured { grid-template-columns: 1fr; } .store-product-image-wrap img { max-height: 320px; object-fit: contain; padding: 18px; } .store-cta-strip { flex-direction: column; align-items: flex-start; } }
@media (max-width: 640px) { .store-preview-shell { padding: 20px; } .store-product-copy { padding: 18px; } .store-cta-strip { width: calc(100% - 12px); padding: 18px; } }


/* V16.6 hero overlap + glow animation */
.hero-overlap-enabled {
  overflow: visible;
}
.hero-overlap-enabled .hero-art {
  position: relative;
  z-index: 3;
  margin-top: -58px;
  margin-bottom: -34px;
}
.hero-overlap-enabled .hero-art::before {
  content: "";
  position: absolute;
  inset: 20px 14px 10px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 214, 120, 0.32), rgba(97, 196, 255, 0.14) 45%, rgba(97, 196, 255, 0) 72%);
  filter: blur(14px);
  z-index: -1;
  animation: heroGlowPulse 4.8s ease-in-out infinite;
}
.hero-overlap-enabled .hero-art img {
  position: relative;
  border-radius: 26px;
  box-shadow:
    0 22px 42px rgba(16,59,105,0.24),
    0 0 0 1px rgba(255,255,255,0.72),
    0 0 26px rgba(126, 208, 255, 0.26);
  animation: heroFloatGlow 4.8s ease-in-out infinite;
  will-change: transform, box-shadow;
}
@keyframes heroFloatGlow {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 22px 42px rgba(16,59,105,0.24),
      0 0 0 1px rgba(255,255,255,0.72),
      0 0 24px rgba(126, 208, 255, 0.24);
  }
  50% {
    transform: translateY(-8px);
    box-shadow:
      0 28px 50px rgba(16,59,105,0.28),
      0 0 0 1px rgba(255,255,255,0.78),
      0 0 38px rgba(255, 191, 73, 0.24);
  }
}
@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.72; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}
@media (max-width: 900px) {
  .hero-overlap-enabled .hero-art {
    margin-top: 0;
    margin-bottom: 0;
  }
}
