/* ============================================================
   VIBEKODING MODERN PROFESSIONAL DESIGN SYSTEM
   Editorial, Clean, Contemporary & Distraction-Free
   Geist & Inter Inspired Precision · Monochromatic Accents
   ============================================================ */

:root {
  --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Contemporary Dark Mode (Minimalist Obsidian / Zinc) */
  --bg: #090a0f;
  --bg-subtle: #0d0f17;
  --bg-surface: #121520;
  --bg-card: rgba(18, 21, 32, 0.75);
  --bg-card-hover: #181d2c;

  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.065);
  --panel-active: rgba(255, 255, 255, 0.1);

  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --stroke-highlight: rgba(99, 102, 241, 0.45);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-faint: #475569;

  /* Sophisticated Accents */
  --primary: #6366f1;         /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.2);
  --accent-cyan: #0ea5e9;     /* Sky */
  --accent-emerald: #10b981;  /* Emerald */
  --accent-amber: #f59e0b;    /* Amber */
  --accent-rose: #f43f5e;     /* Rose */

  --grad-primary: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6);

  --maxw: 1140px;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;

  --panel: rgba(0, 0, 0, 0.025);
  --panel-strong: rgba(0, 0, 0, 0.05);
  --panel-active: rgba(0, 0, 0, 0.08);

  --stroke: rgba(0, 0, 0, 0.09);
  --stroke-strong: rgba(0, 0, 0, 0.18);
  --stroke-highlight: rgba(99, 102, 241, 0.5);

  --text: #090d16;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-faint: #94a3b8;

  --grad-primary: linear-gradient(135deg, #090d16 0%, #334155 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
}

/* Base resets & typography */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.68;
  letter-spacing: -0.012em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Subtle architectural grid pattern background */
.aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(to right, var(--stroke) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--stroke) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 15%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 15%, black 40%, transparent 80%);
  opacity: 0.35;
}
.aurora .blob { display: none; }
.grain { display: none; }

/* Scroll progress */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--primary); z-index: 999;
  transition: width 0.08s linear;
}

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 56px 0; }

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.22;
  letter-spacing: -0.03em;
  font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 4.8vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin-bottom: 0.6em; }
h3 { font-size: 1.22rem; margin-bottom: 0.4em; }
h4 { font-size: 1.02rem; font-weight: 600; }

p { margin-bottom: 1em; color: var(--text-muted); font-size: 0.98rem; }
p:last-child { margin-bottom: 0; }
strong, b { color: var(--text); font-weight: 650; }
a { color: inherit; text-decoration: none; }

.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.small { font-size: 0.85rem; color: var(--text-dim); }

/* Language Switcher Engine */
html[data-lang="id"] [lang="en"] { display: none !important; }
html[data-lang="en"] [lang="id"] { display: none !important; }

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--stroke);
  transition: all 0.2s ease;
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand .logo {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--panel-strong); border: 1px solid var(--stroke);
  display: grid; place-items: center; font-size: 14px; color: var(--text);
}
.nav-links {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.nav-links a {
  font-size: 0.88rem; font-weight: 550; color: var(--text-dim);
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--panel-strong);
}
.nav-cta {
  display: flex; gap: 6px; align-items: center;
}
.icon-btn {
  height: 32px; min-width: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--stroke); background: var(--panel);
  color: var(--text); cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s ease; font-weight: 600; padding: 0 8px;
}
.icon-btn:hover {
  background: var(--panel-strong); border-color: var(--stroke-strong);
}
.lang-btn.on {
  background: var(--text); color: var(--bg); border-color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  text-decoration: none; cursor: pointer; transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--text); color: var(--bg);
}
.btn-primary:hover {
  opacity: 0.9; transform: translateY(-1px);
}
.btn-ghost {
  background: var(--panel); border-color: var(--stroke);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--panel-strong); border-color: var(--stroke-strong);
}

