/* =========================================================
   Sunauo — Playful EdTech Design System
   Bright, modern, kid-friendly, accessible
   ========================================================= */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Color Palette - Playful & Bright */
  --sunny: #FFD166;        /* Sunny Yellow */
  --sky: #38BDF8;          /* Sky Blue */
  --mint: #34D399;         /* Mint Green */
  --coral: #FB7185;        /* Coral Pink */
  --grape: #A78BFA;        /* Grape Purple */
  --peach: #FBCEB1;        /* Soft Peach */
  --lavender: #DDD6FE;     /* Light Lavender */
  
  /* Neutral & Base */
  --cream: #FFFDF7;        /* Warm cream background */
  --paper: #FFFFFF;        /* Pure white cards */
  --ink: #1E1E2E;          /* Dark ink (not pure black) */
  --ink-soft: #6B6B80;     /* Soft gray for secondary text */
  --ink-muted: #A0A0B8;    /* Muted text */
  --border: #E8E8F0;       /* Light border */
  --border-strong: #D0D0E0; /* Stronger border */
  
  /* Semantic Colors */
  --success: #34D399;      /* Mint green */
  --warning: #FFD166;      /* Sunny yellow */
  --error: #FB7185;        /* Coral */
  --info: #38BDF8;         /* Sky blue */
  
  /* Gradients */
  --grad-sun: linear-gradient(135deg, #FFD166 0%, #FFB84D 100%);
  --grad-sky: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
  --grad-mint: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  --grad-coral: linear-gradient(135deg, #FB7185 0%, #F43F5E 100%);
  --grad-grape: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
  --grad-hero: linear-gradient(145deg, #FFFDF7 0%, #F0F9FF 50%, #FDF4FF 100%);
  --grad-card: linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(30, 30, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(30, 30, 46, 0.08);
  --shadow-lg: 0 16px 48px rgba(30, 30, 46, 0.10);
  --shadow-xl: 0 24px 64px rgba(30, 30, 46, 0.12);
  --shadow-pop: 0 6px 0 rgba(30, 30, 46, 0.12); /* 3D button shadow */
  --shadow-pop-hover: 0 10px 0 rgba(30, 30, 46, 0.14);
  --shadow-inner: inset 0 2px 4px rgba(30, 30, 46, 0.04);
  
  /* Typography */
  --font-display: 'Fredoka', system-ui, sans-serif;  /* Headlines, buttons, badges */
  --font-body: 'Nunito', system-ui, sans-serif;      /* Body text, forms */
  --font-mono: 'JetBrains Mono', monospace;          /* Code, numbers */
  
  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  
  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;
  --container-padding: 20px;
  
  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  
  /* Print */
  --print-bg: #FFFFFF;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}
@media (max-width: 768px) {
  html { font-size: 15px; }
}
@media (max-width: 480px) {
  html { font-size: 14px; }
}

body {
  margin: 0;
  background: var(--cream);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 0%, rgba(251, 113, 133, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration: none; transition: color var(--duration-fast) var(--ease-smooth); }
a:hover { color: var(--coral); }
a:focus-visible { outline: 3px solid var(--sunny); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4, h5, h6, .judul {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h4 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

p { max-width: 70ch; margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }

.wadah {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ---- Skip Link (a11y) ---- */
.lewati {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  font-family: var(--font-body);
}
.lewati:focus { left: 0; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 2px solid var(--border);
  transition: box-shadow var(--duration-normal) var(--ease-smooth);
}
.nav.scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--border-strong);
}

.nav-dalam {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo:hover { color: var(--coral); }
.logo svg { width: 36px; height: 36px; }

.nav-tautan {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-tautan a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-body);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast) var(--ease-smooth);
  border: 2px solid transparent;
}
.nav-tautan a:hover {
  color: var(--coral);
  background: var(--peach);
  border-color: var(--coral);
}
.nav-tautan a[aria-current="page"] {
  color: var(--coral);
  background: var(--peach);
  border-color: var(--coral);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}
.btn-lang:hover {
  border-color: var(--sky);
  color: var(--sky);
  background: var(--grad-sky);
  color: var(--paper);
}

.sound-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--paper);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}
.sound-toggle:hover {
  border-color: var(--grape);
  background: var(--grad-grape);
}
.sound-toggle svg { width: 22px; height: 22px; stroke: var(--ink); transition: stroke var(--duration-fast); }
.sound-toggle:hover svg { stroke: var(--paper); }
.sound-toggle.muted svg { stroke: var(--ink-muted); }
.sound-toggle.muted:hover { border-color: var(--ink-muted); background: var(--border); }
.sound-toggle.muted:hover svg { stroke: var(--ink); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}
.nav-toggle:hover { border-color: var(--coral); background: var(--peach); }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--ink); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-tautan {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    padding: var(--space-lg) var(--container-padding) var(--space-xl);
    gap: 8px;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav-tautan.terbuka { display: flex; }
  .nav-tautan a { width: 100%; text-align: center; }
  .nav-actions { width: 100%; justify-content: center; flex-wrap: wrap; }
}

/* =========================================================
   BUTTONS - 3D Tactile Style
   ========================================================= */
.tombol {
  --btn-bg: var(--sky);
  --btn-text: var(--paper);
  --btn-shadow: var(--sky);
  --btn-border: transparent;
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: 3px solid var(--btn-border);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--btn-shadow);
  transition: all var(--duration-fast) var(--ease-spring);
  position: relative;
  overflow: hidden;
}
.tombol::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.tombol:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 var(--btn-shadow);
}
.tombol:hover::before { opacity: 1; }
.tombol:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--btn-shadow);
  transition: transform 50ms var(--ease-smooth);
}
.tombol:focus-visible {
  outline: 3px solid var(--sunny);
  outline-offset: 4px;
}

