:root {
  --jabar-green: #0b5c3a;
  --jabar-green-deep: #063d28;
  --jabar-gold: #c9a227;
  --jabar-gold-soft: #f3e6b5;
  --paper: #f7f4ec;
  --ink: #14241c;
  --muted: #4d5f54;
  --white: #ffffff;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  background: var(--white);
  color: var(--jabar-green);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.brand-bar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  padding: 0.65rem 1.25rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  background: var(--white);
  border-bottom: 3px solid var(--jabar-gold);
}

/* Pelat putih: PNG transparan / berlatar gelap tetap terbaca. */
.brand-bar__plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  background: var(--white);
  border: 1px solid rgb(11 92 58 / 0.08);
  border-radius: 0.35rem;
  box-shadow: 0 1px 0 rgb(11 92 58 / 0.04);
}

.brand-bar__plate img {
  height: 44px;
  width: auto;
  max-width: min(140px, 36vw);
  object-fit: contain;
}

.hero {
  position: relative;
  min-height: min(92vh, 820px);
  min-height: min(92dvh, 820px);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

.hero__visual {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 55%;
  animation: hero-drift 28s ease-in-out infinite alternate;
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgb(6 45 30 / 0.72) 8%, rgb(6 45 30 / 0.28) 58%, rgb(6 45 30 / 0.45) 100%),
    linear-gradient(180deg, rgb(6 45 30 / 0.15) 0%, rgb(5 24 16 / 0.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 2.5rem));
  text-align: left;
  animation: rise 0.9s ease both;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hero__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.hero__mark-plate {
  display: grid;
  place-items: center;
  width: clamp(7.5rem, 18vw, 10.5rem);
  height: clamp(7.5rem, 18vw, 10.5rem);
  padding: 0.85rem;
  background: var(--white);
  border-radius: 1rem;
  box-shadow:
    0 0 0 3px rgb(201 162 39 / 0.55),
    0 18px 40px rgb(0 0 0 / 0.28);
}

.hero__mark {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero__wordmark {
  margin: 0;
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--white);
  text-shadow: 0 2px 24px rgb(0 0 0 / 0.35);
}

.hero__headline {
  margin: 1.1rem 0 0;
  max-width: 22ch;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--jabar-gold-soft);
}

.hero__lead {
  margin: 0.85rem 0 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgb(255 255 255 / 0.86);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.75rem;
  min-height: 2.75rem;
  padding: 0.85rem 1.35rem;
  border-radius: 0.2rem;
  background: var(--jabar-gold);
  color: var(--jabar-green-deep);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero__cta:hover {
  background: var(--jabar-gold-soft);
  transform: translateY(-2px);
}

.apps {
  padding: 4.5rem 1.25rem 3.5rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  background:
    radial-gradient(ellipse at top, #e7efe6 0%, var(--paper) 55%);
}

.apps__inner {
  max-width: 960px;
  margin: 0 auto;
}

.apps__heading {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--jabar-green-deep);
}

.apps__heading::after {
  content: '';
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-top: 0.85rem;
  background: var(--jabar-gold);
}

.apps__note {
  margin: 0.85rem 0 2.15rem;
  max-width: 38rem;
  color: var(--muted);
  line-height: 1.65;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 380px));
  justify-content: center;
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.6rem 1.5rem 1.45rem;
  background: var(--white);
  border: 1px solid rgb(11 92 58 / 0.1);
  border-top: 3px solid var(--jabar-green);
  border-radius: 0.25rem;
  box-shadow: 0 1px 0 rgb(11 92 58 / 0.05);
  animation: rise 0.7s ease both;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.app-card:nth-child(2) {
  animation-delay: 0.12s;
}

.app-card:nth-child(3) {
  animation-delay: 0.2s;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgb(11 92 58 / 0.22);
  box-shadow: 0 14px 32px rgb(6 61 40 / 0.12);
}

.app-card.is-disabled {
  border-top-color: #9aa89f;
  opacity: 0.82;
}

.app-card.is-disabled:hover {
  transform: none;
  border-color: rgb(11 92 58 / 0.1);
  box-shadow: 0 1px 0 rgb(11 92 58 / 0.05);
}

.app-card__icon {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.3rem;
  background: var(--white);
  border: 1px solid rgb(11 92 58 / 0.12);
  color: var(--jabar-green);
  font-size: 1.4rem;
}

.app-card__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.3rem;
  background: var(--white);
}

.app-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--jabar-green-deep);
}

