:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #10110f;
  --text: #f3f0e8;
  --muted: #a9aaa2;
  --quiet: #70736c;
  --line: rgba(243, 240, 232, 0.16);
  --accent: #9fb2a6;
  --accent-warm: #d1b273;
  --danger: #e38d7b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  text-rendering: geometricPrecision;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 20px;
  color: var(--text);
  background: rgba(5, 5, 5, 0.36);
  border-bottom: 1px solid rgba(243, 240, 232, 0.08);
  backdrop-filter: blur(18px);
}

.site-brand {
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.site-nav a {
  transition: color 180ms ease;
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 92svh;
  align-items: flex-end;
  overflow: hidden;
  padding: 112px 20px 86px;
}

.hero-visual,
.hero-poster,
.hero-video,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-visual {
  z-index: -2;
  background: #0b0b0b;
}

.hero-poster,
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-poster {
  opacity: 1;
}

.hero-video {
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-video.is-ready {
  opacity: 1;
}

.hero-shade {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.76) 44%, rgba(5, 5, 5, 0.2) 76%, rgba(5, 5, 5, 0.08)),
    linear-gradient(0deg, rgba(5, 5, 5, 0.9), transparent 42%, rgba(5, 5, 5, 0.3));
}

.hero-content {
  width: min(100%, 1060px);
  margin: 0 auto;
}

.eyebrow,
.section-label,
.project-category,
.modal-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
}

.hero h1 {
  margin: 8px 0 4px;
  font-size: 5.4rem;
  line-height: 0.86;
  font-weight: 760;
}

.hero-headline {
  max-width: 760px;
  margin: 28px 0 0;
  font-size: 1.5rem;
  line-height: 1.08;
  font-weight: 620;
}

.hero-description {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-media-note {
  display: inline-flex;
  margin: 22px 0 0;
  padding: 7px 10px;
  color: var(--muted);
  border: 1px solid rgba(243, 240, 232, 0.22);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.28);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  right: 20px;
  bottom: 28px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.28);
  font-size: 0.65rem;
  text-transform: uppercase;
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  color: var(--text);
  border-color: rgba(243, 240, 232, 0.44);
  transform: translateY(2px);
}

.portfolio-section,
.about-section,
.contact-section {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 72px 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.about-copy h2,
.contact-section h2,
.modal-meta h2,
.legal-content h1 {
  margin: 0;
  font-weight: 650;
}

.section-heading h2 {
  font-size: 1.6rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.project {
  position: relative;
  grid-column: span 12;
  min-width: 0;
}

.project[data-format="wide"] {
  grid-column: span 12;
}

.project[data-format="cinematic"] {
  grid-column: span 12;
}

.project[data-format="vertical"],
.project[data-format="square"] {
  grid-column: span 12;
}

.project-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  text-align: left;
  background: var(--bg-soft);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.project-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(159, 178, 166, 0.12), rgba(209, 178, 115, 0.12)),
    #11120f;
}

.project[data-format="cinematic"] .project-media {
  aspect-ratio: 21 / 9;
}

.project[data-format="vertical"] .project-media {
  aspect-ratio: 9 / 16;
}

.project[data-format="square"] .project-media {
  aspect-ratio: 1 / 1;
}

.project-media img,
.project-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 240ms ease, transform 420ms ease;
}

.project-preview {
  opacity: 0;
}

.project-preview.is-playing {
  opacity: 1;
}

.project-trigger:hover img {
  transform: scale(1.025);
}

.project-trigger::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 46%, rgba(5, 5, 5, 0.82));
  pointer-events: none;
}

.play-indicator {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(243, 240, 232, 0.5);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.32);
  transform: translate(-50%, -50%);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  backdrop-filter: blur(10px);
}

.play-indicator::before {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid var(--text);
  content: "";
}

.project-trigger:hover .play-indicator,
.project-trigger:focus-visible .play-indicator {
  border-color: rgba(243, 240, 232, 0.86);
  background: rgba(5, 5, 5, 0.58);
  transform: translate(-50%, -50%) scale(1.04);
}

