/* Al Azhar CGE — design tokens, reset, layout dasar, header/footer, tema */

:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;

  --bg: #f5f9fc;
  --bg-raised: #ffffff;
  --bg-sunken: #eaf2f8;
  --ink: #0d2236;
  --ink-soft: #42596d;
  --ink-faint: #6b8093;
  --line: #d9e5ee;
  --line-strong: #c2d3e0;

  --brand: #0080c8;
  --brand-deep: #005e94;
  --brand-ink: #0b2d4d;
  --surface-navy: #0b2d4d;
  --on-navy: #d6e6f2;
  --brand-soft: #e1f0fa;
  --gold: #8f6a0a;
  --gold-bright: #d4a72c;
  --gold-soft: #f7edd2;
  --danger: #c23434;
  --success: #1e7d4f;

  --on-brand: #ffffff;
  --hero-wash: linear-gradient(135deg, #e7f3fb 0%, #f5f9fc 55%, #fdf8ec 100%);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-pill: 999px;

  --shadow-s: 0 1px 2px rgba(13, 34, 54, 0.06), 0 2px 8px rgba(13, 34, 54, 0.06);
  --shadow-m: 0 4px 14px rgba(13, 34, 54, 0.08), 0 12px 32px rgba(13, 34, 54, 0.1);
  --shadow-l: 0 8px 24px rgba(13, 34, 54, 0.12), 0 24px 64px rgba(13, 34, 54, 0.16);

  --container: 1200px;
  --header-h: 76px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0a1826;
  --bg-raised: #10263a;
  --bg-sunken: #081320;
  --ink: #e9f2f9;
  --ink-soft: #abc0d1;
  --ink-faint: #7d94a8;
  --line: #1f3a52;
  --line-strong: #2b4a66;

  --brand: #3fa9e2;
  --brand-deep: #7cc4ec;
  --brand-ink: #cfe8f7;
  --surface-navy: #0c2033;
  --on-navy: #c3d8e8;
  --brand-soft: #12304a;
  --gold: #d9b45b;
  --gold-bright: #e3c478;
  --gold-soft: #2b2510;
  --danger: #e57373;
  --success: #5cc392;

  --on-brand: #06121d;
  --hero-wash: linear-gradient(135deg, #0d2134 0%, #0a1826 55%, #171d10 100%);

  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-m: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-l: 0 8px 24px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s, color 0.35s;
}

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

/* Atribut hidden harus menang atas display utilitas (mis. .btn inline-flex) */
[hidden] {
  display: none !important;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.18;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--brand-deep);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 200;
  background: var(--surface-navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg-raised) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand__logo {
  display: block;
  height: 46px;
  width: auto;
  background: #fff;
  border-radius: 10px;
  padding: 5px 10px;
  box-shadow: var(--shadow-s);
}

[data-theme="dark"] .brand__logo {
  border: 1px solid var(--line-strong);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  position: relative;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: var(--radius-s);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav__link:hover,
.nav__item.is-open > .nav__link {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.nav__link[aria-current="page"],
.nav__link.is-active {
  color: var(--brand-deep);
}

.nav__link[aria-current="page"]::after,
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--gold-bright);
}

.nav__item {
  position: relative;
}

.nav__caret {
  width: 10px;
  height: 10px;
  transition: transform 0.2s;
}

.nav__item.is-open .nav__caret {
  transform: rotate(180deg);
}

.nav__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-m);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
  z-index: 95;
}

.nav__item.is-open .nav__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__menu a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav__menu a:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nav__menu a[aria-current="page"] {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.nav-burger {
  display: none;
}

/* ---------- Tombol ---------- */

.btn {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent);
}

.btn--primary:hover {
  background: var(--brand-deep);
  color: var(--on-brand);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 45%, transparent);
}

[data-theme="dark"] .btn--primary:hover {
  background: var(--brand);
  filter: brightness(1.12);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--bg-raised);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.btn--gold {
  background: var(--gold-bright);
  color: #2a1f05;
}

.btn--gold:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--gold-bright) 40%, transparent);
}

.btn--small {
  padding: 9px 16px;
  font-size: 13.5px;
}

/* ---------- Section dasar ---------- */

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

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

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--gold-bright);
  border-radius: 2px;
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-7);
}

.section-head--split {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  margin-bottom: var(--space-3);
}

.section-head p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--space-9);
  background: var(--surface-navy);
  color: var(--on-navy);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 54px solid rgba(255, 255, 255, 0.045);
}

.site-footer__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--space-7);
  padding-block: var(--space-8) var(--space-6);
}

.site-footer h3 {
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: var(--space-4);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.site-footer a {
  color: #d6e6f2;
}

.site-footer a:hover {
  color: var(--gold-bright);
}

.site-footer__brand p {
  color: #a9c2d6;
  font-size: 14.5px;
  max-width: 300px;
}

.footer-contact li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
}

.footer-contact svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--gold-bright);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: var(--space-4);
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s, transform 0.2s;
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.footer-social svg {
  width: 17px;
  height: 17px;
}

.site-footer__bottom {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--space-5);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 13.5px;
  color: #8fabc2;
}

/* ---------- Back to top ---------- */

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 118;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-m);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s;
}

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

.back-top:hover {
  background: var(--brand-deep);
}

.back-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Utilitas ---------- */

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

.u-right {
  text-align: right;
}

.u-full {
  width: 100%;
}

.u-m0 {
  margin: 0;
}

.u-mb-tight {
  margin-bottom: 8px;
}

.u-mt-4 {
  margin-top: var(--space-4);
}

.u-mt-5 {
  margin-top: var(--space-5);
}

.u-mt-7 {
  margin-top: var(--space-7);
}

.u-mt-8 {
  margin-top: var(--space-8);
}

.u-mb-7 {
  margin-bottom: var(--space-7);
}

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

.u-measure {
  max-width: 460px;
  margin-inline: auto;
}

.u-row-center {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.kicker--gold {
  color: var(--gold-bright);
}

.btn--light {
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.btn--light:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Tooltip di header membuka ke bawah dan rata kanan agar tidak terpotong viewport */
.site-header [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 10px);
  left: auto;
  right: 0;
  translate: 0 4px;
}

.site-header [data-tooltip]:hover::after,
.site-header [data-tooltip]:focus-visible::after {
  translate: 0 0;
}

/* ---------- Reveal & motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.rd-1 {
  --reveal-delay: 0.07s;
}

.rd-2 {
  --reveal-delay: 0.14s;
}

.rd-3 {
  --reveal-delay: 0.21s;
}

.rd-4 {
  --reveal-delay: 0.28s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------- Responsive header ---------- */

@media (max-width: 1099px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-l);
    padding: 14px 18px 20px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__link {
    width: 100%;
    justify-content: space-between;
    font-size: 15.5px;
    padding: 12px 14px;
  }

  .nav__menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--bg-sunken);
    display: none;
    margin: 2px 0 6px;
  }

  .nav__item.is-open .nav__menu {
    display: block;
  }

  .nav-burger {
    display: grid;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 66px;
    --space-9: 64px;
    --space-8: 48px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .brand__logo {
    height: 40px;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .back-top {
    right: 14px;
    bottom: 14px;
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 519px) {
  .header-actions .btn,
  .header-actions .design-switch {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }
}
