/* public/site/site.css — situs portofolio.
   Warna aksen datang dari Admin → Profil (variabel --accent dan --accent-ink di <html>). */

:root {
  --paper: #f0f2f5; --surface: #ffffff; --ink: #0b1b3f; --muted: #536078; --line: #d3d9e2;
  --accent: #2a4bff; --accent-ink: #ffffff; --accent-text: var(--accent);
  --ok: #16a34a;
  --rail: 19rem; --radius: 6px;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
  --paper: #0b1120; --surface: #121a2e; --ink: #e7ebf5; --muted: #98a4bf; --line: #232f4a;
  --accent-text: color-mix(in srgb, var(--accent) 62%, #fff);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--f-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: .2em; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- Kerangka ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.main { padding: 0 clamp(1.25rem, 5vw, 4.5rem); max-width: 72rem; width: 100%; }

/* ---------- Rail ---------- */
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--accent); color: var(--accent-ink); padding: 1.75rem 1.75rem; display: flex; flex-direction: column; gap: 1.5rem; }
.rail a { color: inherit; }
.rail-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; font: 700 1.05rem/1.2 var(--f-display); font-stretch: 112%; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 2px solid currentColor; border-radius: var(--radius); font: 800 .95rem var(--f-display); font-stretch: 112%; flex: none; }
.rail-toggle { display: none; background: none; border: 0; color: inherit; font-size: 1.7rem; cursor: pointer; padding: .25rem; line-height: 1; }
.rail-body { display: flex; flex-direction: column; gap: 1.5rem; flex: 1; }
.rail-role { font-weight: 500; opacity: .92; }
.status { display: flex; align-items: center; gap: .55rem; font-size: .9rem; margin-top: .45rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgb(74 222 128 / .6); flex: none; }
.rail-nav { display: flex; flex-direction: column; gap: .15rem; }
.rail-nav a { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; text-decoration: none; opacity: .78; font-weight: 500; }
.rail-nav a::before { content: ""; width: .5rem; height: .5rem; border: 1.5px solid currentColor; border-radius: 1px; flex: none; }
.rail-nav a:hover { opacity: 1; }
.rail-nav a.is-active { opacity: 1; font-weight: 600; }
.rail-nav a.is-active::before { background: currentColor; }
.rail-foot { margin-top: auto; display: grid; gap: 1.1rem; }
.rail-icons { display: flex; align-items: center; gap: 1rem; font-size: 1.2rem; }
.rail-icons a, .theme-toggle { color: inherit; background: none; border: 0; cursor: pointer; font-size: inherit; padding: 0; opacity: .85; line-height: 1; }
.rail-icons a:hover, .theme-toggle:hover { opacity: 1; }
.theme-toggle { margin-left: auto; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1.2rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: 600 .95rem/1.2 var(--f-body); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 82%, #000); border-color: color-mix(in srgb, var(--accent) 82%, #000); color: var(--accent-ink); }
.btn.on-accent { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--accent); }
.btn.on-accent:hover { background: transparent; color: var(--accent-ink); }

/* ---------- Bagian ---------- */
section, .hero { padding-block: clamp(3.25rem, 7vw, 5.5rem); scroll-margin-top: 4.5rem; }
section { border-top: 1px solid var(--line); }
h1 { font: 700 clamp(2.2rem, 5vw, 4.1rem)/1.06 var(--f-display); font-stretch: 112%; letter-spacing: -.025em; max-width: 18ch; text-wrap: balance; }
h2 { font: 700 clamp(1.6rem, 3vw, 2.2rem)/1.15 var(--f-display); font-stretch: 108%; letter-spacing: -.02em; margin-bottom: 2rem; }
h3 { font: 600 1.125rem/1.3 var(--f-body); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--muted); max-width: 40rem; margin-top: 1.5rem; }
.muted { color: var(--muted); }
.prose p { max-width: 38rem; }
.prose p + p { margin-top: 1.1em; }

/* Beranda */
.hero { padding-top: clamp(2.5rem, 7vw, 6rem); }
.hero .status { color: var(--muted); margin: 0 0 1.5rem; }
.status-inline { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 2rem; margin-top: 3.5rem; border-top: 1.5px solid var(--ink); }
.facts > div { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }
.facts a { color: inherit; }

@media (prefers-reduced-motion: no-preference) {
  /* Satu momen terorkestra: isi hero muncul bergantian saat halaman dibuka. */
  .hero > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero > *:nth-child(2) { animation-delay: .06s; } .hero > *:nth-child(3) { animation-delay: .12s; }
  .hero > *:nth-child(4) { animation-delay: .18s; } .hero > *:nth-child(5) { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  .dot { animation: ping 2.4s ease-out infinite; }
  @keyframes ping { 70% { box-shadow: 0 0 0 .55rem rgb(74 222 128 / 0); } 100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); } }
}

/* Potret di hero */
.hero-top { display: grid; gap: 2.5rem; align-items: center; }
.hero-top.has-photo { grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem); gap: clamp(2rem, 5vw, 4rem); }
.hero-top.has-photo h1 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); }
.portrait { position: relative; margin: 0 1rem 1rem 0; }
.portrait::before { content: ""; position: absolute; inset: 1rem -1rem -1rem 1rem; background: var(--accent); border-radius: var(--radius); }
.portrait img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%; border-radius: var(--radius); background: var(--surface); }

