/* ============================================
   BB PORTFOLIO — Global Styles
   ============================================ */

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

:root {
  --bg: #0b0b0f;
  --bg-card: #141419;
  --bg-elevated: #1c1c24;
  --text: #e8e8ed;
  --text-muted: #8a8a9a;
  --accent: #c084fc;
  --accent-hover: #d8b4fe;
  --accent-glow: rgba(192, 132, 252, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { color: var(--text-muted); max-width: 680px; }

.label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

section {
  padding: clamp(4rem, 8vw, 8rem) 0;
}

/* ============================================
   Navigation
   ============================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  background: rgba(11, 11, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

nav .logo span { color: var(--accent); }

nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
}

nav .nav-links a:hover { color: var(--text); }

/* ============================================
   Hero — Landing Page
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 150%;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
}

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

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

/* ============================================
   Project Grid — Landing Page
   ============================================ */
.projects-section { position: relative; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(192, 132, 252, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

.project-card:hover .card-image img {
  transform: scale(1.03);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.card-image img {
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition);
}

.card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.card-body .label { margin-bottom: 0.5rem; }

.card-body h3 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card-body p {
  font-size: 0.925rem;
  line-height: 1.6;
}

/* ============================================
   Side Project Card
   ============================================ */
.side-project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.side-project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(192, 132, 252, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

.side-project-preview {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}

.side-project-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform var(--transition);
}

.side-project-card:hover .side-project-preview img {
  transform: scale(1.04);
}

.side-project-body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.side-project-body h3 {
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
}

.side-project-body p { max-width: none; }

.side-project-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
  transition: gap var(--transition), color var(--transition);
}

.side-project-card:hover .side-project-cta {
  gap: 0.7rem;
  color: var(--accent-hover);
}

@media (max-width: 768px) {
  .side-project-card {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  .side-project-preview {
    border-right: none;
    border-bottom: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    position: relative;
  }

  .side-project-body {
    padding: 2rem;
  }
}

/* ============================================
   Case Study — Hero
   ============================================ */
.case-hero {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding-top: 6rem;
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.case-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 80%, var(--accent-glow) 0%, transparent 50%);
  pointer-events: none;
}

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

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.case-meta-item .label { margin-bottom: 0.25rem; }
.case-meta-item p { font-size: 0.95rem; color: var(--text); }

/* ============================================
   Case Study — Content Sections
   ============================================ */
.case-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.case-section + .case-section {
  border-top: 1px solid var(--border);
}

.case-section h2 {
  margin-bottom: 1.5rem;
}

.case-section p + p {
  margin-top: 1.25rem;
}

.case-section ul {
  list-style: none;
  margin-top: 1rem;
}

.case-section ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.case-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============================================
   Image Showcase
   ============================================ */
.image-showcase {
  margin: 3rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.image-showcase img {
  width: 100%;
  object-fit: contain;
}

.image-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.image-showcase-grid .image-showcase {
  margin: 0;
}

.image-caption {
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Placeholder for missing images */
.image-placeholder {
  margin: 3rem 0;
  padding: 4rem 2rem;
  border: 2px dashed rgba(192, 132, 252, 0.2);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-card);
}

/* ============================================
   Prototype Links
   ============================================ */
.prototype-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.prototype-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.prototype-link:hover {
  border-color: rgba(192, 132, 252, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-glow);
}

.prototype-link .proto-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.prototype-link .proto-text .label { margin-bottom: 0.15rem; }
.prototype-link .proto-text span { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.prototype-link .proto-text p { font-size: 0.8rem; margin-top: 0.25rem; }

/* ============================================
   Outcome / Stats
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   Callout / Highlight Box
   ============================================ */
.callout {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

.callout p { color: var(--text); font-style: italic; }

/* ============================================
   Case Study Navigation (prev/next)
   ============================================ */
.case-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.case-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
  max-width: 45%;
}

.case-nav a:hover {
  border-color: rgba(192, 132, 252, 0.3);
  transform: translateY(-2px);
}

.case-nav a .label { font-size: 0.7rem; }
.case-nav a span { color: var(--text); font-weight: 500; }

.case-nav .next { margin-left: auto; text-align: right; }

/* ============================================
   Footer
   ============================================ */
footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 auto;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  list-style: none;
}

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

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .case-meta {
    gap: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .case-nav {
    flex-direction: column;
  }

  .case-nav a { max-width: 100%; }

  nav .nav-links { gap: 1.25rem; }
}

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

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Tag pills */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}
