/* ==========================================================================
   Dimas Budiman — arsip yang bernapas
   Kertas krem, pena biru, kertas coklat, dan satu warna lampu sodium.
   Font: Dimas Hand (tulisan tangan Dimas), Boska (judul), Gambetta (teks),
   Courier Prime (label arsip).
   ========================================================================== */

@font-face {
  font-family: "Dimas Hand";
  src: url("../fonts/DimasHand-v2.woff2") format("woff2"),
       url("../fonts/DimasHand-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("../fonts/CourierPrime-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .38s cubic-bezier(.4, 0, .2, 1) both forget; }
::view-transition-new(root) { animation: .62s cubic-bezier(.2, .7, .1, 1) .08s both remember; }
@keyframes forget { to { opacity: 0; filter: blur(6px); } }
@keyframes remember { from { opacity: 0; filter: blur(8px); transform: translateY(8px); } }

:root {
  --paper: #f1ece1;
  --paper-2: #e6dfcf;
  --paper-3: #d9cfbb;
  --sheet: #fbf8f1;
  --ink: #1f2d73;          /* pena biru Dimas */
  --ink-2: #3a4a96;
  --ink-soft: rgb(31 45 115 / .5);
  --graphite: #23211d;
  --muted: #6c665a;
  --line: rgb(35 33 29 / .14);
  --line-strong: rgb(35 33 29 / .32);
  --kraft: #c9a676;
  --kraft-deep: #9c7a4a;
  --sodium: #de8f22;       /* lampu sodium, An Unreliable Tabletale */
  --stamp: #b5412f;        /* tinta stempel arsip */
  --rule: rgb(31 45 115 / .13);
  --margin-red: rgb(196 70 60 / .45);
  --night: #151412;

  --hand: "Dimas Hand", "Courier Prime", cursive;
  --display: "Boska", "Gambetta", Georgia, serif;
  --serif: "Gambetta", "Iowan Old Style", Georgia, serif;
  --mono: "Courier Prime", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --rhythm: clamp(80px, 11vw, 160px);
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --shadow-paper: 0 1px 1px rgb(35 33 29 / .06), 0 8px 20px -10px rgb(35 33 29 / .28);
  --shadow-lift: 0 2px 3px rgb(35 33 29 / .08), 0 26px 44px -18px rgb(35 33 29 / .45);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.15  0 0 0 0 0.13  0 0 0 0 0.1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.16'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:not(.lenis) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:not(.lenis) { scroll-behavior: auto; } }

body {
  margin: 0;
  color: var(--graphite);
  background-color: var(--paper);
  background-image: var(--grain);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  overflow-x: clip;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgb(222 143 34 / .35); color: var(--graphite); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
em, i { font-style: italic; }

.hand { font-family: var(--hand); font-weight: 400; letter-spacing: .01em; }
.mono { font-family: var(--mono); }
.display { font-family: var(--display); }
.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;
}
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.kicker b { color: var(--ink); font-weight: 400; }

/* ---------- kursor pena ---------- */

.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label, .has-cursor [data-cursor] { cursor: none; }
.has-cursor input, .has-cursor textarea, .has-cursor select, .has-cursor .drawer, .has-cursor .drawer * { cursor: auto; }
.has-cursor .drawer button, .has-cursor .drawer label, .has-cursor .drawer a { cursor: pointer; }
.cursor {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--ink);
  display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .3s, opacity .3s;
  will-change: transform;
}
.cursor span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--sheet);
  opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.cursor.is-label { width: 74px; height: 74px; margin: -37px 0 0 -37px; background: rgb(31 45 115 / .9); }
