:root {
  --ink: #070914;
  --night: #0b1024;
  --night-soft: #121833;
  --violet: #51406f;
  --amber: #f0b15d;
  --amber-soft: #ffd995;
  --paper: #f7f1e6;
  --paper-muted: rgba(247, 241, 230, 0.68);
  --line: rgba(247, 241, 230, 0.18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  color: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(240, 177, 93, 0.12), transparent 22rem),
    linear-gradient(180deg, #050712 0%, #0b1024 48%, #090a12 100%);
  color: var(--paper);
  font-family: var(--sans);
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.frame-sequence-shell {
  position: relative;
  height: 500svh;
  min-height: 2800px;
  background: #050711;
  --brand-opacity: 0.72;
}

.sticky-frame-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: #050711;
}

.frame-sequence-canvas,
.frame-sequence-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.frame-sequence-canvas {
  display: block;
}

.frame-sequence-poster {
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}

.no-js .frame-sequence-poster,
.frame-sequence-shell.is-reduced-motion .frame-sequence-poster,
.frame-sequence-shell.is-loading .frame-sequence-poster {
  opacity: 1;
}

.frame-sequence-shell.is-reduced-motion .frame-sequence-canvas,
.no-js .frame-sequence-canvas {
  display: none;
}

.cinematic-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.34)),
    linear-gradient(
      to bottom,
      rgba(5, 8, 16, 0.36),
      rgba(5, 8, 16, 0.12) 40%,
      rgba(5, 8, 16, 0.62)
    ),
    radial-gradient(circle at 60% 28%, rgba(255, 190, 90, 0.08), transparent 34%),
    radial-gradient(circle at center, transparent 36%, rgba(0, 0, 0, 0.34) 100%);
  pointer-events: none;
}

.cinematic-vignette {
  position: absolute;
  inset: -2px;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(2, 3, 9, 0.44) 100%),
    linear-gradient(180deg, rgba(2, 3, 9, 0.2), transparent 34%, rgba(2, 3, 9, 0.48));
  pointer-events: none;
}

.hero-wordmark {
  position: absolute;
  top: clamp(22px, 4vh, 48px);
  left: clamp(24px, 5vw, 72px);
  z-index: 4;
  opacity: var(--brand-opacity);
}

.hero-logo-img {
  display: block;
  height: clamp(38px, 4.5vh, 48px);
  width: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.timeline-overlay {
  position: absolute;
  left: clamp(24px, 7vw, 120px);
  bottom: clamp(96px, 16vh, 180px);
  z-index: 4;
  width: min(820px, calc(100vw - 48px));
  color: rgba(255, 250, 238, 0.94);
  text-align: left;
  transform: translate3d(0, 0, 0);
  isolation: isolate;
}

.timeline-overlay::before {
  content: "";
  position: absolute;
  inset: -2.5rem -4rem -3rem -3rem;
  z-index: -1;
  background: radial-gradient(ellipse at left, rgba(0, 0, 0, 0.44), transparent 66%);
  filter: blur(24px);
  opacity: var(--copy-scrim-opacity, 0.72);
  pointer-events: none;
}

.timeline-overlay[data-position="center-left"] {
  bottom: clamp(108px, 18vh, 190px);
  width: min(860px, calc(100vw - 48px));
}

.timeline-overlay[data-position="center"] {
  left: 50%;
  bottom: clamp(92px, 15vh, 168px);
  width: min(1040px, calc(100vw - 48px));
  text-align: center;
  transform: translate3d(-50%, 0, 0);
}

.timeline-overlay[data-position="center"]::before {
  inset: -3rem -5rem -3.5rem;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.42), transparent 68%);
}

