/* ================================================================
   DreamyNite – Story Board Hub
   Design System: Enchanted Forest / Lumina Junior
   ================================================================ */

/* ---- Design Tokens ---- */
:root {
  --primary:           #006d4e;
  --primary-dim:       #005138;
  --primary-container: #006d4e;
  --on-primary:        #ffffff;
  --secondary:         #227158;
  --secondary-container: #6fc0a4;
  --on-secondary:      #ffffff;
  --tertiary:          #1b5e46;
  --on-tertiary:       #ffffff;
  --tertiary-container:#1b5e46;
  --surface:           #f4fcf9;
  --surface-bright:    #f4fcf9;
  --surface-low:       #eff6f3;
  --surface-high:      #deede7;
  --surface-highest:   #d5e8e1;
  --on-surface:        #112d24;
  --on-surface-variant:#414945;
  --outline:           #717975;
  --outline-variant:   #ccd9d2;
  --error:             #ba1a1a;
  --shadow-color:      rgba(0, 109, 78, 0.18);

  /* Spacing */
  --container-max:  1200px;
  --gutter:         24px;
  --margin-desktop: 64px;
  --margin-mobile:  20px;
  --section-pad:    96px;
  --radius:         16px;
  --radius-lg:      24px;
  --radius-full:    9999px;

  /* Typography */
  --font-headline: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:     'Be Vietnam Pro', system-ui, sans-serif;

  /* Transitions */
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 767px) {
  :root { --section-pad: 56px; --gutter: 16px; }
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  overflow-x: hidden;
  position: relative;
}

img { display: block; max-width: 100%; height: auto; }
a   { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---- WebGL Background Canvas ---- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---- Typography ---- */
h1, h2, h3 { font-family: var(--font-headline); line-height: 1.2; }

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h3 { font-size: 1.25rem; font-weight: 700; }

p { line-height: 1.7; color: var(--on-surface-variant); font-size: 1rem; }

.text-center { text-align: center; }

/* ---- Layout helpers ---- */
.section-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
}
@media (min-width: 768px) {
  .section-container { padding: 0 var(--margin-desktop); }
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--spring), transform 0.8s var(--spring);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   BUTTON SYSTEM
   ================================================================ */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover { background: var(--primary-dim); box-shadow: 0 6px 20px var(--shadow-color); }
.btn-primary:active { transform: translateY(2px); }

.btn-secondary {
  background: var(--secondary-container);
  color: var(--on-surface);
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline {
  background: rgba(255,255,255,0.9);
  color: var(--primary);
  border: 2px solid rgba(0,109,78,0.25);
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-white {
  background: #ffffff;
  color: var(--primary);
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-glow {
  background: var(--tertiary);
  color: #ffffff;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  animation: button-glow 2s infinite alternate;
}
@keyframes button-glow {
  from { box-shadow: 0 4px 0 0 rgba(0,0,0,0.2), 0 0 10px rgba(0,109,78,0.4); }
  to   { box-shadow: 0 4px 0 0 rgba(0,0,0,0.2), 0 0 25px rgba(0,109,78,0.8), 0 0 40px rgba(27,94,70,0.5); }
}

.btn-text-link {
  color: var(--primary);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.2s;
}
.btn-text-link:hover { opacity: 0.75; }

/* Toy button effect */
.toy-btn {
  box-shadow: 0 4px 0 0 rgba(0,0,0,0.2);
  transition: transform 0.15s var(--spring), box-shadow 0.15s var(--spring);
}
.toy-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 0 rgba(0,0,0,0.18); }
.toy-btn:active { transform: translateY(4px); box-shadow: 0 0 0 0 rgba(0,0,0,0.2); }

/* Wiggle hover */
.wiggle-hover:hover { animation: wiggle 0.5s ease-in-out infinite; }
@keyframes wiggle {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-5deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

/* Icon button */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-surface-variant);
  transition: color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--primary); background: var(--surface-low); }

