/* Portal SI IPAU — Inspektorat Daerah Kabupaten Banjar
   Tema: Glassmorphism (Apple-inspired) + Toska & Gold
   Tanpa font/skrip eksternal (aman untuk jaringan kantor). */

:root {
  --primary: #0F766E;
  --primary-dark: #0B5F58;
  --secondary: #14B8A6;
  --light: #CCFBF1;
  --gold: #C9A227;
  --gold-soft: #F6EBC0;
  --gold-glow: rgba(201, 162, 39, 0.35);
  --bg: #E8F5F2;
  --text: #0F172A;
  --muted: #475569;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(15, 118, 110, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(20, 184, 166, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(201, 162, 39, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(15, 118, 110, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, #D1FAF5 0%, #F0FDFA 35%, #F8FAFC 70%, #ECFDF5 100%);
  background-attachment: fixed;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
  opacity: 0.55;
}

body::before {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.45), transparent 70%);
}

body::after {
  width: 280px;
  height: 280px;
  bottom: 10%;
  right: -40px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.35), transparent 70%);
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #fff;
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip:focus { left: 12px; }

/* Header */
.top {
  position: relative;
  z-index: 2;
  background: linear-gradient(
    105deg,
    rgba(11, 95, 88, 0.88) 0%,
    rgba(15, 118, 110, 0.82) 50%,
    rgba(20, 184, 166, 0.75) 100%
  );
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 3px solid var(--gold);
  box-shadow:
    0 4px 24px rgba(15, 118, 110, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  height: 56px;
  width: auto;
  margin-right: 14px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.brand-text p { margin: 0; }

.pemda {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}

.instansi {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Hero */
main {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  padding: 48px 0 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.2;
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin: 16px auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  box-shadow: 0 0 12px var(--gold-glow);
}

.lead {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
}

/* Cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 -12px;
  padding: 12px 0 80px;
}

.card {
  width: calc(50% - 24px);
  min-width: 290px;
  max-width: 440px;
  margin: 12px;
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--glass-border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px) scale(1.01);
  background: var(--glass-strong);
  border-top-color: var(--gold);
  box-shadow:
    0 16px 40px rgba(15, 118, 110, 0.18),
    0 0 0 1px rgba(201, 162, 39, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.card:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}

.icon {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(204, 251, 241, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card-body { flex: 1 1 auto; }

.chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.chip-soft {
  color: var(--primary-dark);
  background: rgba(204, 251, 241, 0.75);
  border: 1px solid rgba(15, 118, 110, 0.15);
}

.chip-gold {
  color: #6B5300;
  background: rgba(246, 235, 192, 0.85);
  border: 1px solid var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

.card-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--primary-dark);
}

.card-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.go {
  margin-top: 22px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 14px rgba(15, 118, 110, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover .go,
.card:focus-visible .go {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #094A44 100%);
  box-shadow:
    0 6px 18px rgba(15, 118, 110, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Footer */
.foot {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 -4px 20px rgba(15, 118, 110, 0.06);
}

.foot p { margin: 0; }

.foot .wrap + p,
.foot p + p {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.85;
}

/* ========== MASKOT ROBOT (pojok kanan bawah) ========== */
.robot-larik {
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  left: auto !important;
  top: auto !important;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: auto !important;
  max-width: 140px;
  pointer-events: none;
  animation: mascot-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes mascot-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gelembung {
  max-width: 200px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px 16px 4px 16px;
  box-shadow:
    0 8px 28px rgba(15, 118, 110, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-dark);
  text-align: left;
  letter-spacing: 0.01em;
}

.robot {
  width: 100px !important;
  max-width: 100px !important;
  height: auto !important;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(15, 118, 110, 0.18));
}

/* Lengan melambai */
.r-lengan {
  transform-origin: 92px 58px;
  animation: robot-wave 2.4s ease-in-out infinite;
}

@keyframes robot-wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(6deg); }
}

/* Mata berkedip */
.r-mata {
  transform-origin: 60px 49px;
  animation: robot-blink 4.5s ease-in-out infinite;
}

@keyframes robot-blink {
  0%, 42%, 46%, 100% { transform: scaleY(1); }
  44% { transform: scaleY(0.08); }
}

/* Lampu antena */
.r-lampu {
  animation: robot-lamp 2s ease-in-out infinite;
}

@keyframes robot-lamp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Responsive */
@media (max-width: 640px) {
  .card {
    width: 100%;
    min-width: 0;
  }

  .robot-larik {
    right: 10px !important;
    bottom: 10px !important;
    max-width: 110px;
  }

  .gelembung {
    max-width: 140px;
    padding: 8px 11px;
    font-size: 11.5px;
  }

  .robot {
    width: 80px !important;
    max-width: 80px !important;
  }
}

@media (max-width: 520px) {
  .instansi { font-size: 18px; }
  .logo { height: 48px; }
  .hero { padding: 32px 0 16px; }
  .hero h1 { font-size: 26px; }
  .card { padding: 22px 20px 20px; }
  .cards { padding-bottom: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .go,
  .r-lengan,
  .r-mata,
  .r-lampu {
    transition: none;
    animation: none;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }

  .robot-larik {
    animation: none;
  }
}