/* Badge / Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--stroke); background: var(--panel);
  font-size: 0.76rem; font-weight: 550; color: var(--text-dim);
}
.pill.hot {
  border-color: rgba(16, 185, 129, 0.3); color: var(--accent-emerald);
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-cyan); margin-bottom: 10px;
}

/* Hero Section */
.hero { padding: 64px 0 44px; }
.hero-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: 36px; align-items: center;
}
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero p.lead { font-size: 1.08rem; color: var(--text-muted); margin-top: 14px; line-height: 1.65; }
.hero-cta { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.stat .n { font-family: var(--font-display); font-size: 1.6rem; font-weight: 750; color: var(--text); }
.stat .l { font-size: 0.78rem; color: var(--text-dim); }

/* Interactive Demo Card */
.demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.demo-bar {
  display: flex; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid var(--stroke);
  align-items: center; background: var(--panel);
}
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.demo-bar .r { background: #ff5f57; }
.demo-bar .y { background: #febc2e; }
.demo-bar .g { background: #28c840; }
.demo-bar span { margin-left: 6px; font-size: 0.72rem; color: var(--text-faint); font-family: var(--font-mono); }
.demo-body { padding: 18px; font-family: var(--font-mono); font-size: 0.82rem; min-height: 180px; }
.demo-line { display: flex; gap: 8px; margin-bottom: 10px; }
.demo-line .who { flex-shrink: 0; font-weight: 600; }
.demo-line .who.u { color: var(--accent-cyan); }
.demo-line .who.ai { color: var(--primary); }
.caret {
  display: inline-block; width: 7px; height: 14px;
  background: var(--accent-cyan); vertical-align: -2px;
  animation: blink 1s steps(2) infinite; border-radius: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Cards & Bento Grids */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.b-card {
  grid-column: span 2; background: var(--bg-card);
  border: 1px solid var(--stroke); border-radius: var(--radius-md);
  padding: 20px; transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.b-card.w3 { grid-column: span 3; }
.b-card.w4 { grid-column: span 4; }
.b-card.w6 { grid-column: span 6; }
.b-card:hover {
  border-color: var(--stroke-strong);
  background: var(--bg-card-hover);
}
.b-card .emoji { font-size: 1.4rem; margin-bottom: 10px; display: block; opacity: 0.85; }
.b-card h3 { margin-bottom: 4px; font-size: 1.08rem; }
.b-card p { font-size: 0.88rem; color: var(--text-muted); }

/* Mod List (Lessons & Guides) */
.mod-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px; margin-top: 20px;
}
.mod {
  border: 1px solid var(--stroke); background: var(--bg-card);
  border-radius: var(--radius-md); padding: 18px;
  text-decoration: none; transition: all 0.2s ease;
  display: block; position: relative;
}
.mod:hover {
  border-color: var(--stroke-highlight);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.mod .n {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-cyan); font-weight: 600;
}
.mod h4 { margin: 4px 0 4px; font-size: 0.98rem; color: var(--text); }
.mod p { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* Lesson Details & Prose */
.lesson-hero { padding: 48px 0 32px; }
.crumb { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text); }
.lesson-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lesson-mascot {
  font-size: 2.2rem; width: 64px; height: 64px; border-radius: var(--radius-md);
  background: var(--panel-strong); border: 1px solid var(--stroke);
  display: grid; place-items: center; flex-shrink: 0;
}
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.meta-chip {
  font-size: 0.76rem; padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--stroke); background: var(--panel);
  color: var(--text-dim); font-weight: 550;
}

.prose { max-width: 820px; line-height: 1.72; }
.prose h2 { margin-top: 2em; border-bottom: 1px solid var(--stroke); padding-bottom: 0.25em; font-size: 1.4rem; }
.prose h3 { margin: 1.3em 0 0.4em; color: var(--text); font-size: 1.15rem; }
.prose h4 { margin: 1.1em 0 0.3em; font-size: 1rem; }
.prose ul, .prose ol { margin: 0.6em 0 1em 1.2em; }
.prose li { margin-bottom: 0.35em; color: var(--text-muted); }
.prose li strong { color: var(--text); }

/* Callout Boxes */
.callout {
  border-radius: var(--radius-md); padding: 16px 18px; margin: 20px 0;
  border: 1px solid var(--stroke); background: var(--bg-card);
}
.callout .t {
  font-weight: 650; font-family: var(--font-display);
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 0.9rem;
}
.callout.joke { border-left: 3px solid var(--accent-amber); }
.callout.tip { border-left: 3px solid var(--accent-emerald); }
.callout.warn { border-left: 3px solid var(--accent-rose); }
.callout.info { border-left: 3px solid var(--accent-cyan); }
.callout p { color: var(--text-muted); font-size: 0.9rem; }

/* Prompt / Code Blocks */
.prompt-card {
  border: 1px solid var(--stroke); background: var(--bg-subtle);
  border-radius: var(--radius-md); overflow: hidden; margin: 20px 0;
}
.prompt-card .p-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--stroke);
  background: var(--panel);
}
.prompt-card .p-head code {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-dim);
}
.copy-btn {
  border: 1px solid var(--stroke); background: var(--panel-strong);
  color: var(--text-dim); border-radius: var(--radius-xs);
  padding: 4px 10px; font-size: 0.72rem; cursor: pointer;
  font-weight: 600; font-family: var(--font-body);
}
.copy-btn:hover {
  color: var(--text); border-color: var(--stroke-strong);
}
.prompt-card pre {
  padding: 16px; font-family: var(--font-mono); font-size: 0.82rem;
  line-height: 1.6; white-space: pre-wrap; color: var(--text);
  overflow-x: auto;
}

/* Quiz & XP */
.quiz { margin: 24px 0; }
.quiz .q {
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 8px; background: var(--bg-card);
  cursor: pointer; transition: all 0.18s ease;
}
.quiz .q:hover { border-color: var(--stroke-strong); }
.quiz .q .question { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; font-size: 0.92rem; }
.quiz .q .answer {
  display: none; margin-top: 10px; color: var(--text-muted);
  font-size: 0.88rem; border-top: 1px dashed var(--stroke); padding-top: 10px;
}
.quiz .q.open .answer { display: block; }
.quiz .q .chev { transition: transform 0.2s ease; flex-shrink: 0; font-size: 0.75rem; }
.quiz .q.open .chev { transform: rotate(90deg); }

.xp-bar {
  height: 6px; border-radius: var(--radius-full);
  background: var(--panel-strong); overflow: hidden;
  margin: 8px 0 4px; border: 1px solid var(--stroke);
}
.xp-bar i {
  display: block; height: 100%; background: var(--primary);
  border-radius: var(--radius-full); width: 0;
  transition: width 0.4s ease;
}

/* Table */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius-md); border: 1px solid var(--stroke); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: var(--bg-card); }
th, td { border: 1px solid var(--stroke); padding: 10px 14px; text-align: left; }
th { background: var(--panel-strong); font-family: var(--font-body); font-weight: 650; color: var(--text); }
td { color: var(--text-muted); }