/* Button Variants */
.tombol-utama { --btn-bg: var(--sky); --btn-shadow: var(--sky); --btn-text: var(--paper); }
.tombol-utama:hover { --btn-bg: #0EA5E9; --btn-shadow: #0EA5E9; }

.tombol-coral { --btn-bg: var(--coral); --btn-shadow: var(--coral); --btn-text: var(--paper); }
.tombol-coral:hover { --btn-bg: #F43F5E; --btn-shadow: #F43F5E; }

.tombol-mint { --btn-bg: var(--mint); --btn-shadow: var(--mint); --btn-text: var(--ink); }
.tombol-mint:hover { --btn-bg: #10B981; --btn-shadow: #10B981; }

.tombol-grape { --btn-bg: var(--grape); --btn-shadow: var(--grape); --btn-text: var(--paper); }
.tombol-grape:hover { --btn-bg: #8B5CF6; --btn-shadow: #8B5CF6; }

.tombol-sunny { --btn-bg: var(--sunny); --btn-shadow: var(--sunny); --btn-text: var(--ink); }
.tombol-sunny:hover { --btn-bg: #FFB84D; --btn-shadow: #FFB84D; }

.tombol-luar {
  --btn-bg: transparent;
  --btn-text: var(--ink);
  --btn-border: var(--ink);
  --btn-shadow: var(--ink);
  color: var(--ink);
  background: transparent;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
}
.tombol-luar:hover {
  --btn-bg: var(--ink);
  --btn-text: var(--paper);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 10px 0 var(--ink);
}
.tombol-luar:active { box-shadow: 0 2px 0 var(--ink); }

.tombol-kecil {
  padding: 10px 20px;
  font-size: 0.92rem;
  box-shadow: 0 4px 0 var(--btn-shadow);
}
.tombol-kecil:hover { box-shadow: 0 8px 0 var(--btn-shadow); }
.tombol-kecil:active { box-shadow: 0 1px 0 var(--btn-shadow); }

.tombol-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}
.tombol-icon svg { width: 22px; height: 22px; }

/* Disabled state */
.tombol:disabled,
.tombol[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 0 var(--btn-shadow) !important;
}

/* Loading state */
.tombol.loading {
  pointer-events: none;
}
.tombol.loading .btn-text { opacity: 0; }
.tombol.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 3px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-2xl);
  align-items: center;
  position: relative;
  overflow: visible;
}
@media (max-width: 880px) {
  .hero { 
    grid-template-columns: 1fr; 
    padding-top: var(--space-xl); 
    text-align: center; 
  }
}

.hero-label {
  display: inline-block;
  background: var(--grad-sun);
  color: var(--ink);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  transform: rotate(-3deg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--ink);
}
@media (max-width: 880px) {
  .hero-label { transform: rotate(0deg); margin: 0 auto var(--space-md); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: var(--space-md);
}
.hero p.sub {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin-bottom: var(--space-xl);
  max-width: 55ch;
}
@media (max-width: 880px) {
  .hero p.sub { margin-left: auto; margin-right: auto; }
}

.hero-aksi { display: flex; gap: var(--space-md); flex-wrap: wrap; }
@media (max-width: 880px) {
  .hero-aksi { justify-content: center; }
}

/* Hero Doodle */
.hero-doodle { position: relative; display: flex; justify-content: center; }
.hero-doodle svg { width: 100%; height: auto; max-width: 420px; filter: drop-shadow(0 20px 40px rgba(30,30,46,0.12)); }

/* Floating shapes animation */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes float-reverse {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(15px) rotate(-2deg); }
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.hero-doodle .float-1 { animation: float 6s ease-in-out infinite; }
.hero-doodle .float-2 { animation: float-reverse 7s ease-in-out infinite; }
.hero-doodle .pulse { animation: pulse-soft 4s ease-in-out infinite; }
.hero-doodle .wiggle { animation: wiggle 3s ease-in-out infinite; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  .hero-doodle * { animation: none !important; }
}

/* =========================================================
   GRID KATEGORI (Sticker Style)
   ========================================================= */
.grid-kategori {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin: var(--space-xl) 0 var(--space-2xl);
}
@media (max-width: 480px) {
  .grid-kategori { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.stiker {
  background: var(--grad-card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  display: block;
  position: relative;
  transition: all var(--duration-normal) var(--ease-spring);
  box-shadow: var(--shadow-md);
}
.stiker:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.02) !important;
  box-shadow: var(--shadow-xl);
  border-color: var(--coral);
  z-index: 1;
}
.stiker:focus-visible {
  outline: 3px solid var(--sunny);
  outline-offset: 4px;
}

/* Random rotations for sticker feel */
.stiker:nth-child(6n+1) { transform: rotate(-2deg); }
.stiker:nth-child(6n+2) { transform: rotate(1.5deg); }
.stiker:nth-child(6n+3) { transform: rotate(-1deg); }
.stiker:nth-child(6n+4) { transform: rotate(2deg); }
.stiker:nth-child(6n+5) { transform: rotate(-1.5deg); }
.stiker:nth-child(6n+6) { transform: rotate(1deg); }
.stiker:hover:nth-child(6n+1),
.stiker:hover:nth-child(6n+2),
.stiker:hover:nth-child(6n+3),
.stiker:hover:nth-child(6n+4),
.stiker:hover:nth-child(6n+5),
.stiker:hover:nth-child(6n+6) { transform: rotate(0deg) translateY(-6px) scale(1.02) !important; }

/* Colored bottom borders */
.stiker:nth-child(5n+1) { border-bottom: 6px solid var(--sky); }
.stiker:nth-child(5n+2) { border-bottom: 6px solid var(--coral); }
.stiker:nth-child(5n+3) { border-bottom: 6px solid var(--mint); }
.stiker:nth-child(5n+4) { border-bottom: 6px solid var(--grape); }
.stiker:nth-child(5n+5) { border-bottom: 6px solid var(--sunny); }

.stiker .ikon { font-size: 2.5rem; display: block; margin-bottom: var(--space-sm); filter: drop-shadow(0 2px 4px rgba(30,30,46,0.1)); }
.stiker .nama { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.3; }

/* Badge on sticker */
.stiker .badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--grad-coral);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* =========================================================
   WORKSHEET CARDS (Catalog)
   ========================================================= */
.grid-worksheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
}
@media (max-width: 480px) {
  .grid-worksheet { grid-template-columns: 1fr; }
}

.kartu-ws-wrap { display: flex; flex-direction: column; }

.kartu-ws {
  background: var(--grad-card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: block;
  flex: 1;
  transition: all var(--duration-normal) var(--ease-spring);
  box-shadow: var(--shadow-md);
  position: relative;
}
.kartu-ws:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: var(--shadow-xl);
  border-color: var(--sky);
}
.kartu-ws:focus-visible { outline: 3px solid var(--sunny); outline-offset: 4px; }

.kartu-ws .pratinjau {
  aspect-ratio: 4/3;
  background: var(--grad-sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-bottom: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.kartu-ws .pratinjau img {
  width: 100%; height: 100%; object-fit: cover;
}
.kartu-ws .pratinjau::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(30,30,46,0.08) 100%);
  pointer-events: none;
}

.kartu-ws .isi { padding: var(--space-md) var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); }
.kartu-ws .nama { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.kartu-ws .meta { font-size: 0.85rem; color: var(--ink-muted); font-weight: 500; }

.kartu-ws-wrap .tombol {
  margin-top: var(--space-sm);
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.kartu-ws-wrap .tombol:hover {
  opacity: 0.95;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

/* =========================================================
   GENERATOR STUDIO (Worksheet Page)
   ========================================================= */
.area-generator {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--space-xl);
  margin: var(--space-xl) 0 var(--space-2xl);
  align-items: start;
}
@media (max-width: 980px) {
  .area-generator { grid-template-columns: 1fr; }
}

.panel {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  max-height: calc(100vh - var(--header-height) - var(--space-2xl));
  overflow-y: auto;
}
@media (max-width: 980px) {
  .panel { position: static; max-height: none; }
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.panel h3::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--grad-coral);
  border-radius: 50%;
}

.panel label {
  display: block;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin: var(--space-lg) 0 var(--space-xs);
  color: var(--ink);
}
.panel label:first-child { margin-top: 0; }

.panel select,
.panel input[type="text"],
.panel input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
  transition: all var(--duration-fast) var(--ease-smooth);
}
.panel select:hover,
.panel input:hover { border-color: var(--sky); }
.panel select:focus,
.panel input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.kotak-centang { 
  display: flex; 
  align-items: center; 
  gap: var(--space-sm); 
  font-weight: 600; 
  font-size: 0.92rem; 
  margin: var(--space-md) 0; 
  cursor: pointer;
}
.kotak-centang input { 
  width: 22px; 
  height: 22px; 
  accent-color: var(--coral);
  cursor: pointer;
}

/* Preview Canvas Area */
.kanvas-wrap {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: var(--shadow-lg);
  min-height: 600px;
}

#kanvas { 
  border: 2px solid var(--border); 
  max-width: 100%; 
  height: auto; 
  background: var(--paper); 
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner);
}