/* Tentang */
.about { display: grid; gap: 2rem; }

/* Layanan */
.rows { border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 1rem 2.5rem; padding-block: 1.6rem; border-top: 1px solid var(--line); }
.row h3 { display: flex; gap: .85rem; align-items: baseline; }
.row h3 i { color: var(--accent-text); font-size: 1.25rem; transform: translateY(.1em); }
.row p { color: var(--muted); max-width: 34rem; }

/* Proyek */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2.25rem; }
.project { display: grid; gap: 1.1rem; align-content: start; color: inherit; text-decoration: none; }
.project.is-lead { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.25rem; align-items: center; }
.thumb { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--line) 70%, transparent) 11px 12px), var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { font: 600 .9rem var(--f-body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .85rem; }
.project h3 { font: 700 1.45rem/1.2 var(--f-display); font-stretch: 106%; letter-spacing: -.015em; text-decoration: underline 2px transparent; text-underline-offset: .25em; transition: text-decoration-color .15s; }
.project:hover h3, .project:focus-visible h3 { text-decoration-color: var(--accent-text); }
.project-meta { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.project-body > p:not(.project-meta) { margin-top: .6rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tags li { border: 1px solid var(--line); border-radius: 99px; padding: .1rem .7rem; font-size: .85rem; color: var(--muted); background: var(--surface); }

/* Keahlian */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2.5rem 3rem; }
.skill-group h3 { padding-bottom: .6rem; border-bottom: 1.5px solid var(--ink); margin-bottom: .4rem; }
.skill-group li { display: grid; gap: .45rem; padding-block: .75rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
.meter { display: block; height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.meter::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--accent-text); border-radius: 2px; }

/* Pengalaman */
.timeline li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: .5rem 2.5rem; padding-block: 1.75rem; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .95rem; padding-top: .15rem; }
.where { color: var(--muted); margin-top: .15rem; }
.dashes { margin-top: .9rem; display: grid; gap: .45rem; max-width: 38rem; }
.dashes li { display: block; padding: 0 0 0 1.2rem; border: 0; position: relative; }
.dashes li::before { content: ""; position: absolute; left: 0; top: .8em; width: .6rem; height: 1.5px; background: var(--accent-text); }

/* Pendidikan */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem; }
.sub { padding-bottom: .6rem; border-bottom: 1.5px solid var(--ink); margin-bottom: .2rem; }
.plain li { display: grid; padding-block: .85rem; border-bottom: 1px solid var(--line); }
.plain a { color: inherit; }

/* Kontak */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem; align-items: start; }
.contact .lead { margin-top: 0; }
.mail { display: inline-block; margin-block: 1.5rem; font: 700 clamp(1.25rem, 2.4vw, 1.7rem)/1.2 var(--f-display); font-stretch: 108%; letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact .plain li { grid-template-columns: 6.5rem 1fr; }
.notice { border: 1.5px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 2rem; }
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 500; font-size: .92rem; }
.field input, .field textarea { width: 100%; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 8rem; }
.err { color: #dc2626; font-size: .88rem; }
[data-theme="dark"] .err { color: #f87171; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; }

/* Detail proyek */
.back { display: inline-flex; gap: .5rem; align-items: center; color: var(--muted); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--accent-text); }
.project-page h1 { margin-top: 1.5rem; max-width: 20ch; }
.cover { margin-top: 2.5rem; }
.cover img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
.project-page .prose { margin-top: 2.5rem; }
.sub-h { font: 600 1.125rem/1.3 var(--f-body); margin: 2.5rem 0 0; letter-spacing: 0; }
.sub-h + .tags { margin-top: .75rem; }

/* Footer */
.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot a { color: inherit; }

/* Layar desktop yang pendek: rail dirapatkan agar tombol CV tetap terlihat */
@media (min-width: 62.01rem) and (max-height: 860px) {
  .rail { padding-block: 1.25rem; gap: 1rem; }
  .rail-body { gap: 1rem; }
    .rail-nav a { padding: .28rem 0; }
}

/* ---------- Tablet & ponsel: rail menjadi bilah atas ---------- */
@media (max-width: 62rem) {
  .shell { display: block; }
  .rail { height: auto; min-height: 0; padding: .7rem 1.1rem; gap: 0; z-index: 50; overflow: visible; }
  .rail-toggle { display: block; }
  .brand-mark { width: 2.1rem; height: 2.1rem; font-size: .85rem; }
  .rail-body { display: none; }
  .rail.is-open { position: fixed; inset: 0; height: 100dvh; overflow-y: auto; padding-bottom: 2rem; }
  .rail.is-open .rail-body { display: flex; padding-top: 1.75rem; }
  .rail.is-open .rail-nav a { font-size: 1.3rem; padding: .55rem 0; }
    .status-inline { display: flex; }
  .hero-top.has-photo { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(13rem, 62%); }
    .main { max-width: none; }
}

@media (max-width: 40rem) {
  .row, .timeline li, .contact, .two { grid-template-columns: 1fr; }
  .row { gap: .6rem; }
  .timeline li { gap: .25rem; }
  .two, .contact { gap: 2.5rem; }
  .projects { grid-template-columns: 1fr; gap: 2.5rem; }
  .project.is-lead { grid-template-columns: 1fr; gap: 1.1rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .btn { flex: 1 1 100%; }
  .form .btn { justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .rail, .skip, .foot a { display: none; }
  .shell { display: block; }
}
