/* ---------- Hero ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  /* dvh tracks the live viewport, which sounds right but isn't: as the address bar animates
     in/out on scroll, a dvh-sized box keeps resizing frame-by-frame right along with it, and
     since the background img inside uses object-fit: cover, re-covering a constantly-changing
     box reads as the image continuously zooming in/out, with visible jitter right at the moment
     scroll direction flips and the bar starts animating. svh is pinned to the SMALLEST possible
     viewport (bar always assumed visible), so the box never resizes during scroll — a little
     shorter when the bar happens to be hidden, but perfectly stable, which is what matters here. */
  height: 100svh;
  min-height: 560px;
  display: flex;
  overflow: hidden;
}

.hero__media {
  position: fixed;
  inset: 0;
  z-index: -1;
}

@media (max-width: 860px) {
  /* position: fixed here was meant as a parallax effect (the image stays put while the hero
     content scrolls over it), but on mobile it's sized straight off the live visual viewport —
     as the browser's address bar animates in/out while scrolling, that viewport resizes under
     it, reading as the background suddenly "zooming" in a small jump. Scoping it to the hero
     section instead (position: absolute, same inset: 0) keeps the same framing on load but
     scrolls away normally with the page, so it's no longer tied to that live viewport size. */
  .hero__media {
    position: absolute;
  }
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  filter: blur(var(--hero-blur, 0px));
  transform: scale(1.03); /* hides the blurred edge the filter would otherwise expose at max scroll blur */
}

.hero__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--hero-darken, 0.35));
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  padding-bottom: var(--space-8);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero__headline {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero__eyebrow {
  color: var(--color-gold-light);
  font-size: var(--font-size-md);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: var(--space-3);
  display: block;
}

.hero__heading {
  font-size: clamp(1.4rem, 4.5vw, var(--font-size-4xl));
  color: var(--color-white);
}

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

.hero__actions .btn--outline-light {
  padding: 0;
}

.hero__actions .btn--primary {
  position: relative;
  z-index: 0;
  overflow: hidden;
  font-size: var(--font-size-base);
}

.hero__actions .btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--btn-primary-bg-hover);
  transform: scaleX(0);
  transform-origin: left;
}

.hero__actions .btn--primary:hover::before {
  transform: scaleX(1);
  transition: transform var(--transition-base);
}

.hero__actions .btn--primary:hover {
  background: var(--btn-primary-bg);
}

@media (max-width: 720px) {
  .hero__content { padding-bottom: var(--space-6); }
}

/* ---------- Our Work (home highlight) ---------- */
#our-work {
  min-height: auto;
  padding-bottom: var(--space-4);
}

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

.our-work .section__header {
  margin-bottom: 0;
  align-items: flex-end;
}

.work-carousel {
  width: 100%;
  overflow: hidden;
}

.work-carousel__track {
  display: flex;
  width: 150%; /* 6 items total, 4 visible: 6/4 * 100% */
  transition: transform 550ms cubic-bezier(0.4, 0, 0.2, 1);
}

.work-carousel__track.is-shifted {
  transform: translateX(-33.3334%); /* shift by 2 of 6 items, independent of track width */
}

@media (max-width: 1000px) {
  .work-carousel__track { width: 200%; } /* 3 visible: 6/3 * 100% */
}

.work-photo {
  position: relative;
  display: block;
  flex: 0 0 16.6667%; /* 1 of 6 items */
  cursor: pointer;
}

@media (max-width: 640px) {
  /* The click-to-shift transform model has no touch equivalent — the "prev" arrow only ever
     reveals on :hover, which never fires on touch, so once shifted forward there's no way back.
     Swap to native horizontal scroll-snap so a swipe moves through all 6 photos either way.
     (.work-photo's own flex-basis override here must come after its unconditional rule above —
     same specificity, so source order decides the cascade.) */
  .work-carousel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .work-carousel::-webkit-scrollbar {
    display: none;
  }
  .work-carousel__track {
    width: auto;
    transform: none !important;
  }
  .work-photo {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  /* The shift-based prev/next overlays only make sense for the desktop click-to-shift
     model above — on the mobile scroll-snap strip every tile should read as a plain
     photo link except "See All Projects", which stays as-is. */
  .work-photo:nth-child(3) .work-photo__prev {
    display: none;
  }
  .work-photo:nth-child(4) .work-photo__frame::before {
    background: rgba(0, 0, 0, 0);
  }
  .work-photo:nth-child(4) .work-photo__label {
    display: none;
  }
}

.work-photo__frame {
  display: block; /* must be block (not the default inline) — a <span> wrapping a block-level <img> otherwise breaks aspect-ratio sizing and absolute-positioned children like the dim overlay/arrow */
  position: relative;
  aspect-ratio: var(--work-photo-ratio);
  margin-right: 4px;
  overflow: hidden;
  background: var(--color-border);
}

.work-photo__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0, 0.2, 1);
}

