/* DIME landing v2 — modul "console": #api (konsol) dan #trust (buku besar kepercayaan).
   Semua selektor dicakup di bawah id bagian. Monokrom saja. */

/* =====================================================================
   A · KONSOL  (#api)
   ===================================================================== */
#api { overflow: hidden; }
#api .cx-intro { margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: end; }
#api .cx-intro .sub { margin: 0; font-size: 16px; }
#api .cx-spec { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--hair); }
#api .cx-spec > div { display: contents; }
#api .cx-spec dt, #api .cx-spec dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 12px; }
#api .cx-spec dt { font: 500 10.5px/1.9 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); padding-right: 28px; }
#api .cx-spec dd { color: var(--steel-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pelat konsol ---------- */
#api .cx { margin-top: 56px; --chamfer: 18px;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,.05), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #121317 0%, #0a0b0d 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 40px 80px -40px rgba(0,0,0,.9); }
#api .cx::before { width: 46%; }

#api .cx-bar { position: relative; display: flex; align-items: center; gap: 18px; height: 54px; padding: 0 14px 0 34px; border-bottom: 1px solid var(--hair); }
#api .cx-bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: rgba(0,0,0,.6); }
#api .cx-ep { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
#api .cx-ep b { font-weight: 500; color: var(--ink); background: var(--steel-2); padding: 3px 6px 2px; margin-right: 8px; font-size: 10.5px; letter-spacing: .1em; }
#api .cx-model { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 18px; border-left: 1px solid var(--hair); }
#api .cx-model b { color: var(--steel-2); font-weight: 400; margin-left: 6px; }
#api .cx-model .free { margin-left: 10px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hair-2); padding: 2px 6px; }
#api .cx-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; background: rgba(255,255,255,.03); border: 1px solid var(--hair-2); color: var(--steel-2); font-size: 11.5px; letter-spacing: .06em; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
#api .cx-copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.2; }
#api .cx-copy:hover { border-color: rgba(255,255,255,.4); color: var(--white); }
#api .cx-copy.ok { background: var(--white); color: var(--ink); border-color: var(--white); }

#api .cx-body { display: grid; grid-template-columns: 188px minmax(0, 1fr) 344px; min-height: 452px; }

/* ---------- Rel tab vertikal ---------- */
#api .cx-rail { display: flex; flex-direction: column; padding: 14px 0; border-right: 1px solid var(--hair); background: linear-gradient(90deg, rgba(0,0,0,.18), transparent); }
#api .cx-rail button { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; height: 50px; padding: 0 20px 0 26px; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.035); color: var(--dim); font-size: 14px; text-align: left; cursor: pointer; align-items: center; transition: color .2s, background .2s; }
#api .cx-rail button em { font: 400 10px/1 var(--mono); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: #464950; transition: color .2s; }
#api .cx-rail button i { position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--edge); box-shadow: var(--edge-glow); transform: scaleY(0); transition: transform .35s var(--ease); }
#api .cx-rail button:hover { color: var(--steel-2); }
#api .cx-rail button.on { color: var(--white); background: linear-gradient(90deg, rgba(255,255,255,.055), rgba(255,255,255,0)); }
#api .cx-rail button.on em { color: var(--steel); }
#api .cx-rail button.on i { transform: scaleY(1); }
#api .cx-rail button:focus-visible { outline: 1px solid rgba(255,255,255,.5); outline-offset: -4px; }
#api .cx-rail-foot { margin-top: auto; padding: 18px 20px 6px 26px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--steel-2); }
#api .cx-rail-foot .label { font-size: 10px; }