/* ================================================================
   HEADER / NAV
   ================================================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(244, 252, 249, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--outline-variant);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 24px rgba(0, 109, 78, 0.08);
  transition: background 0.3s;
}
#site-header.scrolled {
  background: rgba(244, 252, 249, 0.97);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--margin-mobile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}
@media (min-width: 768px)  { .nav-container { padding: 0 32px; } }
@media (min-width: 1280px) { .nav-container { padding: 0 var(--margin-desktop); } }

.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  flex-shrink: 0;
}
.logo-icon {
  font-size: 1.75rem;
  color: var(--primary);
  animation: spin-slow 8s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.logo-text {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(0,109,78,0.35));
  animation: logo-float 4s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-3px); }
}

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 1024px) { .nav-links { display: flex; gap: 1.25rem; } }
@media (min-width: 1280px) { .nav-links { gap: 2rem; } }

.nav-link {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  transition: color 0.2s;
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.25s;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-actions {
  display: flex; align-items: center; gap: 0.5rem;
}

.nav-cta {
  display: none;
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
}
@media (min-width: 640px) { .nav-cta { display: inline-flex; } }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 28px; height: 20px; padding: 0;
}
@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--on-surface);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 1023px) {
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px; left: 0; right: 0;
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    background: rgba(244, 252, 249, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem var(--margin-mobile);
    gap: 1.25rem;
    border-bottom: 1px solid var(--outline-variant);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 16px 32px rgba(0, 109, 78, 0.12);
    z-index: 99;
    animation: slideDown 0.3s var(--spring);
  }
  .nav-links.mobile-open .nav-link { font-size: 1rem; padding: 0.4rem 0; }
}
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px var(--margin-mobile) 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}
@media (min-width: 768px) {
  .hero-inner { padding: 60px var(--margin-desktop) 80px; }
}
@media (min-width: 900px) {
  .hero-inner { flex-direction: row; gap: 4rem; }
}

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,109,78,0.1);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(0,109,78,0.2);
  width: fit-content;
}

.hero-text h1 { color: var(--on-surface); }
.hero-text > p { font-size: 1.1rem; max-width: 500px; }

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--outline-variant);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--on-surface-variant);
}
.stat-chip .material-symbols-outlined { color: var(--primary); font-size: 1rem; }

.hero-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-img-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
}
.hero-img-wrapper img {
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 109, 78, 0.2);
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.orb-1 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,109,78,0.4) 0%, transparent 70%);
  top: -40px; right: -40px;
  animation: orb-pulse 4s ease-in-out infinite;
}
.orb-2 {
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(34,113,88,0.3) 0%, transparent 70%);
  bottom: -30px; left: -30px;
  animation: orb-pulse 5s ease-in-out infinite reverse;
}
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.2); opacity: 1; }
}

/* Floating animation */
.floating { animation: floating 3s ease-in-out infinite; }
@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 44px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-full);
  display: flex; justify-content: center;
  opacity: 0.5;
}
.scroll-dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-top: 8px;
  animation: scroll-anim 1.8s ease-in-out infinite;
}
@keyframes scroll-anim {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ================================================================
   POPULAR TALES (Bento Grid)
   ================================================================ */
.popular-tales {
  padding: var(--section-pad) 0;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.section-sub {
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: var(--gutter);
}
@media (min-width: 540px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card, .wide-card { grid-column: span 2; }
}
@media (min-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 300px 260px;
  }
}
/* Below desktop the cards size from min-height, so pin image + overlay inside them */
@media (max-width: 899px) {
  .bento-card { min-height: 240px; }
  .featured-card { min-height: 320px; }
  .bento-card > img { position: absolute; inset: 0; }
}

.bento-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-high);
  cursor: pointer;
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease;
}
.bento-card:hover { transform: scale(1.03); box-shadow: 0 20px 50px rgba(0,0,0,0.12); z-index: 5; }
.bento-card:active { transform: scale(0.98); }

.bento-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.bento-card:hover img { transform: scale(1.08); }

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 60%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}
.card-overlay h3 { font-family: var(--font-headline); font-weight: 700; color: #fff; margin-bottom: 0.25rem; }
.card-overlay p  { font-size: 0.875rem; opacity: 0.88; color: #fff; }



@media (min-width: 900px) {
  .featured-card { grid-column: span 2; grid-row: span 2; min-height: 0; }
  .small-card    { min-height: 0; }
  .wide-card     { grid-column: span 2; min-height: 0; }
}

/* ================================================================
   CREATIVE ZONE
   ================================================================ */
.creative-zone {
  background: linear-gradient(135deg, rgba(229, 242, 235, 0.9) 0%, rgba(162, 219, 203, 0.9) 100%);
  padding: var(--section-pad) 0;
  border-radius: var(--radius-lg);
  margin: 0 1rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
@media (min-width: 768px) {
  .creative-zone { margin: 0 2rem; }
}

#particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.creative-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 900px) {
  .creative-inner { flex-direction: row; gap: 4rem; }
}

.creative-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.creative-text h2 { color: var(--on-surface); }
.creative-text > p { font-size: 1.05rem; }

.zone-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tertiary-container);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  width: fit-content;
}

