/* ==========================================================================
   LUDVIK HERRERA PORTFOLIO — HUMAN CODED MINIMAL CSS
   Swiss Design System / International Typographic Style
   ========================================================================== */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { line-height: 1.5; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- CSS VARIABLES ---------- */
:root {
  /* Typography fluid scale */
  --text-display: clamp(3rem, 8vw + 1rem, 11.25rem);
  --text-h1: clamp(2.25rem, 5vw + 1rem, 6rem);
  --text-h2: clamp(1.75rem, 3vw + 0.5rem, 3.5rem);
  --text-h3: clamp(1.375rem, 2vw + 0.5rem, 2.5rem);
  --text-h4: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);
  --text-body-lg: clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  --text-body: clamp(1rem, 0.25vw + 0.9rem, 1.125rem);
  --text-caption: clamp(0.75rem, 0.2vw + 0.65rem, 0.875rem);

  /* Spacing */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1rem);
  --space-md: clamp(1rem, 2vw, 1.5rem);
  --space-lg: clamp(1.5rem, 3vw, 2.5rem);
  --space-xl: clamp(2rem, 5vw, 4rem);
  --space-2xl: clamp(3rem, 8vw, 6rem);
  --space-3xl: clamp(4rem, 10vw, 8rem);

  /* Grid */
  --gutter: clamp(1rem, 3vw, 2rem);
  --container-padding: clamp(1rem, 5vw, 3rem);
}

/* ---------- DARK THEME (DEFAULT) ---------- */
html, html.dark {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #1a1a1a;
  --card-foreground: #fafafa;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted-foreground: #a3a3a3;
  --border: #333;
  --ring: #555;
}

/* ---------- LIGHT THEME ---------- */
html.light {
  --background: #fafafa;
  --foreground: #0a0a0a;
  --card: #f0f0f0;
  --card-foreground: #0a0a0a;
  --secondary: #e5e5e5;
  --secondary-foreground: #0a0a0a;
  --muted-foreground: #6b6b6b;
  --border: #d4d4d4;
  --ring: #a3a3a3;
}

/* ---------- COLOR THEMES ---------- */
html[data-color-theme="RamsOrange"] {
  --background: #FF611A;
  --foreground: #fff;
  --card: #e0550f;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="MassimoRed"] {
  --background: #FF1C30;
  --foreground: #fff;
  --card: #d91526;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="UIGreen"] {
  --background: #4FBE79;
  --foreground: #fff;
  --card: #3fa566;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.75);
  --border: rgba(255,255,255,0.2);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="UIYellow"] {
  --background: #FFF20E;
  --foreground: #1a1a00;
  --card: #e6d90c;
  --card-foreground: #1a1a00;
  --secondary: rgba(0,0,0,0.08);
  --secondary-foreground: #1a1a00;
  --muted-foreground: rgba(0,0,0,0.55);
  --border: rgba(0,0,0,0.12);
  --ring: rgba(0,0,0,0.2);
}
html[data-color-theme="UIBlue"] {
  --background: #489CC1;
  --foreground: #fff;
  --card: #3b87a9;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="UIRed"] {
  --background: #FF6666;
  --foreground: #fff;
  --card: #e05555;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="UIOrange"] {
  --background: #FF611A;
  --foreground: #fff;
  --card: #e0550f;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}
html[data-color-theme="UIDarkGray"] {
  --background: #50474C;
  --foreground: #fff;
  --card: #72696F;
  --card-foreground: #fff;
  --secondary: rgba(255,255,255,0.14);
  --secondary-foreground: #fff;
  --muted-foreground: rgba(255,255,255,0.7);
  --border: rgba(255,255,255,0.18);
  --ring: rgba(255,255,255,0.3);
}

/* ---------- BODY ---------- */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.15s ease;
}
body.no-scroll { overflow: hidden; }

::selection {
  background: var(--foreground);
  color: var(--background);
}