/* ---------- Panel kode ---------- */
#api .cx-code { position: relative; min-width: 0; overflow-x: auto; overflow-y: hidden; background: rgba(3,3,4,.45); box-shadow: inset 0 10px 24px -18px rgba(0,0,0,.9); padding: 24px 0 26px; outline: none; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; cursor: text; }
#api .cx-code::-webkit-scrollbar { height: 6px; }
#api .cx-code::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }
#api .cx-code:focus-visible { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
#api .cx-scroll { display: flex; min-width: max-content; }
#api .cx-gut { flex: none; padding: 0 18px 0 22px; text-align: right; font-size: 12px; line-height: 22px; color: #2c2f35; user-select: none; border-right: 1px solid rgba(255,255,255,.04); margin-right: 20px; }
#api .cx-gut span { display: block; transition: color .3s; }
#api .cx-gut span.on { color: #5a5e67; }
#api .cx-src { position: relative; padding-right: 28px; }
#api .cx-src pre { margin: 0; font-size: 13px; line-height: 22px; white-space: pre; tab-size: 2; color: #b4b8c0; }
#api .cx-ghost { visibility: hidden; }
#api .cx-live { position: absolute; left: 0; top: 0; right: 0; }

/* warna sintaks monokrom */
#api .t-c { color: #4e525a; }
#api .t-p { color: #6a6e77; }
#api .t-k { color: #e9ebef; font-weight: 500; }
#api .t-s { color: #ffffff; }
#api .t-y { color: #8f949d; }
#api .t-v { color: #d6d9de; text-decoration: underline; text-decoration-color: rgba(255,255,255,.18); text-underline-offset: 3px; }
#api .t-f { color: #9da1aa; }
#api .t-n { color: #e9ebef; }

#api .caret { display: inline-block; width: 7px; height: 15px; margin-left: 1px; vertical-align: -3px; background: var(--white); box-shadow: 0 0 10px rgba(225,235,255,.7); animation: cx-blink 1.05s steps(1) infinite; }
#api .cx.typing .caret { animation: none; }
@keyframes cx-blink { 50% { opacity: 0; } }

/* ---------- Inspektur ---------- */
#api .cx-insp { position: relative; padding: 22px 24px 22px; border-left: 1px solid var(--hair); background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0) 60%); display: flex; flex-direction: column; min-width: 0; }
#api .cx-insp-h { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--hair); }
#api .cx-insp-h .example-tag { margin-left: auto; }
#api .cx-insp-t { font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: -.005em; }
#api .cx-insp-s { font-size: 11px; color: var(--dim); margin-top: 3px; letter-spacing: .02em; transition: color .4s; }
#api .cx.done .cx-insp-s { color: var(--steel-2); }
#api .cx-ring { width: 34px; height: 34px; flex: none; }
#api .cx-ring path { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 2.2; transition: stroke .25s; }
#api .cx-ring path.on { stroke: rgba(255,255,255,.92); filter: drop-shadow(0 0 2px rgba(225,235,255,.8)); }
#api .cx-ring circle { fill: rgba(255,255,255,.25); transition: fill .4s; }
#api .cx.done .cx-ring circle { fill: var(--white); }

#api .cx-hdrs { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; }
#api .cx-hdrs li { display: flex; align-items: baseline; gap: 8px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.045); }
#api .cx-hdrs .k { color: var(--muted); white-space: nowrap; }
#api .cx-hdrs i { flex: 1; min-width: 12px; border-bottom: 1px dotted rgba(255,255,255,.16); transform: translateY(-3px); }
#api .cx-hdrs b, #api .cx-math b { font-weight: 500; color: #50545c; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .3s; }
#api .cx-insp b.set { color: var(--white); }
#api .cx-math { margin-top: 16px; padding: 14px 14px 12px; font-size: 11.5px; color: var(--dim); background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.05); }
#api .cx-math div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
#api .cx-math span { white-space: nowrap; }
#api .cx-math span b { font-weight: 400; }
#api .cx-math .sum { border-top: 1px dashed rgba(255,255,255,.1); margin-top: 5px; padding-top: 8px; }
#api .cx-math .sum + .sum { border-top: 0; margin-top: 0; padding-top: 3px; }
#api .cx-note { margin: auto 0 0; padding-top: 16px; font-size: 12px; line-height: 1.55; color: var(--dim); }
#api .cx-note .mono { color: var(--muted); font-size: 11px; }