.story-preview {
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: 2px dashed rgba(27,94,70,0.25);
}
.story-starter {
  font-style: italic;
  color: var(--on-surface-variant);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.suggestion-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s var(--spring);
}
.chip:hover { transform: scale(1.05); }
.chip-primary  { background: var(--primary); color: #fff; }
.chip-secondary{ background: var(--secondary); color: #fff; }
.chip-add      { background: transparent; color: var(--on-surface-variant); font-weight: 500; }

.creative-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 400px;
  width: 100%;
  min-width: 0;
}
.creative-visual img {
  border-radius: var(--radius-lg);
  width: 100%;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 109, 78, 0.2);
}
.glow-ring {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: rgba(34, 113, 88, 0.15);
  animation: orb-pulse 4s ease-in-out infinite;
  z-index: 1;
}

/* Sparkle particle */
.sparkle-particle {
  position: absolute;
  width: 8px; height: 8px;
  background: #beece1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 10px #beece1, 0 0 20px #6fc0a4;
}
@keyframes pop-sparkle {
  0%   { transform: scale(0) translate(0, 0); opacity: 1; }
  100% { transform: scale(1.5) translate(var(--tx), var(--ty)); opacity: 0; }
}

/* ================================================================
   QUIZ QUEST BANNER
   ================================================================ */
.quiz-banner {
  background: linear-gradient(135deg, rgba(0,109,78,0.95) 0%, rgba(27,94,70,0.95) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  margin: var(--section-pad) 1rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
@media (min-width: 768px) {
  .quiz-banner { margin: var(--section-pad) 2rem; }
}
.quiz-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.quiz-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: 4rem var(--margin-mobile);
}
@media (min-width: 768px) {
  .quiz-inner { padding: 5rem var(--margin-desktop); }
}
@media (min-width: 900px) {
  .quiz-inner { flex-direction: row; }
}

.quiz-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.quiz-text h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.quiz-text p  { color: rgba(255,255,255,0.88); font-size: 1.05rem; max-width: 440px; }

.quiz-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}
.quiz-visual img {
  max-width: 360px;
  width: 100%;
  border-radius: var(--radius);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

/* Pulse animation for treasure */
.pulse-anim {
  animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25)); }
  50%       { transform: scale(1.04); filter: drop-shadow(0 25px 50px rgba(0,0,0,0.35)) drop-shadow(0 0 20px rgba(255,255,255,0.2)); }
}

/* ================================================================
   STORY CLUB
   ================================================================ */
.story-club {
  padding: var(--section-pad) 0;
  position: relative;
  z-index: 1;
}
.story-club h2 { margin-bottom: 0.5rem; }
.story-club .section-sub { margin-bottom: 3rem; }

.club-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gutter);
}
@media (min-width: 640px) {
  .club-cards { grid-template-columns: repeat(2, 1fr); }
  .club-card:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .club-cards { grid-template-columns: repeat(3, 1fr); }
  .club-card:last-child { grid-column: auto; }
}

.club-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border: 2px solid transparent;
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease, border-color 0.2s;
  cursor: pointer;
}
.club-card:hover {
  transform: scale(1.04) translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  border-color: var(--primary);
}
.club-card:active { transform: scale(0.98); }

.club-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.club-icon .material-symbols-outlined { color: #fff; font-size: 2rem; }
.icon-green { background: var(--primary); }
.icon-teal  { background: var(--secondary-container); }
.icon-dark  { background: var(--tertiary-container); }

.club-card h3 { color: var(--on-surface); }
.club-card p  { color: var(--on-surface-variant); font-size: 0.9rem; }

/* ================================================================
   NEWSLETTER
   ================================================================ */
.newsletter {
  padding: var(--section-pad) 0;
  position: relative;
  z-index: 1;
}

.newsletter-card {
  background: var(--surface-highest);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) { .newsletter-card { padding: 5rem 4rem; } }

.newsletter-deco {
  position: absolute;
  font-size: 5rem;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
}
.deco-left  { left: -1rem; bottom: -1rem; }
.deco-right { right: -1rem; top: -1rem; }

.newsletter-card h2 { color: var(--primary); margin-bottom: 1rem; }
.newsletter-card > p { max-width: 520px; margin: 0 auto 2rem; font-size: 1.05rem; }

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}
@media (min-width: 480px) {
  .newsletter-form { flex-direction: row; }
}

.newsletter-form input {
  flex: 1;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--outline-variant);
  background: #fff;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input:focus { border-color: var(--primary); }

.privacy-note {
  font-size: 0.8rem;
  color: var(--on-surface-variant);
  margin-top: 1rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
#site-footer {
  background: var(--surface-high);
  border-radius: 24px 24px 0 0;
  position: relative;
  z-index: 1;
  margin-top: 2rem;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3rem var(--margin-mobile);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    padding: 3rem var(--margin-desktop);
  }
}

