/* ============================================================
   SMK Muhammadiyah 1 Klaten Utara — Stylesheet
   Tema: modern, clean, responsif, dominan hijau
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Palet hijau */
  --green-900: #0b3d22;
  --green-800: #0f5c2e;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  --primary: var(--green-700);
  --primary-dark: var(--green-800);
  --accent: var(--green-500);

  /* Netral */
  --ink: #11271a;          /* teks utama */
  --muted: #51655a;        /* teks sekunder */
  --line: #e4ebe6;         /* border halus */
  --bg: #ffffff;
  --bg-alt: #f4f9f5;       /* background section selang-seling */
  --white: #ffffff;

  /* Bentuk & efek */
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 4px 14px rgba(15, 92, 46, 0.06);
  --shadow: 0 12px 30px rgba(15, 92, 46, 0.10);
  --shadow-lg: 0 22px 50px rgba(11, 61, 34, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --nav-h: 76px;
  --maxw: 1180px;

  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h); /* offset navbar saat anchor-scroll */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); }

/* ---------- Layout ---------- */
.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

.section { padding: clamp(64px, 9vw, 110px) 0; }
.section--alt { background: var(--bg-alt); }

.section__head { max-width: 760px; margin: 0 auto clamp(36px, 5vw, 60px); text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-600);
  background: var(--green-100);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.section__title::after {
  content: "";
  display: block;
  width: 64px; height: 4px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, var(--green-500), var(--green-700));
  border-radius: 4px;
}
.section__lead { margin-top: 18px; color: var(--muted); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 28px;
  border-radius: 100px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
              background-color 0.3s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}
.btn--sm { padding: 9px 20px; font-size: 0.9rem; }
.btn--accent { background: var(--accent); color: var(--green-900); box-shadow: 0 8px 22px rgba(34, 197, 94, 0.35); }
.btn--accent:hover { background: var(--green-400); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(34, 197, 94, 0.45); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: #fff; color: var(--green-800); transform: translateY(-3px); }

/* Indikator fokus keyboard yang jelas (aksesibilitas / WCAG 2.4.7) */
.btn:focus-visible,
.nav-link:focus-visible,
.brand:focus-visible,
.to-top:focus-visible,
.nav-toggle:focus-visible,
.hero__scroll:focus-visible,
.alamat-list a:focus-visible,
.footer__list a:focus-visible {
  outline: 3px solid var(--green-400);
  outline-offset: 3px;
  border-radius: 8px;
}
.navbar.scrolled .nav-link:focus-visible { outline-color: var(--green-600); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.navbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* Default: transparan di atas hero */
.brand { display: flex; align-items: center; gap: 12px; color: #fff; transition: color 0.35s var(--ease); }
.brand__logo {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; }
.brand__text small { font-size: 0.76rem; opacity: 0.9; letter-spacing: 0.02em; }

.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-link {
  position: relative;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-cta { margin-left: 8px; }

/* State: navbar solid setelah di-scroll */
.navbar.scrolled { background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }
.navbar.scrolled .brand { color: var(--green-800); }
.navbar.scrolled .brand__logo { background: var(--green-700); color: #fff; }
.navbar.scrolled .nav-link { color: var(--muted); }
.navbar.scrolled .nav-link:hover, .navbar.scrolled .nav-link.active { color: var(--green-700); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 11px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span { height: 2.5px; width: 100%; background: #fff; border-radius: 4px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background-color 0.3s var(--ease); }
.navbar.scrolled .nav-toggle span { background: var(--green-800); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  /* Gambar sekolah sebagai background + warna fallback hijau */
  background: var(--green-800) url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=2000&q=70") center/cover no-repeat fixed;
}
/* Overlay gradient hijau solid ~50% agar teks terbaca */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 61, 34, 0.86) 0%, rgba(15, 92, 46, 0.62) 50%, rgba(21, 128, 61, 0.5) 100%);
}
.hero__content { position: relative; z-index: 2; color: #fff; max-width: 820px; padding: 110px 0 90px; }
.hero__badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}
.hero__title {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}
.hero__subtitle {
  margin-top: 20px;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 400;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.94);
}
.hero__actions { margin-top: 38px; display: flex; flex-wrap: wrap; gap: 16px; }

/* Indikator scroll */
.hero__scroll {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px; height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 100px;
  display: grid;
  justify-items: center;
  padding-top: 8px;
}
.hero__scroll span { width: 4px; height: 8px; border-radius: 4px; background: #fff; animation: scrollDot 1.6s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats { background: linear-gradient(135deg, var(--green-700), var(--green-800)); color: #fff; }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 44px 0;
  text-align: center;
}
.stat { padding: 10px; }
.stat__num { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1; }
.stat__label { margin-top: 8px; font-size: 0.92rem; color: rgba(255, 255, 255, 0.88); }
.stat + .stat { position: relative; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 46px; width: 1px; background: rgba(255, 255, 255, 0.2); }

/* ============================================================
   PROFIL — info cards
   ============================================================ */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.info-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.info-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--green-100); }
.info-card__icon {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--green-50);
  color: var(--green-700);
  margin-bottom: 20px;
}
.info-card__icon svg { width: 30px; height: 30px; }
.info-card h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 12px; }
.info-card p { color: var(--muted); }
.info-card__list { display: grid; gap: 10px; }
.info-card__list li { position: relative; padding-left: 26px; color: var(--muted); }
.info-card__list li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 14px; height: 14px;
  background: var(--green-100);
  border: 3px solid var(--green-500);
  border-radius: 50%;
}

/* ============================================================
   JURUSAN — grid kartu
   ============================================================ */
.jurusan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.jurusan-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.jurusan-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }

