/* ============================================================
   OUR KEBUN BARU — NRP engagement platform
   Warm civic-architectural design system.
   Mobile-portrait first (§3.6.2) · kiosk targets ≥64px (§4.3.2)
   Contrast ≥4.5:1, no colour-only information (§4.3.4).
   ============================================================ */

:root {
  --paper: #F6EFE2;        /* warm paper */
  --card: #FFFDF7;
  --ink: #2C2A26;          /* 12.9:1 on paper */
  --ink-soft: #5D5748;     /* 5.9:1 on paper */
  --green: #2E6E4E;        /* 5.6:1 on paper */
  --green-deep: #1F4E37;
  --terra: #B4552D;        /* 4.6:1 on paper */
  --gold: #C99A2C;
  --blue: #3E5F8A;
  --line: #E2D8C2;
  --focus: #1849C6;

  --font-d: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-b: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Noto Sans', sans-serif;

  --tap: 48px;             /* web minimum (§4.3.2) */
  --rad: 16px;
  --shadow: 0 8px 26px rgba(44, 42, 38, .10);
}
body.kiosk { --tap: 64px; font-size: 20px; }  /* kiosk minimums (§4.3.2–3) */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body {
  font-family: var(--font-b);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; color: inherit; background: none; border: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* subtle paper grain */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle 1px at 21% 32%, rgba(44,42,38,.05) 99%, transparent),
    radial-gradient(circle 1px at 64% 58%, rgba(44,42,38,.05) 99%, transparent),
    radial-gradient(circle 1px at 84% 21%, rgba(44,42,38,.04) 99%, transparent);
  background-size: 260px 260px;
}
#app { position: relative; z-index: 1; }

.scr { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 64px; }
.scr.center { justify-content: flex-start; }

