/* =========================================================
   Budaya Alam Advisory (BAV) — gaya situs
   Target: WCAG 2.2 AA
   ========================================================= */

:root {
  --blue: #0473B2;          /* kontras 5,1:1 terhadap putih */
  --blue-deep: #035A8C;     /* hover / teks biru di latar tint */
  --blue-ink: #022F4A;      /* latar gelap proyek unggulan */
  --yellow: #EFE444;        /* hanya di atas biru / gelap */
  --amber: #E79F00;         /* warna titik di file logo */
  --ink: #17212B;           /* teks utama, 15,9:1 */
  --ink-soft: #3E4A56;      /* teks sekunder, 8,9:1 */
  --paper: #FFFFFF;
  --tint: #F4F7F9;
  --rule: #D5DDE3;
  --focus: #0473B2;

  --font-head: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hind Guntur", "Segoe UI", system-ui, sans-serif;

  --wrap: 72rem;
  --gap: clamp(1.25rem, 3vw, 2rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --lh: 1.7;
  --ls: normal;
  --ws: normal;
  --p-gap: 1.1em;
}

/* Ukuran teks dari menu aksesibilitas */
html { font-size: 100%; }
html[data-size="lg"]  { font-size: 115%; }
html[data-size="xl"]  { font-size: 130%; }
html[data-size="xxl"] { font-size: 150%; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;   /* fokus & anchor tidak tertutup header (2.4.11) */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: var(--lh);
  letter-spacing: var(--ls);
  word-spacing: var(--ws);
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

h1, h2, h3, legend, .eyebrow, .section-num, .btn, .site-nav, .a11y-trigger {
  font-family: var(--font-head);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { margin: 0 0 var(--p-gap); }

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

a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--blue-deep); text-decoration-thickness: .14em; }

/* Fokus yang jelas di semua latar (2.4.7, 2.4.13) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
  border-radius: 2px;
}
.feature :focus-visible, .site-footer :focus-visible {
  outline-color: var(--yellow);
  box-shadow: 0 0 0 6px var(--blue-ink);
}
#konten:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .75rem 1rem; font-weight: 700;
  border-radius: 4px; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.75rem; }
.brand { display: block; flex: 0 0 auto; }
.brand img { width: clamp(9.5rem, 18vw, 12.5rem); }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: .55rem .8rem; min-height: 44px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; border-radius: 4px;
}
.site-nav a:hover { color: var(--blue); background: var(--tint); }
.nav-toggle { display: none; }

.a11y-trigger {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: .5rem .9rem;
  font-size: .95rem; font-weight: 700;
  color: #fff; background: var(--blue);
  border: 2px solid var(--blue); border-radius: 999px; cursor: pointer;
}
.a11y-trigger:hover { background: var(--blue-deep); border-color: var(--blue-deep); }

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: .75rem; padding-block: .6rem; }
  .site-nav { order: 3; margin-left: auto; }
  .a11y-trigger { order: 2; margin-left: auto; }
  .a11y-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .a11y-trigger { padding: .5rem; width: 44px; justify-content: center; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: .5rem .9rem;
    font: 700 1rem var(--font-head); color: var(--ink); background: #fff;
    border: 2px solid var(--ink); border-radius: 999px; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .site-nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gap) 1rem;
  }
  .site-nav.is-open ul { display: flex; }
  .site-nav a { display: block; padding: .75rem .5rem; font-size: 1.1rem; }
}

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.35rem;
  font-size: 1rem; font-weight: 700; line-height: 1.2;
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--blue-ink); border-color: var(--yellow); }
.btn-yellow:hover { background: #fff; color: var(--blue-ink); border-color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 1.25rem;
  font-size: .9rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue);
}
.lead { font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 40em; }
.cta-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

.hero-figure { margin: 0; }
.braille-big .dot-on circle { fill: var(--amber); }
.braille-big .dot-off circle { fill: var(--amber); }
.hero-figure figcaption {
  margin-top: 1rem; font: 400 .9rem var(--font-head); color: var(--ink-soft); letter-spacing: .05em;
}

.audience {
  list-style: none; margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding: 1.5rem 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  border-top: 1px solid var(--rule);
  font: 700 1rem var(--font-head); color: var(--ink);
}
.audience li { padding-left: 1.1rem; position: relative; }
.audience li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: .5rem; height: .5rem;
  border-radius: 50%; background: var(--blue);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 15rem; order: -1; }
  .hero-figure figcaption { display: none; }
  .audience { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .audience { grid-template-columns: 1fr; } }

/* ---------- Bagian umum ---------- */
.section { padding: var(--section-y) 0; }
.section-tint { background: var(--tint); }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.narrow { max-width: 46rem; }
.section-num {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem; font-size: .9rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep);
}
.section-num span {
  display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .4rem;
  border: 2px solid currentColor; border-radius: 999px; letter-spacing: 0;
}
.section-num.on-dark { color: var(--yellow); }
.section-intro { color: var(--ink-soft); font-size: 1.15rem; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); }
.prose { max-width: 38em; }
.prose p:first-child { font-size: 1.25rem; color: var(--ink); }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* Fokus kerja: daftar bernomor bergaya editorial */
.focus-list {
  list-style: none; margin: 0; padding: 0; counter-reset: fokus;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 1.5rem;
  border-top: 2px solid var(--ink);
}
@media (max-width: 1100px) { .focus-list { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); } }
.focus-list li {
  counter-increment: fokus; position: relative;
  padding: 1.75rem 0 1.5rem; border-bottom: 1px solid var(--rule);
}
.focus-list li::before {
  content: counter(fokus, decimal-leading-zero);
  display: block; margin-bottom: .75rem;
  font: 700 .95rem var(--font-head); color: var(--blue-deep);
}
.focus-list p { color: var(--ink-soft); margin: 0; }

