/*
 * Landing page rupika.id. Mengikuti docs/design-system.md ("Lucu kalem"): kanvas krem, kartu putih membulat
 * tanpa garis dan tanpa bayangan lembut, judul Fredoka, teks Nunito. Gaya stiker (garis tinta 2 px + bayangan
 * padat) hanya untuk tombol, bingkai ponsel, dan maskot Gembul. Tomat hanya untuk tombol utama.
 * Tanpa JavaScript; tema gelap lewat prefers-color-scheme. Font disalin dari @fontsource saat build.
 */

@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/fredoka-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/nunito-latin-800-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #fff7ea;
  --card: #ffffff;
  --card-2: #fff7ea;
  --fill: #efe6d6;
  --sep: #efe6d6;
  --label: #1b1b1b;
  --label-2: #6b6356;
  --accent-fill: #d4432a;
  --on-accent: #ffffff;
  --sticker: #1b1b1b;
  --ink: #1b1b1b;
  /* Warna maskot Gembul (sama dengan logo). */
  --logo-tomato: #f0573a;
  --logo-water: #8cc8ff;
  --logo-cheek: #ffb4a6;
  --logo-glass: #ffffff;
  /* Pastel data (CATEGORY_COLORS di app): lingkaran ikon. */
  --pastel-blue: #8cc8ff;
  --pastel-mint: #9be3c8;
  --pastel-pink: #ffb5a1;
  --pastel-yellow: #ffd166;
  --pastel-purple: #cdb5f2;
  --heading: 'Fredoka', 'Nunito', -apple-system, system-ui, sans-serif;
  --body: 'Nunito', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1a1714;
    --card: #26221d;
    --card-2: #1f1b17;
    --fill: #332d26;
    --sep: #3a342c;
    --label: #f6efe4;
    --label-2: #b8ad9c;
    /* Garis stiker gelap harus tetap terlihat di atas kartu gelap. */
    --sticker: #8a7f70;
    --logo-glass: #ede6da;
  }
}

@media (prefers-contrast: more) {
  :root { --label-2: #4a443a; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 17px/1.55 var(--body);
  overflow-x: clip;
}

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

h1, h2 { font-family: var(--heading); font-weight: 600; margin: 0; text-wrap: balance; }

p { margin: 0; }

a { color: inherit; }

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

.ico { width: 1.25em; height: 1.25em; flex: none; }

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 16px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--card);
  font-weight: 800;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ tombol */

.btn-primary,
.btn-tinted,
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Tombol utama: tomat berstiker (sama dengan Button primary di app). */
.btn-primary {
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font: 600 18px/1.2 var(--heading);
  border: 2px solid var(--sticker);
  box-shadow: 3px 3px 0 var(--sticker);
}

/* Tombol sekunder polos: krem, tanpa stiker (Button tinted di app). */
.btn-tinted {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--label);
  font-weight: 800;
  font-size: 15px;
}

.stores { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.stores .store { flex: 1 1 150px; }

/* Tombol toko bergaya app (stiker putih), bukan tiruan badge resmi. */
.store {
  min-height: 56px;
  padding: 8px 18px 8px 14px;
  border-radius: 16px;
  background: var(--card);
  color: var(--label);
  border: 2px solid var(--sticker);
  box-shadow: 3px 3px 0 var(--sticker);
}
.store .ico { width: 26px; height: 26px; }
.store-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-note { font-size: 13px; font-weight: 700; color: var(--label-2); }
.store-name { font: 600 18px/1.15 var(--heading); white-space: nowrap; }
@media (max-width: 400px) {
  .store { padding-inline: 12px 10px; gap: 8px; }
  .store-name { font-size: 16px; }
}

/* Belum terbit: bukan tautan, tanpa stiker (seperti tombol non-aktif di app). */
.store-off {
  background: var(--fill);
  border-color: transparent;
  box-shadow: none;
  color: var(--label-2);
  cursor: default;
}

.btn-primary,
.store:not(.store-off) { transition: transform 90ms ease-out, box-shadow 90ms ease-out; }
.btn-primary:active,
.store:not(.store-off):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--sticker); }

@media (prefers-reduced-motion: reduce) {
  .btn-primary, .store { transition: none; }
}

/* ------------------------------------------------------------------ bar atas */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: block; }
.brand img { width: auto; height: 36px; }

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  gap: 40px;
  padding-top: 20px;
  padding-bottom: 24px;
}