/* ---------------- header ---------------- */
.hd {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.hd-id { display: flex; align-items: center; gap: .6rem; }
.hd-mark { color: var(--terra); font-size: 1.2rem; }
.hd-name { font-family: var(--font-d); font-weight: 600; font-size: 1.1rem; line-height: 1.15; }
.hd-sub { font-size: .74rem; color: var(--ink-soft); letter-spacing: .04em; }
.langsw { display: flex; gap: .35rem; flex-wrap: wrap; }
.lang-chip {
  min-height: var(--tap); min-width: var(--tap);
  padding: .3em .8em;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  font-size: .92rem; font-weight: 600;
  color: var(--ink);
  background: transparent;
}
.lang-chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------------- shell ---------------- */
.panel {
  width: 100%; max-width: 760px;
  margin: 0 auto;
  padding: 1.4rem 1.1rem 2rem;
  flex: 1;
}
.panel.wide { max-width: 880px; }
.h1 { font-family: var(--font-d); font-weight: 600; font-size: clamp(1.6rem, 5.2vw, 2.3rem); line-height: 1.12; margin-bottom: .5rem; }
.h1.tight { margin-bottom: .15rem; }
.h2 { font-family: var(--font-d); font-weight: 600; font-size: 1.25rem; margin-bottom: .5rem; }
.sub { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 1rem; max-width: 62ch; }
.sub.small { font-size: .88rem; }

/* ---------------- buttons ---------------- */
.bigbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: max(var(--tap), 56px);
  padding: .7em 1.5em;
  border: 2px solid var(--ink);
  border-radius: var(--rad);
  background: var(--card);
  font-size: 1.08rem; font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.bigbtn:active { transform: translateY(2px); }
.bigbtn.primary { background: var(--green); border-color: var(--green-deep); color: #fff; }
.txtbtn {
  min-height: var(--tap);
  padding: .5em .9em;
  font-size: 1rem; font-weight: 700;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btnrow { display: flex; gap: .8rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.1rem; }
.btnrow .txtbtn { margin-right: auto; }

/* ---------------- language screen ---------------- */
.lang-grid { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-top: 1.2rem; }
@media (min-width: 640px) { .lang-grid { grid-template-columns: 1fr 1fr; } }
.lang-grid .bigbtn { min-height: max(var(--tap), 76px); font-size: 1.35rem; }

/* ---------------- block screen ---------------- */
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-top: 1rem; }
.blockcard {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--rad);
  box-shadow: var(--shadow);
  padding: 1.1rem .8rem;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  min-height: max(var(--tap), 150px);
  text-align: center;
  transition: transform .12s ease;
}
.blockcard:active { transform: translateY(2px); }
.bc-ic { width: 52px; height: 52px; color: var(--terra); }
.bc-ic svg { width: 100%; height: 100%; }
.bc-name { font-family: var(--font-d); font-weight: 700; font-size: 1.2rem; }
.bc-sub { font-size: .82rem; color: var(--ink-soft); }
.bc-icname { font-size: .74rem; color: var(--terra); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ---------------- station chrome ---------------- */
.st-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.st-pos { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); }
.tokens { display: flex; gap: .35rem; }
.token {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px dashed var(--ink-soft);
  display: grid; place-items: center;
  color: var(--paper);
}
.token.got { background: var(--gold); border: 2px solid var(--ink); color: var(--ink); animation: pop .4s cubic-bezier(.3,1.6,.6,1); }
.token svg { width: 22px; height: 22px; }
@keyframes pop { from { transform: scale(1.7); } to { transform: none; } }

/* ---------------- scene + hotspots ---------------- */
.scene {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: var(--rad);
  overflow: hidden;
  background: #DDD8CC;
  box-shadow: var(--shadow);
  aspect-ratio: 8 / 5;
}
.scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 3;                       /* above the description card — never blocked */
  width: max(var(--tap), 52px); height: max(var(--tap), 52px);
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--terra);
  color: var(--terra);
  font-size: 1.5rem; font-weight: 800;
  box-shadow: 0 4px 14px rgba(44,42,38,.3);
  animation: pulse 2s ease-in-out infinite;
}
.hotspot.seen { background: var(--green); border-color: var(--green-deep); color: #fff; animation: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 4px 14px rgba(44,42,38,.3), 0 0 0 0 rgba(180,85,45,.5); } 60% { box-shadow: 0 4px 14px rgba(44,42,38,.3), 0 0 0 14px rgba(180,85,45,0); } }
.hs-card {
  position: absolute; left: .8rem; right: .8rem; bottom: .8rem;
  z-index: 2;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: .7rem .9rem;
  font-size: .95rem;
  box-shadow: var(--shadow);
}
.hs-card strong { display: block; color: var(--terra); margin-bottom: .15rem; }

/* ---------------- before/after compare ---------------- */
.scene.compare { touch-action: none; }
.cmp-after, .cmp-before { position: absolute; inset: 0; }
.cmp-before { clip-path: inset(0 50% 0 0); }
.cmp-after svg, .cmp-before svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 6px; margin-left: -3px;
  background: var(--ink);
  cursor: ew-resize;
  touch-action: none;
}
.cmp-handle span {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(var(--tap), 56px); height: max(var(--tap), 56px);
  border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-size: 1.3rem;
  border: 3px solid var(--paper);
}
.cmp-tag {
  position: absolute; top: .7rem;
  font-size: .82rem; font-weight: 800; letter-spacing: .04em;
  padding: .25em .7em; border-radius: 999px;
  border: 2px solid var(--ink);
}
.tag-b { left: .7rem; background: #E8E2D2; color: var(--ink); }
.tag-a { right: .7rem; background: var(--green); color: #fff; border-color: var(--green-deep); }
.work { font-size: .98rem; color: var(--ink-soft); margin-top: .8rem; max-width: 70ch; }

/* ---------------- preference options ---------------- */
.opt-grid { display: grid; gap: .9rem; margin-top: .6rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .opt-grid.n2 { grid-template-columns: 1fr 1fr; } .opt-grid.n3 { grid-template-columns: repeat(3, 1fr); } }
.optcard {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--rad);
  box-shadow: var(--shadow);
  padding: 1rem .9rem;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  text-align: center;
  min-height: max(var(--tap), 150px);
  transition: transform .12s ease;
}
.optcard:active { transform: translateY(2px); }
.optcard.on { border-color: var(--green); border-width: 3px; background: #EDF3EA; }
.opt-art { width: 58px; height: 58px; color: var(--green); }
.opt-art svg { width: 100%; height: 100%; }
.optcard.on .opt-art { color: var(--green-deep); }
.opt-label { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.opt-sub { font-size: .85rem; color: var(--ink-soft); }

/* ---------------- summary ---------------- */
.sum-list { display: flex; flex-direction: column; gap: .8rem; margin: .6rem 0; }
.sum-row {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--rad);
  padding: .9rem 1rem;
  display: grid; gap: .6rem;
}
@media (min-width: 680px) { .sum-row { grid-template-columns: 1fr 1.2fr; } }
.sum-station strong { display: block; font-size: .98rem; }
.sum-station span { font-size: .85rem; color: var(--terra); font-weight: 700; }
.agg-bar { display: grid; grid-template-columns: minmax(90px, .9fr) 1.4fr 3.2em; gap: .5rem; align-items: center; margin-bottom: .3rem; }
.agg-label { font-size: .8rem; line-height: 1.2; }
.agg-bar.mine .agg-label { font-weight: 800; color: var(--green-deep); }
.agg-track { height: 12px; border-radius: 999px; background: #E8E2D2; overflow: hidden; border: 1px solid var(--line); }
.agg-fill { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .7s ease; }
.agg-bar.mine .agg-fill { background: var(--terra); }
.agg-pct { font-size: .82rem; font-weight: 700; text-align: right; }
.agg-note { font-size: .76rem; color: var(--ink-soft); }
.agg-cap { font-size: .8rem; color: var(--ink-soft); }

/* ---------------- intent / contact ---------------- */
.intent-grid { display: flex; flex-direction: column; gap: .8rem; margin: 1rem 0; max-width: 460px; }
.field { display: block; margin: 1rem 0 .6rem; }
.field span { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.field input {
  width: 100%; min-height: max(var(--tap), 54px);
  font-size: 1.05rem; font-family: inherit;
  padding: .5em .8em;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--card); color: var(--ink);
}
.check { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; cursor: pointer; }
.check input { width: 26px; height: 26px; margin-top: .15rem; accent-color: var(--green); flex-shrink: 0; }
.check span { font-size: .95rem; }

/* ---------------- done ---------------- */
.done-tokens { margin-bottom: .6rem; }
.sync { font-size: .88rem; font-weight: 700; padding: .4em .9em; border-radius: 999px; display: inline-block; margin-bottom: 1rem; }
.sync.ok { background: #E3EEE4; color: var(--green-deep); border: 1.5px solid var(--green); }
.sync.pending { background: #F6E8D9; color: #7A4A20; border: 1.5px solid var(--terra); }
.official { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--rad); padding: 1rem 1.1rem; margin: .6rem 0 1rem; }
.off-row { display: grid; gap: .1rem; padding: .55rem 0; border-top: 1px dashed var(--line); font-size: .92rem; }
.off-row:first-of-type { border-top: 0; }
.off-row strong { font-family: var(--font-d); font-size: 1.02rem; }
.off-row span { color: var(--ink-soft); }
.qrbox { text-align: center; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--rad); padding: 1rem; margin-bottom: 1rem; }
.qr { width: min(46vw, 240px); margin: .5rem auto 0; }
.qr svg { width: 100%; height: auto; display: block; }

/* ---------------- standing disclosure (§3.4.1) ---------------- */
.disclose {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--ink); color: var(--paper);
  font-size: .82rem; font-weight: 600;
  text-align: center;
  padding: .55em 1em calc(.55em + env(safe-area-inset-bottom));
}
.demotag {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #E8E2D2; color: var(--ink-soft);
  font-size: .74rem; text-align: center;
  padding: .5em 1em calc(.5em + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

/* ---------------- attract (kiosk) ---------------- */
.attract {
  justify-content: center; align-items: center; text-align: center;
  background: radial-gradient(120% 90% at 50% 10%, #37795A 0%, var(--green-deep) 70%);
  color: var(--paper);
  cursor: pointer;
  padding: 2rem;
}
.attract-icons { display: flex; gap: 2.4vmin; margin-bottom: 3vmin; }
.a-ic { width: clamp(44px, 9vmin, 96px); height: clamp(44px, 9vmin, 96px); color: #EFD9A0; animation: drift 4s ease-in-out infinite; }
.a-ic svg { width: 100%; height: 100%; }
.a-ic1 { animation-delay: .5s; } .a-ic2 { animation-delay: 1s; } .a-ic3 { animation-delay: 1.5s; } .a-ic4 { animation-delay: 2s; }
@keyframes drift { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.4vmin); } }
.attract-title { font-family: var(--font-d); font-size: clamp(2.4rem, 7.5vmin, 5.4rem); font-weight: 600; line-height: 1.05; }
.attract-title span { display: block; font-size: .38em; font-family: var(--font-b); font-weight: 600; opacity: .85; margin-top: 1.4vmin; }
.attract-sub { max-width: 34em; margin: 2.4vmin 0 4vmin; font-size: clamp(1rem, 2.6vmin, 1.5rem); opacity: .92; }
.attract-cta {
  font-weight: 800; font-size: clamp(1rem, 2.8vmin, 1.6rem);
  background: var(--gold); color: var(--ink);
  padding: .7em 1.6em; border-radius: 999px;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 18vh; transform: translateX(-50%);
  background: var(--green-deep); color: #fff;
  font-weight: 700; padding: .6em 1.2em; border-radius: 999px;
  z-index: 80; box-shadow: var(--shadow);
  animation: toastup 1.6s ease forwards;
}
@keyframes toastup { 0% { opacity: 0; transform: translateX(-50%) translateY(10px); } 15%,80% { opacity: 1; transform: translateX(-50%); } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