/* Layanan */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.service { padding: 2rem 2rem 2rem 0; border-bottom: 1px solid var(--rule); }
.service:nth-child(even) { padding-left: 2rem; border-left: 1px solid var(--rule); }
.service h3 { font-size: 1.4rem; }
.service p { color: var(--ink-soft); margin: 0; }
@media (max-width: 760px) {
  .service-grid { grid-template-columns: 1fr; }
  .service:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ---------- Proyek unggulan ---------- */
.feature { background: var(--blue-ink); color: #E8F1F7; padding: var(--section-y) 0; }
.feature h2 { color: #fff; font-size: clamp(2.4rem, 5vw, 3.75rem); margin-bottom: .2em; }
.feature a:not(.btn) { color: var(--yellow); }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.feature-sub { font: 700 1.3rem var(--font-head); color: var(--yellow); margin-bottom: 1.5rem; }
.feature-copy p { max-width: 36em; }
.status { display: flex; align-items: center; gap: .6rem; font: 700 .95rem var(--font-head); color: #fff; margin: 1.75rem 0; }
.status-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--yellow); }
.atlas-dots circle { fill: #3D6F92; }
.atlas-dots circle.on { fill: var(--yellow); }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } .feature-visual { max-width: 26rem; } }

/* Prinsip */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.principles > div { border-top: 4px solid var(--blue); padding-top: 1.5rem; }
.principles p { color: var(--ink-soft); margin: 0; }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr; } }

/* Kontak */
.contact { background: var(--tint); border-top: 1px solid var(--rule); }
.contact-inner > * { max-width: 50rem; }
.contact h2 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
.contact-text { font-size: 1.2rem; color: var(--ink-soft); max-width: 36em; }
.contact-email {
  display: inline-block; margin-top: .75rem;
  font: 700 clamp(1.35rem, 3.6vw, 2.25rem) var(--font-head);
  color: var(--blue); word-break: break-word;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--blue); color: #fff; padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: start; }