/* ---------- Kaki: tombol + catatan live ---------- */
#api .cx-foot { margin-top: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
#api .cx-ctas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#api .cx-ctas .tlink { margin-left: 12px; font-size: 13px; }
#api .cx-live-note { margin: 0; font-size: 12px; color: var(--dim); }
#api .cx-live-note a { color: var(--muted); border-bottom: 1px solid var(--hair-2); }
#api .cx-live-note a:hover { color: var(--white); }
#api .cx-live-note b { color: var(--steel-2); font-weight: 500; }

/* =====================================================================
   B · BUKU BESAR KEPERCAYAAN  (#trust)
   ===================================================================== */
#trust { overflow: hidden; }
#trust::before { content: ''; position: absolute; left: 50%; top: 0; width: min(1100px, 90vw); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
#trust .tr-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: end; }
#trust .tr-head .hd { max-width: 760px; }

/* meter: berapa baris dijamin kode vs bergantung pada DIME */
#trust .tr-meter { padding-bottom: 8px; }
#trust .tr-segs { display: flex; gap: 5px; }
#trust .tr-segs i { width: 30px; height: 9px; border: 1px solid rgba(255,255,255,.28); transform: skewX(-24deg); }
#trust .tr-segs i.on { background: var(--white); border-color: var(--white); box-shadow: 0 0 10px rgba(225,235,255,.35); }
#trust .tr-segs i.on + i:not(.on) { margin-left: 10px; }
#trust .tr-meter-l { display: flex; justify-content: space-between; gap: 24px; margin-top: 12px; font-size: 11px; color: var(--dim); letter-spacing: .02em; }
#trust .tr-meter-l b { color: var(--white); font-weight: 500; margin-right: 4px; }

/* ---------- Buku besar dua kolom ---------- */
#trust .tr-ledger { margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); }
#trust .tr-ch { display: flex; align-items: center; gap: 12px; height: 40px; padding-left: 22px; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--steel-2); border-bottom: 1px solid var(--hair-2); box-shadow: 0 1px 0 rgba(0,0,0,.7); }
#trust .gl { width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--edge); flex: none; }
#trust .gl.solid { background: var(--white); box-shadow: var(--edge-glow); }
#trust .tr-trust .tr-ch { color: var(--muted); }

#trust .tr-rows { list-style: none; margin: 0; padding: 0; }
#trust .tr-row { position: relative; padding: 26px 20px 25px 22px; opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease), background .3s; transition-delay: calc(var(--o) * 85ms + .1s); }
/* garis terukir: gelap di atas, terang tipis di bawah */
#trust .tr-row::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(rgba(0,0,0,.75) 0 1px, rgba(255,255,255,.06) 1px 2px); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s var(--ease); transition-delay: calc(var(--o) * 85ms + .2s); }
#trust .tr-ledger.lit .tr-row { opacity: 1; transform: none; }
#trust .tr-ledger.lit .tr-row::after { transform: none; }
#trust .tr-edge { position: absolute; left: 0; top: 22px; bottom: 22px; width: 1px; background: rgba(255,255,255,.07); }
#trust .tr-edge::after { content: ''; position: absolute; inset: 0; background: var(--edge); box-shadow: var(--edge-glow); transform: scaleY(0); transition: transform .45s var(--ease); }
#trust .tr-row:hover { background: linear-gradient(90deg, rgba(255,255,255,.03), transparent 70%); transition-delay: 0s; }
#trust .tr-row:hover .tr-edge::after { transform: none; }
#trust .tr-claim { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 500; color: var(--text); letter-spacing: -.012em; }
#trust .tr-detail { margin: 7px 0 12px; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 470px; }
#trust .tr-check { margin: 0; font-size: 12px; color: var(--steel-2); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; }
#trust .tr-check .ck { color: var(--dim); margin-right: 8px; }
#trust .tr-check a { color: var(--steel-2); border-bottom: 1px solid rgba(255,255,255,.14); transition: color .2s, border-color .2s; }
#trust .tr-check a:hover { color: var(--white); border-color: var(--white); }
#trust .tr-check .lk { white-space: nowrap; }
#trust .tr-check .sep { color: #3d4047; margin: 0 10px; }
#trust .tr-more { margin: 0; padding: 22px 22px 0; font-size: 11.5px; color: var(--dim); }
#trust .tr-more a { color: var(--steel-2); border-bottom: 1px solid rgba(255,255,255,.14); margin-left: 8px; }
#trust .tr-more a:hover { color: var(--white); border-color: var(--white); }
/* kolom "percaya": arsir diagonal halus menandai wilayah yang bergantung pada DIME */
#trust .tr-trust .tr-rows { background: repeating-linear-gradient(135deg, rgba(255,255,255,.014) 0 1px, transparent 1px 9px); }
#trust .tr-trust .tr-claim { color: #d9dce1; }

