/* ============================================
   DINAS PENDIDIKAN DAN KEBUDAYAAN KAB. KUBU RAYA
   Design System — style.css
   ============================================ */

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

/* ============================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */
:root {
  /* --- Primary Colors --- */
  --primary: #0084c7;
  --primary-rgb: 0, 132, 199;
  --primary-light: #00a5f9;
  --primary-lighter: #38bdf8;
  --primary-dark: #026aa2;
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;

  /* --- Accent / Gold --- */
  --accent: #c69214;
  --accent-rgb: 198, 146, 20;
  --accent-light: #e0b04a;
  --accent-lighter: #f0d060;
  --accent-dark: #a07510;
  --accent-50: #fdf6e3;
  --accent-100: #faeabb;

  /* --- Backgrounds --- */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-dark: #0f172a;
  --bg-dark-secondary: #1e293b;

  /* --- Text --- */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-dark: #f1f5f9;
  --text-on-primary: #ffffff;
  --text-accent: #c69214;

  /* --- Glassmorphism --- */
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-bg-light: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);

  /* --- Borders --- */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-radius-sm: 6px;
  --border-radius: 10px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --shadow-accent: 0 4px 20px rgba(198, 146, 20, 0.3);
  --shadow-primary: 0 4px 20px rgba(26, 54, 93, 0.25);

  /* --- Typography --- */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --text-lg: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --text-xl: clamp(1.15rem, 1rem + 0.5vw, 1.25rem);
  --text-2xl: clamp(1.3rem, 1.1rem + 0.8vw, 1.5rem);
  --text-3xl: clamp(1.6rem, 1.3rem + 1.2vw, 1.875rem);
  --text-4xl: clamp(1.9rem, 1.4rem + 2vw, 2.25rem);
  --text-5xl: clamp(2.2rem, 1.5rem + 3vw, 3rem);
  --text-6xl: clamp(2.5rem, 1.5rem + 4vw, 3.75rem);

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* --- Spacing --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Layout --- */
  --container-max: 1200px;
  --container-wide: 1400px;
  --container-narrow: 800px;

  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 500ms;

  /* --- Z-index --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ============================================
   2. CSS RESET
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-primary);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================
   4. LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: var(--space-16);
}

.section--dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--text-on-dark);
}

.section--alt {
  background-color: var(--bg-secondary);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.section__subtitle {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: block;
}

.section__title {
  margin-bottom: var(--space-4);
}

.section__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin-inline: auto;
}

/* ============================================
   5. SCROLL-DRIVEN ANIMATIONS
   ============================================ */

/* --- Scroll Progress Indicator --- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }

    .scroll-progress {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 3px;
      background: linear-gradient(90deg, var(--accent), var(--accent-light));
      transform-origin: 0 50%;
      animation: grow-progress auto linear;
      animation-timeline: scroll();
      z-index: var(--z-toast);
    }
  }
}

/* --- Scroll Reveal Animations --- */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes reveal-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes reveal-scale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
      animation-fill-mode: both;
      animation-duration: auto;
      animation-timing-function: var(--ease-out);
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }

    .reveal-up { animation-name: reveal-up; }
    .reveal-left { animation-name: reveal-left; }
    .reveal-right { animation-name: reveal-right; }
    .reveal-scale { animation-name: reveal-scale; }
  }
}

/* Fallback: JS-driven animation classes */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.9); }

.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* If native scroll animation is supported, override the JS fallback */
@supports (animation-timeline: view()) {
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    transition: none;
  }

  .reveal-up.is-visible,
  .reveal-left.is-visible,
  .reveal-right.is-visible,
  .reveal-scale.is-visible {
    opacity: unset;
    transform: unset;
  }
}

/* --- Staggered children --- */
.stagger > :nth-child(1) { --stagger-delay: 0ms; }
.stagger > :nth-child(2) { --stagger-delay: 80ms; }
.stagger > :nth-child(3) { --stagger-delay: 160ms; }
.stagger > :nth-child(4) { --stagger-delay: 240ms; }
.stagger > :nth-child(5) { --stagger-delay: 320ms; }
.stagger > :nth-child(6) { --stagger-delay: 400ms; }
.stagger > :nth-child(7) { --stagger-delay: 480ms; }
.stagger > :nth-child(8) { --stagger-delay: 560ms; }

.stagger > * {
  transition-delay: var(--stagger-delay, 0ms);
}

/* ============================================
   6. GLASSMORPHISM
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass--light {
  background: var(--glass-bg-light);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ============================================
   7. 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-width: 0;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.btn-transparansi:hover {
  background-color: var(--primary) !important;
  color: #fff !important;
}

/* ============================================
   8. RESPONSIVE BREAKPOINTS
   ============================================ */
/* Mobile: default (< 640px)
   Tablet: 640px+
   Desktop: 1024px+
   Wide: 1280px+
*/

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-8);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-10);
  }

  .section {
    padding-block: var(--space-24);
  }

  .section--lg {
    padding-block: var(--space-32);
  }
}

/* ============================================
   9. SELECTION & SCROLLBAR
   ============================================ */
::selection {
  background: var(--accent);
  color: var(--primary-dark);
}

/* Modern scrollbar */
@supports (scrollbar-color: auto) {
  html {
    scrollbar-color: var(--primary-200) transparent;
    scrollbar-width: thin;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-200);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}
