/* ============================================
   CINEMATCH DEVELOPER PORTFOLIO
   Dark theme, bento grid, 3D effects
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(17, 17, 26, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555568;

  --accent-blue: #4f8cff;
  --accent-purple: #a855f7;
  --accent-green: #22d3a0;
  --accent-orange: #f97316;
  --accent-cyan: #06b6d4;
  --accent-yellow: #eab308;
  --accent-pink: #ec4899;

  --gradient-primary: linear-gradient(135deg, #4f8cff 0%, #a855f7 100%);
  --gradient-glow: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(79, 140, 255, 0.06), transparent 40%);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   PARTICLES BACKGROUND
   ============================================ */

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(79, 140, 255, 0.3);
  border-radius: 50%;
  animation: float linear infinite;
}

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: var(--transition-base);
  background: transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--accent-blue);
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 999;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0.5rem 0;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 8rem 0;
  position: relative;
  z-index: 1;
}

.section-dark {
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-blue);
  background: rgba(79, 140, 255, 0.1);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(79, 140, 255, 0.2);
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   GLASS CARD
   ============================================ */

.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   3D TILT EFFECT
   ============================================ */

.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  transition: transform 400ms cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* ============================================
   HERO
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero-content {
  max-width: 900px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  margin-bottom: 2rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 211, 160, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 211, 160, 0); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.hero-line {
  display: block;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(79, 140, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(79, 140, 255, 0.5);
  transform: translateY(-2px);
}

.btn-arrow {
  transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

/* Hero Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.stat-card {
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-unit {
  font-size: 1.2rem;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Hero Background */
.hero-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.08) 0%, rgba(168, 85, 247, 0.04) 40%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent);
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   BENTO GRID
   ============================================ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.bento-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: var(--transition-base);
}

.bento-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.bento-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.bento-card:hover .bento-card-glow {
  opacity: 1;
}

.bento-large {
  grid-column: span 1;
  grid-row: span 2;
}

.bento-wide {
  grid-column: span 3;
}

.bento-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(79, 140, 255, 0.1);
  color: var(--accent-blue);
  margin-bottom: 1.25rem;
}

.bento-icon.accent-green { background: rgba(34, 211, 160, 0.1); color: var(--accent-green); }
.bento-icon.accent-purple { background: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }
.bento-icon.accent-orange { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.bento-icon.accent-cyan { background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }
.bento-icon.accent-yellow { background: rgba(234, 179, 8, 0.1); color: var(--accent-yellow); }

.bento-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.bento-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.bento-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

/* ============================================
   ARCHITECTURE TIMELINE
   ============================================ */

.arch-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.arch-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 36px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple), transparent);
}

.arch-step {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.arch-step-marker {
  flex-shrink: 0;
  width: 74px;
  display: flex;
  justify-content: center;
  padding-top: 1.75rem;
  z-index: 1;
}

.arch-step-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-blue);
  background: var(--bg-secondary);
  border: 2px solid var(--accent-blue);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.arch-step-content {
  flex: 1;
  padding: 1.75rem;
}

.arch-step-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.arch-step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.arch-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arch-tech span {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: rgba(79, 140, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(79, 140, 255, 0.2);
}

/* ============================================
   TECH STACK GRID
   ============================================ */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.stack-category {
  padding: 1.75rem;
}

.stack-cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stack-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-blue { background: var(--accent-blue); }
.dot-purple { background: var(--accent-purple); }
.dot-green { background: var(--accent-green); }
.dot-orange { background: var(--accent-orange); }

.stack-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stack-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stack-icon {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ============================================
   CODE SHOWCASE
   ============================================ */

.code-showcase {
  max-width: 1000px;
  margin: 0 auto;
}

.code-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.code-tab {
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
}

.code-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.code-tab.active {
  background: rgba(79, 140, 255, 0.1);
  color: var(--accent-blue);
  border-color: rgba(79, 140, 255, 0.3);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
}

.code-split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
}

.code-block {
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-filename {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: 0.5rem;
}

.code-block pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.7;
}

.code-block code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Syntax Highlighting */
.kw { color: #c792ea; }
.cls { color: #ffcb6b; }
.fn { color: #82aaff; }
.str { color: #c3e88d; }
.num { color: #f78c6c; }
.cmt { color: #546e7a; font-style: italic; }
.esc { color: #89ddff; }

.code-description {
  padding-top: 0.5rem;
}

.code-description h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.code-description p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.code-description ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.code-description li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.code-description li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.code-metric {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(79, 140, 255, 0.05);
  border: 1px solid rgba(79, 140, 255, 0.15);
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================
   PATENT / RESEARCH GRID
   ============================================ */

.patent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.patent-card {
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.patent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-base);
}

.patent-card:hover::before {
  opacity: 1;
}

.patent-num {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  background: rgba(79, 140, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 1rem;
}

.patent-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.patent-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   CONTACT
   ============================================ */

.contact-content {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.contact-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-link:hover {
  color: var(--text-primary);
}

.contact-link svg {
  opacity: 0.6;
}

.contact-link:hover svg {
  opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   ANIMATIONS
   ============================================ */

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-large {
    grid-row: span 1;
  }

  .bento-wide {
    grid-column: span 2;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .code-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 5rem 0;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-large,
  .bento-wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .arch-timeline::before {
    left: 20px;
  }

  .arch-step-marker {
    width: 42px;
  }

  .arch-step {
    gap: 1rem;
  }

  .arch-step-num {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }

  .patent-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}
