/* ==========================================================================
   FARIL PUTRA PRATAMA — PORTFOLIO STYLES
   Aesthetic: Bright, Clean, Experimental, Developer-First
   ========================================================================== */

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

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  --blue-primary: #2563EB;
  --blue-sky: #38BDF8;
  --cyan-electric: #22D3EE;
  --lime-accent: #A3E635;
  --yellow-soft: #FDE047;
  --violet-soft: #A78BFA;
  --emerald-accent: #10B981;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 16px 32px -4px rgba(15, 23, 42, 0.09), 0 6px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 20px 40px -10px rgba(37, 99, 235, 0.12);
}

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

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

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Technical Grid Background */
.bg-tech-grid {
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.6) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-dot-pattern {
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Monospace Helpers */
.font-mono {
  font-family: var(--font-mono);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Custom Cursor (Desktop Only) */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--blue-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out, opacity 0.2s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.16s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

body.cursor-hover .custom-cursor {
  transform: translate(-50%, -50%) scale(1.6);
  background-color: var(--cyan-electric);
}

body.cursor-hover .custom-cursor-follower {
  transform: translate(-50%, -50%) scale(1.4);
  border-color: rgba(34, 211, 238, 0.6);
  background-color: rgba(37, 99, 235, 0.05);
}

@media (pointer: coarse) or (max-width: 1024px) {
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}

/* Floating Navbar */
.nav-floating-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 1080px;
}

.nav-glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(15, 23, 42, 0.03);
  padding: 10px 20px;
  transition: all 0.3s ease;
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background-color: rgba(241, 245, 249, 0.8);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0%;
  height: 2px;
  background-color: var(--blue-primary);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.nav-link.active::after {
  width: 60%;
}

/* Primary Editorial Typography */
.hero-title {
  font-size: clamp(2.4rem, 5vw + 0.5rem, 4.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-main);
}

.section-heading {
  font-size: clamp(2rem, 3.8vw + 0.5rem, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* Strategic Highlighter Tags */
.highlight-blue {
  color: var(--blue-primary);
  position: relative;
  display: inline-block;
}

.highlight-lime {
  background-color: rgba(163, 230, 53, 0.35);
  color: #14532D;
  padding: 0 8px;
  border-radius: 6px;
  display: inline-block;
}

/* Badge Styles */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.badge-status {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #15803D;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}

/* Clean Cards & Microinteractions */
.clean-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.clean-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

/* Floating Hero HTML Cards */
.hero-float-card {
  position: absolute;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  user-select: none;
}

.hero-float-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 36px -6px rgba(37, 99, 235, 0.14);
  border-color: #93C5FD;
}

/* 3D Developer Orb Container */
#hero-three-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  overflow: hidden;
  z-index: 5;
  opacity: 1 !important;
}

.hero-photo-container {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}

#three-canvas-host {
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 1 !important;
}

#three-canvas-host:active {
  cursor: grabbing;
}

/* Three.js Fallback if WebGL fails */
.three-fallback {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #60A5FA 0%, #2563EB 55%, #1D4ED8 100%);
  position: relative;
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.25);
  animation: float-orb 6s ease-in-out infinite;
}

@keyframes float-orb {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-8 { grid-column: span 8; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .bento-col-4,
  .bento-col-6,
  .bento-col-8 {
    grid-column: span 12;
  }
}

/* Case Study Showcase */
.project-showcase {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-showcase:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: #CBD5E1;
}

.browser-mockup {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.06);
}