.app-card p {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.app-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: fit-content;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 0.2rem;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.app-card__action--primary {
  background: var(--jabar-green);
  color: var(--white);
}

.app-card__action--primary:hover {
  background: var(--jabar-green-deep);
}

.app-card__action--primary:active {
  transform: translateY(1px);
}

.app-card__action--muted {
  background: #e8ece9;
  color: var(--muted);
  cursor: not-allowed;
}

.footer {
  padding: 1.5rem 1.25rem max(2rem, env(safe-area-inset-bottom));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid rgb(11 92 58 / 0.1);
  background: var(--white);
}

.loading,
.error {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.error {
  color: #9b1c1c;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translate(0, 0);
  }
  to {
    transform: scale(1.1) translate(-1.5%, 1%);
  }
}

@media (max-width: 1024px) {
  .hero__content {
    width: min(640px, calc(100% - 2rem));
  }
}

@media (max-width: 640px) {
  .brand-bar {
    gap: 0.5rem 0.65rem;
    padding: 0.55rem 0.75rem;
    padding-top: max(0.55rem, env(safe-area-inset-top));
  }

  .brand-bar__plate {
    padding: 0.3rem 0.5rem;
  }

  .brand-bar__plate img {
    height: 36px;
    max-width: min(120px, 40vw);
  }

  /* Tinggi mengikuti konten — hindari potong teks di tepi hero. */
  .hero {
    min-height: 0;
    padding: 2.25rem 0 2.75rem;
  }

  .hero__veil {
    background:
      linear-gradient(180deg, rgb(6 45 30 / 0.55) 0%, rgb(5 24 16 / 0.78) 55%, rgb(5 24 16 / 0.92) 100%),
      linear-gradient(90deg, rgb(6 45 30 / 0.45) 0%, rgb(6 45 30 / 0.2) 100%);
  }

  .hero__content {
    width: min(100%, calc(100% - 1.75rem));
    text-align: center;
  }

  .hero__identity {
    align-items: center;
    gap: 0.85rem;
  }

  .hero__mark-plate {
    width: 6.75rem;
    height: 6.75rem;
    padding: 0.7rem;
    border-radius: 0.85rem;
  }

  .hero__wordmark {
    font-size: clamp(2.35rem, 12vw, 3.1rem);
    line-height: 0.95;
  }

  .hero__headline {
    margin-top: 0.75rem;
    max-width: 18rem;
    margin-inline: auto;
    font-size: 1.05rem;
    line-height: 1.4;
    text-wrap: balance;
  }

  .hero__lead {
    margin: 0.65rem auto 0;
    max-width: 22rem;
    font-size: 0.92rem;
    line-height: 1.55;
    text-wrap: pretty;
  }

  .hero__cta {
    width: 100%;
    max-width: 18rem;
    margin-top: 1.25rem;
  }

  .hero__visual img {
    object-position: 72% 42%;
    animation: none;
  }

  .apps {
    padding: 2rem 0.9rem 1.75rem;
    padding-left: max(0.9rem, env(safe-area-inset-left));
    padding-right: max(0.9rem, env(safe-area-inset-right));
  }

  .apps__heading {
    font-size: 1.35rem;
    text-align: center;
  }

  .apps__heading::after {
    margin-inline: auto;
    margin-top: 0.65rem;
  }

  .apps__note {
    margin: 0.65rem auto 1.15rem;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .app-card {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
    grid-template-areas:
      'icon title'
      'desc desc'
      'action action';
    column-gap: 0.85rem;
    row-gap: 0.55rem;
    padding: 1.05rem 1rem 1rem;
  }

  .app-card__icon {
    grid-area: icon;
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.15rem;
    align-self: start;
  }

  .app-card h3 {
    grid-area: title;
    align-self: center;
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .app-card p {
    grid-area: desc;
    font-size: 0.88rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }

  .app-card__action {
    grid-area: action;
    width: 100%;
    min-height: 2.6rem;
    margin-top: 0.15rem;
  }

  .footer {
    padding: 1.15rem 1rem max(1.5rem, env(safe-area-inset-bottom));
    font-size: 0.78rem;
    line-height: 1.45;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hero {
    min-height: min(82vh, 740px);
    min-height: min(82dvh, 740px);
  }

  .apps {
    padding: 3.25rem 1.5rem 2.75rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-block: 1.25rem;
  }

  .hero__mark-plate {
    width: 4.5rem;
    height: 4.5rem;
    padding: 0.45rem;
  }

  .hero__identity {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
  }

  .hero__wordmark {
    font-size: clamp(2rem, 7vw, 3.25rem);
  }

  .hero__headline {
    margin-top: 0.55rem;
  }

  .hero__cta {
    margin-top: 0.85rem;
  }
}

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

  .hero__visual img,
  .hero__content,
  .app-card {
    animation: none;
  }

  .hero__cta,
  .app-card,
  .app-card__action {
    transition: none;
  }

  .hero__cta:hover,
  .app-card:hover {
    transform: none;
  }
}
