/* 
 * Design System & Master Styling for Alfari Sidnan Ghilmana Portfolio
 * Style: Clean Editorial Tech (Stripe / Vercel Light Aesthetic with Dark Mode Toggle)
 * Domain: alfarighilmana.my.id
 */

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

:root {
  /* Color Scheme - Default: Clean Editorial Tech Light */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-card-subtle: #f1f5f9;
  --bg-code: #0b1120;
  
  --border-subtle: #e2e8f0;
  --border-hover: #94a3b8;
  --border-glow: rgba(37, 99, 235, 0.25);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-highlight: #020617;
  
  /* Brand Accents */
  --primary-cyan: #0284c7;
  --primary-indigo: #4f46e5;
  --primary-emerald: #059669;
  --primary-amber: #d97706;
  --primary-rose: #e11d48;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #0d9488 100%);
  --grad-cyan-indigo: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  --grad-emerald: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  --grad-amber: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
  --grad-dark-card: #ffffff;
  
  /* Typography */
  --font-heading: 'Outfit', -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', 'Fira Code', Consolas, monospace;

  /* Shadows & Glows */
  --glow-cyan: 0 0 20px rgba(2, 132, 199, 0.15);
  --glow-indigo: 0 0 20px rgba(79, 70, 229, 0.15);
  --glow-emerald: 0 0 20px rgba(5, 150, 105, 0.15);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 20px 30px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

  /* Layout */
  --container-max: 1240px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-main: #06090f;
  --bg-surface: #0b111e;
  --bg-surface-elevated: #111a2e;
  --bg-card: rgba(13, 21, 38, 0.7);
  --bg-glass: rgba(11, 17, 30, 0.85);
  --bg-card-subtle: rgba(255, 255, 255, 0.04);
  --bg-code: #030712;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.35);
  --border-glow: rgba(129, 140, 248, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #ffffff;

  --primary-cyan: #38bdf8;
  --primary-indigo: #818cf8;
  --primary-emerald: #10b981;
  --primary-amber: #f59e0b;
  --primary-rose: #f43f5e;

  --grad-brand: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #10b981 100%);
  --grad-cyan-indigo: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  --grad-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-dark-card: linear-gradient(180deg, rgba(17, 26, 46, 0.85) 0%, rgba(10, 16, 28, 0.95) 100%);

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.2);
  --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ambient Subtle Backdrop */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow-1 {
  position: absolute;
  top: -10%;
  left: 20%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, rgba(2, 132, 199, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatAmbient 20s ease-in-out infinite alternate;
}

.ambient-glow-2 {
  position: absolute;
  top: 40%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.07) 0%, rgba(79, 70, 229, 0) 70%);
  border-radius: 50%;
  filter: blur(70px);
  animation: floatAmbient 24s ease-in-out infinite alternate-reverse;
}

.ambient-glow-3 {
  position: absolute;
  bottom: 5%;
  left: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.06) 0%, rgba(5, 150, 105, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatAmbient 22s ease-in-out infinite alternate;
}

[data-theme="dark"] .ambient-glow-1 { background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0) 70%); }
[data-theme="dark"] .ambient-glow-2 { background: radial-gradient(circle, rgba(129, 140, 248, 0.12) 0%, rgba(129, 140, 248, 0) 70%); }
[data-theme="dark"] .ambient-glow-3 { background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 70%); }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 90%);
}

[data-theme="dark"] .grid-overlay {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

@keyframes floatAmbient {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.08); }
  100% { transform: translate(-20px, -30px) scale(0.95); }
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-highlight);
}

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

.cyan-text {
  color: var(--primary-cyan);
}

.emerald-text {
  color: var(--primary-emerald);
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* Section Header Structure */
.section {
  padding: 5.5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-cyan);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .section-tag {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary-cyan);
}

.section-title {
  font-size: 2.6rem;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.section-desc {
  font-size: 1.08rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Animations & Transitions */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