/* ---------- TYPOGRAPHY CLASSES ---------- */
.text-display { font-size: var(--text-display); line-height: 0.9; letter-spacing: -0.04em; font-weight: 700; color: var(--foreground); }
.text-h1 { font-size: var(--text-h1); line-height: 0.95; letter-spacing: -0.03em; font-weight: 700; color: var(--foreground); }
.text-h2 { font-size: var(--text-h2); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; color: var(--foreground); }
.text-h3 { font-size: var(--text-h3); line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; color: var(--foreground); }
.text-body-lg { font-size: var(--text-body-lg); line-height: 1.5; font-weight: 400; }
.text-body { font-size: var(--text-body); line-height: 1.6; letter-spacing: 0.01em; font-weight: 400; }
.text-caption { font-size: var(--text-caption); line-height: 1.4; letter-spacing: 0.03em; font-weight: 400; text-transform: uppercase; }
.text-muted { color: var(--muted-foreground); }
.text-faint { color: var(--muted-foreground); opacity: 0.4; }
.mono-numbers { font-variant-numeric: tabular-nums slashed-zero; font-feature-settings: "tnum" 1, "zero" 1;}

/* ---------- SWISS GRID ---------- */
.swiss-grid {
  display: grid;
  gap: var(--gutter);
  padding-inline: var(--container-padding);
  grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 768px) { .swiss-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 1024px) { .swiss-grid { grid-template-columns: repeat(12, 1fr); } }
@media (min-width: 1440px) { .swiss-grid { max-width: 1400px; margin-inline: auto; } }
@media (min-width: 1920px) { .swiss-grid { max-width: 1800px; } }

/* ---------- ANIMATIONS ---------- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.animate-fade-in { animation: fade-in 0.6s ease-out forwards; }
[data-animate] { opacity: 0; }
[data-animate].animate-fade-in { opacity: 1; }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--muted-foreground); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--foreground); }

.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- FOCUS ---------- */
:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }

