/* ---------------------------------------------------------------- */
/* Design tokens                                                     */
/* ---------------------------------------------------------------- */
:root {
  /* New design system — light default */
  --bg:               #f5f5f7;
  --bg-elevated:      #ffffff;
  --text:             #1d1d1f;
  --text-secondary:   #6e6e73;
  --text-tertiary:    #aeaeb2;
  --border:           rgba(0, 0, 0, 0.07);
  --border-strong:    rgba(0, 0, 0, 0.14);
  --accent:           #c9000f;

  /* Hero is always dark */
  --hero-bg:          #080808;
  --hero-text:        #f5f5f7;
  --hero-secondary:   rgba(245, 245, 247, 0.48);

  /* Fonts */
  --font-display: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Admin backward-compat variables */
  --black:      #0c0c0d;
  --near-black: #131314;
  --charcoal:   #1c1c1e;
  --gray-700:   #2b2b2e;
  --gray-500:   #6e6e73;
  --gray-300:   #a3a3a8;
  --gray-100:   #e7e7ea;
  --red:        #8a1f1f;
  --red-bright: #b32d2d;

  --max-width: 1400px;
  --gutter: clamp(24px, 5vw, 80px);
}

[data-theme="dark"] {
  --bg:             #000000;
  --bg-elevated:    #0c0c0d;
  --text:           #f5f5f7;
  --text-secondary: #aeaeb2;
  --text-tertiary:  #6e6e73;
  --border:         rgba(255, 255, 255, 0.07);
  --border-strong:  rgba(255, 255, 255, 0.14);
  --accent:         #ff453a;
  --hero-bg:        #000000;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
}

.accent { color: var(--accent); }

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  height: 60px;
  background: rgba(8, 8, 8, 0.7);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Switches to light when scrolled past the hero */
.site-header.header-light {
  background: rgba(245, 245, 247, 0.86);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .site-header.header-light {
  background: rgba(0, 0, 0, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.logo { display: flex; align-items: center; }

.logo-img {
  height: 48px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  transition: filter 0.4s ease;
}

.site-header.header-light .logo-img { filter: none; }
[data-theme="dark"] .site-header.header-light .logo-img {
  filter: brightness(0) invert(1);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
}

.nav a {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(245, 245, 247, 0.65);
  transition: color 0.2s ease;
}
.nav a:hover { color: rgba(245, 245, 247, 1); }

.site-header.header-light .nav a { color: var(--text-secondary); }
.site-header.header-light .nav a:hover { color: var(--text); }
[data-theme="dark"] .site-header.header-light .nav a {
  color: rgba(245, 245, 247, 0.65);
}
[data-theme="dark"] .site-header.header-light .nav a:hover {
  color: rgba(245, 245, 247, 1);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: rgba(245, 245, 247, 0.55);
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  color: rgba(245, 245, 247, 1);
  border-color: rgba(245, 245, 247, 0.3);
}

.site-header.header-light .theme-toggle {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.site-header.header-light .theme-toggle:hover { color: var(--text); }

[data-theme="dark"] .site-header.header-light .theme-toggle {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(245, 245, 247, 0.55);
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: transparent;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: rgba(245, 245, 247, 0.65);
  border-radius: 1px;
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}

@media (max-width: 639px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    position: relative;
  }
  .logo-img { height: 40px; }
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0 4px;
  }
  .nav a {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .site-header.nav-open .nav { display: flex; }
  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0; transform: scaleX(0);
  }
  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
}

/* ---------------------------------------------------------------- */
/* Hero                                                              */
/* ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--hero-bg);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 80px var(--gutter) clamp(60px, 8vw, 96px);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

.hero-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(8, 8, 8, 0.75) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hero-secondary);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 300;
  letter-spacing: -0.032em;
  line-height: 1.0;
  color: var(--hero-text);
}

.hero-copy {
  margin-top: clamp(18px, 2vw, 28px);
  max-width: 48ch;
  font-size: clamp(14px, 1.3vw, 17px);
  color: var(--hero-secondary);
  line-height: 1.65;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(32px, 5vw, 52px);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-text);
  border-bottom: 1px solid rgba(245, 245, 247, 0.28);
  padding-bottom: 6px;
  transition: border-color 0.2s ease;
}
.hero-cta:hover { border-bottom-color: rgba(245, 245, 247, 0.7); }

/* ---------------------------------------------------------------- */
/* Section layout                                                    */
/* ---------------------------------------------------------------- */
.section-head {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  color: var(--text);
}

.section-head p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 48ch;
}

/* ---------------------------------------------------------------- */
/* Work / Gallery                                                    */
/* ---------------------------------------------------------------- */
.work {
  padding-top: clamp(80px, 12vw, 140px);
  background: var(--bg);
}

.work .section-head { margin-bottom: clamp(32px, 4vw, 48px); }

.mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

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

.tile {
  background: var(--bg);
  overflow: hidden;
}

/* Carousel */
.carousel { position: relative; cursor: zoom-in; aspect-ratio: 1 / 1; overflow: hidden; }
.carousel-track { display: grid; width: 100%; height: 100%; grid-template: 100% / 100%; }

.carousel-slide {
  grid-area: 1 / 1;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.carousel-slide.is-active { opacity: 1; }

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tile:hover .carousel-img { transform: scale(1.022); }

/* Caption below image */
.tile-caption {
  padding: 16px 20px 32px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.tile-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}

.tile-description {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Carousel dots */
.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 5px;
  pointer-events: auto;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.carousel-dot.is-active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.5);
}

/* Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
}
.tile:hover .carousel-arrow { opacity: 1; }
.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
}
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }

/* ---------------------------------------------------------------- */
/* Image modal                                                       */
/* ---------------------------------------------------------------- */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.93);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  animation: fade-in 0.2s ease;
}
.image-modal[hidden] { display: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.image-modal-img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 48px 96px rgba(0, 0, 0, 0.8);
  cursor: default;
}

