:root {
  --color-ink: #0b0b0c;
  --color-softwhite: #f6f6f7;
  --color-warmneutral: #d9cfc3;
  --color-gold: #d4b26b;
  --color-slateblue: #6e88a7;
  --color-muted: #8b8f97;

  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 56px;
  --space-11: 64px;
  --space-12: 80px;
  --space-13: 96px;
  --space-14: 120px;

  --radius-card: 16px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);

  /* Global “film” color grade for all imagery */
  --site-grade-filter: contrast(1.08) saturate(1.07) hue-rotate(-6deg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-ink);
  background: var(--color-softwhite);
}

/* Lock scroll when modal is open */
body.no-scroll {
  overflow: hidden;
}

/* Layout */

.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

.container.narrow {
  width: min(720px, 100% - 48px);
}

.section {
  padding-block: var(--space-14);
}

.section-soft {
  background: #f1efea;
}

.section-dark {
  background: #111217;
  color: var(--color-softwhite);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(246, 246, 247, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.logo {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 14px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: var(--space-5);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
  color: inherit;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width 0.25s ease;
}

.nav a:hover::after {
  width: 100%;
}

/* Mobile nav */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin-block: 3px;
  background: var(--color-ink);
}

/* HERO */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--color-softwhite);
  background: #000;
}

/* 🎥 FULL OPACITY VIDEO */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
  filter: var(--site-grade-filter);
  transform: translateZ(0);
}

/* 🌫 SOFT BLEND OVERLAY */
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, #3a4a66, var(--color-ink) 54%);
  opacity: 0.3;
  z-index: 1;
  backdrop-filter: blur(2px);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity: 0.16;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  min-height: 100vh;
  gap: var(--space-10);
  padding-block: var(--space-14);
}

.hero-text {
  max-width: 560px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: rgba(246, 246, 247, 0.8);
  margin-bottom: var(--space-3);
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(40px, 5vw, 56px);
  margin: 0 0 var(--space-3);
}

.hero-title {
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

.hero-body {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.hero-tags {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 246, 247, 0.77);
  margin-bottom: var(--space-7);
}

.scroll-cue {
  border: 1px solid rgba(246, 246, 247, 0.4);
  background: transparent;
  color: var(--color-softwhite);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.scroll-cue:hover {
  background: rgba(246, 246, 247, 0.08);
  transform: translateY(-2px);
  border-color: rgba(246, 246, 247, 0.7);
}

.hero-portrait {
  display: flex;
  justify-content: flex-end;
}

.portrait-placeholder {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  background: url("images/hero-portrait.png") center / cover no-repeat;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--space-6);
}

/* SECTION HEADERS */

.section-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.section-header {
  max-width: 640px;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--color-muted);
}

.section-dark .section-kicker {
  color: rgba(246, 246, 247, 0.6);
}

.section-header h2 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
  font-family: "Playfair Display", serif;
  font-size: 32px;
}

.section-subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 15px;
  max-width: 520px;
}

.section-dark .section-subtitle {
  color: rgba(246, 246, 247, 0.7);
}

.lead {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

/* ABOUT */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--space-10);
}

.col-text p {
  margin-bottom: var(--space-4);
  font-size: 15px;
  line-height: 1.7;
}

.meta-group {
  margin-bottom: var(--space-6);
}

.meta-group h3 {
  margin-bottom: var(--space-3);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

.meta-list li + li {
  margin-top: 4px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: #ece9e1;
  font-size: 12px;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--color-ink);
  color: var(--color-softwhite);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* TEXT LINKS */

.text-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--color-slateblue);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.2s ease;
}

.text-link:hover::after {
  width: 100%;
}

/* GRID / CARDS */