/* Pager */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 40px 0 20px;
}
.pager a {
  border: 1px solid var(--stroke); background: var(--bg-card);
  border-radius: var(--radius-md); padding: 16px 18px;
  text-decoration: none; transition: all 0.2s ease; display: block;
}
.pager a:hover {
  border-color: var(--stroke-strong); background: var(--bg-card-hover);
}
.pager .dir {
  font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.pager b { display: block; margin-top: 3px; font-size: 0.92rem; color: var(--text); font-weight: 600; }
.pager .next { text-align: right; }

/* Topic Pills */
.topic-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.topic-pills a {
  font-size: 0.74rem; font-weight: 550; color: var(--text-dim);
  text-decoration: none; padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--stroke); background: var(--panel);
  transition: all 0.18s ease;
}
.topic-pills a:hover {
  color: var(--text); border-color: var(--stroke-strong);
  background: var(--panel-strong);
}
.see-all {
  display: inline-flex; gap: 6px; margin-top: 14px;
  font-size: 0.8rem; font-weight: 600; color: var(--accent-cyan);
  text-decoration: none;
}
.see-all:hover { text-decoration: underline; }

/* Footer */
footer {
  border-top: 1px solid var(--stroke); padding: 40px 0 32px;
  margin-top: 50px; background: var(--bg-subtle);
}
.license-box {
  margin-top: 20px; padding: 16px 18px; border: 1px solid var(--stroke);
  border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--text-dim);
  background: var(--panel); line-height: 1.6;
}
.license-box a { color: var(--accent-cyan); text-decoration: none; }
.license-box a:hover { text-decoration: underline; }

/* Reveal Animations */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .b-card, .b-card.w3, .b-card.w4, .b-card.w6 { grid-column: span 2; }
  .nav-links a.hide-sm { display: none; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .b-card, .b-card.w3, .b-card.w4, .b-card.w6 { grid-column: span 1; }
  .pager { grid-template-columns: 1fr; }
  section { padding: 40px 0; }
  .hero { padding: 44px 0 30px; }
  .nav-inner { padding: 10px 16px; }
}
