/* ============================================================
   HEPIDEI — BASE
   Reset, tipografi, layout, dan sistem reveal.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  /* clip (bukan hidden) supaya position: sticky tetap bekerja */
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 400;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--color-ink);
  color: var(--color-cream);
}

:focus-visible {
  outline: 3px solid var(--color-rose);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 108px);
}

.section--alt {
  background: var(--color-cream-deep);
  padding-top: clamp(84px, 10vw, 128px);
}

.section--paper {
  background: var(--color-paper);
  padding-top: clamp(84px, 10vw, 128px);
}

/* ---------- Scallop divider ---------- */
.wave {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 22px;
  background-image: radial-gradient(
    circle 18px at 18px 0,
    var(--wave-color, var(--color-cream)) 0 99%,
    transparent 100%
  );
  background-size: 36px 22px;
  background-repeat: repeat-x;
  pointer-events: none;
}

/* ---------- Section header ----------
   Satu pola untuk semua section:
   .sec-kicker (label kecil) -> .sec-title -> .sec-lead.
   Semua judul memakai Fredoka (font utama), tanpa campuran serif. */
.sec-head {
  max-width: 660px;
}

.sec-head--center {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.sec-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-rose);
  font: 600 13px/1 var(--font-display);
  letter-spacing: 2.8px;
  text-transform: uppercase;
}

.sec-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.sec-head--center .sec-kicker::after {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.sec-title {
  margin-top: 14px;
  font: 700 clamp(1.85rem, 4.2vw, 3rem) / 1.05 var(--font-display);
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.sec-title .accent {
  color: var(--color-rose);
}

.sec-lead {
  max-width: 54ch;
  margin-top: 14px;
  color: var(--mute);
  font-size: 15.5px;
  line-height: 1.65;
}

.sec-head--center .sec-lead {
  margin-inline: auto;
}

.sub {
  margin-top: 14px;
  color: var(--mute);
  font-size: 15px;
}

.lead {
  max-width: 520px;
  color: var(--mute);
}

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

/* ---------- Helpers ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.more {
  margin-top: 40px;
  text-align: center;
}

.noscript-note {
  padding: 20px 0;
  color: var(--mute);
}

/* ---------- Scroll reveal ----------
   Dipasang oleh main.js lewat IntersectionObserver.

   Reveal memakai `animation` + `transform`, BUKAN `transition` dan
   `translate`. Alasannya: komponen (kartu, tombol) sudah memakai
   `transition` dan `translate`/`rotate` untuk hover. Kalau reveal juga
   memakai properti itu, salah satu akan saling menimpa. Dengan
   keyframes, keduanya jalan bersamaan tanpa konflik.

   Delay per elemen: style="--reveal-delay:120ms". */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
}

@keyframes reveal-left {
  from {
    opacity: 0;
    transform: translate3d(-36px, 0, 0);
  }
}

@keyframes reveal-right {
  from {
    opacity: 0;
    transform: translate3d(36px, 0, 0);
  }
}

@keyframes reveal-pop {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-4deg);
  }
}

.js .reveal,
.js .reveal-left,
.js .reveal-right,
.js .reveal-pop {
  animation-duration: 0.75s;
  animation-timing-function: var(--ease-out);
  animation-delay: var(--reveal-delay, 0ms);
  animation-fill-mode: both;
  animation-play-state: paused;
}

.js .reveal {
  animation-name: reveal-up;
}

.js .reveal-left {
  animation-name: reveal-left;
}

.js .reveal-right {
  animation-name: reveal-right;
}

.js .reveal-pop {
  animation-name: reveal-pop;
  animation-timing-function: var(--ease-spring);
}

.js .reveal.is-visible,
.js .reveal-left.is-visible,
.js .reveal-right.is-visible,
.js .reveal-pop.is-visible {
  animation-play-state: running;
}

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

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

  .js .reveal,
  .js .reveal-left,
  .js .reveal-right,
  .js .reveal-pop {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
