/* ============================================
   PORTAL BELAJAR — SHARED DESIGN SYSTEM
   ============================================ */

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

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Brand Colors */
  --teal:       #14b8a6;
  --teal-dim:   #0d9488;
  --teal-glow:  rgba(20, 184, 166, 0.15);
  --purple:     #a855f7;
  --purple-dim: #9333ea;
  --purple-glow:rgba(168, 85, 247, 0.15);
  --amber:      #f59e0b;
  --amber-dim:  #d97706;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --rose:       #f43f5e;
  --rose-dim:   #e11d48;
  --rose-glow:  rgba(244, 63, 94, 0.15);
  --blue:       #3b82f6;
  --green:      #22c55e;

  /* Backgrounds */
  --bg:         #0d1117;
  --bg-alt:     #0a0e14;
  --surface:    #161b22;
  --surface-2:  #1c2333;
  --surface-3:  #21262d;

  /* Text */
  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  /* Border */
  --border:     #30363d;
  --border-dim: #21262d;

  /* Fonts */
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { color: var(--text-secondary); }

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

code, .mono { font-family: var(--font-mono); }

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 5rem 0; }

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.navbar-brand span { color: var(--teal); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.navbar-nav a {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-3);
  border-color: var(--border);
}

.navbar-nav a.active {
  color: var(--teal);
  background: var(--teal-glow);
  border-color: rgba(20, 184, 166, 0.3);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* === MOBILE NAV === */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { font-size: 0.875rem; padding: 0.625rem 1rem; }
}

/* === PAGE WRAPPER === */
.page-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

/* === HERO SECTION BASE === */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 4rem;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(20,184,166,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* === SECTION HEADER === */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  border: 1px solid;
}

.section-badge.teal  { color: var(--teal);  background: var(--teal-glow);  border-color: rgba(20,184,166,0.3);  }
.section-badge.purple{ color: var(--purple); background: var(--purple-glow); border-color: rgba(168,85,247,0.3); }
.section-badge.amber { color: var(--amber);  background: var(--amber-glow);  border-color: rgba(245,158,11,0.3);  }
.section-badge.rose  { color: var(--rose);   background: var(--rose-glow);   border-color: rgba(244,63,94,0.3);   }

.section-title {
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(20,184,166,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dim));
  color: #0d1117;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px var(--teal-glow); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-glow); }

/* === TAGS === */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.tag.teal   { color: var(--teal);   background: var(--teal-glow);   border-color: rgba(20,184,166,0.3);  }
.tag.purple { color: var(--purple); background: var(--purple-glow); border-color: rgba(168,85,247,0.3); }
.tag.amber  { color: var(--amber);  background: var(--amber-glow);  border-color: rgba(245,158,11,0.3);  }
.tag.rose   { color: var(--rose);   background: var(--rose-glow);   border-color: rgba(244,63,94,0.3);   }
.tag.blue   { color: var(--blue);   background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); }
.tag.green  { color: var(--green);  background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.3);  }

/* === FOOTER === */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand { }

.footer-brand-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-brand-name .dot { color: var(--teal); }

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.social-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 1rem;
  transition: var(--transition);
  color: var(--text-secondary);
  text-decoration: none;
}

.social-link:hover {
  background: var(--teal-glow);
  border-color: rgba(20,184,166,0.4);
  color: var(--teal);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-links a:hover { color: var(--teal); }

.footer-bottom {
  border-top: 1px solid var(--border-dim);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-copy span { color: var(--teal); }

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* === GRID UTILITIES === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* === SCROLL ANIMATION === */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === DECORATIVE === */
.gradient-text {
  background: linear-gradient(135deg, var(--teal), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.line-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: none;
}

/* === STATUS INDICATORS === */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === SELECTION === */
::selection { background: rgba(20,184,166,0.25); color: var(--text-primary); }