/* Generator Actions in Preview */
.generator-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* =========================================================
   CATALOG PAGE ENHANCEMENTS
   ========================================================= */
.kategori-bagian {
  margin-bottom: var(--space-2xl);
}
.kategori-bagian h2 {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.kategori-bagian h2::before {
  content: '';
  width: 8px;
  height: 1.2em;
  background: var(--grad-coral);
  border-radius: 4px;
}
.kategori-bagian p { color: var(--ink-soft); max-width: 60ch; }

.sub-kategori { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.sub-kategori .stiker { flex: 1 1 200px; min-width: 180px; }

/* =========================================================
   BREADCRUMB
   ========================================================= */
.remah {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: var(--space-lg) 0;
}
.remah a { color: var(--ink-muted); text-decoration: none; font-weight: 500; transition: color var(--duration-fast); }
.remah a:hover { color: var(--sky); text-decoration: underline; }
.remah span { color: var(--ink); font-weight: 600; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 3px solid var(--ink);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
  background: var(--grad-hero);
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sky), var(--mint), var(--sunny), var(--coral), var(--grape));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }

.footer h4 { font-family: var(--font-display); margin-bottom: var(--space-md); font-size: 1.1rem; color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--space-sm); }
.footer a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; transition: all var(--duration-fast); display: inline-block; }
.footer a:hover { color: var(--coral); transform: translateX(4px); }