/* ---------- GRID OVERLAY ---------- */
.grid-overlay {
  position: absolute; inset: 0;
  opacity: 0.03; pointer-events: none;
  background-image:
    linear-gradient(to right, currentColor 1px, transparent 1px),
    linear-gradient(to bottom, currentColor 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---------- LINE CLAMP ---------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background-color: color-mix(in srgb, var(--background) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-bar { padding-block: 1rem; }
@media (min-width: 1024px) { .nav-bar { padding-block: 1.25rem; } }
.nav-container {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: var(--text-body); font-weight: 500;
  color: var(--foreground); transition: color 0.2s;
  letter-spacing: -0.01em;
}
.nav-logo:hover { color: var(--muted-foreground); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-links { display: none; align-items: center; gap: 2rem; margin-right: 2rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-link {
  font-size: var(--text-caption); line-height: 1.4; letter-spacing: 0.03em;
  text-transform: uppercase; font-weight: 400;
  color: var(--muted-foreground); transition: color 0.2s;
}
.nav-link:hover { color: var(--foreground); }

/* Theme toggle */
.theme-toggle-btn {
  position: relative; padding: 0.5rem; border-radius: 9999px;
  background: var(--secondary); transition: background-color 0.3s;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle-btn:hover { background: var(--border); }
.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  position: absolute; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s, transform 0.3s;
}
/* Dark mode: show moon, hide sun */
html.dark .theme-toggle-btn .icon-sun { opacity: 0; transform: rotate(90deg) scale(0); }
html.dark .theme-toggle-btn .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
/* Light mode: show sun, hide moon */
html.light .theme-toggle-btn .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
html.light .theme-toggle-btn .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0); }
/* Color theme: show sun (to indicate "go back to dark/light") */
html[data-color-theme] .theme-toggle-btn .icon-sun { opacity: 0; transform: rotate(90deg) scale(0); }
html[data-color-theme] .theme-toggle-btn .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* Color picker */
.color-picker-wrapper { position: relative; }
.color-picker-btn {
  padding: 0.5rem; border-radius: 9999px;
  background: var(--secondary); transition: background-color 0.3s;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.color-picker-btn:hover { background: var(--border); }
.color-picker-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; z-index: 100;
  display: flex; gap: 6px; flex-wrap: wrap; width: 260px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.color-picker-dropdown[hidden] { display: none; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent; transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.color-swatch svg { display: block; flex-shrink: 0; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.swatch-active { border-color: var(--foreground); transform: scale(1.15); }
.swatch-reset {
  font-size: 0; color: transparent;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: flex; padding: 0.5rem; margin-right: -0.5rem;
  position: relative; width: 40px; height: 40px;
  align-items: center; justify-content: center;
}
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }
.mobile-menu-btn .icon-menu,
.mobile-menu-btn .icon-close {
  position: absolute; display: flex;
  transition: opacity 0.2s, transform 0.2s;
}
.mobile-menu-btn .icon-close { opacity: 0; transform: rotate(-90deg); }
.mobile-menu-btn.is-open .icon-menu { opacity: 0; transform: rotate(90deg); }
.mobile-menu-btn.is-open .icon-close { opacity: 1; transform: rotate(0); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--background);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
@media (min-width: 768px) { .mobile-menu { display: none !important; } }
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu-nav { height: 100%; padding-top: 6rem; display: flex; flex-direction: column; }
.mobile-menu-links {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.mobile-menu-links li {
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0; transform: translateY(1rem);
}
.mobile-menu.is-open .mobile-menu-links li {
  opacity: 1; transform: translateY(0);
}
.mobile-menu-links a {
  font-size: var(--text-h2); font-weight: 700;
  color: var(--foreground); transition: color 0.2s;
  display: block;
}
.mobile-menu-links a:hover { color: var(--muted-foreground); }
.mobile-menu-footer {
  grid-column: 1 / -1;
  margin-top: auto; padding-bottom: 3rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.mobile-menu-footer a {
  font-size: var(--text-caption); text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted-foreground);
  transition: color 0.2s;
}
.mobile-menu-footer a:hover { color: var(--foreground); }

/* ==========================================================================
   HERO INTRO
   ========================================================================== */
.hero-intro {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: 5rem; position: relative; overflow: hidden;
}
@media (min-width: 1024px) { .hero-intro { padding-top: 6rem; } }
.hero-bg-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.02;
  background-image:
    linear-gradient(to right, currentColor 1px, transparent 1px),
    linear-gradient(to bottom, currentColor 1px, transparent 1px);
  background-size: 80px 80px;
}
.hero-intro-grid { width: 100%; }
.hero-intro__label { grid-column: 1 / -1; margin-bottom: 1.5rem; animation-delay: 0.1s; }
@media (min-width: 1024px) { .hero-intro__label { grid-column: span 3; margin-bottom: 0; } }
.hero-intro__title { grid-column: 1 / -1; margin-bottom: 2rem; animation-delay: 0.2s; }
@media (min-width: 1024px) {
  .hero-intro__title { grid-column: span 9; margin-bottom: 3rem; }
}
.hero-intro__desc { grid-column: 1 / -1; animation-delay: 0.4s; }
@media (min-width: 768px) { .hero-intro__desc { grid-column: span 6; } }
@media (min-width: 1024px) { .hero-intro__desc { grid-column: 4 / span 5; } }
.hero-intro__stats { grid-column: 1 / -1; margin-top: 2rem; animation-delay: 0.5s; }
@media (min-width: 768px) { .hero-intro__stats { grid-column: span 6; margin-top: 0; } }
@media (min-width: 1024px) { .hero-intro__stats { grid-column: span 4; } }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.stat-number { font-weight: 700; display: block; }
.hero-intro__scroll {
  grid-column: 1 / -1; margin-top: 4rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  animation-delay: 0.7s;
}
@media (min-width: 1024px) { .hero-intro__scroll { margin-top: 6rem; } }
.scroll-line {
  width: 1px; height: 3rem;
  background: linear-gradient(to bottom, var(--muted-foreground), transparent);
}

/* ==========================================================================
   HERO CAROUSEL
   ========================================================================== */
.hero-carousel {
  position: relative; min-height: 85vh; display: flex; flex-direction: column;
  background: var(--background);
}
@media (min-width: 1024px) { .hero-carousel { min-height: 90vh; } }
.hero-carousel__header { padding-top: 3rem; padding-bottom: 1.5rem; }
@media (min-width: 1024px) { .hero-carousel__header { padding-top: 4rem; padding-bottom: 2rem; } }
.hero-carousel__header-inner {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
}
.carousel-play-btn {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: var(--text-caption); text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted-foreground);
  transition: color 0.2s;
}
.carousel-play-btn:hover { color: var(--foreground); }
.carousel-play-btn .btn-label { display: none; }
@media (min-width: 640px) { .carousel-play-btn .btn-label { display: inline; } }
.carousel-play-btn.is-playing .icon-play { display: none; }
.carousel-play-btn.is-paused .icon-pause { display: none; }
.carousel-play-btn.is-paused .btn-label::after { content: 'Play'; }
.carousel-play-btn.is-playing .btn-label::after { content: 'Pause'; }
.carousel-play-btn .btn-label { font-size: 0; }

.hero-carousel__stage {
  flex: 1; position: relative; overflow: hidden;
}
.hero-carousel__track {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 1rem;
}
@media (min-width: 1024px) { .hero-carousel__track { padding: 0 3rem; } }

.hero-slide {
  position: absolute;
  width: calc(100% - (var(--container-padding)*2)); max-width: 1400px;
  height: 50vh;
  aspect-ratio: 16 / 10;
  border-radius: 1rem; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10; opacity: 0; transform: scale(0.75);
  pointer-events: none;
}
@media (min-width: 1024px) {
  .hero-slide { border-radius: 1.5rem; aspect-ratio: 16 / 9; }
}
.hero-slide.slide-active {
  z-index: 30; opacity: 1; transform: scale(1) translateX(0);
  pointer-events: auto;
}
.hero-slide.slide-prev {
  z-index: 20; opacity: 0.4;
  transform: translateX(-85%) scale(0.85);
}
.hero-slide.slide-next {
  z-index: 20; opacity: 0.4;
  transform: translateX(85%) scale(0.85);
}

.hero-slide__content {
  position: absolute; inset: 0;
  padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between;
}
@media (min-width: 640px) { .hero-slide__content { padding: 2rem; } }
@media (min-width: 1024px) { .hero-slide__content { padding: 3rem; } }
.hero-slide__top { max-width: 42rem; }
.hero-slide__top .text-caption { display: block; margin-bottom: 0.5rem; }
@media (min-width: 640px) { .hero-slide__top .text-caption { margin-bottom: 1rem; } }
.hero-slide__title { margin-bottom: 0.75rem; transition: opacity 0.3s; }
@media (min-width: 640px) { .hero-slide__title { margin-bottom: 1rem; } }
.hero-slide__top .text-body-lg { max-width: 36rem; transition: opacity 0.3s; }
.hero-slide:not(.slide-active) .hero-slide__title { opacity: 0.6; }
.hero-slide:not(.slide-active) .hero-slide__top .text-body-lg { opacity: 0.4; }

.hero-slide__visual {
  position: relative; height: 50%; border-radius: 0.75rem; overflow: hidden;
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1rem; gap: 0.75rem;
}
@media (min-width: 1024px) { .hero-slide__visual { border-radius: 1rem; } }
.hero-slide__img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-foreground); opacity: 0.3;
}
@media (min-width: 1024px) {
  .hero-slide__img-placeholder svg { width: 64px; height: 64px; }
}

/* Carousel arrows */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 40;
  padding: 0.5rem; border-radius: 9999px;
  background: color-mix(in srgb, var(--secondary) 80%, transparent);
  backdrop-filter: blur(8px);
  color: var(--foreground); transition: background-color 0.2s;
}
@media (min-width: 640px) { .carousel-arrow { padding: 0.75rem; } }
.carousel-arrow:hover { background: var(--secondary); }
.carousel-arrow:disabled { opacity: 0.5; }
.carousel-arrow--prev { left: 0.5rem; }
.carousel-arrow--next { right: 0.5rem; }
@media (min-width: 640px) { .carousel-arrow--prev { left: 1rem; } .carousel-arrow--next { right: 1rem; } }
@media (min-width: 1024px) { .carousel-arrow--prev { left: 2rem; } .carousel-arrow--next { right: 2rem; } }

/* Dots */
.hero-carousel__dots { padding-bottom: 2rem; padding-top: 1.5rem; }
.dots-container {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.dot {
  width: 0.5rem; height: 0.5rem; border-radius: 9999px;
  background: color-mix(in srgb, var(--muted-foreground) 40%, transparent);
  transition: all 0.3s;
}
.dot:hover { background: var(--muted-foreground); }
.dot--active { width: 2rem; background: var(--foreground); }
.dot-play-wrapper {
  margin-left: 1rem; padding: 0.5rem; border-radius: 9999px;
  background: color-mix(in srgb, var(--secondary) 80%, transparent);
}
.dot-play-btn { display: flex; align-items: center; justify-content: center; color: var(--foreground); }
.dot-play-btn.is-playing .icon-play { display: none; }
.dot-play-btn.is-paused .icon-pause { display: none; }

/* ==========================================================================
   FEATURED PROJECTS CAROUSEL
   ========================================================================== */
.featured-projects {
  padding: 6rem 0 6rem; overflow: hidden;
  background: var(--card);
}
@media (min-width: 1024px) { .featured-projects { padding: 8rem 0 8rem; } }
.featured-projects__header { margin-bottom: 2rem; }
@media (min-width: 1024px) { .featured-projects__header { margin-bottom: 3rem; } }
.featured-projects__header-inner {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 1rem;
}
@media (min-width: 1024px) {
  .featured-projects__header-inner {
    flex-direction: row; align-items: center; justify-content: space-between;
  }
}
.featured-projects__controls { display: flex; align-items: center; gap: 1rem; }
.arrow-group { display: flex; gap: 0.5rem; }
.arrow-btn {
  padding: 0.5rem; border-radius: 9999px;
  background: var(--secondary); color: var(--foreground);
  transition: background-color 0.2s, color 0.2s;
}
.arrow-btn:hover { background: var(--foreground); color: var(--background); }
.arrow-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.arrow-btn:disabled:hover { background: var(--secondary); color: var(--foreground); }

.featured-projects__track {
  display: flex; gap: 1.5rem;
  overflow-x: auto; padding-inline: var(--container-padding); margin-left: var(--container-padding);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 1440px) {
  .featured-projects__track {
    padding-left: calc((100vw - 1400px) / 2 + var(--container-padding));
  }
}
@media (min-width: 1920px) {
  .featured-projects__track {
    padding-left: calc((100vw - 1800px) / 2 + var(--container-padding));
  }
}
.fp-card {
  position: relative;
  flex: 0 0 85vw; max-width: 800px;
  border-radius: 1rem; overflow: hidden;
  background: color-mix(in srgb, var(--secondary) 30%, transparent);
  border: 1px solid var(--border);
  transition: opacity 0.5s;
  scroll-snap-align: start;
  opacity: 0.6;
}
@media (min-width: 640px) { .fp-card { flex: 0 0 70vw; } }
@media (min-width: 768px) { .fp-card { flex: 0 0 60vw; } }
@media (min-width: 1024px) { .fp-card { flex: 0 0 50vw; border-radius: 1.5rem; } }
@media (min-width: 1280px) { .fp-card { flex: 0 0 45vw; } }
.fp-card--active { opacity: 1; }

.fp-card__image {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
}
.fp-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.fp-card__link {
  color: inherit; text-decoration: none;
}
.fp-card__link::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
}
.fp-card__link:focus-visible { outline: none; }
.fp-card__link:focus-visible::after {
  box-shadow: inset 0 0 0 3px var(--foreground); border-radius: 1rem;
}
.fp-badge {
  position: absolute; top: 1rem; left: 1rem;
  padding: 0.375rem 0.75rem; border-radius: 9999px;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(8px);
  font-size: var(--text-caption); text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--foreground);
}
@media (min-width: 1024px) { .fp-badge { top: 1.5rem; left: 1.5rem; } }
.fp-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