.footer-brand { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
@media (min-width: 768px) { .footer-brand { align-items: flex-start; } }

.footer-logo { display: flex; align-items: center; gap: 0.5rem; }
.footer-brand p { font-size: 0.85rem; color: var(--on-surface-variant); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.footer-link {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}
.footer-link:hover { color: var(--secondary); }

.social-icons { display: flex; gap: 0.75rem; }

.social-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-highest);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: transform 0.25s var(--spring), background 0.2s;
}
.social-btn:hover { transform: scale(1.15); background: var(--primary); color: #fff; }

/* ================================================================
   FAB (Mobile)
   ================================================================ */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 50;
  transition: transform 0.25s var(--spring), box-shadow 0.25s;
  animation: button-glow 2.5s infinite alternate;
}
.fab:hover { transform: scale(1.1); }
@media (min-width: 768px) { .fab { display: none; } }

/* ================================================================
   PARTICLE
   ================================================================ */
.particle {
  position: absolute;
  pointer-events: none;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 4s infinite linear;
}
@keyframes twinkle {
  0%   { opacity: 0; transform: scale(0) translateY(0); }
  50%  { opacity: 1; transform: scale(1) translateY(-20px); }
  100% { opacity: 0; transform: scale(0) translateY(-40px); }
}

/* ================================================================
   RESPONSIVE / UTILITIES
   ================================================================ */
@media (max-width: 767px) {
  .hero { padding-top: 72px; }
  .hero-inner { padding-top: 40px; padding-bottom: 72px; gap: 2.5rem; }
  .hero-text > p { max-width: none; }
  .creative-inner { gap: 2.5rem; }
  .newsletter-card { padding: 2.5rem 1.25rem; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn-secondary,
  .hero-buttons .btn-outline {
    font-size: 0.9rem;
    padding: 0.8rem 1.4rem;
    justify-content: center;
  }
  .btn-glow, .btn-white { padding: 0.9rem 1.75rem; font-size: 1rem; }
  .club-card { padding: 2rem 1.25rem; }
  .story-preview { padding: 1rem; }
  .footer-links { gap: 1rem 1.25rem; }
  .fab { right: 1rem; bottom: 1rem; width: 54px; height: 54px; }
}

/* Small phones: keep the logo, icons and hamburger on a single row */
@media (max-width: 400px) {
  .nav-container { gap: 0.5rem; }
  .logo-img  { width: 44px; height: 44px; }
  .logo-text { font-size: 1.15rem; }
  .nav-actions { gap: 0.25rem; }
  .icon-btn  { width: 36px; height: 36px; }
}
@media (max-width: 340px) {
  .logo-text { font-size: 1rem; }
  .nav-actions > .icon-btn[aria-label="Notifications"] { display: none; }
}

/* Touch screens have no hover: avoid cards staying scaled after a tap */
@media (hover: none) {
  .bento-card:hover,
  .club-card:hover { transform: none; box-shadow: none; }
  .bento-card:hover img { transform: none; }
}

/* ================================================================
   USER PROFILE DROPDOWN
   ================================================================ */
.nav-actions {
  position: relative; /* Ensure the absolutely-positioned dropdown aligns correctly */
}

/* User Avatar inside the nav button */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 109, 78, 0.15);
  transition: transform 0.2s;
}
.icon-btn:hover .user-avatar {
  transform: scale(1.05);
}

/* Dropdown Container */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  max-width: calc(100vw - 2 * var(--margin-mobile));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 110, 78, 0.12);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 109, 78, 0.15);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, visibility 0.2s;
  pointer-events: none;
}
.profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Header inside dropdown */
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 109, 78, 0.12);
}
.dropdown-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dropdown-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-email {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

/* Role Badges */
.dropdown-role-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dropdown-role-badge.explorer {
  background: rgba(0, 109, 78, 0.08);
  color: var(--primary);
}
.dropdown-role-badge.parent {
  background: rgba(34, 113, 88, 0.08);
  color: var(--secondary);
}
.dropdown-role-badge.admin {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

/* Divider & Menu */
.dropdown-divider {
  border: none;
  border-top: 1px solid var(--outline-variant);
  margin: 0.75rem 0;
  opacity: 0.6;
}
.dropdown-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}
.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  box-sizing: border-box;
}
.dropdown-item:hover {
  background: var(--surface-low);
  color: var(--primary);
  transform: translateX(3px);
}
.dropdown-item .material-symbols-outlined {
  font-size: 1.2rem;
  color: inherit;
}

/* Logout Button Special Styling */
.dropdown-item.logout-btn {
  color: var(--error);
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.dropdown-item.logout-btn:hover {
  background: rgba(186, 26, 26, 0.06);
  color: var(--error);
}