.footer-bawah {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.footer-bawah .social { display: flex; gap: var(--space-md); }
.footer-bawah .social a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--paper); border: 2px solid var(--border); color: var(--ink-muted); transition: all var(--duration-fast); }
.footer-bawah .social a:hover { border-color: var(--sky); color: var(--sky); background: var(--grad-sky); color: var(--paper); transform: translateY(-2px); }

/* =========================================================
   SEARCH & FILTER (Catalog)
   ========================================================= */
.search-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  align-items: center;
  background: var(--paper);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-md);
}
@media (max-width: 640px) {
  .search-filter { flex-direction: column; align-items: stretch; }
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-box label { position: absolute; left: -9999px; }
.search-box input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 3px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  transition: all var(--duration-fast);
}
.search-box input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
  background: var(--paper);
}
.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  stroke: var(--ink-muted);
  pointer-events: none;
}
.search-box input:focus + svg { stroke: var(--sky); }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.filter-chip {
  padding: 8px 16px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
}
.filter-chip:hover {
  border-color: var(--sky);
  color: var(--sky);
}
.filter-chip.active {
  background: var(--grad-sky);
  border-color: var(--sky);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}
.filter-chip:focus-visible { outline: 3px solid var(--sunny); outline-offset: 2px; }

/* =========================================================
   CONFETTI & INTERACTION EFFECTS
   ========================================================= */
.confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: var(--z-toast);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}
@media (max-width: 480px) {
  .toast-container { left: var(--space-md); right: var(--space-md); bottom: var(--space-md); }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--ink);
  transform: translateX(120%);
  opacity: 0;
  animation: toast-in 0.4s var(--ease-spring) forwards;
  pointer-events: auto;
}
.toast.removing { animation: toast-out 0.3s var(--ease-smooth) forwards; }
@keyframes toast-in { to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }
.toast.success { border-left: 6px solid var(--mint); }
.toast.info { border-left: 6px solid var(--sky); }
.toast.warning { border-left: 6px solid var(--sunny); }
.toast.error { border-left: 6px solid var(--coral); }

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  .nav, .hero, .hero-doodle, .footer, .panel, .tombol, .search-filter,
  .generator-actions, .hero-aksi, .nav-toggle, .sound-toggle, .btn-lang,
  .kartu-ws-wrap .tombol, .back-link, .breadcrumb, .stiker .badge {
    display: none !important;
  }
  body { background: var(--print-bg) !important; background-image: none !important; }
  .kanvas-wrap { border: none !important; padding: 0 !important; box-shadow: none !important; min-height: auto !important; }
  #kanvas { border: none !important; box-shadow: none !important; border-radius: 0 !important; page-break-inside: avoid; }
  .area-generator { display: block !important; }
  .panel { display: none !important; }
  .wadah { max-width: 100% !important; padding: 0 !important; }
  .kartu-ws-wrap { page-break-inside: avoid; }
  @page { margin: 0; size: A4; }
  html, body { width: 210mm; height: 297mm; }
}

/* =========================================================
   RESPONSIVE UTILITIES
   ========================================================= */
@media (max-width: 640px) {
  :root { --container-padding: 16px; --header-height: 64px; }
  .stiker { padding: var(--space-lg) var(--space-sm); }
  .stiker .ikon { font-size: 2rem; }
  .kategori-bagian h2 { font-size: 1.5rem; }
  .grid-kategori { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-sm); }
  .grid-worksheet { grid-template-columns: 1fr; }
  .hero { padding: var(--space-2xl) 0 var(--space-xl); }
  .hero h1 { font-size: 2.25rem; }
  .hero-aksi { flex-direction: column; width: 100%; }
  .hero-aksi .tombol { width: 100%; }
  .panel { padding: var(--space-md); }
  .kanvas-wrap { padding: var(--space-md); min-height: auto; }
  .generator-actions { flex-direction: column; }
  .generator-actions .tombol { width: 100%; }
  .search-filter { flex-direction: column; align-items: stretch; }
  .filter-chips { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-bawah { flex-direction: column; text-align: center; }
  .footer-bawah .social { justify-content: center; }
}

@media (max-width: 480px) {
  :root { --container-padding: 14px; }
  .logo { font-size: 1.4rem; }
  .nav-tautan a { padding: 12px 16px; }
  .tombol { padding: 14px 20px; font-size: 1rem; }
  .tombol-kecil { padding: 10px 16px; font-size: 0.88rem; }
}