.cursor.is-label span { opacity: 1; }
.cursor.is-link { width: 36px; height: 36px; margin: -18px 0 0 -18px; background: rgb(31 45 115 / .14); }
.cursor.is-hidden { opacity: 0; }
.cursor.on-dark { background: var(--sheet); }
.cursor.on-dark span { color: var(--night); }
.cursor.on-dark.is-label { background: rgb(251 248 241 / .92); }
.cursor.on-dark.is-link { background: rgb(251 248 241 / .2); }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, transform .45s var(--ease);
}
.site-head.is-scrolled { border-bottom-color: var(--line); }
.site-head.is-away { transform: translateY(-100%); }
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 68px;
}
.brand {
  font-family: var(--hand);
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav { display: flex; gap: clamp(14px, 2vw, 30px); align-items: baseline; }
.nav a {
  font-family: var(--mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--graphite);
  position: relative;
  padding-block: 6px;
}
.nav a span { color: var(--muted); font-size: 11px; margin-right: 4px; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after,
.nav a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M1 4 C 20 1, 40 5, 60 3 S 90 2, 99 4' fill='none' stroke='%231f2d73' stroke-width='1.4' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
}
.nav-toggle {
  display: none;
  background: none; border: 0; padding: 8px 0;
  font-family: var(--mono); font-size: 14px; color: var(--ink);
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--paper); background-image: var(--grain);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s, transform .25s var(--ease), visibility 0s .25s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav a { font-size: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
}

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

.site-foot {
  margin-top: var(--rhythm);
  border-top: 1px solid var(--line);
  padding-block: 48px 64px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}
.site-foot .wrap { display: grid; gap: 28px; grid-template-columns: 1.4fr 1fr 1fr; }
.site-foot h2 { font-family: var(--hand); font-weight: 400; font-size: 40px; color: var(--ink); margin: 0 0 10px; line-height: 1; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .acc small { display: block; font-size: 11px; opacity: .8; }
.site-foot p { margin: 0; max-width: 38ch; font-family: var(--serif); font-size: 17px; color: var(--graphite); }
.site-foot .fine { display: block; margin-top: 12px; font-size: 12px; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* ---------- tombol & tautan ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--mono); font-size: 14px; letter-spacing: .02em;
  padding: 12px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--ink-2); color: var(--sheet); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgb(31 45 115 / .07); color: var(--ink); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.danger { border-color: #9b3228; background: transparent; color: #9b3228; }
.btn.danger:hover { background: rgb(155 50 40 / .08); }

.link-arrow {
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  text-decoration: none; display: inline-flex; gap: 8px; align-items: center;
}
.link-arrow:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex: none; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: 6px 13px;
  font-family: var(--mono); font-size: 13px; white-space: nowrap; line-height: 1.3;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.chip .n { opacity: .6; margin-left: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; flex: none; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-family: var(--mono); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--graphite); color: var(--sheet); }

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

.page-head { padding-block: clamp(40px, 7vw, 104px) clamp(28px, 4vw, 56px); }
.page-head .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px clamp(32px, 6vw, 96px); align-items: end; }
.page-title {
  font-family: var(--hand); font-weight: 400; color: var(--ink);
  font-size: clamp(64px, 9.4vw, 148px); line-height: .9; margin: calc(12px + .2em) 0 0; padding-right: .25em;
}
.page-lede { font-family: var(--display); font-weight: 300; font-size: clamp(22px, 2.2vw, 31px); line-height: 1.28; max-width: 30ch; margin: 0; color: var(--graphite); }
.page-lede em { color: var(--ink); }
.page-lede small { display: block; margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.5; }
.page-lede small a { color: var(--ink); }
@media (max-width: 900px) { .page-head .wrap { grid-template-columns: 1fr; } }

.split-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.split-line > span { display: inline-block; }

/* ==========================================================================
   PENAMPIL (lightbox)
   ========================================================================== */

