/* ===========================================================
   style.css — tampilan blog Ahmad Riza Rudi
   Tema (terang/gelap) diatur lewat atribut [data-theme] di <html>.
   Warna disimpan sebagai CSS variable biar gampang diubah.
   =========================================================== */

/* ---------- Variabel warna: TEMA TERANG (default) ----------
   Konsep: MONOKROM (hitam-putih + tingkatan abu) dengan SATU warna
   aksen hangat (terracotta) yang nyambung dengan ilustrasi anime.
   Warna sengaja sedikit "hangat" (off-white, near-black) biar tidak
   terasa mati seperti #fff/#000 polos. */
:root {
  --bg: #ffffff;          /* putih bersih */
  --bg-soft: #f4f4f5;     /* abu netral sangat muda */
  --surface: #ffffff;     /* kartu/permukaan */
  --text: #131314;        /* near-black netral */
  --text-soft: #52525b;   /* teks sekunder (abu netral) */
  --muted: #8e8e96;       /* teks paling redup */
  --border: #e4e4e7;
  --accent: #131314;      /* aksen = hitam (grayscale murni) */
  --accent-soft: #ececee; /* abu muda untuk latar aksen */
  --accent-ink: #ffffff;  /* teks di atas aksen (tombol) */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 30px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --maxw: 920px;
}

/* ---------- TEMA GELAP ---------- */
[data-theme="dark"] {
  --bg: #0b0b0c;          /* near-black netral */
  --bg-soft: #161618;
  --surface: #161618;
  --text: #ededee;
  --text-soft: #a1a1aa;
  --muted: #6c6c74;
  --border: #272729;
  --accent: #ededee;      /* aksen = putih (grayscale di gelap) */
  --accent-soft: #232326;
  --accent-ink: #0b0b0c;  /* teks gelap di atas tombol putih */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- Reset ringan & dasar ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Efek transisi mulus saat perubahan tema gelap/terang */
body, .site-header, .site-footer, .card, .btn, .theme-toggle, .nav a, .ebook-highlight, .cta-box, .profile-card, .stat, .skill-bar span, .timeline li::before, input, textarea {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header & navigasi ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }

nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
  transform: translateY(-1px);
}
.nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Tombol ganti tema */
.theme-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.08) rotate(15deg);
}
.theme-toggle:active {
  transform: scale(0.92) rotate(-10deg);
}
[data-theme="light"] .theme-toggle::before { content: "🌙"; }
[data-theme="dark"] .theme-toggle::before { content: "☀️"; }

/* Tombol menu (hamburger) — disembunyikan di desktop */
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px;
  background: none; border: 0; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.2s; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.btn-primary:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 20px 56px;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  align-items: center;
  gap: 48px;
}
.hero-text { min-width: 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; margin: 12px 0 18px; }
.hero-lead { font-size: 1.15rem; color: var(--text-soft); max-width: 600px; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Slot gambar anime (hero) ----------
   Taruh file gambarmu di: public/img/hero.png
   Kalau file belum ada, placeholder bergaris muncul otomatis. */
.hero-art {
  position: relative;
  align-self: end;            /* gambar nempel bawah, sejajar dengan teks */
  min-height: 260px;          /* ruang minimum buat placeholder */
  cursor: pointer;
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;          /* batasi tinggi biar tidak "kepanjangan" */
  object-fit: contain;        /* tampilkan gambar UTUH, tanpa crop */
  /* Gambar line-art berlatar putih -> bingkai jadi "kartu" putih supaya
     rapi di tema terang MAUPUN gelap (tidak jadi kotak putih nyolok). */
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity 0.2s ease;
}
/* Pose BERDIRI (default, terlihat) */
.hero-art .art-stand { position: relative; z-index: 1; }
/* Pose MELAMBAI (tumpuk di atasnya, awalnya transparan) */
.hero-art .art-wave {
  position: absolute; inset: 0; z-index: 2;
  height: 100%;
  opacity: 0; pointer-events: none;
  transform-origin: 50% 100%; /* berayun dari bawah */
}
/* Hover (desktop) atau .is-waving (klik/tap) -> tampilkan pose melambai */
.hero-art:hover .art-stand,
.hero-art.is-waving .art-stand { opacity: 0; }
.hero-art:hover .art-wave,
.hero-art.is-waving .art-wave {
  opacity: 1;
  animation: hero-wiggle 0.7s ease-in-out infinite;
}
/* Goyangan kecil biar terasa "melambai" */
@keyframes hero-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3.5deg); }
  75% { transform: rotate(3.5deg); }
}
/* Hormati preferensi pengguna yang mematikan animasi */
@media (prefers-reduced-motion: reduce) {
  .hero-art:hover .art-wave,
  .hero-art.is-waving .art-wave { animation: none; }
}
/* Placeholder: tampil saat gambar belum ada / gagal load */
.art-placeholder {
  position: absolute; inset: 0;
  z-index: 0;                 /* di BELAKANG gambar; muncul hanya kalau img gagal/dihapus */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 16px;
  color: var(--muted); font-size: 0.82rem; font-weight: 500;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--bg-soft);
}
.art-placeholder strong { color: var(--text-soft); font-size: 0.9rem; }
.art-placeholder code { font-size: 0.78rem; color: var(--accent); }

