@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ===================================================
   PT RUANG KODE DIGITAL — Studio Design System v3
   Hand-crafted editorial aesthetic. No AI templates.
   =================================================== */

:root {
    --bg: #060608;
    --surface: #0c0c10;
    --card: #111116;
    --border: #1a1a22;
    --border-hover: #2a2a36;
    --text-primary: #eeeef0;
    --text-secondary: #8b8b98;
    --text-muted: #55555f;
    --accent: #4f7df9;
    --accent-hover: #6b94ff;
    --cyan: #22d3ee;
    --emerald: #34d399;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Typography ───────────────────────────────── */

.font-grotesk { font-family: 'Space Grotesk', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.heading-xl {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.heading-lg {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.body-text {
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.7;
}

/* ── Page Loader / Curtain ────────────────────── */

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.page-loader .loader-bar {
    width: 120px;
    height: 2px;
    background: #1a1a22;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.page-loader .loader-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    animation: loader-fill 1.2s ease-out forwards;
}

@keyframes loader-fill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ── Navigation ───────────────────────────────── */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 2rem;
    transition: background 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
    background: rgba(6, 6, 8, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-color: var(--border);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 100px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}

.nav-links .nav-item-link {
    padding: 0.45rem 1rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease;
    white-space: nowrap;
}

.nav-links .nav-item-link:hover {
    color: var(--text-primary);
}

.nav-links .nav-item-link.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

/* ── Dropdown Menus ───────────────────────────── */

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease;
    white-space: nowrap;
}

.nav-dropdown-trigger:hover,
.nav-dropdown:hover .nav-dropdown-trigger {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-dropdown-trigger.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-chevron {
    font-size: 0.6rem;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.25s ease;
}

.nav-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

/* Dropdown Container */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding-top: 10px; /* Invisible bridge eliminates hover gap */
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Glassmorphism Inner Card */
.dropdown-inner {
    width: 320px;
    background: rgba(14, 14, 18, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.55rem;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.85), 0 0 24px rgba(79, 125, 249, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.dropdown-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropdown-item:hover .dropdown-item-icon {
    border-color: rgba(79, 125, 249, 0.4);
    background: rgba(79, 125, 249, 0.1);
}

.dropdown-item-text {
    flex: 1;
    min-width: 0;
}

.dropdown-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.dropdown-item-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 0.15rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0.5rem;
}

.dropdown-item-featured {
    background: rgba(79, 125, 249, 0.05);
    border: 1px solid rgba(79, 125, 249, 0.15);
}

.dropdown-item-featured:hover {
    background: rgba(79, 125, 249, 0.12);
    border-color: rgba(79, 125, 249, 0.35);
}

.badge-hot {
    font-size: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
    letter-spacing: 0.04em;
}

/* Mobile Drawer Sublinks */
.mobile-drawer-link {
    display: block;
    padding: 0.6rem 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-drawer-sublink {
    display: block;
    padding: 0.4rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.mobile-drawer-sublink:hover,
.mobile-drawer-sublink.active {
    color: var(--accent);
}

/* ── Buttons ──────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease, background 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79, 125, 249, 0.25);
    background: var(--accent-hover);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    text-decoration: none;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.3s cubic-bezier(0.16,1,0.3,1);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-live-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: rgba(79, 125, 249, 0.1);
    border: 1px solid rgba(79, 125, 249, 0.3);
    box-shadow: 0 2px 10px rgba(79, 125, 249, 0.2), 0 0 16px rgba(79, 125, 249, 0.15);
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-live-link:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(79, 125, 249, 0.45), 0 0 24px rgba(79, 125, 249, 0.3);
    transform: translateY(-2px);
}

/* ── Cards ────────────────────────────────────── */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    transition: border-color 0.35s ease, transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

/* ── Badge / Chips ────────────────────────────── */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    background: rgba(79, 125, 249, 0.08);
    color: var(--accent);
    border: 1px solid rgba(79, 125, 249, 0.2);
}

.chip-emerald {
    background: rgba(52, 211, 153, 0.08);
    color: var(--emerald);
    border-color: rgba(52, 211, 153, 0.2);
}

/* ── Reveal Animation Classes ─────────────────── */

[data-animate] {
    opacity: 0;
    will-change: transform, opacity;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-in"] {
    transform: none;
}

[data-animate="fade-left"] {
    transform: translateX(60px);
}

[data-animate="fade-right"] {
    transform: translateX(-60px);
}

[data-animate="scale-in"] {
    transform: scale(0.92);
}

.split-word {
    display: inline-block;
    overflow: hidden;
}

.split-word .word-inner {
    display: inline-block;
    transform: translateY(105%);
}

/* ── Marquee / Ticker ─────────────────────────── */

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 2rem;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.marquee-item .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.4;
}

/* ── Divider Line ─────────────────────────────── */

.divider {
    height: 1px;
    background: var(--border);
    border: none;
}

/* ── Stat Number ──────────────────────────────── */

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* ── Grid Helpers ─────────────────────────────── */

.grid-auto {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-auto { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-auto { grid-template-columns: repeat(3, 1fr); }
}

/* ── Footer ───────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    background: var(--surface);
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 1023px) {
    .nav-links { display: none !important; }
    #mobile-nav-toggle { display: block !important; }
    .heading-xl { font-size: 2.2rem !important; }
}

@media (max-width: 640px) {
    .heading-xl { font-size: 1.75rem !important; }
    .site-nav { padding: 0 1rem; }
}
