/* ─── Design Tokens ─── */
:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Font */
  --font-body: 'Cormorant', 'Georgia', serif;
  --font-display: 'Cormorant', 'Georgia', serif;

  /* Transition */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Light Mode (Default) ─── */
:root,
[data-theme='light'] {
  --color-bg: #f5f4f0;
  --color-surface: #eae8e3;
  --color-text: #1a1a18;
  --color-text-muted: #6b6b66;
  --color-text-faint: #a3a29d;
  --color-divider: #d4d2cd;
  --color-accent: #1a1a18;
}

/* ─── Dark Mode ─── */
[data-theme='dark'] {
  --color-bg: #111110;
  --color-surface: #1c1b19;
  --color-text: #d8d6d0;
  --color-text-muted: #8a8985;
  --color-text-faint: #5a5955;
  --color-divider: #2a2926;
  --color-accent: #d8d6d0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111110;
    --color-surface: #1c1b19;
    --color-text: #d8d6d0;
    --color-text-muted: #8a8985;
    --color-text-faint: #5a5955;
    --color-divider: #2a2926;
    --color-accent: #d8d6d0;
  }
}

/* ─── Layout ─── */
.site-container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .site-container {
    padding-inline: var(--space-8);
  }
}

/* ─── Header / Nav ─── */
.site-header {
  padding-block: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-logo {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
}

.site-logo:hover {
  opacity: 0.6;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-text);
}

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-1);
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--color-text);
}

/* ─── Mobile Nav ─── */
.nav-toggle {
  display: none;
  color: var(--color-text-muted);
  padding: var(--space-1);
}

@media (max-width: 639px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--space-6);
    background: var(--color-bg);
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
    z-index: 100;
    border-bottom: 1px solid var(--color-divider);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
  }

  .site-header {
    position: relative;
  }
}

/* ─── Pages ─── */
.page {
  display: none;
  padding-block: clamp(var(--space-8), 6vw, var(--space-24));
  min-height: 60vh;
}

.page.active {
  display: block;
}

/* ─── Home ─── */
.hero {
  padding-block: clamp(var(--space-16), 12vw, var(--space-32));
}

.hero-name {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 300;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.hero-descriptor {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ─── Reels ─── */
.reels-section {
  padding-block: clamp(var(--space-8), 6vw, var(--space-16));
}

.reels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .reels-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.reel-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reel-label {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.reel-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--color-surface);
}

.reel-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── Work List ─── */
.work-list {
  list-style: none;
}

.work-item {
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-4);
}

.work-item:first-child {
  border-top: 1px solid var(--color-divider);
}

.work-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
}

.work-meta {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
}

.work-role {
  display: block;
}

.work-year {
  display: block;
  color: var(--color-text-faint);
}

/* ─── Section Headers ─── */
.section-header {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}

/* ─── Director / Cinematography Pages ─── */
.discipline-page .reel-container {
  margin-bottom: clamp(var(--space-8), 6vw, var(--space-16));
}

.discipline-statement {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 300;
  color: var(--color-text);
  max-width: 52ch;
  line-height: 1.5;
}

.discipline-credits {
  margin-top: clamp(var(--space-8), 4vw, var(--space-16));
}

/* ─── About ─── */
.about-content {
  max-width: 52ch;
}

.about-content p {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-festivals {
  margin-top: clamp(var(--space-8), 4vw, var(--space-16));
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.festival-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.festival-list li {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ─── Contact ─── */
.contact-content {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.contact-email {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  font-weight: 300;
  color: var(--color-text);
  text-decoration: none;
  display: inline-block;
}

.contact-email:hover {
  opacity: 0.5;
}

.contact-links {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-6);
}

.contact-links a {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
}

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

/* ─── Footer ─── */
.site-footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
}

/* ─── Scroll Reveal ─── */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to {
    opacity: 1;
  }
}

/* ─── Discipline Tagline ─── */
.discipline-tagline {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

/* ─── Photography Grid ─── */
.photo-grid {
  columns: 2 280px;
  column-gap: var(--space-4);
}

@media (min-width: 768px) {
  .photo-grid {
    columns: 3 240px;
  }
}

.photo-item {
  break-inside: avoid;
  margin-bottom: var(--space-4);
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-surface);
}

/* ─── Page Transition ─── */
.page-transition {
  animation: page-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes page-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
