/* ===================== TOKENS ===================== */
:root{
  --bg: #F7F9FC;
  --bg-alt: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EFF4FF;
  --border: #E2E8F5;
  --text: #10182B;
  --text-muted: #5B6478;
  --primary: #1D4ED8;
  --primary-dark: #1739A8;
  --primary-tint: #EFF4FF;
  --accent: #F59E0B;
  --accent-tint: #FEF3DE;
  --danger: #E0492A;
  --shadow: 0 18px 40px -22px rgba(16, 24, 43, 0.28);
  --shadow-sm: 0 8px 18px -10px rgba(16, 24, 43, 0.22);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

[data-theme="dark"]{
  --bg: #0B1020;
  --bg-alt: #10162A;
  --surface: #131A30;
  --surface-2: #17203A;
  --border: #232C48;
  --text: #EAEEFC;
  --text-muted: #8D96B5;
  --primary: #5C8DFF;
  --primary-dark: #4472E0;
  --primary-tint: #182444;
  --accent: #F7B750;
  --accent-tint: #2B2313;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 18px -10px rgba(0, 0, 0, 0.5);
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3{
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

p{ margin: 0; }

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

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

.section{
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 24px;
}

.section-alt{ background: var(--bg-alt); border-radius: var(--radius-lg); }

.section-head{
  max-width: 560px;
  margin-bottom: 40px;
}

.section-head h2{
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 800;
}

.section-head p{
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 0.98rem;
}

/* ===================== PROGRESS LINE ===================== */
.progress-line{
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--primary);
  z-index: 1000;
  transition: width .1s linear;
}

/* ===================== NAVBAR ===================== */
.navbar{
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.navbar-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark{
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: 0.95rem;
}

.nav-links{
  display: flex;
  gap: 28px;
}

.nav-link{
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease;
}

.nav-link::after{
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: width .25s ease;
}

.nav-link:hover, .nav-link.active{ color: var(--text); }
.nav-link.active::after{ width: 100%; }

.navbar-actions{ display: flex; align-items: center; gap: 8px; }

.icon-btn{
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, transform .15s ease;
}

.icon-btn:hover{ border-color: var(--primary); }
.icon-btn:active{ transform: scale(0.94); }

.hamburger{ display: none; }

.mobile-menu{
  display: none;
  flex-direction: column;
  position: sticky;
  top: 65px;
  z-index: 899;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}

.mobile-menu.open{ max-height: 260px; }

.mobile-menu a{
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  color: var(--text);
}

/* ===================== HERO ===================== */
.hero{
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.class-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.hero-copy h1{
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.1;
}

.hero-school{
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
}

.hero-desc{
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.btn-primary{
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover{ background: var(--primary-dark); transform: translateY(-2px); }

.btn-outline{
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover{ border-color: var(--primary); transform: translateY(-2px); }

.hero-facts{
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.fact{
  display: flex;
  align-items: center;
  gap: 12px;
}

.fact i{
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
}

.fact span{ display: block; font-size: 0.78rem; color: var(--text-muted); }
.fact strong{ font-size: 0.92rem; }

/* ---- ticket card ---- */
.ticket-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
}

.ticket-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-label{
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.day-pill{
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
}

.ticket-clock{
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.ticket-clock span:first-child{
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ticket-date{
  font-size: 0.88rem;
  color: var(--text-muted);
}

.ticket-divider{
  height: 1px;
  background: var(--border);
  margin: 22px 0 16px;
}

.ticket-caption{
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 12px;
}

.ticket-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ticket-list li{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ticket-list li i{ color: var(--primary); width: 16px; }

.ticket-empty{
  color: var(--text-muted);
  justify-content: center;
  background: transparent !important;
}

.ticket-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.ticket-link i{ font-size: 0.8rem; transition: transform .2s ease; }
.ticket-link:hover i{ transform: translateX(3px); }

/* ===================== SEARCH BAR ===================== */
.search-bar{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  transition: border-color .2s ease;
}

.search-bar:focus-within{ border-color: var(--primary); }

.search-bar i{ color: var(--text-muted); }

.search-bar input{
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.96rem;
  font-family: var(--font-body);
}

.search-bar input::placeholder{ color: var(--text-muted); }

.clear-btn{
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
}

.search-result{
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.search-result h4{
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.search-result ul{
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.search-result.not-found{
  color: var(--text-muted);
  text-align: center;
}

/* ===================== SCHEDULE CARDS ===================== */
.schedule-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.day-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.day-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.day-card.is-today{
  border-color: var(--primary);
}

.day-card-tab{
  position: absolute;
  top: 0; right: 0;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-bottom-left-radius: var(--radius-sm);
}

.day-card.is-today .day-card-tab{
  background: var(--primary);
  color: #fff;
}

.day-name{
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.day-count{
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: block;
}

.day-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-list li{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9rem;
}

.period-no{
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
}

.day-list li i{ color: var(--primary); width: 15px; text-align: center; }

/* ===================== GURU ===================== */
.teacher-count{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  margin-bottom: 26px;
}

.teacher-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.teacher-card{
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color .2s ease, transform .2s ease;
}

.teacher-card:hover{
  border-color: var(--primary);
  transform: translateY(-2px);
}

.teacher-no{
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
}

.teacher-name{
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.empty-state{
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

/* ===================== ABOUT ===================== */
.about-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.about-card h2{
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.about-card > p{
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 28px;
}

.about-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.about-grid span{
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.about-grid strong{ font-size: 1rem; }

/* ===================== FOOTER ===================== */
.footer{
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-title{ font-weight: 700; }
.footer-sub{ font-size: 0.85rem; color: var(--text-muted); }

.footer-links{
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover{ color: var(--primary); }

.footer-bottom{
  text-align: center;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===================== BACK TO TOP ===================== */
.back-to-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 800;
}

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

/* ===================== TOAST ===================== */
.toast{
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 1100;
}

.toast.show{
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===================== SCROLL REVEAL ===================== */
.reveal{
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}

.reveal.in-view{
  opacity: 1;
  transform: translateY(0);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 880px){
  .hero-grid{
    grid-template-columns: 1fr;
  }
  .nav-links{ display: none; }
  .hamburger{ display: grid; }
  .mobile-menu{ display: flex; }
}

@media (max-width: 520px){
  .navbar-inner{ padding: 12px 16px; }
  .hero{ padding: 40px 16px 24px; }
  .section{ padding: 60px 16px; }
  .about-card{ padding: 26px; }
  .hero-actions .btn{ flex: 1; justify-content: center; }
  .footer-inner{ flex-direction: column; align-items: flex-start; }
}