.image-modal-close,
.image-modal-arrow {
  position: fixed;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.image-modal-close {
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 15px;
}
.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.image-modal-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 24px;
}
.image-modal-arrow.prev { left: 20px; }
.image-modal-arrow.next { right: 20px; }
.image-modal-arrow:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}
.image-modal-arrow[hidden] { display: none; }

/* ---------------------------------------------------------------- */
/* Approach                                                          */
/* ---------------------------------------------------------------- */
.approach {
  padding: clamp(80px, 12vw, 140px) 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.approach-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.approach-card {
  padding: clamp(32px, 4vw, 52px) clamp(20px, 3vw, 40px);
  border-right: 1px solid var(--border);
  transition: background 0.3s ease;
}
.approach-card:last-child { border-right: none; }
.approach-card:hover { background: var(--bg-elevated); }

.approach-index {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: clamp(20px, 3vw, 28px);
}

.approach-card h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  color: var(--text);
  margin-bottom: 14px;
}

.approach-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 32ch;
}

@media (max-width: 767px) {
  .approach-card {
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .approach-card:first-child { border-top: none; }
}

/* ---------------------------------------------------------------- */
/* Contact                                                           */
/* ---------------------------------------------------------------- */
.contact {
  padding: clamp(80px, 14vw, 160px) var(--gutter);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.contact-inner { max-width: 800px; }

.contact h2 {
  font-size: clamp(32px, 5.5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.03em;
}

.contact p {
  margin-top: 18px;
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 44ch;
}

.contact-cta {
  display: inline-block;
  margin-top: clamp(24px, 3.5vw, 40px);
  font-family: var(--font-display);
  font-size: clamp(15px, 1.8vw, 20px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: opacity 0.2s ease;
}
.contact-cta:hover { opacity: 0.65; }

/* ---------------------------------------------------------------- */
/* Footer                                                            */
/* ---------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding: 24px var(--gutter) 40px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