.browser-header {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.browser-dot.red { background-color: #EF4444; }
.browser-dot.yellow { background-color: #F59E0B; }
.browser-dot.green { background-color: #10B981; }

.browser-url {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex: 1;
  max-width: 320px;
}

/* Code Editor Interface */
.code-window {
  background: #0F172A;
  color: #F8FAFC;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #1E293B;
  font-family: var(--font-mono);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.25);
}

.code-header {
  background: #1E293B;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  font-size: 0.75rem;
  color: #94A3B8;
}

.code-content {
  padding: 20px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}

/* Syntax Highlighting */
.syn-keyword { color: #F43F5E; font-weight: 600; }
.syn-func { color: #38BDF8; font-weight: 600; }
.syn-string { color: #A3E635; }
.syn-num { color: #FBBF24; }
.syn-comment { color: #64748B; font-style: italic; }

/* Interactive Tech Orbit Bento */
.tech-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.tech-card:hover {
  transform: translateY(-2px) rotate(1.2deg);
  border-color: #93C5FD;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.1);
}

.tech-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Social Cards */
.social-card-linkedin {
  position: relative;
  overflow: hidden;
}

.social-card-linkedin .slide-status {
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-card-linkedin:hover .slide-status {
  transform: translateY(0);
  opacity: 1;
}

.social-card-github .cursor-blink {
  animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.social-card-instagram {
  overflow: hidden;
}

.social-card-instagram .photo-tile {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-card-instagram:hover .photo-tile-1 {
  transform: translate(-4px, -4px) rotate(-2deg);
}

.social-card-instagram:hover .photo-tile-2 {
  transform: translate(4px, -2px) rotate(3deg);
}

.social-card-instagram:hover .photo-tile-3 {
  transform: translate(0px, 4px) rotate(-1deg);
}

/* GitHub Terminal Button */
.github-cta-box {
  background: #0F172A;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  border: 1px solid #1E293B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}

.github-cta-box:hover {
  background: #020617;
  border-color: #38BDF8;
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.github-cta-box .cta-text-hover {
  display: none;
}

.github-cta-box:hover .cta-text-normal {
  display: none;
}

.github-cta-box:hover .cta-text-hover {
  display: inline-block;
  color: #38BDF8;
}

/* Timeline Components */
.timeline-item {
  position: relative;
  padding-left: 36px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--blue-primary);
  z-index: 2;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 24px;
  bottom: -24px;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::after {
  display: none;
}

/* Philosophy Banner */
.philosophy-section {
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #EEF2FF 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.philosophy-title {
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

/* Docked CLI Terminal Drawer */
#cli-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 440px;
  max-width: calc(100vw - 48px);
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  z-index: 1100;
  overflow: hidden;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  font-family: var(--font-mono);
}

#cli-drawer.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cli-header {
  background: #1E293B;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  color: #94A3B8;
  font-size: 0.75rem;
}

.cli-body {
  height: 280px;
  overflow-y: auto;
  padding: 16px;
  font-size: 0.8rem;
  color: #E2E8F0;
  line-height: 1.6;
}

.cli-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #020617;
  border-top: 1px solid #1E293B;
}

.cli-input-row input {
  background: transparent;
  border: none;
  outline: none;
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
}

/* Floating Terminal Trigger Button */
.terminal-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  background: #0F172A;
  color: #F8FAFC;
  border: 1px solid #334155;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.terminal-fab:hover {
  transform: translateY(-2px);
  background: #1E293B;
  border-color: #38BDF8;
  color: #38BDF8;
  box-shadow: 0 14px 30px -5px rgba(56, 189, 248, 0.25);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .nav-floating-container {
    top: 12px;
    width: calc(100% - 24px);
  }

  .nav-glass {
    padding: 8px 14px;
  }

  .hero-float-card {
    position: static;
    margin-top: 12px;
    width: 100%;
  }

  #hero-three-container {
    height: 100% !important;
    width: 100% !important;
    opacity: 1 !important;
    display: flex !important;
  }

  .hero-photo-container {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .philosophy-title {
    font-size: 2.8rem;
  }
}

/* Smooth & Lightweight Hardware-Accelerated Animations */
html {
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body, .clean-card, .tech-card, .nav-glass, .project-showcase, .browser-mockup {
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Subtle Floating Animation for Hero Accents (Low CPU) */
@keyframes soft-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.animate-soft-float {
  animation: soft-float 5s ease-in-out infinite;
  will-change: transform;
}

/* Smooth Fade In on Render */
@keyframes smooth-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-entry {
  animation: smooth-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Respect User Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dark mode modular styles */
@import url("./theme-dark.css");