.jurusan-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
}
.jurusan-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.6s var(--ease);
}
.jurusan-card:hover .jurusan-card__media img { transform: scale(1.08); }
/* Ikon fallback (tampil di belakang gambar; jika gambar gagal load -> img dihapus & ikon terlihat) */
.jurusan-card__ico { position: relative; z-index: 0; }
.jurusan-card__ico svg { width: 58px; height: 58px; }
/* Gradien dasar tiap media (sebagai placeholder berwarna) */
.media-mesin      { background: linear-gradient(135deg, #166534, #22c55e); }
.media-listrik    { background: linear-gradient(135deg, #15803d, #4ade80); }
.media-konstruksi { background: linear-gradient(135deg, #14532d, #16a34a); }
.media-tjkt       { background: linear-gradient(135deg, #166534, #34d399); }
.media-pplg       { background: linear-gradient(135deg, #15803d, #22c55e); }
.media-dpib       { background: linear-gradient(135deg, #14532d, #15803d); }
/* Overlay halus di atas gambar agar konsisten */
.jurusan-card__media::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 55%, rgba(11, 61, 34, 0.35));
}
.jurusan-card__body { padding: 24px 24px 28px; }
.jurusan-card__body h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.jurusan-card__body p { color: var(--muted); font-size: 0.96rem; }

/* ============================================================
   EKSTRAKURIKULER — icon grid
   ============================================================ */
.ekskul-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.ekskul-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.ekskul-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--green-100); }
.ekskul-card__ico {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
}
.ekskul-card:hover .ekskul-card__ico { background: var(--green-700); color: #fff; transform: scale(1.1); }
.ekskul-card__ico svg { width: 30px; height: 30px; }
.ekskul-card h3 { font-size: 1.04rem; font-weight: 600; margin-bottom: 8px; }
.ekskul-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

/* ============================================================
   ALAMAT & MAPS
   ============================================================ */
.alamat-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 36px; align-items: stretch; }
.alamat-info { display: flex; flex-direction: column; gap: 22px; }
.alamat-list { display: grid; gap: 22px; }
.alamat-list li { display: flex; gap: 16px; align-items: flex-start; }
.alamat-list__ico {
  flex-shrink: 0;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--green-50);
  color: var(--green-700);
}
.alamat-list__ico svg { width: 24px; height: 24px; }
.alamat-list strong { font-family: var(--font-head); font-weight: 600; display: block; margin-bottom: 2px; }
.alamat-list p { color: var(--muted); font-size: 0.96rem; }
.alamat-list a:hover { color: var(--green-700); text-decoration: underline; }
.alamat-info .btn { align-self: flex-start; margin-top: 4px; }

.map-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 360px;
}
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--green-900); color: rgba(255, 255, 255, 0.82); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1fr;
  gap: 40px;
  padding: 64px 0 44px;
}
.brand--footer { color: #fff; margin-bottom: 18px; }
.brand--footer .brand__logo { background: var(--green-600); }
.footer__desc { font-size: 0.95rem; max-width: 360px; }
.footer__col h4 { color: #fff; font-size: 1.1rem; font-weight: 600; margin-bottom: 18px; }
.footer__list { display: grid; gap: 12px; font-size: 0.94rem; }
.footer__list a { display: inline-block; padding: 3px 0; transition: color 0.25s var(--ease), padding-left 0.25s var(--ease); }
.footer__list a:hover { color: var(--green-400); padding-left: 4px; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 0; }
.footer__bottom p { font-size: 0.88rem; text-align: center; color: rgba(255, 255, 255, 0.65); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 900;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background-color 0.3s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--green-800); transform: translateY(-4px); }

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
/* Stagger antar kartu dalam satu grid */
.cards-3 .reveal:nth-child(2), .jurusan-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.cards-3 .reveal:nth-child(3), .jurusan-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.jurusan-grid .reveal:nth-child(4) { transition-delay: 0.08s; }
.jurusan-grid .reveal:nth-child(5) { transition-delay: 0.16s; }
.jurusan-grid .reveal:nth-child(6) { transition-delay: 0.24s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .cards-3 { grid-template-columns: 1fr; max-width: 540px; margin-inline: auto; }
  .jurusan-grid { grid-template-columns: repeat(2, 1fr); }
  .ekskul-grid { grid-template-columns: repeat(3, 1fr); }
  .alamat-grid { grid-template-columns: 1fr; }
  .map-wrap { min-height: 320px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  /* Mobile menu */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: #fff;
    padding: 16px 20px 26px;
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.32s var(--ease), opacity 0.32s var(--ease), visibility 0.32s;
  }
  .nav-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-link { color: var(--ink); padding: 12px 14px; border-radius: 10px; }
  .nav-link::after { display: none; }
  .nav-link:hover, .nav-link.active { background: var(--green-50); color: var(--green-700); }
  .nav-cta { margin: 8px 0 0; text-align: center; }
  /* Selalu padatkan hamburger menjadi gelap karena background menu putih */
  .nav-toggle span { background: var(--green-800); }

  .hero { background-attachment: scroll; } /* fixed bg dimatikan di mobile */
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  /* Pada grid 2 kolom, sembunyikan garis pemisah di kolom kiri baris ke-2
     agar setiap baris hanya punya satu pemisah di tengah (simetris) */
  .stat:nth-child(3)::before { display: none; }
}

@media (max-width: 560px) {
  .jurusan-grid { grid-template-columns: 1fr; }
  .jurusan-card__body h3 { font-size: 1.08rem; }
  .ekskul-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; padding-bottom: 36px; }
  /* Tombol hero menumpuk penuh agar nyaman & mudah ditekan di ponsel */
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .map-wrap { min-height: 280px; }
}

/* Hormati preferensi pengurangan animasi */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