/* =========================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================= */
/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: var(--ink);
    --border-strong: var(--ink);
    --ink-soft: var(--ink);
    --ink-muted: var(--ink);
  }
  .tombol { border-width: 4px; }
  .kartu-ws, .stiker, .panel { border-width: 4px; }
}

/* Large text scaling */
html { font-size: clamp(14px, 1.2vw + 0.8rem, 18px); }

/* =========================================================
   ANIMATION KEYFRAMES
   ========================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce-in { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.animate-in { animation: slide-up 0.5s var(--ease-spring) forwards; opacity: 0; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* Stagger animation for grid items */
.grid-kategori .stiker,
.grid-worksheet .kartu-ws-wrap {
  opacity: 0;
  animation: slide-up 0.5s var(--ease-spring) forwards;
}
.grid-kategori .stiker:nth-child(1) { animation-delay: 50ms; }
.grid-kategori .stiker:nth-child(2) { animation-delay: 100ms; }
.grid-kategori .stiker:nth-child(3) { animation-delay: 150ms; }
.grid-kategori .stiker:nth-child(4) { animation-delay: 200ms; }
.grid-kategori .stiker:nth-child(5) { animation-delay: 250ms; }
.grid-kategori .stiker:nth-child(6) { animation-delay: 300ms; }
.grid-kategori .stiker:nth-child(n+7) { animation-delay: 350ms; }

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.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; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.transition { transition: all var(--duration-normal) var(--ease-smooth); }

/* =========================================================
   GRID-BUKU (Textbooks)
   ========================================================= */
.grid-buku { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-lg); }
.kartu-buku { text-decoration: none; color: var(--ink); }
.kartu-buku .sampul { aspect-ratio: 3/4; background: var(--grad-card); border: 3px solid var(--ink); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-sm); box-shadow: var(--shadow-md); transition: all var(--duration-normal); }
.kartu-buku:hover .sampul { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--sky); }
.kartu-buku .sampul img { width: 100%; height: 100%; object-fit: cover; }
.kartu-buku .info h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: var(--space-xs); }
.kartu-buku .info p { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: var(--space-sm); }
.kartu-buku .badge { display: inline-block; background: var(--grad-mint); color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; padding: 4px 10px; border-radius: var(--radius-full); border: 2px solid var(--ink); }

/* Kurikulum bagian */
.kurikulum-bagian { margin-bottom: var(--space-2xl); }
.kurikulum-bagian h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: var(--space-md); padding-bottom: var(--space-sm); border-bottom: 2px solid var(--border); color: var(--ink); }
.grid-buku .kartu-ws-wrap { flex: 1 1 220px; }

/* Legal pages */
.legal-konten { line-height: 1.8; }
.legal-konten h2 { margin-top: var(--space-xl); margin-bottom: var(--space-md); }
.legal-konten p { margin-bottom: var(--space-md); }
.legal-konten ul { padding-left: var(--space-xl); margin: var(--space-md) 0; }
.legal-konten li { margin-bottom: var(--space-sm); }

/* Halaman header */
.halaman-header { margin-bottom: var(--space-xl); }
.halaman-header h1 { margin-bottom: var(--space-sm); }
.halaman-header p { color: var(--ink-soft); max-width: 60ch; }
.tombol.kembali { --btn-bg: transparent; --btn-text: var(--ink); --btn-border: var(--border-strong); --btn-shadow: var(--border-strong); font-size: 0.9rem; padding: 10px 18px; border-radius: var(--radius-md); margin-bottom: var(--space-md); display: inline-flex; }
.tombol.kembali:hover { background: var(--cream); color: var(--coral); border-color: var(--coral); box-shadow: 0 4px 0 var(--coral); }

/* =========================================================
   BLOG POST STYLES (Existing - Enhanced)
   ========================================================= */
