/* ==========================================================================
   Tanah Rata — Portal Induk (Hub)
   Gaya: Minimalis Profesional ala Portal Layanan Pemerintahan Digital
   ========================================================================== */

:root {
  --primary:      #0A5C74;
  --primary-dark: #073E4E;
  --primary-tint: #E4F1F4;
  --accent:       #D9A62E;
  --accent-dark:  #B3860F;
  --status-aktif: #1E8E5A;
  --status-aktif-tint: #E4F5EC;
  --status-segera: #8A939A;
  --status-segera-tint: #EEF0F1;
  --bg:           #F6F8F9;
  --surface:      #FFFFFF;
  --border:       #DCE3E5;
  --text:         #16232A;
  --text-muted:   #5B6870;

  --font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(22, 35, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(22, 35, 42, 0.08);

  --container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Focus visibility for keyboard nav */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 248, 249, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.01em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-mark span.dot { color: var(--accent); }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover { color: var(--primary); border-color: var(--primary-tint); }

.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease;
}
.btn-portal:hover { background: var(--primary); color: #fff; }
.btn-portal svg { width: 15px; height: 15px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 48px;
  overflow: hidden;
}
.hero-grid-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}
.hero-content {
  position: relative;
  max-width: 680px;
}
.hero h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.hero h1 .accent-word { color: var(--primary); }
.hero p.lead {
  margin-top: 16px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #2A1E00;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .15s ease;
}
.btn-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-cta svg { width: 18px; height: 18px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--primary);
}
.btn-secondary svg { width: 16px; height: 16px; }

/* Trust bar */
.trust-bar {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 680px;
}
.trust-item {
  background: var(--surface);
  padding: 18px 20px;
  text-align: left;
}
.trust-item .num {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}
.trust-item .label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* ---------- Section shared ---------- */
.section {
  padding: 64px 0;
}
.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
}
.section-head p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 15.5px;
}
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Layanan cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.service-card { color: inherit; }
.service-card.is-active:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-tint);
}
.service-card.is-soon { opacity: 0.88; cursor: default; }

.service-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-icon svg { width: 24px; height: 24px; }

/* Badge: teks selalu warna --text (kontras AA terjamin), titik status
   memakai warna semantik (hijau/abu) sebagai penanda visual tambahan —
   status tetap terbaca lewat teks meski titik warna tidak terlihat. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-aktif { background: var(--status-aktif-tint); }
.badge-aktif::before { background: var(--status-aktif); }
.badge-segera { background: var(--status-segera-tint); }
.badge-segera::before { background: var(--status-segera); }

.service-card h3 {
  font-size: 17px;
  font-weight: 700;
}
.service-card p {
  font-size: 14.5px;
  color: var(--text-muted);
}
.service-open {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  padding-top: 4px;
}
.service-open svg { width: 15px; height: 15px; transition: transform .15s ease; }
.service-card.is-active:hover .service-open svg { transform: translateX(3px); }

.service-soon-label {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--status-segera);
  padding-top: 4px;
}

/* ---------- Kabar Negeri ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.news-thumb {
  aspect-ratio: 16/10;
  background: var(--primary-tint);
  overflow: hidden;
}
.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.news-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.news-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
}
.news-link {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.news-link svg { width: 14px; height: 14px; }

.section-foot-link {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

/* ---------- Tentang ---------- */
.about-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
}
.about-facts {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 8px 0;
}
.fact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.fact-row:last-child { border-bottom: none; }
.fact-row svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.fact-row .fact-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.fact-row .fact-value {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary-dark);
  color: #D9E6EA;
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  margin-bottom: 12px;
}
.footer-brand .brand-mark { background: rgba(255,255,255,0.12); }
.footer-desc {
  font-size: 13.5px;
  color: #A9C0C6;
  max-width: 280px;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 14px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a, .footer-item {
  font-size: 14px;
  color: #B9CDD2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.footer-col a:hover { color: #fff; }
.footer-item svg, .footer-col a svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: #6FA3AF; }

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #8FB1B8;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .service-card, .news-card, .btn-cta { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .about-wrap { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-grid .footer-col:nth-child(4) { grid-column: span 2; }
}

@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 18px 18px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .btn-portal { margin-top: 10px; justify-content: center; }
  .nav-toggle { display: flex; }

  .hero { padding: 40px 0 32px; }
  .trust-bar { grid-template-columns: 1fr; }

  .services-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }

  .section { padding: 48px 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid .footer-col:nth-child(4) { grid-column: span 1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