.viewer {
  position: fixed; inset: 0; z-index: 90;
  background: rgb(241 236 225 / .97);
  background-image: var(--grain);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  opacity: 0; transition: opacity .25s;
}
.viewer.is-open { opacity: 1; }
.viewer-top, .viewer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--gutter); font-family: var(--mono); font-size: 13px; color: var(--muted); }
.viewer-stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 64px; }
.viewer-stage img {
  max-width: 100%; max-height: calc(100svh - 150px); width: auto; height: auto;
  object-fit: contain; box-shadow: var(--shadow-lift);
  background: var(--sheet);
  cursor: zoom-in; transition: transform .35s var(--ease);
}
.viewer-stage.is-zoomed img { cursor: zoom-out; transform: scale(2.2); transition: transform .35s var(--ease), transform-origin 0s; }
.viewer-stage video, .viewer-stage iframe { max-width: 100%; max-height: calc(100svh - 150px); background: #000; box-shadow: var(--shadow-lift); }
.viewer-stage iframe { width: min(100%, 1000px); aspect-ratio: 16 / 9; height: auto; border: 0; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--sheet);
  font-family: var(--mono); font-size: 18px; color: var(--ink);
  display: grid; place-items: center; z-index: 2;
}
.viewer-nav:hover { border-color: var(--ink); }
.viewer-nav.prev { left: 10px; } .viewer-nav.next { right: 10px; }
.viewer-close { border: 0; background: none; font-family: var(--mono); font-size: 14px; color: var(--ink); padding: 8px 0; }
.viewer-caption { color: var(--graphite); }
.viewer-caption .hand { font-size: 26px; color: var(--ink); margin-right: 10px; }
.viewer-note { max-width: 62ch; font-family: var(--serif); font-size: 17px; color: var(--graphite); }
@media (max-width: 700px) {
  .viewer-stage { padding: 0 8px; }
  .viewer-nav { top: auto; bottom: 8px; transform: none; }
  .viewer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   PROSA
   ========================================================================== */

.prose { font-size: 20px; line-height: 1.68; }
.prose p { margin: 0 0 1.05em; }
.prose h2, .prose h3 { font-family: var(--display); font-weight: 400; color: var(--graphite); line-height: 1.1; margin: 1.6em 0 .5em; }
.prose h2 { font-size: 34px; } .prose h3 { font-size: 27px; }
.prose blockquote { margin: 1.4em 0; padding-left: 22px; border-left: 2px solid var(--ink); color: var(--ink); font-family: var(--display); font-style: italic; font-size: 1.15em; line-height: 1.45; }
.prose img { margin: 1.6em 0; box-shadow: var(--shadow-paper); }
.prose a { color: var(--ink); }
.prose a.wiki { text-decoration-style: dotted; text-decoration-thickness: 1.5px; }
.prose a.wiki.is-missing { color: var(--muted); text-decoration-style: dashed; }
.prose hr { border: 0; height: 12px; margin: 2em 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'><path d='M2 7 C 20 2, 40 11, 60 6 S 100 3, 118 7' fill='none' stroke='%231f2d73' stroke-width='1.4' stroke-linecap='round'/></svg>") center/120px 12px no-repeat; }
@media (max-width: 700px) { .prose { font-size: 18.5px; } }

/* ==========================================================================
   FORMULIR & MODE DIMAS
   ========================================================================== */

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > span, .field legend { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-strong); background: #fffdf8;
  padding: 10px 12px; border-radius: var(--radius); font-size: 17px;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(31 45 115 / .12); }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field textarea.big { min-height: 46vh; font-family: var(--serif); font-size: 19px; }
.field input.hand-input { font-family: var(--hand); font-size: 34px; color: var(--ink); padding: 6px 12px; }
.field small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: #9b3228; font-family: var(--mono); font-size: 13px; min-height: 18px; margin: 0 0 12px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; }
.radios { display: flex; gap: 16px; flex-wrap: wrap; }
.radios label { display: flex; gap: 6px; align-items: center; font-size: 16px; }
.checks { display: grid; gap: 6px; max-height: 190px; overflow: auto; border: 1px solid var(--line); background: #fffdf8; padding: 10px 12px; }
.checks label { display: flex; gap: 8px; align-items: baseline; font-size: 15px; line-height: 1.3; }

.admin-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 4px;
  background: var(--graphite); color: var(--sheet);
  border-radius: 999px; padding: 5px 6px 5px 16px;
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / .45);
  font-family: var(--mono); font-size: 13px;
  max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none;
}
.admin-bar .who { font-family: var(--hand); font-size: 22px; margin-right: 8px; white-space: nowrap; color: #f2c47c; }
.admin-bar button, .admin-bar a { border: 0; background: none; color: var(--sheet); padding: 8px 10px; border-radius: 999px; white-space: nowrap; text-decoration: none; font-size: 13px; }
.admin-bar button:hover, .admin-bar a:hover { background: rgb(255 255 255 / .12); color: #fff; }
.admin-bar .sep { width: 1px; height: 20px; background: rgb(255 255 255 / .2); margin: 0 4px; flex: none; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgb(21 20 18 / .42); backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: min(100%, 720px);
  background: var(--paper); background-image: var(--grain); color: var(--graphite);
  box-shadow: -24px 0 60px -24px rgb(0 0 0 / .45);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  transform: translateX(104%); transition: transform .45s var(--ease);
}
.drawer.is-open { transform: none; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 18px; flex-wrap: wrap; padding: 18px 24px 16px; border-bottom: 1.5px solid var(--graphite); background: var(--paper); }
.drawer-kicker { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--stamp); max-width: 36ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head h2 { font-family: var(--hand); font-weight: 400; font-size: 44px; line-height: .9; color: var(--ink); margin: 0; }
.drawer-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.drawer-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--sheet); font-size: 14px; color: var(--graphite); display: grid; place-items: center; }
.drawer-x:hover { border-color: var(--ink); color: var(--ink); }
.status-seg { background: var(--sheet); }
.status-seg button[data-status="published"][aria-pressed="true"] { background: var(--ink); }
.status-seg button[data-status="draft"][aria-pressed="true"] { background: var(--sodium); color: var(--graphite); }
.drawer-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 40px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.drawer-foot { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line-strong); background: var(--sheet); }
.drawer-foot .left, .drawer-foot .right { display: flex; gap: 8px; align-items: center; flex: none; }
.drawer-state { flex: 1; margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-state.is-err { color: #9b3228; white-space: normal; }
@media (max-width: 560px) {
  .drawer-head { padding: 14px 16px 12px; }
  .drawer-head h2 { font-size: 36px; }
  .drawer-body { padding: 0 16px 32px; }
  .drawer-foot { padding: 10px 16px; flex-wrap: wrap; }
  .drawer-state { order: -1; flex-basis: 100%; text-align: left; }
  .drawer-foot .right { margin-left: auto; }
}

/* bagian-bagian panel */
.ed-sec { padding: 22px 0 6px; border-bottom: 1px solid var(--line); }
.ed-sec:last-child { border-bottom: 0; }
.ed-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.ed-sec-head .no { font-family: var(--mono); font-size: 11px; color: var(--stamp); border: 1px solid currentColor; border-radius: 99px; padding: 2px 7px 1px; flex: none; }
.ed-sec-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.1; }
.ed-sec-head small { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.field-row.three { grid-template-columns: 1.2fr 1fr 1fr; }
@media (max-width: 560px) { .field-row, .field-row.three { grid-template-columns: 1fr; gap: 0; } .ed-sec-head { flex-wrap: wrap; } .ed-sec-head small { margin-left: 0; flex-basis: 100%; text-align: left; } }
.src-seg { margin-bottom: 12px; }
.ed .seg button[aria-pressed="true"] { background: var(--graphite); }

/* keping tema */
.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 6px 8px; border: 1px solid var(--line-strong); background: #fffdf8; cursor: text; }
.chips-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(31 45 115 / .12); }
.chips-input input { flex: 1; min-width: 120px; border: 0 !important; box-shadow: none !important; padding: 4px !important; background: none !important; font-size: 16px; outline: none; }
.chip-tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 13px; background: rgb(31 45 115 / .08); color: var(--ink); border-radius: 99px; padding: 3px 4px 3px 10px; }
.chip-tag button { border: 0; background: none; width: 20px; height: 20px; border-radius: 50%; color: inherit; font-size: 14px; line-height: 1; padding: 0; }
.chip-tag button:hover { background: var(--ink); color: var(--sheet); }