.blog-post { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-xl); margin: var(--space-xl) 0 var(--space-2xl); padding: var(--space-2xl) var(--space-xl); box-shadow: var(--shadow-lg); }
@media (max-width: 640px) { .blog-post { padding: var(--space-lg) var(--space-md); margin: var(--space-lg) 0 var(--space-xl); } }
.blog-header { margin-bottom: var(--space-xl); padding-bottom: var(--space-lg); border-bottom: 2px dashed var(--border); }
.blog-meta { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); font-size: 0.9rem; color: var(--ink-soft); margin-bottom: var(--space-md); }
.blog-category { display: inline-flex; align-items: center; gap: 6px; background: var(--grad-sky); color: var(--paper); font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; padding: 6px 14px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.02em; border: 2px solid var(--ink); }
.blog-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: var(--space-md); line-height: 1.2; }
.blog-excerpt { font-size: 1.15rem; color: var(--ink-soft); line-height: 1.7; max-width: 70ch; margin: 0; font-weight: 400; }
.blog-content { font-size: 1.05rem; line-height: 1.8; }
.blog-content > * + * { margin-top: 1.5em; }
.blog-content h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 2.5em 0 1em; padding-bottom: 0.3em; border-bottom: 3px solid var(--sky); color: var(--ink); font-weight: 800; }
.blog-content h3 { font-size: 1.2rem; margin: 1.8em 0 0.8em; color: var(--ink); }
.blog-content p { margin: 1em 0; max-width: 72ch; line-height: 1.85; }
.blog-content ul, .blog-content ol { margin: 1.2em 0; padding-left: 1.8em; }
.blog-content li { margin: 0.6em 0; line-height: 1.75; max-width: 72ch; }
.blog-content li::marker { color: var(--sky); font-weight: 700; }
.blog-content a { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.blog-content a:hover { color: var(--coral); }
.blog-content blockquote { border-left: 4px solid var(--sky); background: var(--cream); padding: 1.2em 1.5em; margin: 1.5em 0; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; font-style: italic; color: var(--ink); }
.blog-content blockquote p:first-child { margin-top: 0; }
.blog-content blockquote p:last-child { margin-bottom: 0; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 1.5em 0; display: grid; gap: var(--space-sm); }
.checklist li { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-lg); padding: var(--space-md) var(--space-lg); display: flex; align-items: flex-start; gap: var(--space-md); transition: all var(--duration-fast) var(--ease-spring); box-shadow: var(--shadow-sm); }
.checklist li:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--coral); }
.checklist li::before { content: "✓"; flex-shrink: 0; width: 32px; height: 32px; background: var(--grad-mint); color: var(--paper); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }
.checklist li strong { display: block; margin-bottom: 4px; color: var(--ink); font-family: var(--font-display); }
.checklist li p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Generator CTA */
.generator-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-md); margin: var(--space-xl) 0; }
.cta-card { background: var(--grad-card); border: 3px solid var(--ink); border-radius: var(--radius-xl); padding: var(--space-xl) var(--space-lg); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: var(--space-sm); transition: all var(--duration-normal) var(--ease-spring); box-shadow: var(--shadow-md); }
.cta-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--sky); }
.cta-card .cta-icon { font-size: 3rem; line-height: 1; }
.cta-card .cta-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.cta-card .cta-desc { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.cta-card .cta-arrow { margin-top: auto; align-self: flex-end; font-size: 1.5rem; color: var(--sky); transition: transform var(--duration-fast); }
.cta-card:hover .cta-arrow { transform: translateX(6px); }

/* Blog CTA Section */
.blog-cta { background: linear-gradient(135deg, var(--lavender) 0%, var(--peach) 100%); border: 3px solid var(--ink); border-radius: var(--radius-xl); padding: var(--space-2xl) var(--space-lg); margin: var(--space-2xl) 0; text-align: center; }
@media (max-width: 640px) { .blog-cta { padding: var(--space-xl) var(--space-md); } }
.blog-cta h3 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 var(--space-sm); color: var(--ink); }
.blog-cta p { color: var(--ink-soft); margin: 0 0 var(--space-xl); max-width: 60ch; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }
.cta-buttons .tombol { min-width: 180px; }

/* Tags */
.blog-tags { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-xl) 0 var(--space-lg); }
.blog-tags a, .blog-tags span { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--border-strong); border-radius: var(--radius-full); padding: 8px 16px; font-size: 0.82rem; font-weight: 600; font-family: var(--font-display); color: var(--ink-soft); text-decoration: none; transition: all var(--duration-fast) var(--ease-spring); }
.blog-tags a:hover { border-color: var(--sky); color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Blog Share */
.blog-share { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 2px dashed var(--border); }
.blog-share span { font-weight: 700; font-family: var(--font-display); font-size: 0.9rem; color: var(--ink-soft); }
.blog-share a { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--border-strong); border-radius: var(--radius-full); padding: 10px 18px; font-size: 0.85rem; font-weight: 700; font-family: var(--font-display); color: var(--ink); text-decoration: none; transition: all var(--duration-fast) var(--ease-spring); }
.blog-share a:hover { border-color: var(--sky); color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Blog Nav */
.blog-nav { display: flex; justify-content: space-between; gap: var(--space-md); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 2px dashed var(--border); }
.blog-nav a { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-lg); padding: 12px 20px; font-weight: 700; font-family: var(--font-display); font-size: 0.9rem; color: var(--ink); text-decoration: none; transition: all var(--duration-fast) var(--ease-spring); max-width: 45%; box-shadow: var(--shadow-sm); }
.blog-nav a:hover { border-color: var(--sky); color: var(--sky); transform: translateY(-2px); box-shadow: var(--shadow-md); }
@media (max-width: 640px) { .blog-nav { flex-direction: column; } .blog-nav a { max-width: 100%; justify-content: center; } }

/* Related Posts */
.related-posts { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 3px solid var(--ink); }
.related-posts h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 var(--space-xl); color: var(--ink); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
.related-card { background: var(--grad-card); border: 3px solid var(--ink); border-radius: var(--radius-xl); padding: var(--space-lg); text-decoration: none; color: var(--ink); display: block; transition: all var(--duration-normal) var(--ease-spring); box-shadow: var(--shadow-md); }
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--sky); }
.related-card time { font-size: 0.8rem; color: var(--ink-muted); display: block; margin-bottom: var(--space-sm); font-weight: 500; }
.related-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; margin: 0 0 var(--space-sm); color: var(--ink); }
.related-card p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; line-height: 1.5; }