.footer-logo { width: clamp(12rem, 24vw, 16rem); margin: 0 0 1rem -.75rem; }
.footer-tag { font-family: var(--font-head); max-width: 24em; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.footer-links a { display: inline-block; padding: .35rem 0; min-height: 24px; font-weight: 500; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.4); font-size: .95rem; }
.footer-base p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Panel aksesibilitas ---------- */
.a11y-panel {
  width: min(30rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 1.5rem; border: 2px solid var(--ink); border-radius: 12px;
  color: var(--ink); background: #fff; font-family: var(--font-body);
}
.a11y-panel::backdrop { background: rgba(2, 47, 74, .55); }
.a11y-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.a11y-head h2 { font-size: 1.4rem; margin: 0; }
.a11y-close {
  width: 44px; height: 44px; font-size: 1.75rem; line-height: 1;
  background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 50%; cursor: pointer;
}
.a11y-note { font-size: .95rem; color: var(--ink-soft); margin: .5rem 0 1rem; }
.a11y-group { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 1rem 0; }
.a11y-group legend { font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: .6rem; float: left; width: 100%; }
.a11y-group legend + * { clear: both; }
.size-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.size-options label { position: relative; }
.size-options input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.size-options span {
  display: grid; place-items: center; min-height: 44px;
  border: 2px solid var(--ink-soft); border-radius: 8px; font: 700 .95rem var(--font-head);
}
.size-options input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.size-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }

.toggle { display: flex; align-items: center; gap: .75rem; min-height: 44px; cursor: pointer; line-height: 1.35; }
.toggle input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 2.75rem; height: 1.6rem; margin: 0; border-radius: 999px;
  background: #fff; border: 2px solid var(--ink-soft); position: relative; cursor: pointer;
}
.toggle input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 1.05rem; height: 1.05rem;
  border-radius: 50%; background: var(--ink-soft); transition: transform .15s ease;
}
.toggle input:checked { background: var(--blue); border-color: var(--blue); }
.toggle input:checked::after { transform: translateX(1.15rem); background: #fff; }
.a11y-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.a11y-foot { margin: 1rem 0 0; font-size: .95rem; }

/* ---------- Halaman teks (pernyataan aksesibilitas) ---------- */
.page { padding: var(--section-y) 0; }
.page .prose { max-width: 44rem; }
.page h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page h2 { font-size: 1.6rem; margin-top: 2.25rem; }
.page ul { padding-left: 1.25rem; }
.page li { margin-bottom: .4rem; }

/* =========================================================
   Mode dari menu aksesibilitas
   ========================================================= */

/* Kontras tinggi */
html.a11y-contrast {
  --ink: #000; --ink-soft: #000; --rule: #000; --tint: #fff;
  --blue: #004A75; --blue-deep: #00324F; --blue-ink: #000; --amber: #000;
  --focus: #000;
}
html.a11y-contrast body { background: #fff; }
html.a11y-contrast a { text-decoration: underline; }
html.a11y-contrast .site-footer { background: #000; }
html.a11y-contrast .feature { color: #fff; }
html.a11y-contrast .feature-copy p, html.a11y-contrast .feature .status { color: #fff; }
html.a11y-contrast .atlas-dots circle { fill: #777; }
html.a11y-contrast .principles > div { border-top-color: #000; }
html.a11y-contrast .btn-ghost { border-width: 3px; }
html.a11y-contrast .site-header { background: #fff; border-bottom: 2px solid #000; }

/* Spasi teks sesuai uji WCAG 1.4.12 */
html.a11y-spacing { --lh: 2; --ls: .12em; --ws: .16em; --p-gap: 2em; }
html.a11y-spacing h1, html.a11y-spacing h2, html.a11y-spacing h3 { line-height: 1.5; letter-spacing: .06em; }

/* Satu huruf yang mudah dibaca */
html.a11y-font body, html.a11y-font .a11y-panel { --font-body: "Atkinson Hyperlegible", system-ui, sans-serif; }

/* Garis bawahi semua tautan */
html.a11y-links a { text-decoration: underline !important; text-decoration-thickness: .1em !important; }

/* Kurangi gerakan: dari menu atau dari pengaturan sistem */
html.a11y-motion { scroll-behavior: auto; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
  animation: none !important; transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Mode warna paksa Windows */
@media (forced-colors: active) {
  .btn, .a11y-trigger, .nav-toggle, .size-options span { border: 2px solid ButtonText; }
  .toggle input { border-color: ButtonText; }
  .toggle input:checked::after { background: Highlight; }
}

/* Cetak */
@media print {
  .site-header, .a11y-panel, .cta-row, .hero-figure, .feature-visual { display: none !important; }
  .feature, .site-footer { background: #fff !important; color: #000 !important; }
  .feature h2, .feature-sub, .site-footer a { color: #000 !important; }
  a[href^="mailto"]::after { content: ""; }
}
