/* ==========================================================================
   Personal site — stylesheet publik
   Semua warna, font, dan jarak ditentukan lewat variabel di :root.
   Ubah di satu tempat, seluruh halaman ikut berubah.
   ========================================================================== */

:root {
  /* Warna */
  --ink:      #101317;   /* teks utama, hitam kebiruan */
  --paper:    #FCFCFA;   /* latar halaman */
  --surface:  #F3F2EE;   /* latar blok yang perlu dibedakan tipis */
  --line:     #E3E2DC;   /* garis pemisah */
  --muted:    #6E7378;   /* teks sekunder */
  --accent:   #1E3AE0;   /* satu-satunya warna cerah. Dipakai hemat. */

  /* Huruf */
  --font-display: 'Inter Tight', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Ukuran */
  --measure: 1120px;     /* lebar maksimal konten */
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --section: clamp(4.5rem, 11vw, 8.5rem);
}

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, p, figure, ul, li {
  margin: 0;
  padding: 0;
}

ul { list-style: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Fokus keyboard harus selalu terlihat — ini syarat aksesibilitas dasar. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hormati pengguna yang mematikan animasi di setelan sistemnya. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------- tipografi */
.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

/* Label monospace. Dipakai untuk penanda section dan metadata —
   font mono di sini bukan hiasan, tapi mengacu ke pekerjaan si pemilik. */
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 46ch;
}

.mark { color: var(--accent); }

/* --------------------------------------------------------------- layout */
.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

/* Judul section di kiri (sempit), isi di kanan. Struktur "lembar spesifikasi". */
.section-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.section-grid > .label { padding-top: 0.6rem; }

/* Untuk section yang butuh lebar penuh (gallery, kontak): label di atas. */
.section-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }

@media (max-width: 800px) {
  .section-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-grid > .label { padding-top: 0; }
}

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav.is-stuck { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.0625rem;
}

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav__links a:hover { color: var(--ink); }

@media (max-width: 600px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

.nav__cta { color: var(--ink) !important; }

/* ----------------------------------------------------------------- hero */
.hero {
  padding-block: clamp(4rem, 14vw, 9rem) clamp(3.5rem, 9vw, 6rem);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

/* Titik hijau berdenyut = sinyal "terbuka untuk kerja". Elemen kecil,
   tapi ini informasi pertama yang dicari rekruter. */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14A05C;
  box-shadow: 0 0 0 0 rgba(20, 160, 92, 0.5);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 8px rgba(20, 160, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 160, 92, 0); }
}

.hero__text {
  margin-top: clamp(1.5rem, 4vw, 2.25rem);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (max-width: 800px) {
  .hero__text { grid-template-columns: 1fr; gap: 1.25rem; }
}

.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 2;
}

/* -------------------------------------------------------------- tentang */
.about p + p { margin-top: 1.25rem; }
.about p { max-width: 62ch; }

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.25rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
}

/* -------------------------------------------------------------- project
   Ini elemen tanda tangan situs: bukan grid kartu, tapi daftar baris besar.
   Di desktop, thumbnail muncul mengikuti kursor saat baris disentuh. */
.projects { border-top: 1px solid var(--line); }

.project {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem 2rem;
  padding-block: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .project:hover { padding-left: 1.25rem; }
  .project:hover .project__title { color: var(--accent); }
  .project:hover .project__arrow { opacity: 1; transform: none; }
}

.project__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 3.4vw, 2.125rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  transition: color 0.25s ease;
}

.project__summary {
  grid-column: 1;
  color: var(--muted);
  max-width: 52ch;
  margin-top: 0.4rem;
}

.project__side {
  grid-column: 2;
  grid-row: 1 / span 2;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.project__tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.project__arrow {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (max-width: 700px) {
  .project { grid-template-columns: 1fr; }
  .project__side {
    grid-column: 1;
    grid-row: auto;
    align-items: flex-start;
    text-align: left;
    margin-top: 0.75rem;
  }
  .project__arrow { display: none; }
}

/* Thumbnail melayang yang mengikuti kursor (hanya perangkat berpointer). */
.peek {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 18px 45px rgba(16, 19, 23, 0.18);
}

.peek.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.peek img { width: 100%; height: 100%; object-fit: cover; }

@media (hover: none) { .peek { display: none; } }

/* -------------------------------------------------------------- gallery */
.gallery {
  columns: 3;
  column-gap: 14px;
}

@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 520px) { .gallery { columns: 1; } }

.gallery__item {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  background: var(--surface);
  cursor: zoom-in;
  overflow: hidden;
  width: 100%;
}

.gallery__item img {
  width: 100%;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery__item:hover img { transform: scale(1.03); }

.gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.9rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(16, 19, 23, 0.75), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery__item:hover .gallery__caption,
.gallery__item:focus-visible .gallery__caption { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(16, 19, 23, 0.94);
}

.lightbox.is-open { display: grid; }

.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.9rem;
  border-radius: 2px;
  cursor: pointer;
}

.lightbox__close:hover { border-color: #fff; }

/* -------------------------------------------------------------- contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.field input,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.field textarea { resize: vertical; min-height: 120px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover { background: transparent; color: var(--ink); }

.contact-list li {
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.contact-list a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-list a:hover { border-bottom-color: var(--accent); }

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: 2px;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.alert--ok  { background: #E8F5EE; color: #0E6B3D; }
.alert--err { background: #FBEBEB; color: #A02020; }

/* --------------------------------------------------------------- footer */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3.5rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Bagi pembaca layar saja */
.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;
}

/* Muncul perlahan saat masuk layar. Diaktifkan oleh main.js. */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-in { opacity: 1; transform: none; }

.empty {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding-block: 2rem;
}
