/* Gaya web portofolio N2D: halaman utama dan halaman perjalanan proyek. */
:root {
  --paper: #f3f1ec;
  --sheet: #fbfaf7;
  --ink: #1d1d1b;
  --muted: #5f5c55;
  --line: #d8d4cb;
  --screen: #121315;
  --screen-ink: #b9bcc1;
  --amber: #f0b24a;
  --teal: #45c2b1;
  --ok-bg: #dcebd4; --ok: #27500a;
  --warn-bg: #f6e6c4; --warn: #6b4500;
  --link: #1f4e8c;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

.intro { max-width: 1240px; margin: 0 auto; padding: 36px 16px 28px; }
.kicker { font: 500 14px var(--mono); color: var(--muted); margin: 0 0 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.kicker a { margin-left: auto; }
.intro h1 { font: 600 clamp(30px, 4.4vw, 46px)/1.12 var(--serif); margin: 0 0 14px; max-width: 22ch; }
.intro p { font-size: 19px; color: var(--muted); max-width: 62ch; margin: 0 0 20px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; background: var(--sheet); }
.btn.primary { background: var(--ink); color: var(--sheet); }

.journey { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 32px; align-items: start; }
.text { padding-bottom: 40px; }
.jnav { position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; gap: 4px; flex-wrap: wrap; }
.jnav a { font: 500 13px var(--mono); color: var(--muted); text-decoration: none; padding: 4px 8px; border: 1px solid transparent; }
.jnav a[aria-current="step"] { color: var(--ink); border-color: var(--ink); background: var(--sheet); }

.chapter { padding: 48px 0 24px; min-height: 70vh; scroll-margin-top: 56px; }
.chapter .no { font: 500 13px var(--mono); color: var(--muted); }
.chapter h2 { font: 600 30px/1.2 var(--serif); margin: 4px 0 8px; }
.chapter > p { color: var(--muted); margin: 0 0 20px; }
.chapter > p.def { color: var(--ink); font-size: 19px; }
.card { background: var(--sheet); border: 1px solid var(--line); padding: 16px 18px; margin: 0 0 16px; scroll-margin-top: 60px; }
.card h3 { font: 600 22px/1.25 var(--serif); margin: 0 0 6px; }
.card p { margin: 0 0 10px; }
table.spec { width: 100%; border-collapse: collapse; font-size: 15px; margin: 4px 0 10px; }
table.spec th { text-align: left; font-weight: 400; color: var(--muted); width: 84px; padding: 5px 10px 5px 0; vertical-align: top; }
table.spec td { padding: 5px 0; }
table.spec tr + tr th, table.spec tr + tr td { border-top: 1px solid var(--line); }
.tag { font: 13px var(--mono); }
.pill { padding: 1px 8px; font-size: 14px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.card ul { margin: 0 0 8px; padding-left: 20px; }

/* strip tahap di kartu proyek: hitam = tahap utama, garis = ikut disentuh */
.stages { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; font: 500 12px/1.4 var(--mono); }
.stages > span { padding: 2px 7px; border: 1px solid var(--line); color: #a19d94; }
.stages > .on { border-color: var(--ink); color: var(--ink); }
.stages > .main { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0 !important; margin: -1px; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* tombol ke halaman perjalanan proyek */
.go { display: inline-block; margin: 2px 0 14px; padding: 8px 14px; background: var(--ink); color: var(--sheet); font: 600 15px var(--sans); text-decoration: none; }
.go:hover { background: #3a3d42; }
.go:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* galeri per proyek: kotak pertama lebar, sisanya kecil; klik = lihat besar */
.media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 14px; }
.media .m { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--screen); border: 1px solid var(--line); cursor: zoom-in; }
.media .m[hidden] { display: none; }
.media .wide { grid-column: 1 / -1; }
.media .m img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.media .m:hover img { opacity: 0.88; }
.media .m:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.media .m .lbl { position: absolute; left: 0; bottom: 0; max-width: 100%; padding: 2px 7px; background: #121315; color: #f3f1ec; font: 12px/1.5 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media .m .more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgb(18 19 21 / 0.72); color: #f3f1ec; font: 500 15px var(--mono); }
.media .m .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 12px; background: #121315; color: #f3f1ec; font: 500 13px var(--mono); border: 1px solid #3a3d42; }
.media .slot { aspect-ratio: 16 / 10; border: 1px dashed #b3ada1; background: var(--paper); color: var(--muted); padding: 8px 10px; font: 12px/1.45 var(--mono); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.media .slot.wide { aspect-ratio: 16 / 7; }
.media .slot b { color: var(--ink); font-weight: 500; }
.media .slot code { font: inherit; color: var(--link); }
.media-note { font: 12px/1.5 var(--mono); color: var(--muted); margin: -8px 0 14px; }

/* lightbox */
dialog.lb { padding: 0; border: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #0e0f10; color: #d9d6cf; overflow: hidden; }
dialog.lb::backdrop { background: rgb(0 0 0 / 0.6); }
html.lb-open { overflow: hidden; }
.lb-top { height: 48px; display: flex; gap: 10px; align-items: center; padding: 0 12px 0 16px; border-bottom: 1px solid #26282c; font: 13px var(--mono); }
.lb-top .sp { flex: 1; }
.lb button { all: unset; cursor: pointer; padding: 5px 11px; border: 1px solid #3a3d42; font: 500 13px var(--mono); color: #d9d6cf; background: #121315; }
.lb button:hover { border-color: #8a8d93; }
.lb button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.lb button[hidden] { display: none; }
.lb-view { position: absolute; top: 48px; bottom: 56px; left: 0; right: 0; overflow: auto; display: flex; padding: 12px 64px; }
.lb-view > * { margin: auto; display: block; max-width: 100%; max-height: 100%; }
.lb-view img { cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.lb.zoom .lb-view { padding: 0; cursor: grab; }
.lb.zoom .lb-view img { max-width: none; max-height: none; cursor: grab; }
.lb.zoom .lb-view:active img { cursor: grabbing; }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; margin: 0; padding: 0 16px; display: flex; align-items: center; border-top: 1px solid #26282c; font-size: 15px; }
.lb .lb-prev, .lb .lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 18px; padding: 10px 13px; }
.lb .lb-prev { left: 10px; }
.lb .lb-next { right: 10px; }
.lb.zoom .lb-prev, .lb.zoom .lb-next { display: none; }
.lb-hint { color: #8a8d93; }
@media (max-width: 640px) { .lb-hint { display: none; } }

/* panggung 3D */
.stage-wrap { position: sticky; top: 0; height: 100vh; padding: 16px 0; }
.stage-box { position: relative; height: 100%; background: var(--screen); border: 1px solid #26282c; }
three-stage { display: block; height: 100%; }
three-stage .pin {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer; white-space: nowrap;
  font: 500 13px var(--mono); color: var(--screen-ink); background: #1b1c1f; border: 1px solid #3a3d42; padding: 4px 9px;
}
three-stage:not([ready]) .pin { visibility: hidden; }
three-stage .pin[aria-current="step"] { color: #121315; background: var(--amber); border-color: var(--amber); }
three-stage .pin:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.fallback { list-style: none; margin: 0; padding: 24px; color: var(--screen-ink); font: 14px/2 var(--mono); }
.fallback li::before { content: "→ "; color: var(--amber); }
.file-note { display: none; margin: 0 24px; padding: 12px 14px; border: 1px solid var(--amber); color: var(--screen-ink); font: 14px/1.6 var(--mono); }
.di-file .file-note { display: block; }
.di-file .stage-ui, .di-file .hint { display: none; }
.stage-ui { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.stage-ui .lbl { font: 12px var(--mono); color: var(--screen-ink); }
.seg { display: flex; border: 1px solid #3a3d42; }
.seg button { all: unset; cursor: pointer; font: 500 12px var(--mono); color: var(--screen-ink); padding: 4px 9px; }
.seg button + button { border-left: 1px solid #3a3d42; }
.seg button[aria-pressed="true"] { background: var(--screen-ink); color: #121315; }
.seg button:focus-visible { outline: 2px solid var(--teal); }
.hint { position: absolute; right: 12px; top: 12px; font: 12px var(--mono); color: #7d8189; z-index: 2; }

.summary { max-width: 1240px; margin: 0 auto; padding: 24px 16px 40px; scroll-margin-top: 16px; }
.summary h2 { font: 600 30px var(--serif); margin: 0 0 6px; }
.summary > p { color: var(--muted); margin: 0 0 16px; }
.tbl { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.tbl th, .tbl td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl thead th { border-top: 0; font: 500 13px var(--mono); color: var(--muted); }
footer { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr; gap: 0; }
  .stage-wrap { order: -1; height: 38vh; padding: 0; z-index: 4; top: 0; }
  .jnav { top: 38vh; }
  .chapter { min-height: auto; scroll-margin-top: calc(38vh + 52px); }
  .hint { display: none; }
  .media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-view { padding: 8px; }
  .lb .lb-prev, .lb .lb-next { top: auto; bottom: 66px; transform: none; }
}

/* ---- versi final ---- */
/* bahasa: yang bukan bahasa aktif disembunyikan */
html[data-lang="en"] [data-l="id"], html[data-lang="id"] [data-l="en"] { display: none !important; }
[hidden] { display: none !important; }
/* galeri tanpa media asli tidak ditampilkan */
.media .slot { display: none; }
.media:not(:has(a.m)) { display: none; }

/* baris atas: nama, menu, pilihan bahasa */
.topbar { max-width: 1240px; margin: 0 auto; padding: 14px 16px 0; display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; font: 500 14px var(--mono); color: var(--muted); }
.topbar .who { color: var(--ink); }
.topbar nav { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); text-decoration: underline; }
.lang { display: flex; border: 1px solid var(--ink); }
.lang button { all: unset; cursor: pointer; padding: 3px 10px; font: 500 13px var(--mono); color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.lang button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* data singkat di bawah judul */
dl.meta { display: grid; grid-template-columns: 110px 1fr; gap: 4px 14px; margin: 0 0 22px; max-width: 70ch; font-size: 16px; }
dl.meta dt { color: var(--muted); font: 500 13px/1.9 var(--mono); }
dl.meta dd { margin: 0; }

/* bagian bawah: pengalaman, proyek lain, keahlian, kontak */
.more { max-width: 1240px; margin: 0 auto; padding: 8px 16px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.more > section { background: var(--sheet); border: 1px solid var(--line); padding: 18px 20px; scroll-margin-top: 16px; }
.more h2 { font: 600 26px var(--serif); margin: 0 0 12px; }
.more h3 { font: 600 20px/1.3 var(--serif); margin: 0 0 4px; }
.more .org { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.more ul { margin: 0; padding-left: 20px; }
.more li + li { margin-top: 4px; }
.more .tbl { border: 0; }
.more .tbl td:first-child { white-space: nowrap; font-weight: 600; }
dl.rows { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
dl.rows dt { color: var(--muted); font: 500 13px/1.8 var(--mono); }
dl.rows dd { margin: 0; }
@media (max-width: 640px) {
  dl.meta, dl.rows { grid-template-columns: 1fr; gap: 0 14px; }
  dl.meta dd, dl.rows dd { margin-bottom: 8px; }
  .topbar nav { margin-left: 0; order: 3; width: 100%; }
}
/* gambar tegak (mis. cover A4) ditampilkan utuh, tidak dipotong */
.media .m.tegak img { object-fit: contain; object-position: center; }
.summary .media { margin-top: 12px; }
