/* =========================================================
   KARBITPRIME — Design tokens
   Situs katalog karya original & patch terjemahan
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Color */
  --bg: #12142B;
  --bg-card: #1B1E3D;
  --bg-card-hover: #232752;
  --paper: #F3ECDD;
  --ink: #2A2333;
  --text: #E8E6F0;
  --text-muted: #9C9AB8;
  --accent-gold: #D9A441;
  --accent-gold-bright: #F0BE63;
  --accent-jade: #4FA88C;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(217, 164, 65, 0.35);

  /* Type */
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --max-width: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 800px 500px at 15% -10%, rgba(217,164,65,0.08), transparent),
    radial-gradient(ellipse 600px 400px at 100% 10%, rgba(79,168,140,0.06), transparent);
  background-size: 140% 140%;
  animation: bgDrift 26s ease-in-out infinite;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@keyframes bgDrift {
  0%, 100% { background-position: 0% 0%, 100% 0%; }
  50% { background-position: 10% 10%, 90% 15%; }
}

/* ---------- Scroll-reveal animation ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; }
.reveal.is-visible { animation: fadeInUp 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }

@keyframes floatCard {
  0%, 100% { transform: rotate(-1.2deg) translateY(0); }
  50% { transform: rotate(-1.2deg) translateY(-8px); }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 20, 43, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

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

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-left: 1px solid var(--border);
  padding-left: 10px;
  display: none;
}

@media (min-width: 640px) {
  .brand-tag { display: block; }
}

nav.main-nav {
  display: flex;
  gap: 4px;
}

nav.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text);
  background: var(--bg-card);
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 24px 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; gap: 40px; }
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-jade);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-jade);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-gold-bright);
  font-weight: 500;
}

.hero p.lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent-gold);
  color: #1a1508;
  box-shadow: 0 0 0 rgba(217,164,65,0);
}
.btn-primary:hover {
  background: var(--accent-gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -10px rgba(217,164,65,0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-bright); }

/* ---------- Hero signature: before/after translation card ---------- */
.translate-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.5);
  position: relative;
  animation: floatCard 6s ease-in-out infinite;
}

.translate-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(42,35,51,0.18);
  border-radius: 4px;
  pointer-events: none;
}

.translate-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.translate-card-head .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}

.toggle-switch {
  display: flex;
  background: rgba(42,35,51,0.08);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.toggle-switch button {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink);
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-switch button.active {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}

.translate-card-body {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.55;
  min-height: 92px;
  transition: opacity 0.18s ease;
}

.translate-card-body .orig { font-style: italic; opacity: 0.75; }

.translate-card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(42,35,51,0.12);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.6;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 64px 0 24px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

.section-head .see-all {
  font-size: 0.85rem;
  color: var(--accent-jade);
  font-weight: 500;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.chip {
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
  cursor: pointer;
}

.chip.active {
  border-color: var(--border-bright);
  color: var(--accent-gold-bright);
  background: rgba(217,164,65,0.08);
}

/* ---------- Patch card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2,0.7,0.3,1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  box-shadow: 0 20px 44px -20px rgba(0,0,0,0.55);
}

.card:hover .card-thumb-img { transform: scale(1.06); }

.card-thumb {
  aspect-ratio: 3/4;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  overflow: hidden;
}

.card-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.4s ease;
}

.card-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.card-thumb .status,
.card-thumb .initial,
.card-badges { position: relative; z-index: 1; }

.card-thumb .status {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.35);
  color: var(--accent-jade);
}

.card-thumb .initial {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  z-index: 1;
}

.card-body { padding: 14px 14px 16px; }

.card-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.25;
}

.card-tags {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card-meta .ver { color: var(--accent-gold-bright); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer strong { color: var(--text); }

/* ---------- Type & platform badges ---------- */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
}
.type-badge.original { background: rgba(79,168,140,0.18); color: var(--accent-jade); }
.type-badge.patch { background: rgba(217,164,65,0.18); color: var(--accent-gold-bright); }

.platform-badges { display:flex; gap:6px; align-items:center; }
.platform-badge {
  display:flex; align-items:center; gap:4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
}
.platform-badge svg { width:12px; height:12px; }

.card-badges { position:absolute; top:10px; right:10px; display:flex; gap:4px; }

/* ---------- Mirror download list ---------- */
.mirror-group { margin-bottom: 18px; }
.mirror-group-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.mirror-list { display:flex; flex-direction:column; gap:8px; }
.mirror-btn {
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mirror-btn:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.mirror-btn .arrow { color: var(--accent-gold-bright); font-family: var(--font-mono); }

.dev-credit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.dev-credit strong { color: var(--accent-jade); }

.sort-toggle { display:flex; gap:4px; }
.sort-toggle a {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.sort-toggle a.active { color: var(--accent-gold-bright); border-color: var(--border-bright); background: rgba(217,164,65,0.08); }

.card-updated {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---------- Comments ---------- */
.hp-field { position: absolute; left: -9999px; width:1px; height:1px; opacity:0; }

.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0 24px;
}
.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.comment-form textarea { min-height: 80px; resize: vertical; }

.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-head strong { color: var(--accent-gold-bright); font-size: 0.9rem; }
.comment-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}
.comment-item p { color: var(--text); font-size: 0.88rem; margin: 0; line-height: 1.6; }

/* ---------- Detail page ---------- */
.detail-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

@media (max-width: 720px) {
  .detail-hero { grid-template-columns: 1fr; }
}

.detail-cover {
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 50px -22px rgba(0,0,0,0.6);
}

.detail-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--accent-jade); }

.detail-tags { display: flex; gap: 6px; margin-bottom: 14px; }
.detail-tags span {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.detail-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin: 0 0 8px;
}

.detail-sub { color: var(--text-muted); margin-bottom: 22px; }

.info-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.info-strip div { display: flex; flex-direction: column; gap: 4px; }
.info-strip .k {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.info-strip .v { font-weight: 600; font-size: 0.92rem; }
.info-strip .v.free { color: var(--accent-jade); }

.requirement-box {
  background: rgba(217,164,65,0.08);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 26px;
  display: flex;
  gap: 10px;
}

.requirement-box .ico { color: var(--accent-gold-bright); font-weight: 700; }

.detail-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}

@media (max-width: 860px) {
  .detail-body { grid-template-columns: 1fr; }
}

.detail-body h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 28px 0 12px;
}
.detail-body h2:first-child { margin-top: 0; }

.detail-body p { color: var(--text-muted); line-height: 1.7; }

.changelog {
  list-style: none;
  padding: 0;
  margin: 0;
}
.changelog li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  gap: 12px;
}
.changelog .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-gold-bright);
  white-space: nowrap;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
}

.sidebar-card .btn-primary { width: 100%; justify-content: center; margin-bottom: 10px; }
.sidebar-card .btn-ghost { width: 100%; justify-content: center; }

.sidebar-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.5;
}