.timeline-brand,
.section-kicker {
  margin: 0 0 1.15rem;
  color: rgba(255, 217, 149, 0.84);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.timeline-brand {
  opacity: 0.78;
  text-transform: none;
  transform: translate3d(0, calc(var(--brand-y, 0) * 1px), 0);
}

.brand-kicker {
  text-transform: none;
}

.timeline-subline {
  max-width: 520px;
  margin: clamp(1rem, 2.5vh, 1.5rem) 0 0;
  color: rgba(255, 250, 238, 0.68);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  opacity: var(--subline-opacity, 0);
  transform: translate3d(0, var(--subline-y, 14px), 0);
  text-wrap: balance;
  text-shadow: 0 16px 38px rgba(0, 0, 0, 0.56);
}

.timeline-overlay[data-position="center"] .timeline-subline {
  margin-right: auto;
  margin-left: auto;
}

.timeline-copy {
  min-height: 1.9em;
  max-width: 820px;
  margin: 0;
  color: rgba(255, 250, 238, 0.94);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 7rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
  opacity: var(--copy-opacity, 1);
  filter: blur(var(--copy-blur, 0px));
  text-shadow: 0 18px 54px rgba(0, 0, 0, 0.62);
  text-wrap: balance;
  transform: translate3d(0, var(--copy-y, 0px), 0);
  will-change: opacity, transform, filter;
}

.timeline-overlay[data-position="center"] .timeline-copy {
  max-width: 1040px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(2.7rem, 5.8vw, 6.8rem);
}

.hero-cta {
  margin-top: clamp(1.4rem, 3vh, 2.2rem);
  opacity: var(--cta-opacity, 0);
  pointer-events: none;
  transform: translate3d(0, var(--cta-y, 14px), 0);
  will-change: opacity, transform;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.frame-sequence-shell[data-cta-visible="true"] .hero-cta {
  pointer-events: auto;
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border: 1px solid rgba(255, 250, 238, 0.32);
  border-radius: 999px;
  background: rgba(255, 250, 238, 0.08);
  color: rgba(255, 250, 238, 0.92);
  backdrop-filter: blur(10px);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.primary-cta:hover,
.primary-cta:focus-visible {
  border-color: rgba(255, 250, 238, 0.58);
  background: rgba(255, 250, 238, 0.16);
  outline: none;
}

.primary-cta--light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.primary-cta--light:hover,
.primary-cta--light:focus-visible {
  background: var(--amber-soft);
  color: var(--ink);
}

.timeline-progress {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: clamp(26px, 5vh, 56px);
  z-index: 4;
  width: min(190px, 34vw);
  height: 1px;
  background: rgba(247, 241, 230, 0.22);
}

.timeline-progress span {
  display: block;
  width: calc(var(--timeline-progress, 0) * 100%);
  height: 100%;
  background: rgba(255, 217, 149, 0.9);
}

.reduced-motion-copy {
  display: none;
}

.no-js .timeline-subline,
.frame-sequence-shell.is-reduced-motion .timeline-subline {
  opacity: 1;
  transform: none;
}

.no-js .hero-cta,
.frame-sequence-shell.is-reduced-motion .hero-cta {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 1920px) {
  .frame-sequence-shell { min-height: 3200px; }
  .timeline-copy, .timeline-overlay[data-position="center"] .timeline-copy {
    font-size: clamp(4rem, 8vw, 9rem);
  }
}

@media (max-width: 1024px) {
  .frame-sequence-shell {
    height: 450svh;
    min-height: 2300px;
  }

  .timeline-overlay {
    bottom: clamp(86px, 14vh, 150px);
  }
}

@media (max-width: 768px) {
  .hero-wordmark {
    left: clamp(16px, 4vw, 40px);
  }
  .timeline-overlay {
    left: clamp(16px, 4vw, 40px);
    width: min(600px, calc(100vw - 32px));
  }
}

@media (max-width: 640px) {
  .frame-sequence-shell {
    height: 350svh;
    min-height: 1780px;
  }

  .sticky-frame-stage {
    min-height: 620px;
  }

  .cinematic-overlay {
    background:
      linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.34)),
      linear-gradient(
        to bottom,
        rgba(5, 8, 16, 0.34),
        rgba(5, 8, 16, 0.08) 38%,
        rgba(5, 8, 16, 0.72)
      ),
      radial-gradient(circle at 58% 30%, rgba(255, 190, 90, 0.08), transparent 34%),
      radial-gradient(circle at center, transparent 34%, rgba(0, 0, 0, 0.34) 100%);
  }

  .timeline-overlay {
    left: 24px;
    right: 24px;
    bottom: 96px;
    width: auto;
    text-align: left;
    transform: none;
  }

  .timeline-overlay[data-position="center"],
  .timeline-overlay[data-position="center-left"] {
    left: 24px;
    right: 24px;
    bottom: 96px;
    width: auto;
    text-align: left;
    transform: none;
  }

  .timeline-overlay::before,
  .timeline-overlay[data-position="center"]::before {
    inset: -2rem -1.4rem -2.6rem;
    background: radial-gradient(ellipse at left, rgba(0, 0, 0, 0.52), transparent 68%);
    filter: blur(22px);
  }

  .timeline-subline {
    max-width: 20rem;
    margin-left: 0;
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .timeline-copy,
  .timeline-overlay[data-position="center"] .timeline-copy {
    min-height: 3.7em;
    max-width: 100%;
    margin-left: 0;
    font-size: clamp(2.2rem, 11.4vw, 3.85rem);
    line-height: 0.98;
  }

  .timeline-progress {
    left: 20px;
    right: auto;
    bottom: 22px;
    width: 150px;
  }

}

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

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

  .frame-sequence-shell {
    height: auto;
    min-height: 100svh;
  }

  .sticky-frame-stage {
    position: relative;
    min-height: 100svh;
  }

  .frame-sequence-poster {
    opacity: 1;
  }

  .frame-sequence-canvas,
  .timeline-progress {
    display: none;
  }

  .timeline-copy {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .reduced-motion-copy {
    display: none;
  }
}

/* --- What We Do & Portfolio Styles --- */

.nav-menu {
  position: absolute;
  top: clamp(22px, 4vh, 48px);
  right: clamp(24px, 5vw, 72px);
  z-index: 5;
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-link {
  background: none;
  border: none;
  color: rgba(255, 250, 238, 0.92);
  opacity: var(--brand-opacity, 0.72);
  font-family: var(--sans);
  font-size: clamp(0.8rem, 1.1vw, 0.9rem);
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0;
  position: relative;
  transition: opacity 250ms ease, color 250ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--amber);
  transition: width 250ms ease, left 250ms ease;
}

.nav-link:hover {
  color: var(--paper);
  opacity: 1;
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

.nav-separator {
  color: rgba(255, 250, 238, 0.24);
  font-family: var(--sans);
  font-size: 0.8rem;
  user-select: none;
}

.agency-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.25, 1, 0.5, 1);
}

.agency-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 11, 0.88);
  backdrop-filter: blur(20px);
}

