/* =========================================================
   hero
   ========================================================= */

.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  background: var(--color-surface);
}
.hero-media {
  position: relative;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background: var(--color-surface);
  overflow: hidden;
}
#hero-reel {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-headline {
  position: absolute;
  bottom: 10%;
  left: 0;
  right: 0;
  font-size: 6.5vh;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}
.hero-scroll {
  position: absolute;
  bottom: 32px;
  right: 40px;
  font-size: 1.3vh;
  color: var(--color-text);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* =========================================================
   subheadline
   ========================================================= */

.subheadline {
  height: 32vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
}
.sub-leadin {
  font-size: 2.0vh;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text);
  line-height: 1.4;
}
.sub-payoff {
  font-size: 6.6vh;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text);
  max-width: 24ch;
}
.sub-payoff .accent {
  color: var(--color-accent);
}

/* =========================================================
   work
   ========================================================= */

.work {
  display: flex;
  flex-direction: column;
  min-height: 75vh;
}

/* work is the only section that pads its content wrapper —
   other sections rely on fixed heights + flex centering, but
   work is content-driven so it needs explicit breathing room. */
.work .section-content-wrapper {
  padding-top: 6vh;
  padding-bottom: 6vh;
}

/* three independent flex columns — no row enforcement */
.work-cols {
  display: flex;
  align-items: flex-start;
  align-self: stretch;
  gap: 36px;
  width: 100%;
}

.work-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-card {
  display: flex;
  flex-direction: column;
}

/*
  .card-media: <img> is in normal document flow (not absolute positioned).
  Its natural dimensions determine the container height.
  Width = 100% of the column. Height = auto from the loaded image.
  <video> overlays absolutely on top.
  When no thumbnail is present, aspect-ratio is applied inline by PHP
  as a placeholder so the empty card is still visible.
*/
.card-media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.card-media img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.card-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2;
}

.card-media video.is-playing {
  opacity: 1;
}

.card-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px 14px 14px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.72));
  pointer-events: none;
  line-height: 1.4;
  z-index: 3;
}

