@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Design System — Sekolah Ceria
   Exact replica of original React / Next.js / Tailwind styles
   Orange dominant. Playful & modern kid education network.
   ============================================================ */

:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;

  --color-bg: #ffffff;
  --color-bg-off: #fffaf3;
  --color-surface: #ffffff;
  --color-border: #f5e6d3;
  --color-border-strong: #ecc7a3;
  --color-ink: #3e2f23;
  --color-ink-soft: #6b5847;
  --color-ink-mute: #94816e;
  --color-accent: #ffa726;
  --color-accent-strong: #fb8c00;
  --color-accent-dark: #e65100;
  --color-accent-soft: #fff4e0;
  --color-on-accent: #ffffff;

  --radius-card: 1rem;
  --radius-pill: 9999px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-ink);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Typography Tokens */
.text-display {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.text-h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.text-h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
}

.text-body {
  font-size: 1rem;
  line-height: 1.6;
}

.text-caption {
  font-size: 0.875rem;
  line-height: 1.5;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
}

/* Layout Utilities */
.container-ui {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 72rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container-ui {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-ui {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Responsive Display Utilities (Ensures zero FOUC and full offline resilience) */
.hidden {
  display: none;
}

@media (max-width: 767px) {
  .hidden.md\:block,
  .hidden.md\:flex,
  .hidden.md\:grid {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .md\:hidden {
    display: none !important;
  }
  .md\:flex {
    display: flex !important;
  }
  .md\:grid {
    display: grid !important;
  }
  .md\:block {
    display: block !important;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-accent);
  color: var(--color-on-accent);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(255, 167, 38, 0.25);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--color-accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(251, 140, 0, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background-color: var(--color-surface);
  color: var(--color-ink);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: rgba(62, 47, 35, 0.3);
  background-color: var(--color-bg-off);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

/* Background Utility Classes */
.bg-bg-off {
  background-color: var(--color-bg-off);
}

.bg-accent-soft {
  background-color: var(--color-accent-soft);
}

.text-accent {
  color: var(--color-accent);
}

.text-ink {
  color: var(--color-ink);
}

.text-ink-soft {
  color: var(--color-ink-soft);
}

.text-ink-mute {
  color: var(--color-ink-mute);
}

.border-border {
  border-color: var(--color-border);
}

/* Section Decorators */
section#unit,
section#fasilitas,
section#gallery,
section#pendaftaran,
section#contact {
  position: relative;
  scroll-margin-top: 5rem;
}

section#unit::before,
section#fasilitas::before,
section#contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 167, 38, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Card Enhanced */
.card-enhanced {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(255, 167, 38, 0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-enhanced:hover {
  box-shadow: 0 8px 30px rgba(255, 167, 38, 0.12);
  transform: translateY(-2px);
}

/* Facility Grid & Card */
.facility-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .facility-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .facility-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.facility-card {
  position: relative;
  border-radius: 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.facility-card:hover {
  box-shadow: 0 6px 24px rgba(255, 167, 38, 0.14);
  transform: translateY(-3px);
}

.facility-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, #ffa726);
  border-radius: 4px 0 0 4px;
}

.facility-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem 1.25rem;
}

.facility-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.facility-card-header > div {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.facility-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facility-card-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facility-card-body {
  padding: 0.5rem 1rem 1rem 1.25rem;
  list-style: none;
  margin: 0;
}

@media (max-width: 639px) {
  .facility-card-header {
    padding: 0.875rem 0.875rem 0.625rem 1rem;
  }
  .facility-card-body {
    padding: 0.375rem 0.875rem 0.875rem 1rem;
  }
  .facility-card-title {
    font-size: 0.875rem;
  }
}

/* ============================================================
   REVEAL FIX: Never hide sections permanently!
   Guaranteed visible by default, smooth animated entrance
   ============================================================ */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

/* ============================================================
   Hero Styles
   ============================================================ */
.hero-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide.active img {
  transform: scale(1.04);
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(62, 47, 35, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-figure {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 42rem;
  max-height: 85vh;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.open .lightbox-figure {
  transform: scale(1);
}

/* ============================================================
   Mobile Drawer Styles
   ============================================================ */
.mobile-drawer-wrapper {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer-wrapper.open {
  pointer-events: auto !important;
  opacity: 1 !important;
}

.mobile-drawer-wrapper .drawer-aside {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
}

.mobile-drawer-wrapper.open .drawer-aside {
  transform: translateX(0) !important;
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION BAR (DIRAPIHKAN KHUSUS)
   ============================================================ */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 0.75rem;
}

@media (min-width: 768px) {
  .mobile-bottom-bar {
    display: none !important;
  }
}

.mobile-bottom-pill {
  pointer-events: auto;
  width: 100%;
  max-width: 27rem;
  margin: 0 auto max(0.65rem, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 167, 38, 0.3);
  border-radius: 1.75rem;
  box-shadow: 
    0 10px 30px -4px rgba(62, 47, 35, 0.12),
    0 2px 10px rgba(255, 167, 38, 0.16);
  padding: 0.35rem 0.5rem;
}

.mobile-nav-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  list-style: none;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.25rem 0.35rem;
  border-radius: 1.125rem;
  color: var(--color-ink-mute);
  text-decoration: none;
  position: relative;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn:active {
  transform: scale(0.92);
}

.mobile-nav-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.75rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-nav-text {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 0.15rem;
  letter-spacing: 0.01em;
  transition: color 0.2s, font-weight 0.2s;
  white-space: nowrap;
}

.mobile-nav-btn.active {
  color: var(--color-accent-dark);
}

.mobile-nav-btn.active .mobile-nav-icon-container {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  transform: translateY(-2px);
}

.mobile-nav-btn.active .mobile-nav-text {
  font-weight: 800;
  color: var(--color-accent-dark);
}

.mobile-nav-btn.is-cta .mobile-nav-icon-container {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(251, 140, 0, 0.38);
}

.mobile-nav-btn.is-cta .mobile-nav-text {
  color: var(--color-accent-dark);
  font-weight: 700;
}

/* ============================================================
   PREMIUM MICRO-ANIMATIONS & EYE-PLEASING VISUAL EFFECTS
   ============================================================ */

/* 1. Hairline Top Reading Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #ffa726 0%, #fb8c00 50%, #ff7043 100%);
  box-shadow: 0 0 12px rgba(255, 167, 38, 0.9), 0 0 4px rgba(251, 140, 0, 0.8);
  z-index: 100;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

/* 2. Directional Scroll Animations (Up & Down Physics) */
.site-header {
  transition:
    transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform;
}

.site-header.nav-hidden {
  transform: translateY(-115%);
}

.site-header.nav-visible {
  transform: translateY(0);
}

.site-header.nav-visible.scrolled #main-nav-pill {
  box-shadow: 0 10px 30px -5px rgba(62, 47, 35, 0.14), 0 0 12px rgba(255, 167, 38, 0.18);
  border-color: rgba(255, 167, 38, 0.4);
}

/* Directional body states */
body.scrolling-up .site-header #main-nav-pill {
  box-shadow: 0 10px 32px -4px rgba(255, 167, 38, 0.22), 0 2px 8px rgba(62, 47, 35, 0.08);
}

body.scrolling-down .mobile-bottom-pill {
  transform: translateY(4px);
  opacity: 0.94;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, box-shadow 0.3s ease;
}

body.scrolling-up .mobile-bottom-pill {
  transform: translateY(0);
  opacity: 1;
  box-shadow: 0 14px 34px -4px rgba(62, 47, 35, 0.18), 0 4px 14px rgba(255, 167, 38, 0.25);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, box-shadow 0.3s ease;
}

/* 3. 3D Perspective Tilt Card with Specular Sheen */
.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tilt-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.32),
    transparent 70%
  );
  transition: opacity 0.3s ease;
  z-index: 5;
}

.tilt-card:hover .tilt-sheen {
  opacity: 1;
}

/* 4. Floating Back to Top Button with Circular Progress */
.back-to-top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 5.75rem;
  z-index: 40;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 167, 38, 0.35);
  box-shadow:
    0 8px 24px -4px rgba(62, 47, 35, 0.16),
    0 2px 10px rgba(255, 167, 38, 0.2);
  color: var(--color-accent-strong);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.85);
  transition:
    opacity 0.3s ease,
    visibility 0.3s,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    color 0.2s;
}

@media (min-width: 768px) {
  .back-to-top-btn {
    bottom: 2rem;
    right: 2rem;
  }
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 30px -4px rgba(251, 140, 0, 0.4);
  color: var(--color-accent-dark);
}

.back-to-top-btn:active {
  transform: scale(0.92);
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.progress-ring-bg {
  stroke: rgba(255, 167, 38, 0.15);
}

.progress-ring-indicator {
  stroke: var(--color-accent);
  stroke-dasharray: 125.66;
  stroke-dashoffset: 125.66;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s ease-out;
}

.back-to-top-icon {
  position: relative;
  z-index: 2;
  transition: transform 0.25s ease;
}

.back-to-top-btn:hover .back-to-top-icon {
  transform: translateY(-2px);
}

/* 5. Joyful Micro-Confetti / Sparkle Burst */
.particle-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform, opacity;
  animation: burstParticle 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes burstParticle {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.15) rotate(var(--rot));
  }
}

/* 6. Mobile Bottom Nav Tap Pop */
@keyframes navPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.24) translateY(-3px); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1) translateY(0); }
}

.mobile-nav-btn.popping .mobile-nav-icon-container {
  animation: navPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 7. Enhanced Card & Section Entrance Delays */
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.facility-grid > :nth-child(1) { transition-delay: 0.05s; }
.facility-grid > :nth-child(2) { transition-delay: 0.15s; }
.facility-grid > :nth-child(3) { transition-delay: 0.25s; }

/* 8. Pulsing Glow on Hero Accent Elements */
@keyframes softPulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.pulse-soft {
  animation: softPulse 3s ease-in-out infinite;
}

