/* Aksa Bali landing — Tridatu / Quiet Precision.
   Token warna mengikuti design-aksara-bali-android.md §3. */

@font-face {
  font-family: "Aksara Bali";
  src: url("fonts/NotoSansBalinese.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+1B00-1B7F, U+25CC;
}

:root {
  --red: #A4232E;
  --red-pressed: #831B25;
  --red-soft: #FAECEE;
  --on-red: #FFFFFF;
  --ink: #171717;
  --surface: #FFFFFF;
  --bg: #F8F7F5;
  --surface-alt: #F1F0EE;
  --outline: #E3E0DD;
  --text-2: #555555;
  --text-3: #6E6E6E;
  --success: #28754C;

  /* Benang tridatu */
  --t-red: #A4232E;
  --t-red-edge: #6E141C;
  --t-white: #FFFFFF;
  --t-white-edge: #171717;
  --t-black: #171717;
  --t-black-edge: #171717;
  --t-gap: var(--bg);

  --font-ui: "Plus Jakarta Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-bali: "Aksara Bali", "Noto Sans Balinese", "Noto Serif Balinese", sans-serif;

  --radius-card: 16px;
  --radius-ctl: 12px;
  --gutter: 20px;
  --wrap: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red: #E37780;
    --red-pressed: #F29AA2;
    --red-soft: #3B2428;
    --on-red: #1A0B0D;
    --ink: #F6F3F1;
    --surface: #1B1B1B;
    --bg: #111111;
    --surface-alt: #242424;
    --outline: #393939;
    --text-2: #C8C3BF;
    --text-3: #A7A19D;
    --success: #7BD3A1;

    --t-red: #C93A47;
    --t-red-edge: #E37780;
    --t-white: #F6F3F1;
    --t-white-edge: #F6F3F1;
    --t-black: #050505;
    --t-black-edge: #77716C;

    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

[lang="ban-Bali"] { font-family: var(--font-bali); }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: var(--radius-ctl);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--outline); }

.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; min-height: 48px;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand__tag { font-size: .8125rem; color: var(--text-2); }

.mark {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
}
.mark span { font-size: 22px; line-height: 1; transform: translateY(-1px); }
.mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: var(--red);
}
@media (prefers-color-scheme: dark) {
  .mark::after { background: #C93A47; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  border-radius: var(--radius-ctl);
  border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: var(--on-red); }
.btn--primary:hover { background: var(--red-pressed); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--outline); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: .9375rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }

.link {
  display: inline-flex; align-items: center; min-height: 48px;
  font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--outline);
  text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.link:hover { text-decoration-color: var(--red); }

/* ---------- Hero ---------- */

.hero { padding: clamp(32px, 7vw, 72px) 0 0; }
.hero__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface);
  font-size: .875rem; font-weight: 600; color: var(--text-2);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--red) 0%, transparent); }
}

.hero__title { margin-top: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; align-items: center; }
.hero__bali {
  display: flex; flex-wrap: wrap; justify-content: center; column-gap: .45em;
  font-weight: 500;
  font-size: clamp(2.25rem, 12vw, 7rem);
  line-height: 1.55;
  letter-spacing: 0;
}
.hero__bali > span { white-space: nowrap; }
.hero__latin {
  margin-top: 4px;
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  font-weight: 800; letter-spacing: -0.025em;
}
.hero__lead {
  margin-top: 16px; max-width: 34rem;
  color: var(--text-2); font-size: clamp(1rem, 2.2vw, 1.125rem);
}

/* ---------- Countdown ---------- */

.countdown { margin-top: clamp(28px, 5vw, 40px); width: 100%; max-width: 640px; }
.countdown__label { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.countdown__grid {
  margin-top: 12px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 14px);
}
.unit {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(14px, 3vw, 22px) 6px clamp(10px, 2vw, 16px);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
}
.unit__num {
  display: block;
  font-size: clamp(2.125rem, 8.5vw, 4rem);
  font-weight: 800; line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.unit__num.is-tick { animation: tick .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes tick {
  from { opacity: .25; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.unit__label { margin-top: 8px; font-size: .8125rem; font-weight: 600; color: var(--text-2); }
.unit__bali { margin-top: 2px; font-size: 1rem; line-height: 1.5; color: var(--red); min-height: 1.5em; }
.countdown__note { margin-top: 10px; font-size: .8125rem; color: var(--text-3); }

.hero__actions {
  margin-top: clamp(24px, 4vw, 32px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 24px;
}

/* ---------- Benang tridatu ---------- */

.thread {
  display: block; width: 100%; height: 22px;
  margin: clamp(48px, 8vw, 80px) 0 0;
  overflow: visible;
}
.thread path { fill: none; stroke-linejoin: round; stroke-linecap: butt; }
.thread .t-gap { stroke: var(--t-gap); stroke-width: 6.6; }
.thread .t-edge { stroke-width: 4.6; }
.thread .t-fill { stroke-width: 3; }
.thread .t-edge.t-red { stroke: var(--t-red-edge); }
.thread .t-fill.t-red { stroke: var(--t-red); }
.thread .t-edge.t-white { stroke: var(--t-white-edge); }
.thread .t-fill.t-white { stroke: var(--t-white); }
.thread .t-edge.t-black { stroke: var(--t-black-edge); }
.thread .t-fill.t-black { stroke: var(--t-black); }
.thread.is-drawing { animation: reveal 1.8s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes reveal {
  from { clip-path: inset(-20px 100% -20px 0); }
  to { clip-path: inset(-20px 0 -20px 0); }
}

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 9vw, 96px) 0; }
.section--alt { background: var(--surface-alt); }
.section__title { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; max-width: 26ch; text-wrap: balance; }
.section__lead { margin-top: 10px; color: var(--text-2); max-width: 40rem; }

.features {
  list-style: none; margin: 32px 0 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
}
.feature__num {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--red-soft); color: var(--red);
  font-size: 1.375rem; line-height: 1;
}
.feature h3 { margin-top: 16px; font-size: 1.125rem; }
.feature p { margin-top: 6px; color: var(--text-2); font-size: .9375rem; }

.curriculum { margin-top: 28px; }
.curriculum__label { font-size: .9375rem; color: var(--text-2); }
.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--outline); border-radius: 999px;
  background: var(--surface);
  font-size: .875rem; font-weight: 600;
}

/* ---------- Wreastra explorer ---------- */

.explorer {
  margin-top: 32px;
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .explorer { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}

.explorer__grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.glyph-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 76px; padding: 6px 2px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--outline); border-radius: 12px;
  font: inherit; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.glyph-btn:hover { border-color: var(--text-3); }
.glyph-btn[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); }
.glyph-btn__g { font-family: var(--font-bali); font-size: 1.75rem; line-height: 1.5; }
.glyph-btn__l { font-size: .75rem; font-weight: 600; color: var(--text-2); }
.glyph-btn[aria-pressed="true"] .glyph-btn__l { color: var(--red); }