/*
  Client is the primary label (white, normal weight).
  Project title is secondary (same color, reduced opacity — reads as grey).
  Both inline on one line separated by an em dash.
*/
.card-client {
  font-size: 1.5vh;
  font-weight: 400;
  color: var(--color-text);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

.card-sep {
  font-size: 1.5vh;
  font-weight: 300;
  color: var(--color-text);
  opacity: 0.5;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

.card-title {
  font-size: 1.5vh;
  font-weight: 300;
  color: var(--color-text);
  opacity: 0.55;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

@media (max-width: 1199px) {
  .work-cols { gap: 24px; }
  .work-col  { gap: 16px; }
}

@media (max-width: 767px) {
  .work { min-height: auto; }
  /* trim the inherited 6vh content-wrapper padding on phones (also removes
     vh jitter when the address bar grows/shrinks) */
  .work .section-content-wrapper {
    padding-top: 40px;
    padding-bottom: 40px;
  }
  .work-cols {
    flex-direction: column;
    gap: 16px;
  }
  .work-col { gap: 16px; }
  .card-client,
  .card-sep,
  .card-title { font-size: 3.6vw; }

  /* force a controlled aspect ratio on phones — natural ratios produce very
     tall portrait cards. !important overrides the inline aspect-ratio that
     index.php writes for cards without thumbnails. */
  .work-card[data-orientation="horizontal"] .card-media { aspect-ratio: 21 / 9 !important; }
  .work-card[data-orientation="vertical"]   .card-media { aspect-ratio: 3 / 4 !important; }
  .work-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* cap at 4 cards by sort order on mobile. round-robin distributes
     sort-positions 1..4 as col1[0], col2[0], col3[0], col1[1] — so keep
     col1's first 2 and col2/col3's first 1, hide the rest. */
  .work-col:nth-child(1) .work-card:nth-child(n+3),
  .work-col:nth-child(2) .work-card:nth-child(n+2),
  .work-col:nth-child(3) .work-card:nth-child(n+2) {
    display: none;
  }
}

/* =========================================================
   scope
   ========================================================= */

.scope {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.scope .section-content-wrapper {
  justify-content: center;
  align-items: stretch;
  gap: 2vh;
}

.scope-image {
  flex: 0 0 58vh;
  overflow: hidden;
  background-color: var(--color-surface);
  align-self: stretch;
  position: relative;
}

.scope-image .scope-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.scope-image .scope-img.active {
  opacity: 1;
}

.scope-phases {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.scope-phase {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 32px;
  height: 10vh;
  overflow: hidden;
  padding: 2.4vh 0;
  transition: background 0.2s ease;
}

.scope-phase:hover {
  background: rgba(252, 247, 241, 0.04);
}

.scope-phase-num {
  flex: 0 0 40px;
  font-size: 1.1vh;
  font-weight: 300;
  color: var(--color-text);
  opacity: 0.35;
  letter-spacing: 0.06em;
  padding-top: 0.5vh;
  transition: opacity 0.2s ease;
}

.scope-phase:hover .scope-phase-num {
  opacity: 0.65;
}

.scope-phase-name {
  flex: 1;
  font-size: 4.5vh;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--color-text);
}

.scope-phase-desc {
  flex: 0 0 54%;
  font-size: 1.8vh;
  font-weight: 300;
  line-height: 1.65;
  color: var(--color-text);
  text-align: right;
}

/* =========================================================
   metrics
   ========================================================= */

.metrics {
  display: flex;
  flex-direction: column;
  height: 38vh;
}
.metrics-grid {
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 80px;
}
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.metric-number {
  font-size: 14vh;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 1.5vh;
  font-weight: 300;
  color: var(--color-text);
  letter-spacing: 0.08em;
}

/* =========================================================
   the standard
   ========================================================= */

.standard {
  display: flex;
  flex-direction: column;
  height: 75vh;
}
.standard .section-content-wrapper {
  flex-direction: row;
  align-items: center;
  gap: 60px;
}
.standard-text {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.standard-text h2 {
  font-size: 5.4vh;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 18ch;
  color: var(--color-text);
  margin-bottom: 4vh;
}
.standard-text p {
  font-size: 2.0vh;
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1.6vh;
}
.standard-image {
  flex: 1 1 50%;
  height: 60vh;
  background-color: var(--color-surface);
  overflow: hidden;
}
.standard-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.standard-cta {
  display: inline-block;
  margin-top: 16px;
  align-self: flex-start;
  font-size: 1.5vh;
  font-weight: 400;
  color: var(--color-text);
  position: relative;
}
.standard-cta::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background-color: var(--color-accent);
  transition: width 0.25s ease;
}
.standard-cta:hover::after {
  width: 100%;
}

/* =========================================================
   contact
   ========================================================= */

.contact {
  position: relative;
  isolation: isolate;
  height: 75vh;
  display: flex;
  flex-direction: column;
}
.contact::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  pointer-events: none;
  background: url('../assets/images/contact_background.jpg') center / cover no-repeat;
  z-index: 0;
}
.contact > .section-label-wrapper,
.contact > .section-content-wrapper {
  position: relative;
  z-index: 2;
}
.contact-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  align-self: stretch;
}

.contact-display h2 {
  font-size: 8vh;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-text);
  margin-bottom: 32px;
}
.contact-email {
  display: inline-block;
  font-size: 2.8vh;
  font-weight: 300;
  color: var(--color-text);
  position: relative;
}
.contact-email::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background-color: var(--color-accent);
  transition: width 0.25s ease;
}
.contact-email:hover::after {
  width: 100%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.contact-form .field input,
.contact-form .field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-text);
  padding: 12px 0;
  font-size: 1.5vh;
  font-weight: 400;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}
.contact-form .field textarea {
  min-height: 110px;
}
.contact-form .field input:focus,
.contact-form .field textarea:focus {
  border-bottom-color: var(--color-text);
}

.contact-submit {
  width: 100%;
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 1.5vh;
  font-weight: 500;
  padding: 16px 0;
  margin-top: 8px;
  transition: filter 0.2s ease;
}
.contact-submit:hover {
  filter: brightness(1.12);
}

.contact-error {
  font-size: 1.5vh;
  color: var(--color-text);
  min-height: 1em;
}

.contact-success {
  grid-column: -2 / -1;
  font-size: 2.6vh;
  font-weight: 300;
  color: var(--color-text);
}
.contact-success[hidden] { display: none; }

/* =========================================================
   footer
   ========================================================= */