.project-meta {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 14px;
  left: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.project-title {
  max-width: 68%;
  font-size: 1.08rem;
  font-weight: 650;
  text-align: right;
}

.project.is-missing-poster .project-media::before,
.project.is-missing-video .project-media::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--quiet);
  content: "Media placeholder";
}

.about-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-top: 92px;
}

.about-rule {
  width: 100%;
  height: 1px;
  background: var(--line);
}

.about-copy {
  max-width: 760px;
  margin-left: auto;
}

.about-copy h2 {
  margin-top: 12px;
  font-size: 2rem;
}

.about-text {
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.1rem;
}

.about-text p {
  margin: 0 0 12px;
}

.contact-section {
  padding-top: 84px;
  padding-bottom: 84px;
}

.contact-section h2 {
  max-width: 780px;
  margin-top: 16px;
  font-size: 3.2rem;
  line-height: 1.02;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 34px;
  color: var(--muted);
}

.contact-links a {
  border-bottom: 1px solid rgba(243, 240, 232, 0.28);
  transition: color 180ms ease, border-color 180ms ease;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  color: var(--text);
  border-color: var(--text);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 20px 34px;
  color: var(--quiet);
  border-top: 1px solid rgba(243, 240, 232, 0.09);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 14px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--text);
}

.video-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.video-modal[aria-hidden="true"] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  max-height: calc(100svh - 40px);
  display: grid;
  gap: 14px;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: -14px;
  right: -14px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--text);
  background: rgba(5, 5, 5, 0.82);
  border: 1px solid rgba(243, 240, 232, 0.3);
  border-radius: 999px;
  cursor: pointer;
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.modal-video-shell {
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 6px;
}

.modal-video-shell video {
  width: 100%;
  max-height: calc(100svh - 160px);
  background: #000;
}

.modal-error {
  display: grid;
  min-height: 280px;
  margin: 0;
  place-items: center;
  color: var(--danger);
}

.modal-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  color: var(--muted);
}

.modal-meta h2 {
  color: var(--text);
  font-size: 1.1rem;
}

.legal-page {
  background: var(--bg);
}

.legal-content {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 72px 20px;
  color: var(--muted);
}

.legal-back {
  display: inline-flex;
  margin-bottom: 72px;
  color: var(--text);
  font-weight: 700;
}

.legal-content h1 {
  color: var(--text);
  font-size: 2.4rem;
}

.legal-content a {
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .site-header {
    min-height: 72px;
    padding: 0 34px;
  }

  .hero {
    padding-right: 34px;
    padding-left: 34px;
  }

  .hero h1 {
    font-size: 8.5rem;
  }

  .hero-headline {
    font-size: 2rem;
  }

  .scroll-cue {
    right: 34px;
  }

  .portfolio-section,
  .about-section,
  .contact-section {
    padding-right: 34px;
    padding-left: 34px;
  }

  .project-grid {
    gap: 22px;
  }

  .project[data-format="wide"] {
    grid-column: span 8;
  }

  .project[data-format="cinematic"] {
    grid-column: span 12;
  }

  .project[data-format="vertical"] {
    grid-column: span 4;
  }

  .project[data-format="square"] {
    grid-column: span 4;
  }

  .about-section {
    grid-template-columns: 4fr 8fr;
  }

  .about-rule {
    margin-top: 18px;
  }

  .contact-section h2 {
    font-size: 4.2rem;
  }

  .site-footer {
    padding-right: 34px;
    padding-left: 34px;
  }
}

@media (min-width: 1180px) {
  .hero h1 {
    font-size: 11rem;
  }

  .project[data-index="1"],
  .project[data-index="4"] {
    margin-top: 72px;
  }

  .contact-section h2 {
    font-size: 5rem;
  }
}

@media (max-width: 560px) {
  .site-nav {
    gap: 12px;
    font-size: 0.72rem;
  }

  .hero h1 {
    font-size: 4.4rem;
  }

  .hero-headline {
    font-size: 1.25rem;
  }

  .scroll-cue {
    width: 52px;
    height: 52px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .project-meta {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .project-title {
    max-width: 100%;
    text-align: left;
  }

  .contact-section h2 {
    font-size: 2.5rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