h1 {
  font-size: clamp(2.1rem, 1.35rem + 3.4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 15ch;
}

.lead {
  margin-top: 16px;
  max-width: 34em;
  font-size: 18px;
  font-weight: 600;
  color: var(--label-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}
.actions .btn-primary { width: 100%; }

.fine { margin-top: 18px; font-size: 15px; font-weight: 700; color: var(--label-2); }

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(320px, 74vw);
  padding-top: 86px;
  margin-right: 24px;
}

/* Bingkai ponsel berstiker; screenshot app asli di dalamnya, tanpa status bar tiruan. */
.phone {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 8px;
  border-radius: 42px;
  background: var(--card);
  border: 2px solid var(--sticker);
  box-shadow: 5px 5px 0 var(--sticker);
}
.phone img { width: 100%; border-radius: 34px; }

/* Gembul mengintip dari balik ponsel (hanya kepala di atas tepi ponsel). */
.gembul-peek {
  position: absolute;
  z-index: 0;
  /* Sedikit naik supaya mulutnya tidak tertutup tepi ponsel. */
  top: -5%;
  right: -16%;
  width: 46%;
  transform: rotate(12deg);
}

/* ------------------------------------------------------------------ maskot Gembul (statis) */

.gembul { display: block; overflow: visible; }
.gembul .g-line { stroke: var(--sticker); }
.gembul .g-shadow { fill: var(--sticker); }
.gembul .g-lid { fill: var(--logo-tomato); }
.gembul .g-glass { fill: var(--logo-glass); }
.gembul .g-water { fill: var(--logo-water); }
.gembul .g-ink { fill: var(--ink); }
.gembul .g-shine { fill: var(--logo-glass); }
.gembul .g-cheek { fill: var(--logo-cheek); }
.gembul .g-mouth { fill: none; stroke: var(--ink); }

/* ------------------------------------------------------------------ Safe to Spend */

.sts {
  display: grid;
  gap: 24px;
  padding-top: 48px;
  padding-bottom: 8px;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  line-height: 1.12;
}

.sts-text p,
.feature-text p { margin-top: 12px; max-width: 32em; font-size: 17px; font-weight: 600; color: var(--label-2); }

.sts-card { display: block; width: 100%; max-width: 380px; }
.sts-card img { width: 100%; }

/* ------------------------------------------------------------------ fitur */

.features {
  display: grid;
  gap: 20px;
  padding-top: 48px;
}

/* Kartu putih membulat tanpa bayangan; ponsel menyembul dari bawah kartu. */
.feature {
  display: grid;
  gap: 28px;
  padding: 28px 22px 0;
  border-radius: 28px;
  background: var(--card);
  overflow: hidden;
}

.feature .phone-sm {
  justify-self: center;
  width: min(290px, 100%);
  margin-right: 5px;
}
/* Hanya bagian atas layar yang tampil: bagian bawah terpotong tepi kartu. */
.phone-crop {
  aspect-ratio: 290 / 460;
  overflow: hidden;
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 0;
}
.phone-crop img { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* Ponsel lembar Catat: bagian bawah (keypad) lebih penting, jadi potongannya lebih tinggi. */
.feature .phone-sm:not(.phone-crop) {
  aspect-ratio: 290 / 520;
  overflow: hidden;
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: 0;
}

/* ------------------------------------------------------------------ privasi */

.privacy {
  display: grid;
  gap: 20px;
  padding-top: 64px;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border-radius: 20px;
  background: var(--card);
}
.row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0 16px;
  padding: 14px 0;
}
.row + .row { border-top: 1px solid var(--sep); }
.tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink);
}
.tile .ico { width: 22px; height: 22px; }
.tile-blue { background: var(--pastel-blue); }
.tile-mint { background: var(--pastel-mint); }
.tile-pink { background: var(--pastel-pink); }
.tile-yellow { background: var(--pastel-yellow); }
.tile-purple { background: var(--pastel-purple); }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-text strong { font-size: 16px; font-weight: 800; line-height: 1.35; }
.row-text span { font-size: 15px; font-weight: 600; color: var(--label-2); line-height: 1.45; }

.note { font-size: 15px; font-weight: 600; color: var(--label-2); }
.note a { color: var(--label); font-weight: 800; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ penutup */

.closing { padding-top: 64px; padding-bottom: 56px; }

.closing-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 22px;
  border-radius: 28px;
  background: var(--card);
}
.gembul-happy { width: 96px; }
.closing-text p { margin-top: 10px; max-width: 34em; font-weight: 600; color: var(--label-2); }
.closing-text .actions { margin-top: 22px; }

/* ------------------------------------------------------------------ footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  padding-bottom: 40px;
  font-size: 15px;
  font-weight: 600;
  color: var(--label-2);
}
/* Garis pemisah selebar isi (bukan selebar padding). */
.footer::before { content: ''; flex-basis: 100%; margin-bottom: 12px; border-top: 1px solid var(--sep); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-right: auto; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--label);
  font-weight: 800;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ layar lebar */

@media (min-width: 560px) {
  .actions .btn-primary { width: auto; }
  .stores .store { flex: 0 0 auto; }
}

@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .feature { padding: 36px 36px 0; }
  .closing-card { flex-direction: row; align-items: center; gap: 32px; padding: 36px; }
  .gembul-happy { width: 132px; flex: none; }
}

@media (min-width: 880px) {
  .topbar { padding-top: 20px; padding-bottom: 20px; }
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 48px;
    padding-top: 40px;
  }
  h1 { max-width: 17ch; }
  .hero-visual { width: 330px; }
  .sts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding-top: 72px;
  }
  .sts-card { justify-self: center; }
  .features { padding-top: 72px; gap: 24px; }
  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 40px;
    padding: 0 56px;
  }
  .feature-text { align-self: center; padding: 56px 0; }
  .feature .phone-sm { margin-top: 48px; }
  .feature:nth-child(even) .feature-text { order: 2; }
  .privacy {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 48px;
    padding-top: 88px;
  }
  .privacy h2 { grid-column: 1; }
  .privacy .rows { grid-column: 2; grid-row: 1 / span 2; }
  .privacy .note { grid-column: 1; grid-row: 2; align-self: start; }
  .closing { padding-top: 88px; padding-bottom: 72px; }
  .closing-card { padding: 44px 56px; gap: 44px; }
}