/* ---------- Sambungan tengah ---------- */
#trust .tr-seam { position: relative; display: flex; justify-content: center; }
#trust .tr-line { position: absolute; left: 50%; top: 44px; bottom: 0; width: 1px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.1) 85%, transparent); }
#trust .tr-line i { position: absolute; left: 0; top: -90px; width: 1px; height: 90px; background: linear-gradient(180deg, transparent, rgba(255,255,255,.95), transparent); box-shadow: 0 0 6px rgba(225,235,255,.8); opacity: 0; }
#trust .tr-ledger.run .tr-line i { animation: tr-sweep 7s var(--ease-io) infinite; }
@keyframes tr-sweep { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(900px); opacity: 0; } }
#trust .tr-glyph { position: relative; z-index: 1; width: 40px; height: 40px; margin-top: 0; overflow: visible; }
#trust .tr-glyph .o { fill: var(--bg); stroke: rgba(255,255,255,.8); stroke-width: 1.2; stroke-dasharray: 11 3.5 3 3.5; filter: drop-shadow(0 0 4px rgba(225,235,255,.45)); transform-origin: 20px 20px; }
#trust .tr-glyph .i { fill: var(--white); }
#trust .tr-ledger.run .tr-glyph .o { animation: tr-rot 40s linear infinite; }
@keyframes tr-rot { to { transform: rotate(360deg); } }

/* ---------- Jalankan sendiri ---------- */
#trust .tr-run { margin-top: 88px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 20px 56px; padding-top: 34px; border-top: 1px solid var(--hair); }
#trust .tr-run-h h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.015em; }
#trust .tr-run-h p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--dim); }
#trust .tr-run-h .mono { color: var(--muted); font-size: 12px; }
#trust .tr-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#trust .tr-chip { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; padding: 14px 16px 15px; text-align: left; cursor: pointer; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)); border: 1px solid var(--hair); transition: border-color .25s, background .25s; }
/* tanda sudut ala jam tangan */
#trust .tr-chip::before, #trust .tr-chip::after { content: ''; position: absolute; width: 7px; height: 7px; border-color: rgba(255,255,255,.45); border-style: solid; transition: border-color .25s; }
#trust .tr-chip::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; }
#trust .tr-chip::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
#trust .tr-chip:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.035); }
#trust .tr-chip:hover::before, #trust .tr-chip:hover::after { border-color: var(--white); }
#trust .tr-chip-t { font-size: 12px; color: var(--dim); padding-right: 52px; }
#trust .tr-chip code { display: block; font-size: 12.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
#trust .tr-chip code .pr { color: var(--dim); margin-right: 8px; }
#trust .tr-chip-c { position: absolute; right: 14px; top: 13px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); transition: color .2s; }
#trust .tr-chip:hover .tr-chip-c { color: var(--white); }
#trust .tr-chip.ok { border-color: rgba(255,255,255,.5); }
#trust .tr-chip.ok .tr-chip-c { color: var(--white); }
#trust .tr-repo { grid-column: 2; display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--steel-2); }
#trust .tr-repo a { color: var(--white); border-bottom: 1px solid var(--hair-2); }
#trust .tr-repo .label { font-size: 10px; }
#trust .tr-pend { color: var(--muted); }