.work-photo:hover .work-photo__frame img {
  transform: scale(1.05);
}

.work-photo__caption {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.work-photo__caption-title {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 75%;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-button);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-white);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  transform-origin: top left;
  transition: transform var(--transition-base);
}

.work-photo__caption-category {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-button);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: right;
  color: var(--color-white-80);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  transform-origin: bottom right;
  transition: transform var(--transition-base);
}

.work-photo:hover .work-photo__caption-title,
.work-photo:hover .work-photo__caption-category {
  transform: scale(1.15);
}

.work-photo__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0);
  transition: background-color var(--transition-base);
}

.work-photo--dim .work-photo__frame::before {
  background: rgba(0, 0, 0, 0.55);
}

.work-photo__label {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  color: var(--color-white);
  text-align: center;
  pointer-events: none;
}

.work-photo__label svg {
  width: 30px;
  height: 30px;
}

.work-photo__label--text {
  font-family: var(--font-button);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Once shifted, the former "next" slot (4th item) settles into a plain, undimmed photo */
.work-carousel__track.is-shifted .work-photo:nth-child(4) .work-photo__frame::before {
  background: rgba(0, 0, 0, 0);
}

.work-carousel__track.is-shifted .work-photo:nth-child(4) .work-photo__label {
  opacity: 0;
}

/* "Back" arrow on the 3rd photo — only reachable once shifted (viewing 3-6), and only on hover */
.work-photo__prev {
  opacity: 0;
  transition: opacity var(--transition-base);
}

.work-carousel__track:not(.is-shifted) .work-photo:nth-child(3) .work-photo__prev {
  display: none;
}

.work-carousel__track.is-shifted .work-photo:nth-child(3):hover .work-photo__frame::before {
  background: rgba(0, 0, 0, 0.55);
}

.work-carousel__track.is-shifted .work-photo:nth-child(3):hover .work-photo__prev {
  opacity: 1;
  pointer-events: auto;
}

.our-work > .container {
  /* .container centers itself with auto margins, which disables flexbox's
     stretch alignment inside the column-flex .our-work — without this it
     shrinks to its content width instead of spanning full width, which is
     why flex-start/flex-end below weren't reaching the true left/right edges */
  width: 100%;
}

/* ---------- Getting Started ---------- */
#getting-started .section__header {
  align-items: flex-end;
}

#getting-started {
  padding-bottom: var(--space-7);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.process-card {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.process-card__label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-gold);
  font-family: var(--font-header);
  font-size: var(--font-size-lg);
  transition: color var(--transition-fast);
}

.process-card__media {
  position: relative;
  display: block;
  height: var(--media-height-lg);
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-border);
}

.process-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  transition: background-color 600ms ease;
}

.process-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0 solid var(--color-gold);
  border-radius: inherit;
  transition: border-width var(--transition-fast);
  pointer-events: none;
}

.process-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}

.process-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  color: var(--color-white);
  transform: translate(-50%, -50%);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.process-card__play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.process-card__body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: var(--space-3);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  text-align: center;
  opacity: 0;
  transition: opacity 400ms ease;
}

.process-card:is(:hover, :focus-visible, .is-active) .process-card__label {
  color: var(--color-green-dark);
}

.process-card:is(:hover, :focus-visible, .is-active) .process-card__media::after {
  border-width: 3px;
}

.process-card:is(:hover, :focus-visible) .process-card__media::before {
  background: rgba(0, 0, 0, 0.65);
}

.process-card:is(:hover, :focus-visible) .process-card__media img {
  transform: scale(1.04);
}

.process-card:is(:hover, :focus-visible) .process-card__play {
  background: var(--color-gold);
  border-color: var(--color-gold);
}

.process-card:is(:hover, :focus-visible) .process-card__body {
  opacity: 1;
}

@media (max-width: 1000px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .process-card__media { height: var(--media-height-sm); }
  .process-card__media img { object-position: center 20%; }
}

@media (max-width: 560px) {
  .process-grid { grid-template-columns: 1fr; }
}

.process-dialog {
  width: min(1100px, calc(100vw - 32px), calc((100vh - 120px) * 16 / 9));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-ink);
  color: var(--color-white);
}

.process-dialog::backdrop {
  background: rgba(26, 26, 26, 0.8);
}

.process-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
}

.process-dialog__title {
  margin: 0;
  color: var(--color-white);
  font-size: var(--font-size-md);
}

.process-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: inherit;
}

.process-dialog__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.process-dialog__close svg {
  width: 18px;
  height: 18px;
}

.process-dialog__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.process-dialog__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.process-dialog__soon {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: var(--font-size-md);
}

.process-dialog.is-missing .process-dialog__video { visibility: hidden; }
.process-dialog.is-missing .process-dialog__soon { display: flex; }

/* ---------- Who We Are (sticky text / scrolling images) ---------- */
#who-we-are {
  padding-bottom: var(--space-7);
}

.who-we-are {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: var(--space-6);
  align-items: start;
}

