:root {
    --bg: #f0f7ff;
    --bg-secondary: #ffffff;
    --card: #ffffff;
    --border: #d0e6ff;
    --text: #0f172a;
    --text-muted: #334155;
    --heading: #0B1738;
    --primary: #1267F5;
    --primary-dark: #0e54d0;
    --accent: #16a34a;
    --code-bg: #0B1738;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Base Typography (Untuk API.html & Halaman Statis) */
h1 { font-size: 2.5rem; color: var(--heading); margin-bottom: 10px; font-weight: 800; }
h2 { font-size: 1.8rem; color: var(--heading); margin-top: 40px; margin-bottom: 15px; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
h3 { font-size: 1.2rem; color: var(--primary); margin-top: 25px; margin-bottom: 10px; font-family: monospace; }
p { margin-bottom: 15px; color: var(--text-muted); }

/* Code Blocks Fix (Agar tidak putih di API.html) */
code {
    font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--primary-dark); /* Warna biru gelap biar jelas di putih */
    background: #e1effe;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-word;
}

pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    border: 2px solid var(--border);
    white-space: pre;
}

pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #e1e4e8; /* Kode di dalam pre tetap putih/terang */
    line-height: 1.5;
}

/* Syntax Highlighting */
.comment { color: #8b949e; }
.keyword { color: #ff7b72; }
.string { color: #a5d6ff; }
.variable { color: #ffa657; }
.tag { color: #7ee787; }
.attr { color: #79c0ff; }

/* Main Navigation Bar */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(240, 247, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-brand {
    font-weight: 800;
    color: var(--heading);
    text-decoration: none;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.nav-links a:not(.nav-brand) {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:not(.nav-brand):hover {
    color: var(--primary);
}

.nav-links a.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* Override top-links agar sejajar di nav */
.top-links {
    position: static;
    display: flex;
    gap: 8px; /* Diperpendek dari 12px */
}

.top-link {
    width: 34px; /* Diperpendek dari 38px */
    height: 34px;
    border-radius: 8px;
}

.top-link svg { width: 20px; height: 20px; }

/* Hero Section */
header {
    text-align: center;
    padding-top: 40px;
    padding: 80px 20px 60px;
    border-bottom: 2px solid var(--border);
    background: radial-gradient(circle at 50% 0%, rgba(18, 103, 245, 0.05) 0%, transparent 60%);
}

.logo-container {
    width: 120px; height: 120px; margin: 0 auto 30px;
    display: flex; align-items: center; justify-content: center;
    background: #ffffff; border: 2px solid var(--border);
    border-radius: 24px; padding: 20px;
    box-shadow: 0 10px 25px rgba(18, 103, 245, 0.08);
}

.logo-container svg { width: 100%; height: 100%; }

.tagline { font-size: 1.2rem; color: var(--primary); margin-bottom: 30px; font-weight: 600; }
.description { max-width: 600px; margin: 0 auto 40px; color: var(--text-muted); font-size: 1.1rem; }

.badges { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.badge {
    background: var(--bg-secondary); border: 2px solid var(--border);
    padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; color: var(--text);
    display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.badge strong { color: var(--heading); }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 80px 0; }
.pillar-card {
    background: var(--card); border: 2px solid var(--border); padding: 25px;
    border-radius: 12px; text-align: center; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.pillar-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 10px 15px rgba(18, 103, 245, 0.1); }
/* SEBELUMNYA: .pillar-card h3 { */
.pillar-card h2 {
    color: var(--primary);
    font-family: monospace;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
    border: none;
    padding: 0;
    margin-top: 0;
}
.pillar-card p { font-size: 0.95rem; color: var(--text-muted); }

/* Titles */
.section-title { text-align: center; color: var(--heading); margin-bottom: 15px; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; border: none; padding: 0; margin-top: 0;}
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 40px; max-width: 640px; margin-left: auto; margin-right: auto; font-size: 1.05rem; }

/* Showcase */
.showcase { background: var(--card); border: 2px solid var(--border); border-radius: 12px; padding: 30px; margin: 40px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.04); }
.showcase-header { margin-bottom: 20px; border-bottom: 2px solid var(--border); padding-bottom: 15px; }
.showcase-header h3 { color: var(--heading); font-size: 1.2rem; border: none; padding: 0; margin: 0; }

#livecodes { width: 100%; height: 480px; border: 2px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.hero-btn {
    background: var(--primary); color: white; border: none; padding: 12px 28px;
    font-size: 1.1rem; font-weight: 600; border-radius: 8px; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 4px 12px rgba(18, 103, 245, 0.25);
}
.hero-btn:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(18, 103, 245, 0.35); }

.tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-link {
    padding: 10px 20px; background: var(--bg-secondary); border: 2px solid var(--border);
    border-radius: 8px; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--text);
    transition: all 0.2s;
}
.tab-link:hover { border-color: var(--primary); color: var(--primary); }
.tab-link.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 10px rgba(18, 103, 245, 0.2); }

/* Comic Section */
.comic-section { margin: 80px 0; text-align: center; }
.comic-card { background: var(--card); border: 2px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 10px 30px rgba(18, 103, 245, 0.06); overflow: hidden; margin-top: 25px; }
.comic-card img { width: 100%; height: auto; border-radius: 10px; display: block; }

/* Features */
.features { margin: 80px 0; }
.feature {
    display: flex; align-items: flex-start; margin-bottom: 25px;
    background: var(--bg-secondary); border: 2px solid var(--border); padding: 25px;
    border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); min-width: 0; overflow-wrap: break-word;
}
.feature-icon { color: var(--primary); font-weight: 800; margin-right: 20px; font-size: 1.5rem; min-width: 40px; }
/* SEBELUMNYA: .feature h4 { */
.feature h3 {
    color: var(--heading);
    margin-bottom: 8px;
    font-size: 1.15rem;
    border: none;
    padding: 0;
    margin-top: 0;
}
.feature p { color: var(--text-muted); font-size: 0.98rem; }
.feature code { background: #e1effe; padding: 2px 6px; border-radius: 4px; color: var(--primary-dark); font-size: 0.85rem; word-break: break-word;}

/* Security Section */
.security-section {
    background: linear-gradient(135deg, #071026 0%, #0B1738 100%);
    border: 2px solid rgba(18, 103, 245, 0.5); border-radius: 20px; padding: 50px 30px;
    text-align: center; margin: 80px 0; position: relative; overflow: hidden;
    box-shadow: 0 15px 35px rgba(7, 16, 38, 0.4); color: #ffffff;
    display: flex; flex-direction: column; align-items: center;
}
.security-section::before { content: '🔒'; position: absolute; font-size: 12rem; opacity: 0.03; top: -20px; right: -20px; pointer-events: none; }
.security-section h2 { color: #ffffff; margin-bottom: 15px; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; border: none; padding: 0; margin-top: 0;}
.security-section p { color: #e5e7eb; font-size: 1.05rem; font-weight: 400; max-width: 650px; margin: 0 auto 25px; line-height: 1.7; text-align: center; }
.security-code-box { text-align: left; width: 100%; max-width: 580px; margin: 20px auto; background: #030816; padding: 24px 28px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); overflow-x: auto; }
.security-code-box pre { background: transparent; padding: 0; border: none; overflow-x: visible; }
.security-code-box code { color: #f1f5f9; font-size: 0.95rem; font-family: "SF Mono", Monaco, Menlo, Consolas, monospace; line-height: 1.6; white-space: pre; display: block; background: transparent; padding: 0; }
.security-quote { margin-top: 25px; font-style: italic; color: #3b82f6; font-weight: 600; font-size: 1.15rem; text-align: center; }

/* Top Links */
.top-links { position: absolute; top: 20px; right: 20px; display: flex; gap: 12px; z-index: 100; }
.top-link { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--bg-secondary); border: 2px solid var(--border); border-radius: 12px; color: var(--heading); text-decoration: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.top-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(18, 103, 245, 0.15); }
.top-link svg { width: 22px; height: 22px; }

/* API Page Specific */
nav { background: var(--bg-secondary); border-bottom: 2px solid var(--border); padding: 15px 20px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
nav a { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 1.1rem; }
nav span { color: var(--text-muted); font-weight: 400; margin-left: 10px; }

.method-signature {
    background: var(--bg-secondary); border: 2px solid var(--border); border-left: 4px solid var(--primary);
    padding: 15px; border-radius: 8px; margin-bottom: 15px; font-family: "SF Mono", Monaco, Menlo, Consolas, monospace;
    font-size: 0.95rem; color: var(--heading); font-weight: 600; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

footer { text-align: center; border-top: 2px solid var(--border); padding: 40px 20px; margin-top: 60px; color: var(--text-muted); font-size: 0.9rem; }
footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* 1. Tandai elemen target */
#active-code-box {
  view-transition-name: code-slide;
  overflow-x: auto;  
  position: relative;
}

/* 2. State Lama (Old) meluncur keluar ke kiri (-100%) */
::view-transition-old(code-slide) {
  overflow: hidden;
  animation: slide-out-left 0.3s ease-in forwards;
}

/* 3. State Baru (New) meluncur masuk dari kanan (100% ke 0) */
::view-transition-new(code-slide) {
  animation: slide-in-right 0.3s ease-out forwards;
}

/* Keyframes untuk meluncur keluar (ke kiri) */
@keyframes slide-out-left {
  0% { transform: translateX(0%); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}

/* Keyframes untuk meluncur masuk (dari kanan) */
@keyframes slide-in-right {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0%); opacity: 1; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .feature { flex-direction: column; }
    .feature-icon { margin-bottom: 12px; }
    #livecodes { height: 520px; }
    .security-section { padding: 35px 20px; }
    .security-code-box { padding: 16px 20px; }
    .feature code { font-size: 0.8rem; }

    /* === TAMBAHAN NAVBAR MOBILE === */
    .nav-container {
        padding: 6px 15px; /* Lebih ramping di HP */
    }
    .nav-links {
        gap: 10px; /* Jarak antar link sangat rapat di HP */
    }
    .nav-links a:not(.nav-brand) {
        font-size: 0.8rem; /* Font teks link lebih kecil di HP */
    }
    /* Sembunyikan link disabled (What is HTMP?) di HP agar tidak tabrak GitHub */
    .nav-links a.disabled {
        display: none; 
    }
    .top-link {
        width: 32px;
        height: 32px;
    }
    .top-link svg {
        width: 18px;
        height: 18px;
    }
    header {
        padding: 30px 15px 40px; /* Sesuaikan padding header di mobile */
    }
    /* ================================= */
}