/* =====================================================================
   Layar sempit
   ===================================================================== */
@media (max-width: 1080px) {
  #api .cx-body { grid-template-columns: 160px minmax(0, 1fr); }
  #api .cx-insp { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--hair); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
  #api .cx-insp-h { grid-column: 1 / -1; }
  #api .cx-math { margin-top: 8px; align-self: start; }
  #api .cx-note { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  #api .cx-intro { grid-template-columns: 1fr; gap: 26px; margin-top: 24px; }
  #api .cx { margin-top: 40px; --chamfer: 12px; }
  #api .cx-bar { height: 48px; padding: 0 10px 0 22px; }
  #api .cx-model { display: none; }
  #api .cx-body { display: block; min-height: 0; }
  #api .cx-rail { flex-direction: row; padding: 0; border-right: 0; border-bottom: 1px solid var(--hair); background: rgba(0,0,0,.2); }
  #api .cx-rail button { flex: 1; justify-content: center; height: 44px; padding: 0 4px; font-size: 13px; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.04); }
  #api .cx-rail button:last-of-type { border-right: 0; }
  #api .cx-rail button em, #api .cx-rail-foot { display: none; }
  #api .cx-rail button i { left: 14px; right: 14px; top: auto; bottom: -1px; width: auto; height: 1px; transform: scaleX(0); }
  #api .cx-rail button.on { background: rgba(255,255,255,.05); }
  #api .cx-rail button.on i { transform: scaleX(1); }
  #api .cx-code { padding: 18px 0 20px; }
  #api .cx-gut { padding: 0 12px 0 14px; margin-right: 14px; font-size: 11px; line-height: 20px; }
  #api .cx-src pre { font-size: 12px; line-height: 20px; }
  #api .caret { height: 13px; width: 6px; }
  #api .cx-insp { display: flex; padding: 20px 18px; }
  #api .cx-hdrs { font-size: 11px; }
  #api .cx-math { font-size: 10.5px; padding: 12px; align-self: stretch; }
  #trust .tr-more { padding-left: 16px; }
  #trust .tr-check { gap: 8px 16px; }
  #trust .tr-check .ck { margin-right: 0; }
  #trust .tr-check .sep { display: none; }
  #api .cx-foot { flex-direction: column; align-items: flex-start; }
  #api .cx-ctas .btn-lg { height: 44px; padding: 0 20px; }
  #api .cx-ctas .tlink { margin-left: 4px; }

  #trust .tr-head { grid-template-columns: 1fr; gap: 28px; }
  #trust .tr-meter { max-width: 360px; }
  #trust .tr-segs i { flex: 1; width: auto; }
  #trust .tr-ledger { margin-top: 48px; grid-template-columns: 1fr; }
  #trust .tr-seam { height: 64px; align-items: center; }
  #trust .tr-line { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.16) 20%, rgba(255,255,255,.16) 80%, transparent); }
  #trust .tr-line i { display: none; }
  #trust .tr-glyph { width: 32px; height: 32px; }
  #trust .tr-ch { padding-left: 16px; }
  #trust .tr-row { padding: 22px 6px 21px 16px; }
  #trust .tr-claim { font-size: 16px; }
  #trust .tr-detail { font-size: 13.5px; }
  #trust .tr-run { grid-template-columns: 1fr; margin-top: 64px; }
  #trust .tr-chips { grid-template-columns: 1fr; }
  #trust .tr-repo { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #trust .tr-row, #trust .tr-row::after { transition: none; opacity: 1; transform: none; }
  #trust .tr-line i, #trust .tr-glyph .o { animation: none !important; }
  #api .caret { animation: none; }
  #api .cx-rail button i, #trust .tr-edge::after { transition: none; }
}