.footer {
  color: var(--color-text);
  display: flex;
  flex-direction: column;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding: 32px 0;
  align-self: stretch;
}
.footer-col h4 {
  font-size: 1.3vh;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 20px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 1.2vh;
  font-weight: 300;
  color: var(--color-text);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.footer-col a:hover {
  opacity: 1;
}
.footer-bottom {
  border-top: 1px solid var(--color-rule);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2vh;
  font-weight: 300;
  color: var(--color-text);
  align-self: stretch;
}
.footer-socials {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}
.footer-socials a:hover {
  opacity: 0.7;
}
.footer-socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* =========================================================
   breakpoints
   ========================================================= */

@media (max-width: 1199px) {
  .scope-image { flex: 0 0 46vh; }

  .metrics-grid { gap: 56px; }

  .contact-inner { grid-template-columns: 1fr; gap: 56px; }

  .footer-columns { gap: 32px; }
}

@media (max-width: 767px) {
  /* hero — keep 100vh (the one intentional vh on mobile, fills viewport) */
  .hero-headline {
    left: 0;
    right: 0;
    bottom: 14%;
    white-space: normal;
    font-size: 9.5vw;
  }
  .hero-scroll { right: 24px; bottom: 24px; font-size: 3vw; }

  /* subheadline — full mobile pass (zero overrides existed) */
  .subheadline {
    height: auto;
    min-height: 70vw;
  }
  .sub-leadin { font-size: 3.5vw; }
  .sub-payoff { font-size: 9vw; max-width: none; }

  /* scope */
  .scope {
    height: auto;
    min-height: 170vw;
  }
  .scope .section-content-wrapper {
    gap: 4vw;
    padding-top: 6vw;
  }
  .scope-image {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
  }
  .scope-phase {
    flex-direction: column;
    gap: 8px;
    padding: 6vw 0;
    height: auto;
    overflow: visible;
  }
  .scope-phase-num  { font-size: 2.8vw; opacity: 0.35; padding-top: 0; }
  .scope-phase-name { font-size: 9vw; }
  .scope-phase-desc { font-size: 3.8vw; text-align: left; flex: 0 0 auto; }

  /* metrics */
  .metrics {
    height: auto;
    min-height: 145vw;
  }
  .metrics-grid {
    flex-direction: column;
    align-items: center;
    gap: 10vw;
  }
  .metric-number { font-size: 20vw; }
  .metric-label  { font-size: 3vw; }

  /* the standard — image restored as a wide cinematic banner above the text.
     breathing room comes from min-height + content-wrapper padding (the
     documented exception, same pattern as .work .section-content-wrapper) */
  .standard {
    height: auto;
    min-height: 180vw;
  }
  .standard .section-content-wrapper {
    flex-direction: column;
    gap: 8vw;
    padding-top: 8vw;
    padding-bottom: 8vw;
  }
  .standard-image {
    display: block;
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 21 / 9;
    overflow: hidden;
  }
  .standard-text  { flex: 1 1 auto; }
  .standard-text h2 {
    font-size: 8vw;
    max-width: none;
    margin-bottom: 6vw;
  }
  .standard-text p  { font-size: 4vw; margin-bottom: 3vw; }
  .standard-cta    { font-size: 4vw; }

  /* contact — bigger form touch targets, no border-radius */
  .contact {
    height: auto;
    min-height: 200vw;
  }
  .contact-inner { gap: 10vw; }
  .contact-display h2 {
    font-size: 10vw;
    margin-bottom: 8vw;
  }
  .contact-email { font-size: 5vw; }
  .contact-form  { gap: 6vw; }
  .contact-form .field input,
  .contact-form .field textarea {
    font-size: 4vw;
    padding: 16px 0;
  }
  .contact-submit {
    font-size: 4vw;
    padding: 18px 0;
  }
  .contact-error   { font-size: 3.5vw; }
  .contact-success { font-size: 5.5vw; }

  /* footer */
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
    padding: 60px 0;
  }
  .footer-col h4 { font-size: 2.8vw; margin-bottom: 4vw; }
  .footer-col a  { font-size: 3.5vw; overflow-wrap: break-word; }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    font-size: 3vw;
  }
}

/* small-phone polish — cuts approved by the user */
@media (max-width: 380px) {
  .footer-columns { grid-template-columns: 1fr; }
  .scope-phase-desc { display: none; }
}