.fp-card__hover-overlay {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  opacity: 0; transition: opacity 0.3s;
}
.fp-card:hover .fp-card__hover-overlay { opacity: 1; }

.fp-card__body { padding: 1.25rem; }
@media (min-width: 1024px) { .fp-card__body { padding: 2rem; } }
.fp-card__meta {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.fp-card__meta .text-caption { display: block; margin-bottom: 0.25rem; }
.fp-card__body .text-h3 { margin-bottom: 0.5rem; }
.fp-card__arrow {
  padding: 0.5rem; border-radius: 9999px; background: var(--secondary);
  color: var(--foreground); transition: all 0.3s;
  opacity: 0; transform: translate(-0.5rem, 0.5rem);
  flex-shrink: 0;
}
.fp-card:hover .fp-card__arrow {
  opacity: 1; transform: translate(0, 0);
}
.fp-spacer { flex: 0 0 var(--container-padding); }

.featured-projects__dots { margin-top: 2rem; }

/* ==========================================================================
   PROJECT GRID
   ========================================================================== */
.project-grid-section { padding: 6rem 0; }
@media (min-width: 1024px) { .project-grid-section { padding: 8rem 0; } }
.project-grid__header {
  grid-column: 1 / -1; margin-bottom: 3rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
@media (min-width: 1024px) {
  .project-grid__header {
    flex-direction: row; align-items: flex-end; justify-content: space-between;
    margin-bottom: 4rem;
  }
}
.project-grid__header .text-caption { display: block; margin-bottom: 0.75rem; }

.filter-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  padding: 0.5rem 1rem; border-radius: 9999px;
  font-size: var(--text-caption); text-transform: uppercase;
  letter-spacing: 0.03em; transition: all 0.2s;
  background: var(--secondary); color: var(--muted-foreground);
}
.pill:hover { color: var(--foreground); }
.pill--active { background: var(--foreground); color: var(--background); }

.project-grid {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 768px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .project-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.project-card {
  position: relative;
  border-radius: 1rem; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  transition: border-color 0.3s, opacity 0.4s, transform 0.4s;
}
.project-card:hover { border-color: color-mix(in srgb, var(--muted-foreground) 30%, transparent); }
.project-card.is-hidden { display: none; }

.project-card--hero {
  grid-column: span 1;
}
@media (min-width: 1024px) {
  .project-card--hero { grid-column: span 2; grid-row: span 2; }
}

.project-card__image {
  aspect-ratio: 4 / 3; position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
  display: flex; align-items: center; justify-content: center; 
}
.project-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.project-card__link {
  color: inherit; text-decoration: none;
}
.project-card__link::after {
  content: ''; position: absolute; inset: 0; z-index: 2;
}
.project-card__link:focus-visible { outline: none; }
.project-card__link:focus-visible::after {
  box-shadow: inset 0 0 0 3px var(--foreground); border-radius: 1rem;
}
@media (min-width: 1024px) {
  .project-card--hero .project-card__image { aspect-ratio: 1; }
}
.project-card__hover-overlay {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  opacity: 0; transition: opacity 0.3s;
}
.project-card:hover .project-card__hover-overlay { opacity: 1; }

.project-card__body { padding: 1.25rem; }
@media (min-width: 1024px) { .project-card__body { padding: 1.5rem; } }
.project-card__meta {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.project-card__meta .text-caption { display: block; margin-bottom: 0.25rem; }
.project-card__title { font-weight: 700; color: var(--foreground); }
.project-card__arrow {
  padding: 0.5rem; border-radius: 9999px; background: var(--secondary);
  color: var(--foreground); transition: all 0.3s;
  opacity: 0; transform: translate(-0.5rem, 0.5rem);
  flex-shrink: 0;
}
.project-card:hover .project-card__arrow {
  opacity: 1; transform: translate(0, 0);
}

.project-grid__cta {
  grid-column: 1 / -1; margin-top: 3rem;
  display: flex; justify-content: center;
}
@media (min-width: 1024px) { .project-grid__cta { margin-top: 4rem; } }
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 9999px;
  background: var(--foreground); color: var(--background);
  font-size: var(--text-caption); text-transform: uppercase;
  letter-spacing: 0.03em; font-weight: 500;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }

/* ==========================================================================
   QUOTE SECTION
   ========================================================================== */
.quote-section { padding: 6rem 0; }
@media (min-width: 1024px) { .quote-section { padding: 10rem 0; } }
.quote-section__inner {
  grid-column: 1 / -1; text-align: center;
}
@media (min-width: 1024px) { .quote-section__inner { grid-column: 2 / span 10; } }
.quote-text { text-balance: auto; line-height: 1.1; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-style: italic; text-decoration: underline rgba(255,255,0,0.75); }
@media (min-width: 1024px) { .quote-text { font-size: var(--text-h2); } }
.quote-footer { margin-top: 2rem; }
@media (min-width: 1024px) { .quote-footer { margin-top: 3rem; margin-bottom: 6em;} }
.quote-author { display: block; font-weight: 500; color: var(--foreground); }
.quote-footer .text-caption { display: block; margin-top: 0.25rem; }

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about-section { padding: 6rem 0; background: var(--card); }
@media (min-width: 1024px) { .about-section { padding: 8rem 0; } }
.about-grid { row-gap: 0; }
.about__intro {
  grid-column: 1 / -1; margin-bottom: 3rem;
}
@media (min-width: 1024px) { .about__intro { grid-column: span 5; margin-bottom: 0; align-self: end; } }
.about__intro .text-caption { display: block; margin-bottom: 1rem; }
.about__intro .text-h1 { margin-bottom: 1.5rem; }

.about__bio { grid-column: 1 / -1; }
@media (min-width: 1024px) { .about__bio { grid-column: 7 / span 6; align-self: end; } }
.about__bio-lead { color: var(--foreground); line-height: 1.6; margin-bottom: 1.5rem; }
.about__bio .text-body { line-height: 1.6; margin-bottom: 1.5rem; }
.about__bio .text-body:last-child { margin-bottom: 0; }

.about__principles {
  grid-column: 1 / -1; margin-top: 5rem;
}
@media (min-width: 1024px) { .about__principles { margin-top: 8rem; } }
.about__principles-title { margin-bottom: 3rem; }
.principles-grid {
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}
@media (min-width: 768px) { .principles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .principles-grid { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; align-items: start; } }
.principle__number { font-weight: 700; display: block; margin-bottom: 0.5rem; }
.principle__title { font-weight: 500; margin-bottom: 0.5rem; color: var(--foreground); }
@media (min-width: 1024px) {
  .principle--offset { margin-top: 0; }
}

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.timeline-section { padding: 6rem 0; border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .timeline-section { padding: 8rem 0; } }
.timeline__header {
  grid-column: 1 / -1; margin-bottom: 3rem;
}
@media (min-width: 1024px) {
  .timeline__header {
    grid-column: span 4; margin-bottom: 0;
    position: sticky; top: 6rem; align-self: start;
  }
}
.timeline__header .text-caption { display: block; margin-bottom: 1rem; }
.timeline__items { grid-column: 1 / -1; }
@media (min-width: 1024px) { .timeline__items { grid-column: 6 / span 7; } }

.timeline-item {
  display: grid; grid-template-columns: 80px 1fr; gap: 1rem;
  padding: 2rem 0; border-top: 1px solid var(--border);
}
@media (min-width: 768px) { .timeline-item { grid-template-columns: 120px 1fr; gap: 2rem; } }
.timeline-item--first { border-top: none; padding-top: 0; }
.timeline-item__year .text-h2 { line-height: 1; }
.timeline-item__title { font-weight: 500; color: var(--foreground); margin-bottom: 0.25rem; }
.timeline-item__content .text-caption { display: block; margin-bottom: 0.75rem; }

/* ==========================================================================
   EXPERTISE MARQUEE
   ========================================================================== */
.expertise-marquee {
  padding: 2rem 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); overflow: hidden;
}
@media (min-width: 1024px) { .expertise-marquee { padding: 3rem 0; } }
.marquee-track { display: flex; overflow: hidden; }
.marquee-content {
  display: flex; flex-shrink: 0; gap: 0;
  animation: marquee 40s linear infinite;
}
.marquee-item {
  font-size: var(--text-h5); font-weight: 500;
  color: var(--muted-foreground); white-space: nowrap;
  text-transform: uppercase;
}
.marquee-dot {
  margin: 0 1.5rem; color: var(--border);
}
@media (min-width: 1024px) { .marquee-dot { margin: 0 2rem; } }

/* ==========================================================================
   EXPERTISE SECTION
   ========================================================================== */
.expertise-section { padding: 6rem 0; }
@media (min-width: 1024px) { .expertise-section { padding: 8rem 0; } }
.expertise__header {
  grid-column: 1 / -1; margin-bottom: 3rem;
}
@media (min-width: 1024px) { .expertise__header { grid-column: span 4; margin-bottom: 0; } }
.expertise__header .text-caption { display: block; margin-bottom: 1rem; }
.expertise__header .text-h1 { margin-bottom: 1.5rem; }

.expertise__content { grid-column: 1 / -1; }
@media (min-width: 1024px) { .expertise__content { grid-column: 6 / span 7; } }
.expertise__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.skills-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 1.5rem;
}
@media (min-width: 768px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
.skills-grid span { font-size: var(--text-body); color: var(--foreground); }
.expertise__panel[hidden] { display: none; }

.expertise__clients {
  grid-column: 1 / -1; margin-top: 5rem;
}
@media (min-width: 1024px) { .expertise__clients { margin-top: 8rem; } }
.expertise__clients-title { margin-bottom: 2rem; }
.clients-list {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
}
.clients-list span {
  font-size: var(--text-body); color: var(--muted-foreground);
}

.expertise__recognition {
  grid-column: 1 / -1; margin-top: 4rem; padding-top: 4rem;
  border-top: 1px solid var(--border);
}
@media (min-width: 1024px) { .expertise__recognition { margin-top: 6rem; padding-top: 4rem; } }
.recognition-grid {
  display: grid; grid-template-columns: 1fr; gap: 2rem;
}
@media (min-width: 768px) { .recognition-grid { grid-template-columns: repeat(2, 1fr); } }
.recognition__awards { grid-column: 1 / -1; }
.recognition-grid .text-caption { display: block; margin-bottom: 0.75rem; }
.recognition-list {
  list-style: disc; padding-left: 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.recognition-list li { font-size: var(--text-body); line-height: 1.6; color: var(--foreground); }
.recognition-link {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.recognition-link:hover { color: var(--foreground); }

/* ==========================================================================
   PHOTOGRAPHY
   ========================================================================== */
.photography-section {
  padding: 6rem 0; background: var(--card); overflow: hidden;
}
@media (min-width: 1024px) { .photography-section { padding: 8rem 0; } }
.photography__header { margin-bottom: 3rem; }
.photography__header-inner {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 1.5rem;
}
@media (min-width: 1024px) {
  .photography__header-inner {
    flex-direction: row; align-items: flex-end; justify-content: space-between;
  }
}
.photography__header-inner .text-caption { display: block; margin-bottom: 1rem; }
.photography__nav { display: flex; gap: 0.5rem; }

.photography__track {
  display: flex; gap: 1rem; overflow-x: auto; margin-left: var(--container-padding);
  padding-inline: var(--container-padding);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 1024px) { .photography__track { gap: 1.5rem; } }

.photo-card {
  flex: 0 0 280px; scroll-snap-align: start;
}
@media (min-width: 640px) { .photo-card { flex: 0 0 340px; } }
@media (min-width: 1024px) { .photo-card { flex: 0 0 420px; } }
.photo-card .text-caption { display: block; margin-bottom: 0.25rem; }
.photo-card__title { font-weight: 500; color: var(--foreground); }

.photo-card__image {
  aspect-ratio: 3 / 4; border-radius: 0.75rem; overflow: hidden; margin-bottom: 1rem;
  background: color-mix(in srgb, var(--secondary) 50%, transparent);
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-card__img-wrap {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  pointer-events: none; user-select: none;
  transition: opacity 0.3s;
}
.photo-card:hover .photo-card__img-wrap { opacity: 0.85; }
@media (min-width: 1024px) { .photo-card__image { border-radius: 1rem; } }
.photo-card__hover {
  position: absolute; inset: 0; z-index: 2;
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
  opacity: 0; transition: opacity 0.3s;
}
.photo-card:hover .photo-card__hover { opacity: 1; }
.photo-spacer { flex: 0 0 var(--container-padding); }

.photography__footer { margin-top: 3rem; }
.photography__footer-inner {
  grid-column: 1 / -1; display: flex; justify-content: center;
}
.link-underline {
  text-decoration: underline; text-underline-offset: 4px;
  transition: color 0.2s;
}
.link-underline:hover { color: var(--foreground); }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-section { padding: 6rem 0; border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .contact-section { padding: 8rem 0; } }
.contact__main {
  grid-column: 1 / -1; margin-bottom: 4rem;
}
@media (min-width: 1024px) { .contact__main { grid-column: span 8; margin-bottom: 0; } }
.contact__main .text-caption { display: block; margin-bottom: 1rem; }
.contact__main .text-h1 { margin-bottom: 2rem; }
.contact__email {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-size: var(--text-h3); line-height: 1.15; font-weight: 500;
  color: var(--foreground); transition: color 0.2s;
}
.contact__email:hover { color: var(--muted-foreground); }
.contact__email svg { transition: transform 0.2s; }
.contact__email:hover svg { transform: translate(2px, -2px); }

.contact__sidebar { grid-column: 1 / -1; }
@media (min-width: 1024px) { .contact__sidebar { grid-column: 10 / span 3; } }
.contact__sidebar .text-caption { display: block; margin-bottom: 1rem; }
.contact__sidebar > div + div { margin-top: 2rem; }
.social-links { display: flex; flex-direction: column; gap: 0.75rem; }
.social-link {
  font-size: var(--text-body); color: var(--foreground);
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: color 0.2s;
}
.social-link svg { opacity: 0; transition: opacity 0.2s; }
.social-link:hover { color: var(--muted-foreground); }
.social-link:hover svg { opacity: 1; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-inner {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 1rem;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@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;
  }
}