.grid {
  display: grid;
  gap: var(--space-7);
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: #ffffff;
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* Hide inline modal content inside cards – only show in popup */
.card .modal-content {
  display: none;
}

.card-thumb {
  width: 100%;
  border-radius: 12px;
  margin-bottom: var(--space-4);
  display: block;
  object-fit: cover;
  filter: var(--site-grade-filter);
}

.section-dark .card {
  background: #181921;
  color: var(--color-softwhite);
}

.section-dark .card p {
  color: rgba(246, 246, 247, 0.7);
}

/* HORIZONTAL GALLERIES */

.scroll-gallery-wrapper {
  overflow-x: auto;
  padding-inline: var(--space-4);
  padding-bottom: var(--space-8);
}

.scroll-gallery {
  display: flex;
  gap: var(--space-7);
  min-width: max-content;
}

.gallery-item {
  flex: 0 0 auto;
  width: min(360px, 70vw);
  display: flex;
  flex-direction: column;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
  transform: translateZ(0);
  filter: var(--site-grade-filter);
  transition:
    transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1),
    filter 0.25s ease;
}

.gallery-item figcaption {
  margin-top: var(--space-2);
  font-size: 13px;
  text-align: center;
  color: var(--color-muted);
}

.section-dark .gallery-item figcaption {
  color: rgba(246, 246, 247, 0.82);
}

.gallery-item img:hover {
  transform: scale(1.03);
  filter: contrast(1.12) saturate(1.1) hue-rotate(-6deg);
}

/* CONTACT */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-10);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.contact-right h3 {
  margin-top: 0;
  margin-bottom: var(--space-4);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.contact-right ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.contact-right li {
  margin-bottom: var(--space-2);
}

/* FOOTER */

.site-footer {
  padding-block: var(--space-8);
  background: #101012;
  color: rgba(246, 246, 247, 0.8);
  font-size: 13px;
}

.footer-inner {
  text-align: center;
}

.footer-line {
  width: 64px;
  height: 1px;
  background: var(--color-gold);
  margin: 0 auto var(--space-4);
}

/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 10, 0.6);
  backdrop-filter: blur(10px);
  z-index: 40;
  padding-inline: var(--space-4);
}

.modal-backdrop.is-visible {
  display: flex;
}

.modal {
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  padding: var(--space-7);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-body {
  font-size: 14px;
  color: var(--color-ink);
  max-height: calc(90vh - 2 * var(--space-7));
  overflow-y: auto;
}

/* MODAL TYPOGRAPHY – FLUSH LEFT */
.modal-body,
.modal-body h2,
.modal-body p,
.modal-body ul,
.modal-body li,
.modal-body .text-link,
.modal-body a {
  text-align: left;
  margin-left: 0;
}

.modal-body h2 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  font-family: "Playfair Display", serif;
  font-size: 24px;
}

.modal-body p {
  margin-bottom: var(--space-3);
}

.modal-body ul {
  margin: 0 0 var(--space-3) 1.2rem;
}

/* modal gallery */

.modal-gallery {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-gallery img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  filter: var(--site-grade-filter);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
}

.modal-gallery img:hover {
  transform: scale(1.02);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

/* Make case study / publication links sit flush-left under titles */
.project-card .text-link,
.flipbook-card .text-link {
  display: inline-block;
  text-align: left;
}

/* REVEAL ON SCROLL */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* PARALLAX LAYERS */

.parallax-layer {
  will-change: transform;
}

/* WORK SECTION PARALLAX BACKGROUND */

#professional {
  position: relative;
  overflow: hidden;
}

#professional::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/parallax-work-bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  /* JS animates this custom property for cinematic drift */
  background-position: center calc(50% + var(--work-parallax-offset, 0px));
  opacity: 0.28;
  z-index: 0;
}

#professional .section-inner {
  position: relative;
  z-index: 1;
}

/* ADA: REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }

  .parallax-layer {
    transform: none !important;
  }
}

/* RESPONSIVE */

@media (max-width: 880px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .hero-portrait {
    justify-content: flex-start;
    margin-top: var(--space-8);
  }

  .two-column,
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: rgba(246, 246, 247, 0.98);
    padding: var(--space-5);
    gap: var(--space-4);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-block;
  }

  .scroll-gallery-wrapper {
    padding-inline: var(--space-3);
  }

  .gallery-item {
    width: 70vw;
  }
}
