@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #eef1f4;
  --card: #ffffff;
  --ink: #0d1b2a;
  --ink-2: #46566a;
  --line: #d3dae2;
  --signal: #ffb703;
  --signal-soft: #fff1cc;
  --ok: #14705a;
  --bad: #b3261e;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a121b;
    --card: #111d2a;
    --ink: #e9eff5;
    --ink-2: #9fb0c2;
    --line: #26384c;
    --signal-soft: #2c2410;
    --ok: #4cc9a4;
    --bad: #ff8a80;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
}

h1, h2 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- kerangka */

.top, main, .foot {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

.top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-block: 22px;
}

.mark {
  font: 800 1.5rem/1 var(--display);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.by { color: var(--ink-2); font-size: 0.9rem; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding-block: clamp(16px, 5vw, 64px) 48px;
}

main.narrow {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
}

.intro h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-weight: 700;
  line-height: 1.02;
}

.intro .lead {
  margin-top: 20px;
  max-width: 34ch;
  font-size: 1.15rem;
  color: var(--ink-2);
}

.facts {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 40ch;
}

.facts li {
  padding-left: 16px;
  border-left: 3px solid var(--signal);
  color: var(--ink-2);
}

.foot {
  padding-block: 20px 28px;
  color: var(--ink-2);
  font-size: 0.875rem;
}

.foot p { max-width: 64ch; }

/* ------------------------------------------------------------- komponen */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.drop {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  min-height: 220px;
  padding: 28px 20px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop:hover,
.drop.over,
.drop:focus-within {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.drop:focus-within { outline: 3px solid var(--signal); outline-offset: 3px; }

.drop-title { font: 700 1.5rem/1.2 var(--display); }
.drop-sub { color: var(--ink-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font: 600 1rem/1 var(--body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover:not(:disabled) { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--ink); color: var(--card); }
.btn.quiet {
  padding-inline: 6px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.quiet:hover:not(:disabled) { color: var(--bad); background: transparent; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }

.list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--line);
}

.list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { color: var(--bad); background: var(--bg); }

.summary { margin-top: 12px; color: var(--ink-2); font-size: 0.925rem; }
.summary.warn { color: var(--bad); }

.opts { margin-top: 18px; }
.opts summary { cursor: pointer; font-weight: 600; width: fit-content; }
.field { display: grid; gap: 6px; margin-top: 12px; }
.field label { font-size: 0.9rem; color: var(--ink-2); }

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 84px; resize: vertical; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }

.error { margin-top: 14px; color: var(--bad); font-weight: 500; }
.error:empty { display: none; }

/* progres */

progress {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 14px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
progress::-webkit-progress-bar { background: var(--bg); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--signal); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--signal); border-radius: 999px; }

.pct { font: 700 2.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.pct-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.meta { margin-top: 12px; color: var(--ink-2); font-size: 0.925rem; font-variant-numeric: tabular-nums; }

.list.rows li { grid-template-columns: minmax(0, 1fr) 84px 52px; }
.list.rows progress { height: 8px; }
.list.rows .fsize { text-align: right; }

/* ------------------------------------------------------------------ resi */

.resi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: cetak 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes cetak {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-6px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

.resi-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 22px clamp(18px, 3vw, 28px) 0;
}

.resi-head h2 { font-size: 1.75rem; font-weight: 700; }
.resi-no { color: var(--ink-2); font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.resi-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 18px clamp(18px, 3vw, 28px) 26px;
}

.qr {
  width: 148px;
  height: 148px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  image-rendering: pixelated;
}

.linkrow { display: flex; gap: 8px; }
.linkrow input { min-width: 0; font-variant-numeric: tabular-nums; }

.facts-dl { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.facts-dl dt { color: var(--ink-2); }
.facts-dl dd { margin: 0; font-variant-numeric: tabular-nums; }

.perf {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--line);
}
.perf::before,
.perf::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}
.perf::before { left: -13px; clip-path: inset(0 0 0 50%); }
.perf::after { right: -13px; clip-path: inset(0 50% 0 0); }

.resi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px clamp(18px, 3vw, 28px) 22px; }

.status-ok { color: var(--ok); font-weight: 600; }

/* ------------------------------------------------------- halaman unduh */

.dl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dl-row:first-child { border-top: 1px solid var(--line); }
.dl-row .fsize { grid-column: 1; }
.dl-row .btn { grid-column: 2; grid-row: 1 / span 2; }

.lead-dl { margin-top: 10px; color: var(--ink-2); }
.gap-top { margin-top: 24px; }
.page-h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); line-height: 1.05; font-weight: 700; }

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop { background: rgb(5 10 16 / 0.55); }
dialog h2 { font-size: 1.4rem; margin-bottom: 14px; }

@media (max-width: 860px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .intro .lead, .facts { max-width: none; }
}

@media (max-width: 520px) {
  .resi-body { grid-template-columns: minmax(0, 1fr); }
  .qr { width: 132px; height: 132px; }
  .linkrow { flex-direction: column; }
  .linkrow .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .resi { animation: none; }
  .drop { transition: none; }
}
