:root {
  --bg-main: #F5F5F7;
  --bg-card: #FFFFFF;
  --text-main: #1D1D1F;
  --text-secondary: #86868B;
  --text-inverse: #FFFFFF;
  
  --accent-color: #0071E3;
  --accent-hover: #0077ED;
  --success-color: #34C759;
  
  --border-color: rgba(0, 0, 0, 0.05);
  
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-xl: 40px;
  
  --shadow-bento: 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  
  --gap-sm: 16px;
  --gap-md: 24px;
  --gap-lg: 32px;
  --gap-xl: 64px;
  --gap-2xl: 120px;
  
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  
  --transition-fast: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

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

/* Navbar */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--text-main);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover { color: var(--text-main); }

/* Hero Section */
.hero-section {
  padding: 120px 40px 100px;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

/* Global Highlights Bento */
.global-highlights {
  max-width: 1200px;
  margin: 0 auto var(--gap-2xl);
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: var(--gap-md);
}

.bento-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-bento);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.highlight-large {
  grid-column: span 2;
  grid-row: span 2;
  background: linear-gradient(135deg, #1D1D1F 0%, #434345 100%);
  color: var(--text-inverse);
  padding: 48px;
}

.highlight-large h3, .highlight-small h3 {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 16px;
}

.highlight-small h3 { color: var(--text-secondary); }

.giant-number {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.highlight-small .giant-number {
  font-size: clamp(2.5rem, 4vw, 4rem);
  color: var(--text-main);
}

/* Alternating Project Layout */
.projects-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px var(--gap-2xl);
}

.section-header {
  margin-bottom: var(--gap-xl);
  text-align: center;
}

.section-header h2 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

#projectsGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-xl);
}

.bento-project {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--gap-xl);
  margin-bottom: var(--gap-2xl);
  min-height: auto;
}

.bento-project.reverse {
  grid-template-columns: 0.9fr 1.1fr;
}
.bento-project.reverse .bento-visual-col {
  order: 2;
}
.bento-project.reverse .bento-data-col {
  order: 1;
}

/* Left/Right Columns */
.bento-visual-col {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  box-shadow: var(--shadow-bento);
  border: 1px solid var(--border-color);
  min-height: 440px;
}

.bento-visual-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  transition: transform var(--transition-slow);
}

.bento-visual-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

.bento-project:hover .bento-visual-bg {
  transform: scale(1.05);
}

.bento-visual-content {
  position: relative;
  z-index: 2;
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.bento-tag {
  display: inline-block;
  padding: 8px 24px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  order: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bento-visual-content h3 {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  order: 2;
  text-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.bento-visual-subtitle {
  font-size: 22px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  max-width: 90%;
  line-height: 1.6;
  text-shadow: 0 4px 16px rgba(0,0,0,0.5);
  order: 3;
}

.bento-visual-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bento-data-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: var(--gap-md);
}

.bento-data-desc {
  grid-column: span 2;
  justify-content: flex-start;
  padding: 32px;
}

.bento-data-desc h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.bento-data-desc p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bento-data-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  min-height: 120px;
}

.bento-data-stat .stat-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.bento-data-stat .stat-lbl {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.bento-cta-card {
  grid-column: span 2;
  background: var(--text-main);
  color: var(--text-inverse);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 24px 32px;
  border-radius: 100px;
  margin-top: 8px;
  text-decoration: none;
}

.bento-cta-card:hover {
  background: #000000;
}

.bento-cta-card span {
  font-size: 18px;
  font-weight: 600;
}

.bento-cta-card svg {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-fast);
}

.bento-cta-card:hover svg {
  transform: translateX(4px);
}

.bento-cta-outline {
  background: transparent;
  color: var(--text-main);
  border: 2px solid var(--text-main);
  margin-top: 0;
}

.bento-cta-outline:hover {
  background: var(--text-main);
  color: var(--text-inverse);
}

/* Modal */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.project-modal.active { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-container {
  position: relative;
  width: 96vw;
  height: 94vh;
  background: var(--bg-main);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-bento);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--text-main);
  color: var(--text-inverse);
  transform: scale(1.05);
}

#projectFrame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-xl);
}

/* Responsive */
@media (max-width: 1024px) {
  .global-highlights {
    grid-template-columns: 1fr 1fr;
  }
  .highlight-large {
    grid-column: span 2;
    grid-row: span 1;
  }
  #projectsGrid {
    grid-template-columns: 1fr;
  }
  .bento-project, .bento-project.reverse {
    grid-template-columns: 1fr;
  }
  .bento-project.reverse .bento-visual-col {
    order: unset;
  }
  .bento-project.reverse .bento-data-col {
    order: unset;
  }
  .bento-visual-col {
    min-height: 360px;
    padding: 32px;
  }
  .bento-visual-content h3 {
    font-size: 48px;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 100px 24px 60px;
  }
  .global-highlights, .projects-section {
    padding: 0 24px var(--gap-xl);
  }
  .global-highlights {
    grid-template-columns: 1fr;
  }
  .highlight-large {
    grid-column: span 1;
  }
  .bento-data-col {
    grid-template-columns: 1fr;
  }
  .bento-data-desc, .bento-cta-card {
    grid-column: span 1;
  }
  .modal-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .modal-close {
    top: 16px;
    right: 16px;
  }
  .bento-visual-content h3 {
    font-size: 36px;
  }
  .bento-visual-subtitle {
    font-size: 16px;
  }
}

/* Animations */
.in-view {
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