/* pemilih karya & seri */
.karya-picker, .series-picker { border: 1px solid var(--line-strong); background: #fffdf8; }
.kp-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.kp-top input { flex: 1; border: 0; background: none; font-size: 16px; padding: 6px 4px; outline: none; font-family: var(--serif); }
.kp-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.kp-chosen { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.kp-chosen:not(:empty) { padding: 10px; border-bottom: 1px solid var(--line); background: rgb(31 45 115 / .03); }
.kp-list, .sp-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.kp-row, .sp-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 22px; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 10px; color: inherit; }
.kp-row:last-child, .sp-row:last-child { border-bottom: 0; }
.kp-row:hover, .sp-row:hover { background: rgb(31 45 115 / .04); }
.kp-thumb { width: 44px; height: 44px; background: var(--paper-2); overflow: hidden; }
.kp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kp-text { display: grid; gap: 2px; min-width: 0; }
.kp-text b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-text small { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-check { width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 50%; position: relative; }
.sp-row .kp-check { border-radius: 50%; }
.kp-row .kp-check { border-radius: 4px; }
[aria-selected="true"] .kp-check, [aria-checked="true"] .kp-check { background: var(--ink); border-color: var(--ink); }
[aria-selected="true"] .kp-check::after, [aria-checked="true"] .kp-check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--sheet); border-width: 0 2px 2px 0; transform: rotate(45deg); }
[aria-selected="true"], [aria-checked="true"] { background: rgb(31 45 115 / .06); }
.kp-empty { margin: 0; padding: 16px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sp-new-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px dashed var(--line-strong); background: none; padding: 12px 10px; font-family: var(--serif); font-size: 16px; color: var(--ink); text-align: left; }
.sp-new-btn .plus { width: 44px; height: 30px; display: grid; place-items: center; border: 1.5px dashed currentColor; font-size: 18px; }
.sp-new-btn:hover, .sp-new-btn.is-on { background: rgb(31 45 115 / .05); }
.sp-new { padding: 4px 10px 0; }