/* ---------- Section umum ---------- */
.section { padding: 36px 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  position: relative; padding-left: 16px;
}
/* Garis aksen kecil di kiri judul section */
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 4px; border-radius: 3px; background: var(--accent);
}
.link-more { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.link-more:hover { text-decoration: underline; }

/* ---------- Kartu & grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.project-card h3 { font-size: 1.2rem; margin: 12px 0 6px; letter-spacing: -0.01em; }
.project-card p { color: var(--text-soft); font-size: 0.95rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ---------- Tag ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  font-size: 0.8rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}
a.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag-sm { font-size: 0.75rem; padding: 2px 8px; }
.tag-count { opacity: 0.6; }
.tag-filter { margin: 8px 0 28px; }

/* ---------- Sorotan ebook ---------- */
.ebook-highlight {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.ebook-highlight h2 { font-size: 1.4rem; margin: 6px 0; letter-spacing: -0.02em; }
.ebook-highlight p { color: var(--text-soft); }

/* ---------- Halaman Jasa: harga & CTA ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.price-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.price-card.price-featured { border-color: var(--accent); box-shadow: var(--shadow); }
.price-tag {
  position: absolute; top: -11px; left: 24px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink);
  padding: 3px 10px; border-radius: 999px;
}
.price-name { font-weight: 700; font-size: 1.1rem; }
.price-num { color: var(--text-soft); font-size: 1rem; margin: 4px 0 14px; }
.price-num strong { color: var(--text); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.price-list { list-style: none; display: grid; gap: 8px; margin-bottom: 20px; }
.price-list li { color: var(--text-soft); font-size: 0.92rem; padding-left: 20px; position: relative; }
.price-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.price-card .btn { margin-top: auto; text-align: center; }
.price-note { margin-top: 16px; font-size: 0.88rem; }

.cta-box {
  text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px 24px;
}
.cta-box h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.cta-box p { color: var(--text-soft); margin: 8px 0 22px; }
.cta-box .hero-actions { justify-content: center; }

/* ---------- Daftar artikel ---------- */
.article-list { display: flex; flex-direction: column; gap: 4px; }
.article-item {
  display: block;
  padding: 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.15s, border-color 0.15s;
}
.article-item:hover { background: var(--surface); border-color: var(--border); }
.article-item time { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.article-item h3 { font-size: 1.25rem; margin: 6px 0; letter-spacing: -0.01em; }
.article-item p { color: var(--text-soft); font-size: 0.96rem; }

/* ---------- Halaman umum ---------- */
.page { padding: 48px 20px 72px; }
.page h1 { font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; }

/* ========== Halaman About / Profil ========== */

/* Kartu profil: foto + info */
.profile-card {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.profile-photo {
  position: relative; flex-shrink: 0;
  width: 150px; height: 190px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--accent-soft);
}
.profile-photo img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-fallback {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 3.5rem; color: var(--accent);
}
.profile-info { min-width: 0; flex: 1; }
.profile-info h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 6px 0; letter-spacing: -0.03em; }
.profile-role { font-weight: 600; color: var(--text); }
.profile-meta { color: var(--text-soft); font-size: 0.92rem; margin-top: 6px; }
.profile-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.profile-links .btn { padding: 9px 16px; font-size: 0.9rem; }

/* Statistik singkat */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0;
}
.stat {
  text-align: center; padding: 16px 8px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
}
.stat strong { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 0.8rem; color: var(--muted); }

/* Blok section */
.section-block { margin-top: 40px; }
.section-block > h2 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px;
  position: relative; padding-left: 16px;
}
.section-block > h2::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 4px; border-radius: 3px; background: var(--accent);
}