.overlay-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(18, 24, 51, 0.45);
  border: 1px solid rgba(247, 241, 230, 0.08);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transform: translate3d(0, 30px, 0) scale(0.97);
  transition: transform 450ms cubic-bezier(0.25, 1, 0.5, 1);
}

.agency-overlay.is-active .overlay-container {
  transform: translate3d(0, 0, 0) scale(1);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid rgba(247, 241, 230, 0.08);
}

.overlay-tabs {
  display: flex;
  gap: 2rem;
}

.tab-button {
  background: none;
  border: none;
  color: var(--paper-muted);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: color 300ms ease;
}

.tab-button::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
}

.tab-button.is-active {
  color: var(--paper);
}

.tab-button.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.tab-button:hover {
  color: var(--paper);
}

.overlay-close {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--paper-muted);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 300ms ease;
}

.overlay-close:hover {
  color: var(--amber);
}

.overlay-close:hover .close-icon {
  transform: rotate(90deg);
}

.close-icon {
  transition: transform 400ms cubic-bezier(0.25, 1, 0.5, 1);
}

.overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem;
  -webkit-overflow-scrolling: touch;
}

.overlay-content::-webkit-scrollbar {
  width: 6px;
}

.overlay-content::-webkit-scrollbar-track {
  background: transparent;
}

.overlay-content::-webkit-scrollbar-thumb {
  background: rgba(247, 241, 230, 0.15);
  border-radius: 99px;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 241, 230, 0.3);
}

.overlay-panel {
  animation: overlayFadeIn 400ms ease forwards;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    transform: translate3d(0, 15px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.panel-heading {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin: 0 0 0.5rem 0;
  color: var(--paper);
  font-weight: 400;
}

.panel-subheading {
  font-family: var(--sans);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--paper-muted);
  margin: 0 0 2.5rem 0;
  max-width: 700px;
  line-height: 1.5;
}

.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.capability-card {
  position: relative;
  padding: 2rem;
  background: rgba(247, 241, 230, 0.02);
  border: 1px solid rgba(247, 241, 230, 0.05);
  border-radius: 12px;
  transition: background 300ms ease, border-color 300ms ease, transform 300ms ease;
}

.capability-card:hover {
  background: rgba(247, 241, 230, 0.04);
  border-color: rgba(240, 177, 93, 0.2);
  transform: translate3d(0, -4px, 0);
}

.card-num {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--amber);
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--paper);
  margin: 0 0 0.75rem 0;
}

.card-desc {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--paper-muted);
  margin: 0;
  line-height: 1.6;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.portfolio-card {
  padding: 1.75rem;
  background: rgba(247, 241, 230, 0.02);
  border: 1px solid rgba(247, 241, 230, 0.05);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  transition: background 300ms ease, border-color 300ms ease, transform 300ms ease;
}

.portfolio-card:hover {
  background: rgba(247, 241, 230, 0.04);
  border-color: rgba(240, 177, 93, 0.2);
  transform: translate3d(0, -4px, 0);
}

.portfolio-card .card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.movie-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--paper);
  margin: 0;
}

.movie-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-soft);
  font-weight: 500;
}

.movie-role {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--paper-muted);
  margin: 1.25rem 0 0 0;
  line-height: 1.4;
}

body.overlay-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .overlay-container {
    width: 95%;
    height: 85vh;
  }
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .overlay-container {
    height: 90vh;
  }
  .overlay-header {
    padding: 1.2rem 1.8rem;
  }
  .overlay-content {
    padding: 1.8rem;
  }
}

@media (max-width: 640px) {
  .nav-menu {
    top: clamp(16px, 3vh, 32px);
    right: clamp(16px, 4vw, 48px);
    gap: 0.8rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  .overlay-container {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    border: none;
  }

  .overlay-header {
    padding: 1.2rem 1.5rem;
  }

  .overlay-tabs {
    gap: 1.2rem;
  }

  .tab-button {
    font-size: 1.2rem;
  }

  .overlay-content {
    padding: 1.5rem;
  }

  .panel-subheading {
    margin-bottom: 1.5rem;
  }

  .capabilities-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

