:root {
  --ink: #E9F0E7;
  --ink-dim: #A6B8AC;
  --muted: #6E8579;
  --line: rgba(233, 240, 231, .10);
  --moss: #6FA87D;
  --gold: #C9A87C;
  --bg: #080D0B;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: clamp(20px, 3.4vw, 46px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

canvas#hutan {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
canvas#hutan:active { cursor: grabbing; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* Scrim: menahan teks tetap terbaca di jam berapa pun tanpa mengaburkan hutan. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(6, 10, 9, .46) 0%, rgba(6, 10, 9, 0) 22%),
    linear-gradient(104deg, rgba(6, 10, 9, .60) 0%, rgba(6, 10, 9, .26) 24%, rgba(6, 10, 9, 0) 48%),
    linear-gradient(to top, rgba(6, 10, 9, .68) 0%, rgba(6, 10, 9, 0) 26%);
}

/* ---------- kepala ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: var(--pad);
  pointer-events: none;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  pointer-events: auto;
}
.mark svg { width: 17px; height: 17px; color: var(--moss); flex: none; }
.mark span {
  font-size: 10.5px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .82;
}

.readout {
  display: flex;
  gap: clamp(18px, 2.8vw, 40px);
  margin: 0;
  text-align: right;
}
.readout dt {
  font-size: 8.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.readout dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* ---------- judul ---------- */

.hero {
  position: fixed;
  z-index: 2;
  left: var(--pad);
  top: clamp(92px, 15vh, 190px);
  max-width: 48vw;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s ease .15s, transform 1.1s cubic-bezier(.16, 1, .3, 1) .15s;
}
body.siap .hero { opacity: 1; transform: none; }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 clamp(14px, 2.2vh, 26px);
  font-size: 9.5px;
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--moss);
}
.kicker::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

.hero h1 {
  margin: 0 0 clamp(16px, 2.6vh, 30px);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 5.4vw, 78px);
  line-height: .98;
  letter-spacing: -.025em;
  font-optical-sizing: auto;
  white-space: nowrap;
}
.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

.lede {
  margin: 0;
  max-width: 32ch;
  font-size: 11.5px;
  line-height: 1.85;
  letter-spacing: .01em;
  color: var(--ink-dim);
}

/* ---------- kaki ---------- */

.bot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: var(--pad);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease .5s;
}
body.siap .bot { opacity: 1; }

.hint {
  margin: 0;
  max-width: 42ch;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: .05em;
  color: rgba(233, 240, 231, .40);
}

.clock {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .14em;
  color: rgba(233, 240, 231, .55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock__zona { color: rgba(233, 240, 231, .32); letter-spacing: .12em; }

/* ---------- tooltip ---------- */

.tip {
  position: fixed;
  z-index: 5;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 14px));
  padding: 10px 14px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 15, 13, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
  white-space: nowrap;
}
.tip[data-on="1"] { opacity: 1; }
.tip__sp {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.tip__meta {
  margin: 3px 0 0;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- panel ---------- */

.panel {
  position: fixed;
  z-index: 6;
  top: clamp(16px, 3vh, 34px);
  right: clamp(16px, 3vw, 34px);
  width: min(366px, calc(100vw - 32px));
  max-height: calc(100vh - 2 * clamp(16px, 3vh, 34px));
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(120% 60% at 80% 0%, rgba(111, 168, 125, .07), transparent 60%),
    linear-gradient(180deg, rgba(13, 21, 18, .95), rgba(8, 13, 11, .97));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  transform: translateX(calc(100% + 60px));
  opacity: 0;
  transition: transform .55s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
  pointer-events: none;
}
.panel[data-open="1"] {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.panel__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .3s;
}
.panel__close:hover { color: var(--ink); border-color: rgba(233, 240, 231, .26); transform: rotate(90deg); }
.panel__close svg { width: 12px; height: 12px; }

.panel__eyebrow {
  margin: 0 0 18px;
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--moss);
}

.panel__nama {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.panel__latin {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

.panel__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
  margin: 30px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}
.panel__meta dt {
  margin-bottom: 6px;
  font-size: 8.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel__meta dd {
  margin: 0;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--ink);
}

.panel__notes {
  margin-top: 28px;
  padding: 18px 18px 20px;
  border-left: 1px solid rgba(201, 168, 124, .35);
  background: linear-gradient(90deg, rgba(201, 168, 124, .05), transparent 70%);
}
.panel__notes-label {
  margin: 0 0 10px;
  font-size: 8.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(201, 168, 124, .75);
}
.panel__notes-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-dim);
}
.panel__notes-text.is-empty { color: rgba(166, 184, 172, .42); font-style: italic; }

.panel__foot {
  margin: 28px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: rgba(233, 240, 231, .3);
}
.panel code, .empty code {
  font-family: var(--mono);
  color: var(--ink-dim);
  background: rgba(233, 240, 231, .06);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- keadaan kosong ---------- */

.empty {
  position: fixed;
  z-index: 8;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  padding: 34px 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(9, 15, 13, .9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: center;
}
.empty__eyebrow {
  margin: 0 0 14px;
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--moss);
}
.empty h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 26px;
}
.empty p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-dim);
}

/* ---------- layar kecil ---------- */

@media (max-width: 820px) {
  .hero {
    max-width: none;
    right: var(--pad);
    top: clamp(84px, 13vh, 130px);
  }
  .hero h1 { font-size: clamp(34px, 10vw, 54px); }
  .lede { display: none; }

  .readout { gap: 18px; }
  .readout div:nth-child(3) { display: none; }

  .bot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hint { max-width: 30ch; }

  .scrim {
    background:
      linear-gradient(to bottom, rgba(6, 10, 9, .46) 0%, rgba(6, 10, 9, 0) 20%),
      linear-gradient(104deg, rgba(6, 10, 9, .58) 0%, rgba(6, 10, 9, .22) 30%, rgba(6, 10, 9, 0) 62%),
      linear-gradient(to top, rgba(6, 10, 9, .82) 0%, rgba(6, 10, 9, .2) 22%, rgba(6, 10, 9, 0) 34%);
  }

  .panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 68vh;
    padding: 26px 22px;
    transform: translateY(calc(100% + 40px));
  }
}

@media (max-height: 640px) {
  .lede { display: none; }
  .hero { top: 88px; }
}

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