/* Skill bars */
.skill-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.skill-top { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.skill-pct { color: var(--muted); font-weight: 500; }
.skill-bar { height: 8px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.skill-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding-bottom: 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-year { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline strong { display: block; margin-top: 2px; }
.timeline p { color: var(--text-soft); font-size: 0.95rem; margin-top: 2px; }

@media (max-width: 680px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .skill-list { grid-template-columns: 1fr; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-links { justify-content: center; }
}
.page-lead { color: var(--text-soft); font-size: 1.1rem; margin: 10px 0 28px; }
.muted { color: var(--muted); }
.back-link { display: inline-block; color: var(--text-soft); font-size: 0.9rem; margin-bottom: 24px; }
.back-link:hover { color: var(--accent); }

/* ---------- Prose (isi artikel & ebook) ---------- */
.prose { color: var(--text-soft); font-size: 1.05rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.1rem; }
.prose h1, .prose h2, .prose h3 { color: var(--text); letter-spacing: -0.02em; line-height: 1.3; }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: 0.4rem; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  color: var(--text);
}
.prose blockquote h3 { margin-top: 0; }
.prose code {
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px; font-size: 0.9em;
}
.prose pre { background: #11131a; color: #e7e9f0; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.article-header, .chapter-header { margin-bottom: 28px; }
.article-header time { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; }
.article-header h1, .chapter-header h1 { margin: 8px 0 14px; }

/* ---------- Ebook: cover, daftar isi, navigasi ---------- */
.ebook-reader { max-width: 720px; }
.ebook-cover {
  text-align: center; padding: 40px 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 36px;
}
.toc-title { font-size: 1.3rem; margin-bottom: 12px; }
.toc { list-style: none; counter-reset: none; margin-bottom: 28px; }
.toc li { border-bottom: 1px solid var(--border); }
.toc a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; transition: padding 0.15s, color 0.15s; }
.toc a:hover { padding-left: 14px; color: var(--accent); }
.toc-num { color: var(--accent); font-weight: 700; min-width: 26px; }
.toc-text { font-weight: 500; }

.chapter-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.chapter-nav-item { display: flex; flex-direction: column; gap: 4px; max-width: 48%; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s; }
.chapter-nav-item:hover { border-color: var(--accent); }
.chapter-nav-item span { font-size: 0.8rem; color: var(--muted); }
.chapter-nav-item.next { text-align: right; margin-left: auto; }
.chapter-nav-item strong { color: var(--text); font-size: 0.95rem; }

/* ---------- Form & alert (kontak) ---------- */
.contact-page { max-width: 620px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-weight: 600; font-size: 0.92rem; }
.form input, .form textarea {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { align-self: flex-start; }

.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 24px; font-size: 0.95rem; }
.alert-success { background: #e7f7ee; color: #1c7a4b; border: 1px solid #b6e6cc; }
.alert-error { background: #fdecec; color: #b3261e; border: 1px solid #f4c4c0; }
.alert-error ul { padding-left: 1.2rem; }
[data-theme="dark"] .alert-success { background: #11241a; color: #5fd699; border-color: #1f4030; }
[data-theme="dark"] .alert-error { background: #2a1413; color: #ff8d85; border-color: #4a201d; }

/* Honeypot anti-spam: disembunyikan dari manusia, tetap terbaca bot. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-alt { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-soft); }
.contact-alt a { color: var(--accent); font-weight: 600; }
.social-list { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.social-list li { display: flex; gap: 14px; align-items: baseline; }
.social-list span { min-width: 92px; color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.footer-made { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 90px 20px; }
.big-404 { font-size: 5rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 20px; color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--accent); }
.project-actions { margin-top: 28px; }

/* ---------- Responsif (mobile) ---------- */
@media (max-width: 680px) {
  /* Hero: tumpuk, gambar di atas */
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 48px 20px 36px; }
  .hero-art { order: -1; min-height: 0; }
  .hero-art img { max-height: 300px; margin: 0 auto; }

  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 0 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), padding 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  }
  .nav.nav-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    padding: 12px 20px;
  }
  .nav a { padding: 12px; }
  .theme-toggle { align-self: flex-start; margin-top: 6px; }
  .chapter-nav { flex-direction: column; }
  .chapter-nav-item, .chapter-nav-item.next { max-width: 100%; text-align: left; }
}

/* ===========================================================
   Tambahan Fitur Premium: Terminal, Tag Filter, & Scroll Anim
   =========================================================== */

/* --- Gaya Tombol Tag Filter --- */
button.tag {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
button.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
button.tag.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* --- Animasi Timeline Perjalanan --- */
.timeline-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.timeline-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- Terminal Mini Interaktif (TKJ Special) --- */
.terminal-container {
  background: #0f141c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
  margin-top: 14px;
}
[data-theme="dark"] .terminal-container {
  border-color: #1f242c;
  background: #090d16;
}
.terminal-header {
  background: #1a202c;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .terminal-header {
  background: #111520;
}
.terminal-buttons {
  display: flex;
  gap: 6px;
}
.term-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.term-btn.red { background: #ff5f56; }
.term-btn.yellow { background: #ffbd2e; }
.term-btn.green { background: #27c93f; }
.terminal-title {
  color: #a0aec0;
  font-size: 0.8rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 500;
}
.terminal-body {
  padding: 18px;
  color: #cbd5e0;
  font-size: 0.88rem;
  line-height: 1.6;
  height: 280px;
  overflow-y: auto;
  text-align: left;
}
.terminal-line {
  margin-bottom: 4px;
  white-space: pre-wrap;
}
.term-highlight {
  color: #319795;
  font-weight: bold;
}
.term-command {
  color: #ecc94b;
  font-weight: bold;
}
.term-error {
  color: #f56565;
}
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.terminal-prompt {
  color: #48bb78;
  font-weight: bold;
}
#terminalInput {
  background: transparent !important;
  border: none !important;
  color: #cbd5e0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  flex: 1;
  padding: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ===========================================================
   Efek ketik (typing) pada judul hero
   =========================================================== */
[data-typing] { min-height: 1.05em; }
.type-cursor {
  display: inline-block;
  width: 0.06em;
  margin-left: 0.04em;
  background: currentColor;
  animation: type-blink 0.9s steps(1) infinite;
}
[data-typing] .type-cursor { height: 0.95em; vertical-align: -0.08em; }
@keyframes type-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .type-cursor { display: none; }
}

/* ===========================================================
   Reveal saat scroll (elegan, halus)
   Elemen disembunyikan hanya saat JS aktif (html.reveal-ready) supaya
   tidak kedip, lalu muncul saat masuk layar (.is-visible). Hero TIDAK
   ikut (biar langsung tampil di atas, tanpa nunggu).
   =========================================================== */
html.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.165, 0.84, 0.44, 1),
              transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: opacity, transform;
}
html.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===========================================================
   Transisi antar halaman (page transition)
   - Saat halaman DIBUKA: konten <main> fade-in + naik tipis.
   - Saat link internal DIKLIK: body diberi .is-leaving -> fade-out
     halus dulu (diatur di main.js) sebelum pindah halaman.
   =========================================================== */
main {
  animation: page-enter 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.is-leaving {
  opacity: 0;
  transition: opacity 0.22s ease;
}
/* Hormati pengguna yang mematikan animasi */
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  body.is-leaving { opacity: 1; transition: none; }
}