/* CTA Card Generator Links */
.cta-card { display: inline-flex; flex-direction: column; align-items: center; text-align: center; background: var(--grad-card); border: 3px solid var(--ink); border-radius: var(--radius-xl); padding: var(--space-xl) var(--space-lg); text-decoration: none; color: var(--ink); min-width: 200px; transition: all var(--duration-normal) var(--ease-spring); box-shadow: var(--shadow-md); }
.cta-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--sky); }
.cta-card .cta-icon { font-size: 3rem; margin-bottom: var(--space-sm); }
.cta-card .cta-title { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--ink); margin-bottom: var(--space-xs); }
.cta-card .cta-desc { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .blog-nav a { max-width: 100%; justify-content: center; }
  .blog-nav { flex-direction: column; }
  .cta-buttons { flex-direction: column; }
  .cta-buttons .tombol { width: 100%; }
  .blog-share { flex-wrap: wrap; }
  .blog-meta { flex-direction: column; gap: var(--space-sm); }
}

/* =========================================================
   FOKUS KEYBOARD
   ========================================================= */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--sunny);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   AD SLOT
   ========================================================= */
.slot-iklan { margin: var(--space-md) 0 var(--space-xl); min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 0.78rem; border: 2px dashed var(--border); border-radius: var(--radius-md); }

/* =========================================================
   EMPTY STATES
   ========================================================= */
.empty-state { text-align: center; padding: var(--space-3xl) var(--space-xl); }
.empty-state .icon { font-size: 4rem; margin-bottom: var(--space-lg); opacity: 0.5; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: var(--space-sm); color: var(--ink); }
.empty-state p { color: var(--ink-soft); max-width: 40ch; margin: 0 auto var(--space-xl); }

/* =========================================================
   PLAYFUL EDTECH POLISH & FIXES
   ========================================================= */
.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--grad-sun);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 1.35rem;
}
.btn-lang {
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  background: #FFF9DB;
  font-weight: 700;
}
.btn-lang:hover {
  background: var(--sky);
  color: var(--paper);
  transform: translateY(-2px);
}

.kategori-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sub-kategori {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.panel select {
  cursor: pointer;
  font-weight: 600;
}

.kanvas-wrap {
  background:
    radial-gradient(#CBD5E1 1.5px, transparent 1.5px),
    #F1F5F9;
  background-size: 20px 20px;
}

#kanvas {
  border: 3px solid var(--ink);
  box-shadow: 0 14px 30px rgba(30, 30, 46, 0.14);
}
/* =========================================================
   REDESAIN 2026-11-20 — Playful & Interaktif (kid-first)
   Ditambahkan saat port desain baru yang disetujui Eric.
   Aturan: animasi TIDAK PERNAH di tombol interaktif itu sendiri
   (pernah membekukan halaman) — animasi selalu di <span> dalam.
   ========================================================= */

/* ---- Pemilih umur (hero + filter) ---- */
.pilih-umur-wrap { margin-top: var(--space-lg); }
.pilih-umur-judul {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}
.pilih-umur-judul .sunau-mini { display: inline-block; animation: goyang-lembut 2.4s ease-in-out infinite; }
.pilih-umur {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.pilih-umur-btn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 20px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) var(--ease-spring), background var(--duration-fast);
}
.pilih-umur-btn:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 7px 0 var(--ink); }
.pilih-umur-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.pilih-umur-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.pilih-umur-btn.umur-paud { background: var(--grad-mint); }
.pilih-umur-btn.umur-tk { background: var(--grad-sky); color: var(--paper); }
.pilih-umur-btn.umur-sd1-2 { background: var(--grad-grape); color: var(--paper); }
.pilih-umur-btn.umur-sd3-5 { background: var(--grad-coral); color: var(--paper); }
.pilih-umur-btn.umur-all { background: var(--grad-sun); }
.pilih-umur-btn.active {
  box-shadow: 0 2px 0 var(--ink), 0 0 0 4px var(--sunny);
  transform: translateY(2px) scale(1.04);
}

/* Chip umur di bilah filter (perilaku sama dengan pemilih umur hero) */
.chip-umur {
  padding: 8px 16px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--paper);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
}
.chip-umur:hover { border-color: var(--sunny); color: var(--ink); }
.chip-umur.active {
  background: var(--grad-sun);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.chip-umur:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.filter-umur-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
  align-self: center;
  margin-right: 2px;
}