/* meja tulis: bilah format, pratinjau, gambar sisipan */
.desk-ed { border: 1px solid var(--line-strong); background: #fffdf8; }
.desk-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #fbf8f1; }
.desk-tabs button { padding: 4px 12px; font-size: 12px; }
.desk-tools { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.desk-tools.is-off { opacity: .3; pointer-events: none; }
.desk-tools button, .desk-img { border: 0; background: none; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; font-family: var(--mono); font-size: 13px; color: var(--graphite); display: inline-grid; place-items: center; cursor: pointer; }
.desk-tools button:hover, .desk-img:hover { background: rgb(31 45 115 / .08); color: var(--ink); }
.desk-img { border: 1px solid var(--line-strong); margin-left: 6px; color: var(--ink); position: relative; overflow: hidden; }
.desk-img.is-busy::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--ink); }
.desk-paper textarea.big { border: 0 !important; box-shadow: none !important; width: 100%; display: block; min-height: 44vh; padding: 18px 18px 22px; background: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px) 0 11px / 100% 32px local, #fffdf8; line-height: 32px; font-size: 19px; }
.desk-preview { padding: 18px 20px; min-height: 44vh; }
.desk-preview img { max-width: 100%; }
.desk-foot { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.desk-strip { border-top: 1px solid var(--line); padding: 10px; }
.desk-strip p { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.desk-strip-list { display: flex; gap: 8px; overflow-x: auto; }
.desk-strip-list button { flex: none; border: 1px solid var(--line); padding: 3px; background: var(--sheet); width: 72px; height: 72px; }
.desk-strip-list button:hover { border-color: var(--ink); }
.desk-strip-list img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.media-item { position: relative; background: var(--sheet); box-shadow: var(--shadow-paper); padding: 6px; display: grid; gap: 6px; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-2); }
.media-item input { font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); background: #fffdf8; width: 100%; }
.media-item .tools { display: flex; justify-content: space-between; }
.media-item .tools button { border: 0; background: none; font-family: var(--mono); font-size: 12px; padding: 2px 4px; color: var(--ink); }
.media-item .tools button.rm { color: #9b3228; }
.media-item progress { width: 100%; height: 4px; }
.drop {
  display: grid; place-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--line-strong); padding: 22px; cursor: pointer;
  font-family: var(--mono); font-size: 13px; color: var(--muted); background: rgb(255 255 255 / .35);
}
.drop:hover, .drop.is-over { border-color: var(--ink); color: var(--ink); }
.drop .hand { font-size: 28px; color: var(--ink); }
.md-help { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }

.item-tools { display: flex; gap: 6px; }
.item-tools button { border: 1px solid var(--line-strong); background: var(--sheet); font-family: var(--mono); font-size: 12px; padding: 4px 9px; border-radius: 999px; color: var(--graphite); }
.item-tools button:hover { border-color: var(--ink); color: var(--ink); }
.item-tools button.rm:hover { border-color: #9b3228; color: #9b3228; }

.toast {
  position: fixed; left: 50%; bottom: 76px; z-index: 100;
  transform: translate(-50%, 12px); opacity: 0;
  background: var(--sheet); color: var(--graphite); box-shadow: var(--shadow-lift);
  padding: 10px 16px; font-family: var(--mono); font-size: 13px; max-width: calc(100vw - 32px);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { color: #9b3228; }

.offline-note {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px dashed var(--line-strong); padding: 8px 12px; display: inline-block;
}
.empty { font-family: var(--hand); font-size: 32px; color: var(--ink); opacity: .6; padding: 40px 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- masuk ---------- */

.login { min-height: calc(100svh - 68px - 140px); display: grid; place-items: center; padding-block: 48px; }
.login-sheet { width: min(100%, 460px); background: var(--sheet); box-shadow: var(--shadow-paper); padding: 34px 32px 30px; }
.login-sheet h1 { font-family: var(--hand); font-weight: 400; font-size: 72px; line-height: .9; color: var(--ink); margin: 6px 0 14px; }
.login-sheet p { margin: 0 0 20px; font-size: 17px; }
.login-sheet code { font-family: var(--mono); font-size: 14px; background: var(--paper); padding: 1px 5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
.w { display: inline-block; }
/* bilah alat lengket turun saat kepala situs muncul kembali */
.archive-bar, .toolbar { transition: top .45s var(--ease); }
.site-head:not(.is-away) ~ main .archive-bar, .site-head:not(.is-away) ~ main .toolbar { top: 68px; }


/* ---------- ruang gelap (video, foto) ---------- */

body.page-dark { --dark-accent: #f2c47c; --dark-select: rgb(222 143 34 / .45); background-color: var(--night); background-image: none; color: #e9e3d6; }
.page-dark .site-head { background: color-mix(in srgb, var(--night) 86%, transparent); }
.page-dark .site-head.is-scrolled { border-bottom-color: rgb(255 255 255 / .08); }
.page-dark .brand, .page-dark .page-title { color: var(--sheet); }
.page-dark .nav a { color: #d8d1c2; }
.page-dark .nav a span, .page-dark .kicker { color: #8f887a; }
.page-dark .kicker b { color: var(--dark-accent); }
.page-dark .nav a[aria-current="page"] { color: var(--dark-accent); }
.page-dark .nav a[aria-current="page"]::after, .page-dark .nav a:hover::after { filter: invert(1) brightness(1.6); }
.page-dark .nav-toggle { color: var(--dark-accent); }
@media (max-width: 860px) { .page-dark .nav { background: var(--night); } }
.page-dark .page-lede { color: #e9e3d6; }
.page-dark .page-lede em, .page-dark .page-lede small a { color: var(--dark-accent); }
.page-dark .site-foot { border-top-color: rgb(255 255 255 / .1); color: #8f887a; }
.page-dark .site-foot h2 { color: var(--sheet); }
.page-dark .site-foot p { color: #d8d1c2; }
.page-dark ::selection { background: var(--dark-select); color: #fff; }
.page-dark :focus-visible { outline-color: var(--dark-accent); }