.explorer__detail {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
}
@media (min-width: 520px) and (max-width: 879px) {
  .explorer__detail { grid-template-columns: 180px minmax(0, 1fr); align-items: center; }
}
@media (max-width: 879px) { .explorer__detail { order: -1; } }

.detail__glyph {
  display: grid; place-items: center;
  min-height: 180px;
  font-size: 7rem; line-height: 1.6;
  border-radius: 12px;
  background:
    linear-gradient(var(--outline), var(--outline)) center / 100% 1px no-repeat,
    linear-gradient(var(--outline), var(--outline)) center / 1px 100% no-repeat,
    var(--bg);
}
.detail__name { font-size: 1.5rem; font-weight: 800; }
.detail__meta { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.detail__meta div { display: flex; flex-direction: column; }
.detail__meta dt { font-size: .75rem; font-weight: 600; color: var(--text-3); }
.detail__meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail__note { margin-top: 12px; color: var(--text-2); font-size: .9375rem; }
.detail__example {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--outline);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
}
.detail__example-bali { font-size: 1.75rem; line-height: 1.6; }
.detail__example-latin { color: var(--text-2); font-size: .9375rem; }
.detail__example-latin::before { content: "contoh: "; color: var(--text-3); }

/* ---------- Whitelist ---------- */

.whitelist {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .whitelist { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: start; gap: 64px; }
}

.checks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 32px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--red-soft);
}
.checks li::after {
  content: ""; position: absolute; left: 7px; top: 8px;
  width: 5px; height: 9px;
  border: solid var(--red); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.whitelist__count {
  margin-top: 24px; display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--text-2);
}
.whitelist__count strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
}
.form-card { padding: clamp(20px, 4vw, 28px); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9375rem; font-weight: 600; }
.optional { font-weight: 500; color: var(--text-3); }
.field input, .field select {
  width: 100%; min-height: 52px; padding: 0 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--outline); border-radius: var(--radius-ctl);
  font: inherit; font-size: 1rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field input::placeholder { color: var(--text-3); }
.field input:hover, .field select:hover { border-color: var(--text-3); }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.field.has-error input { border-color: var(--red); }
.field__error { font-size: .8125rem; font-weight: 600; color: var(--red); min-height: 0; }
.field__error:empty { display: none; }
.field__error:not(:empty)::before { content: "! "; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__status { font-size: .875rem; font-weight: 600; color: var(--red); text-align: center; }
.form__status:empty { display: none; }
.form__status.is-ok { color: var(--success); }
.form__fineprint { font-size: .8125rem; color: var(--text-3); text-align: center; }

.btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 8px 0; }
.success:focus { outline: none; }
.success__badge {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--red-soft); color: var(--red);
}
.success__title { margin-top: 6px; font-size: 1.5rem; font-weight: 800; }
.success__text { color: var(--text-2); max-width: 30ch; }
.success__text strong { color: var(--ink); }
.success__actions { margin-top: 10px; display: grid; gap: 10px; width: 100%; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--outline); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand--footer .mark { width: 34px; height: 34px; border-radius: 9px; }
.brand--footer .mark span { font-size: 19px; }
.footer__meta { font-size: .8125rem; color: var(--text-3); }
.footer__meta a { color: var(--text-2); }

/* ---------- Small screens ---------- */

@media (max-width: 559px) {
  .explorer__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .glyph-btn { min-height: 64px; }
  .glyph-btn__g { font-size: 1.5rem; }
  .brand__tag { display: none; }
}
.lbl-short { display: none; }
.brand__name, .btn { white-space: nowrap; }

@media (max-width: 379px) {
  :root { --gutter: 16px; }
  .explorer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