/* ---- Maskot Sunau (matahari ramah) ---- */
.sunau-maskot { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.sunau-btn { background: none; border: none; padding: 0; cursor: pointer; }
.sunau-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 6px; border-radius: 50%; }
.sunau-maskot svg { width: 100%; height: auto; max-width: 340px; filter: drop-shadow(0 20px 40px rgba(30,30,46,0.12)); }
.sunau-putar { animation: putar-pelan 36s linear infinite; transform-box: fill-box; transform-origin: center; }
.sunau-goyang { animation: goyang-lembut 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.sunau-bubble {
  position: relative;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  max-width: 340px;
  text-align: center;
}
.sunau-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
@media (max-width: 880px) {
  .sunau-bubble { order: -1; }
}

/* ---- Huruf & angka melayang (hero) ---- */
/* PENTING: animasi melayang hanya di <span> dalam tombol — tombolnya statis. */
.huruf-melayang {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-md) 0 var(--space-lg);
}
.huruf-btn {
  width: 64px;
  height: 64px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  padding: 0;
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast);
}
.huruf-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ink); }
.huruf-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.huruf-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.huruf-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  animation: melayang 3.2s ease-in-out infinite;
}
.huruf-btn:nth-child(2) span { animation-delay: 0.4s; }
.huruf-btn:nth-child(3) span { animation-delay: 0.8s; }
.huruf-btn:nth-child(4) span { animation-delay: 0.2s; }
.huruf-btn:nth-child(5) span { animation-delay: 0.6s; }
.huruf-btn:nth-child(6) span { animation-delay: 1s; }
.huruf-btn:nth-child(7) span { animation-delay: 0.5s; }
.huruf-btn span.memantul { animation: memantul 0.55s var(--ease-bounce); }
.huruf-sunny span { color: #B7791F; background: var(--grad-sun); border-radius: 13px; }
.huruf-sky span { color: #0369A1; background: var(--grad-sky); border-radius: 13px; }
.huruf-mint span { color: #065F46; background: var(--grad-mint); border-radius: 13px; }
.huruf-coral span { color: #9F1239; background: var(--grad-coral); border-radius: 13px; }
.huruf-grape span { color: #5B21B6; background: var(--grad-grape); border-radius: 13px; }
@media (max-width: 480px) {
  .huruf-btn { width: 52px; height: 52px; }
  .huruf-btn span { font-size: 1.45rem; }
}

/* ---- Ubin mainan (chunky tiles) ---- */
.stiker .ikon { font-size: 3rem; }
.stiker:hover .ikon { animation: goyang-lembut 0.6s ease-in-out; }
.stiker.umur-cocok { outline: 4px solid var(--sunny); outline-offset: 2px; }
.kategori-bagian.umur-cocok { background: rgba(255, 209, 102, 0.14); border-radius: var(--radius-xl); }
.kategori-bagian.umur-redup,
.stiker.umur-redup { opacity: 0.35 !important; filter: saturate(0.4); }
.kategori-bagian, .stiker { transition: opacity var(--duration-normal) var(--ease-smooth), filter var(--duration-normal) var(--ease-smooth), outline-color var(--duration-fast); }

/* Ubin "Segera hadir" — bukan tautan, jadi tidak ada dead link */
.stiker.segera-hadir { cursor: default; opacity: 0.8; }
.stiker.segera-hadir:hover { transform: none !important; box-shadow: var(--shadow-md); border-color: var(--ink); }
.stiker.segera-hadir:hover .ikon { animation: none; }
.stiker .badge.segera { background: var(--grad-sun); color: var(--ink); }

/* ---- Tombol besar + skor bintang (halaman generator) ---- */
.tombol-besar {
  font-size: 1.25rem !important;
  padding: 18px 28px !important;
  width: 100%;
}
.bintang-skor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  background: var(--grad-sun);
  border: 3px solid var(--ink);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  margin: 0 auto;
}
.bintang-skor .bintang-jumlah { min-width: 1.2em; text-align: center; }
.bintang-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-weight: 800;
  background: var(--grad-sun);
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* ---- Keyframe baru ---- */
@keyframes melayang {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}
@keyframes memantul {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-6deg); }
  65% { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1); }
}
@keyframes goyang-lembut {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes putar-pelan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Gerakan baru ikut aturan reduced-motion yang sudah ada */
@media (prefers-reduced-motion: reduce) {
  .sunau-putar, .sunau-goyang, .huruf-btn span, .pilih-umur-judul .sunau-mini, .stiker:hover .ikon { animation: none !important; }
}

/* Elemen desain baru tidak ikut tercetak */
@media print {
  .pilih-umur-wrap, .huruf-melayang, .sunau-maskot, .bintang-skor, .bintang-nav, .chip-umur, .filter-umur-label, .hub-paud-banner, .hub-lompat { display: none !important; }
}

/* =========================================================
   HUB PAUD 2026-11-20 — satu halaman untuk semua generator usia 3-6
   Banner di hero beranda + halaman /paud/ (buildPaudHub di build.js).
   Memakai ulang .stiker / .sub-kategori / .pilih-umur-btn / .sunau-maskot.
   ========================================================= */
.hub-paud-banner {
  margin-top: var(--space-lg);
  background: var(--grad-sun);
  border: 3px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.hub-paud-banner p { margin: 0; font-weight: 600; flex: 1 1 240px; }
@media (max-width: 880px) {
  .hub-paud-banner { justify-content: center; text-align: center; }
}

.hub-atas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.hub-lompat {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.hub-lompat .pilih-umur-btn { text-decoration: none; }
.hub-bagian { scroll-margin-top: 90px; }
.hub-kategori { margin-bottom: var(--space-xl); }
.hub-kategori h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hub-hitung {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--grad-sun);
  border: 2px solid var(--ink);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.hub-hitung-besar { font-size: 1rem; padding: 6px 14px; }