.who-we-are__copy {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-4));
}

.who-we-are__lede {
  margin-top: var(--space-3);
  color: var(--color-ink-92);
  max-width: 440px;
}

.who-we-are__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.who-we-are__gallery figure {
  position: relative;
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.who-we-are__gallery img {
  width: 100%;
  height: var(--media-height-md);
  object-fit: cover;
}

.who-we-are__rating {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  background: rgba(26, 26, 26, 0.72);
  opacity: 0;
  transition: opacity 400ms ease-in-out;
  pointer-events: none;
}

.who-we-are__gallery figure:hover .who-we-are__rating {
  opacity: 1;
}

.who-we-are__stars {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.who-we-are__rating .founder__star {
  width: 20px;
  height: 20px;
}

.who-we-are__quote {
  margin: 0;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.6;
}

@media (max-width: 860px) {
  .who-we-are {
    grid-template-columns: 1fr;
  }
  .who-we-are__copy {
    position: static;
  }
  .who-we-are__gallery img {
    height: var(--media-height-sm);
  }
}

/* ---------- Section focus effect (js/section-focus.js) ---------- */
[data-focus-section] {
  position: relative;
  isolation: isolate;
}

/* Seals the sub-pixel seam between stacked sections, which can otherwise show the fixed hero photo
   as a hairline at fractional display scales (e.g. Windows 125%). */
[data-focus-section] + [data-focus-section] {
  box-shadow: 0 -1px 0 var(--color-bg);
}

[data-focus-section]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--color-bg);
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

[data-focus-section].is-dimmed::after {
  opacity: 0.75; /* veil strength: 0 = none, 1 = fully hidden */
}

/* ---------- Founder ---------- */
.founder {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--space-6);
  align-items: center;
}

.founder__photo {
  border-radius: 32px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 3px solid var(--color-gold);
}

.founder__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.founder__star {
  width: 16px;
  height: 16px;
  background-color: var(--color-gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.founder__body {
  margin-top: var(--space-3);
}

@media (max-width: 860px) {
  .founder {
    grid-template-columns: 1fr;
  }
  .founder__photo {
    max-width: 360px;
  }
}

/* ---------- Team carousel (Founder + departments) ---------- */
.team-carousel {
  min-height: auto;
  padding: calc(var(--space-5) + 8px) 0;
  background: rgba(8, 22, 3, 0.75);
  color: var(--color-white);
}

.team-carousel .section__eyebrow {
  color: var(--color-gold-light);
  font-family: var(--font-header);
  font-size: var(--font-size-base);
}

.team-carousel .founder__body {
  color: var(--color-white);
}

.team-carousel .founder {
  grid-template-columns: 280px 1fr;
}

/* This mobile override must come after the unconditional ".team-carousel .founder" rule above —
   both have equal specificity, so source order decides, and it previously lost the cascade,
   leaving the 280px photo column squeezed onto narrow screens with the text overlapping it. */
@media (max-width: 860px) {
  .team-carousel .founder {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  /* Shrink the photo (was inheriting the 360px cap meant for the standalone Founder bio
     section above) and trim the section's own padding so the whole slide reads in one
     mobile viewport instead of needing a scroll per slide. */
  .team-carousel .founder__photo {
    max-width: 200px;
    margin: 0 auto;
  }
  .team-carousel {
    padding: var(--space-4) 0;
    /* This section's background is a 75%-opacity tint, deliberately translucent so the hero's
       fixed photo bleeds through behind it for a richer, darker look. .hero__media switches to
       position: absolute on mobile (scoped to the hero section, to stop it resizing/jittering
       with the browser chrome on scroll) so that photo no longer extends behind this section.
       Give the section its own copy of the same photo instead — same tint-over-photo look as
       desktop, but as a normal (non-fixed) section background, so it scrolls with the page and
       can't reintroduce that jitter. */
    background-color: var(--color-green-dark);
    background-image: linear-gradient(rgba(8, 22, 3, 0.75), rgba(8, 22, 3, 0.75)), url('../assets/img-web/projects/RedwoodProject/002.jpg');
    background-size: cover;
    background-position: center 10%;
    background-attachment: scroll;
  }
}

.team-carousel__inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.team-carousel__viewport {
  width: 100%;
  overflow: hidden;
}

.team-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-white-60);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.team-carousel__arrow svg {
  width: 18px;
  height: 18px;
}

.team-carousel__arrow:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-ink);
}

.team-carousel__arrow--prev {
  left: -112px;
}

.team-carousel__arrow--next {
  right: -112px;
}

@media (max-width: 1000px) {
  .team-carousel__arrow--prev {
    left: 0;
  }
  .team-carousel__arrow--next {
    right: 0;
  }
}

.team-carousel__track {
  display: flex;
}

.team-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.team-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-white-60);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.team-carousel__dot:hover {
  background: var(--color-white-80);
}

.team-carousel__dot.is-active {
  background: var(--color-gold);
  transform: scale(1.3);
}
