/* Búfalo Studio - State of AI Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-primary: #EDEDED;
  --bg-secondary: #171717;
  --text-primary: #171717;
  --text-secondary: #444444;
  --text-light: #EDEDED;
  --accent-red: #DA0037;
  --border-color: rgba(23, 23, 23, 0.12);
  --card-bg: rgba(255, 255, 255, 0.6);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body.theme-dark {
  --bg-primary: #171717;
  --bg-secondary: #0A0A0A;
  --text-primary: #EDEDED;
  --text-secondary: #A3A3A3;
  --border-color: rgba(237, 237, 237, 0.15);
  --card-bg: rgba(30, 30, 30, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-red) var(--bg-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.7s cubic-bezier(0.16, 1, 0.3, 1), color 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 100vh;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-red);
  border-radius: 3px;
}

/* Background Subtle Technical Grid */
.bg-tech-grid {
  background-image: linear-gradient(to right, var(--border-color) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--border-color) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Typography Utility Classes */
.font-mono-tech {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

.text-display {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.leading-editorial {
  line-height: 1.6;
}

/* Accent Red Interactions */
.buffalo-underline {
  position: relative;
  display: inline-block;
}

.buffalo-underline::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-red);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.buffalo-underline:hover::after {
  width: 100%;
}

.btn-buffalo-primary {
  background-color: var(--accent-red);
  color: #EDEDED;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 1rem 2.25rem;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(218, 0, 55, 0.25);
  border: 1px solid var(--accent-red);
  cursor: pointer;
  text-decoration: none;
}

.btn-buffalo-primary:hover {
  transform: translateY(-2px);
  background-color: #C00030;
  box-shadow: 0 15px 40px rgba(218, 0, 55, 0.4);
}

.btn-buffalo-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  font-weight: 600;
  padding: 1rem 2.25rem;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
}

.btn-buffalo-secondary:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: translateY(-2px);
}

/* Chapter Card Hover Effect */
.chapter-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  transition: border-color 0.4s ease, transform 0.4s ease;
}

.chapter-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-4px);
}

/* Glass Gallery Card */
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
}


.gallery-card img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(23, 23, 23, 0.95) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

/* Pulsing Data Node */
.pulse-red-glow {
  box-shadow: 0 0 0 0 rgba(218, 0, 55, 0.7);
  animation: pulseGlow 2s infinite;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  z-index: 1;
  margin-right: 0.5rem; /* Prevent overlap with adjacent text */
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(218, 0, 55, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(218, 0, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(218, 0, 55, 0);
  }
}

/* Custom Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background-color: var(--accent-red);
  z-index: 100;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* GSAP Parallax Multi-Layer Styling */
.parallax-stage {
  position: relative;
  width: 100%;
  min-h: 680px;
  overflow: hidden;
  border: 1px solid rgba(237, 237, 237, 0.15);
  background-color: #0A0A0A;
}

.parallax-layer-kanban {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 120%;
  height: 140%;
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  filter: grayscale(30%) contrast(110%);
  will-change: transform;
  transition: transform 0.1s linear;
}

.parallax-layer-[#DA0037]-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(218, 0, 55, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.parallax-layer-engineer {
  position: relative;
  z-index: 10;
  will-change: transform;
  transition: transform 0.1s linear;
}

.parallax-layer-hud {
  position: absolute;
  bottom: 5%;
  right: 4%;
  z-index: 20;
  max-width: 500px;
  width: 90%;
  border: 1px solid var(--accent-red);
  box-shadow: 0 20px 50px rgba(218, 0, 55, 0.35);
  backdrop-filter: blur(8px);
  will-change: transform;
  transition: transform 0.1s linear;
}

/* Brutalist Badge Styling */
.brutalist-badge {
  background: #171717;
  border: 1px solid #DA0037;
  color: #EDEDED;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
}

/* ========================
   HERO SECTION: Ghost Image + Atmospheric Glow
   ======================== */

.hero-section {
  overflow: hidden;
}

/* Atmospheric red glow top-right */
.hero-section::before {
  content: '';
  position: absolute;
  top: -10%;
  right: 2%;
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(218, 0, 55, 0.08) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
  z-index: 0;
}

/* Ghost buffalo image fading in from right */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 52%;
  height: 100%;
  background-image: url('assets/images/buffalo_engineer.webp');
  background-size: cover;
  background-position: center top;
  opacity: 0.08;
  filter: grayscale(30%) contrast(120%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,1) 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,1) 100%);
  z-index: 0;
}

@media (max-width: 1023px) {
  .hero-section::after {
    display: none;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* ========================
   FEATURED CARD (Cap 01)
   ======================== */

.featured-card {
  background: linear-gradient(135deg, rgba(218, 0, 55, 0.05) 0%, rgba(255, 255, 255, 0.65) 100%) !important;
  border-color: rgba(218, 0, 55, 0.25) !important;
}

.featured-card:hover {
  background: linear-gradient(135deg, rgba(218, 0, 55, 0.10) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
  border-color: var(--accent-red) !important;
}

.featured-card-stat {
  min-width: 130px;
  border-left: 1px solid rgba(218, 0, 55, 0.2);
  padding-left: 1.5rem;
}

/* ========================
   GALLERY ASYMMETRIC LAYOUT (Cap 02)
   ======================== */

.gallery-featured-img {
  height: 575px !important;
}

.gallery-half-img {
  height: 275px !important;
}

/* ========================
   MODAL TECH GRID
   ======================== */

.modal-tech-bg {
  background-image:
    linear-gradient(to right, rgba(237, 237, 237, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(237, 237, 237, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  background-color: #171717;
}

.modal-tech-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(218, 0, 55, 0.12) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
}

/* ========================
   TECH MARQUEE
   ======================== */

.tech-marquee-content {
  animation: scroll-marquee 40s linear infinite;
}
@keyframes scroll-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ========================
   TERMINAL FAQ
   ======================== */

#terminal-body::-webkit-scrollbar {
  width: 4px;
}
#terminal-body::-webkit-scrollbar-track {
  background: transparent;
}
#terminal-body::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}
