/*
 * BLUEBERRY GROUP — Shared site styles
 * Global foundations, header, footer and reusable components.
 */

/* Hero */

.hero {
  position: relative;
  width: 100%;
  height: min(900px, 100vh);
  min-height: 720px;
  overflow: hidden;
  background: var(--blueberry-deep)
    url("../../branding-profile/home/projects-section-background.jpg")
    center 42% / cover;
  color: var(--blueberry-white);
}

.hero-video,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-video {
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--blueberry-deep) url("../../branding-profile/home/projects-section-background.jpg") center 42% / cover;
}

.hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 149.78vh);
  height: max(66.76vw, 100vh);
  border: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hero-overlay {
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(var(--blueberry-deep-rgb), 0.34),
    rgba(var(--blueberry-deep-rgb), 0.04) 36%,
    rgba(var(--blueberry-deep-rgb), 0.74)
  );
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: 31%;
  right: 0;
  left: 0;
}

.hero h1 {
  max-width: 1060px;
  margin: 24px 0 0;
  font: 500 var(--blueberry-display-xl) / 0.98 var(--blueberry-font-display);
  letter-spacing: -0.06em;
}

.hero h1 span {
  color: var(--blueberry-aqua);
}

.hero-lower {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 48px;
  left: 0;
}

.hero-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hero-intro p {
  max-width: 520px;
  margin: 0;
  font-size: var(--blueberry-text-body);
  line-height: 1.65;
}

/* Trust strip */

.trust-strip {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--blueberry-line);
  background: var(--blueberry-white);
  padding: 22px 24px;
}

.trust-inner {
  display: grid;
  grid-template-columns: 230px 1fr;
  align-items: center;
  width: min(var(--blueberry-container), 100%);
  margin: auto;
}

.trust-inner > span {
  color: var(--blueberry-navy);
  font-size: var(--blueberry-text-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trust-inner > span > span { display: block; }

.trust-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, var(--blueberry-ink) 6%, var(--blueberry-ink) 94%, transparent);
}

.trust-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: trustRail var(--logo-speed, 60s) linear infinite;
}

.trust-track b {
  min-width: 210px;
  color: var(--blueberry-muted);
  font: 500 var(--blueberry-text-body) var(--blueberry-font-display);
  text-align: center;
}

.trust-track .trust-logo {
  display: flex;
  min-width: calc(var(--logo-size, 120px) + 70px);
  height: calc(var(--logo-size, 120px) * 0.48);
  align-items: center;
  justify-content: center;
}

.trust-track .trust-logo img {
  display: block;
  max-width: var(--logo-size, 120px);
  max-height: calc(var(--logo-size, 120px) * 0.42);
  object-fit: contain;
}

.trust-track i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blueberry-aqua);
}

@keyframes trustRail {
  to {
    transform: translateX(-50%);
  }
}

/* About */

.story {
  padding: var(--blueberry-space-section) 24px;
  overflow: hidden;
  background: var(--blueberry-white);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px 350px;
  grid-template-rows: 215px 370px;
  gap: 0 44px;
  width: min(var(--blueberry-container), 100%);
  margin: auto;
}

.story-heading {
  grid-column: 1 / 3;
}

.story-heading h2 {
  max-width: 720px;
  margin: 18px 0 0;
  font: var(--blueberry-weight-editorial) var(--blueberry-section-title) / var(--blueberry-leading-editorial) var(--blueberry-font-display);
  letter-spacing: -0.055em;
  color: var(--blueberry-navy);
}

.story-heading h2 .story-heading-line {
  display: block;
  color: var(--blueberry-deep);
}

.story-heading h2 .story-heading-line.is-accent {
  color: var(--blueberry-aqua);
}

.story-image {
  overflow: hidden;
  border-radius: var(--blueberry-radius-medium);
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.story-image:hover img {
  transform: scale(1.035);
}

.story-image-tall {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 350px;
  height: 406px;
}

.story-years {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  align-items: flex-end;
  align-self: start;
  gap: 16px;
  height: 316px;
  margin-top: 58px;
}

.story-years strong {
  color: var(--blueberry-navy);
  font: 500 var(--blueberry-display-stat) / 0.72 var(--blueberry-font-display);
  letter-spacing: -0.09em;
}

.story-years small {
  max-width: 82px;
  margin-bottom: 4px;
  font-size: var(--blueberry-text-label);
  font-weight: 600;
  line-height: 1.25;
  color: var(--blueberry-navy);
}

.story-image-low {
  grid-column: 2;
  grid-row: 2;
  width: 270px;
  height: 316px;
  margin-top: 58px;
}

.story-copy {
  grid-column: 3;
  grid-row: 2;
  margin-top: 216px;
  color: var(--blueberry-navy);
  font-size: var(--blueberry-text-meta);
  line-height: 1.7;
}

.story-copy p {
  margin: 0 0 20px;
}

.story-link i { color: inherit; font-style: normal; }

/* Services */

.services,
.projects,
.process,
.feature {
  width: 100%;
  padding-inline: max(24px, calc((100% - var(--blueberry-container)) / 2));
}

.services {
  padding-top: var(--blueberry-space-section);
  padding-bottom: var(--blueberry-space-section);
  background: var(--blueberry-paper);
  color: var(--blueberry-white);
}

.services .badge:not(.eyebrow) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blueberry-deep);
}

.services .section-head h2 {
  color: var(--blueberry-deep);
}

.services .section-head h2 span {
  color: var(--blueberry-aqua);
}

.services .section-head p {
  color: var(--blueberry-muted);
}

/* Projects */

.projects {
  padding-top: var(--blueberry-space-section);
  padding-right: 0;
  padding-bottom: var(--blueberry-space-section);
  padding-left: 0;
  overflow: hidden;
  background: var(--blueberry-white);
}

.projects .section-head {
  width: min(var(--blueberry-container), calc(100% - var(--blueberry-page-gutter)));
}

.projects-grid {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: max-content;
  margin-left: max(24px, calc((100vw - var(--blueberry-container)) / 2));
  animation: projectRail 140s linear infinite;
  will-change: transform;
}

.projects-grid:hover,
.projects-grid:focus-within {
  animation-play-state: paused;
}

.project-card--featured {
  position: relative;
  flex: 0 0 clamp(340px, 30vw, 460px);
}

.projects .project-card--featured figure {
  aspect-ratio: 0.90;
}

@keyframes projectRail {
  to {
    transform: translate3d(calc(var(--project-loop-distance, 0px) * -1), 0, 0);
  }
}

/* Metrics and 3D scroll object */

.stats-showcase {
  position: relative;
  padding-block: 80px;
  overflow: hidden;
  background: var(--blueberry-deep);
}

.stats-showcase .shell {
  width: min(var(--blueberry-container), calc(100% - 48px));
  margin-inline: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 0;
}

.stat {
  min-width: 0;
  padding-inline: 32px;
  border-left: 1px solid rgba(var(--blueberry-white-rgb), 0.2);
}

.stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.stat:last-child {
  padding-right: 0;
}

.stat strong {
  display: block;
  color: var(--blueberry-white);
  font: 600 var(--blueberry-display-sm) var(--blueberry-font-display);
  letter-spacing: -0.05em;
}

.stat-line {
  display: none;
}

.stat h3 {
  margin: 14px 0 8px;
  font: 600 var(--blueberry-text-body) var(--blueberry-font-display);
  color: var(--blueberry-aqua);
}

.stat p {
  max-width: 210px;
  margin: 0;
  color: var(--blueberry-on-dark-muted);
  font-size: var(--blueberry-text-label);
  line-height: 1.55;
}

.stats-watermark {
  display: none;
}

.stats-render {
  display: none;
}

.stats-showcase.on .stats-render {
  opacity: 1;
}

/* Process */

.process {
  position: relative;
  padding-top: var(--blueberry-space-section);
  padding-bottom: var(--blueberry-space-section);
  overflow: hidden;
  background: var(--blueberry-white);
}

.process::before {
  position: absolute;
  inset: 170px 0 0;
  opacity: 0.12;
  background-image:
    linear-gradient(90deg, var(--blueberry-muted) 1px, transparent 1px),
    linear-gradient(var(--blueberry-muted) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
  pointer-events: none;
}

.process > * {
  position: relative;
  z-index: 1;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--blueberry-line);
  border-radius: var(--blueberry-radius-medium);
  background: var(--blueberry-white);
  padding: 7px 7px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.step:hover {
  border-color: var(--blueberry-aqua-soft);
  transform: translateY(-5px);
}

.step img {
  width: 100%;
  height: 135px;
  border-radius: 12px;
  object-fit: cover;
}

.step h3 {
  margin: 22px 16px 12px;
  color: var(--blueberry-deep);
  font: 600 var(--blueberry-text-lead) var(--blueberry-font-display);
}

.step h3 b {
  margin-right: 3px;
  color: var(--blueberry-aqua);
}

.step p {
  max-width: 210px;
  margin: 0 16px;
  color: var(--blueberry-muted);
  font-size: var(--blueberry-text-label);
  line-height: 1.65;
}

.step::after {
  position: absolute;
  right: 10px;
  bottom: -8px;
  color: var(--blueberry-paper);
  content: attr(data-step);
  font: 600 var(--blueberry-display-lg) var(--blueberry-font-display);
  pointer-events: none;
  z-index: 0;
}

.step > * { position: relative; z-index: 1; }

/* Why BLUEBERRY */

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  min-height: 610px;
  padding-top: var(--blueberry-space-section);
  padding-bottom: var(--blueberry-space-section);
  background: var(--blueberry-white);
  color: var(--blueberry-deep);
}

.feature h2 {
  margin: 18px 0;
  color: var(--blueberry-deep);
  font: var(--blueberry-weight-editorial) var(--blueberry-section-title) / var(--blueberry-leading-editorial) var(--blueberry-font-display);
  letter-spacing: -0.055em;
}

.feature h2 span {
  color: var(--blueberry-aqua);
}

.feature-copy p {
  max-width: 500px;
  color: var(--blueberry-muted);
  font-size: var(--blueberry-text-meta);
  line-height: var(--blueberry-leading-body);
}

.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
  color: var(--blueberry-deep);
  font-size: var(--blueberry-text-meta);
}

.check::before {
  margin-right: 10px;
  color: var(--blueberry-aqua);
  content: "\2713";
}

.feature-image {
  height: 390px;
  overflow: hidden;
  border-radius: var(--blueberry-radius-medium);
}

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

/* Home project enquiry */

.home-project-form {
  padding-block: var(--blueberry-space-section);
  background: var(--blueberry-deep);
  color: var(--blueberry-white);
}

.home-project-form .shell {
  width: min(var(--blueberry-container), calc(100% - 48px));
  margin-inline: auto;
}

.home-project-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(48px, 6vw, 88px);
}

.home-project-form-grid > * {
  min-width: 0;
}

.home-project-form-copy h2 {
  max-width: 520px;
  margin: 20px 0;
  color: var(--blueberry-white);
  font: 500 var(--blueberry-section-title) / 1.05 var(--blueberry-font-display);
  letter-spacing: -0.055em;
}

.home-project-form-copy h2 span {
  color: var(--blueberry-aqua);
}

.home-project-form-copy > p {
  max-width: 460px;
  margin: 0;
  color: var(--blueberry-on-dark-muted);
  font-size: var(--blueberry-text-body);
  line-height: var(--blueberry-leading-body);
}

.home-project-form-benefits {
  display: grid;
  gap: 14px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.home-project-form-benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--blueberry-white);
  font-size: var(--blueberry-text-meta);
  font-weight: 500;
}

.home-project-form-benefits span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid rgba(var(--blueberry-aqua-rgb), 0.7);
  border-radius: 50%;
  color: var(--blueberry-aqua);
  font-size: 13px;
}

.home-project-form-card {
  width: 100%;
  max-width: 100%;
  padding: clamp(32px, 3vw, 36px);
  border: 1px solid rgba(var(--blueberry-white-rgb), 0.18);
  border-radius: var(--blueberry-radius-medium);
  background: rgba(var(--blueberry-white-rgb), 0.08);
}

.home-project-enquiry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.home-project-form .form-field {
  gap: 8px;
}

.home-project-form .form-field label {
  color: var(--blueberry-white);
  font-size: var(--blueberry-text-label);
}

.home-project-form .form-field input,
.home-project-form .form-field select,
.home-project-form .form-field textarea {
  box-sizing: border-box;
  border: 1px solid rgba(var(--blueberry-white-rgb), 0.2);
  border-radius: var(--blueberry-radius-small);
  background: rgba(var(--blueberry-deep-rgb), 0.34);
  color: var(--blueberry-white);
}

.home-project-form .form-field input,
.home-project-form .form-field select {
  height: var(--blueberry-control-height-featured-form);
  padding: 0 14px;
}

.home-project-form .form-field textarea {
  min-height: var(--blueberry-control-textarea-featured-min);
  padding: 14px;
}

.home-project-form .form-field input::placeholder,
.home-project-form .form-field textarea::placeholder {
  color: var(--blueberry-on-dark-muted);
  opacity: 1;
}

.home-project-form .form-field select option {
  background: var(--blueberry-white);
  color: var(--blueberry-deep);
}

.home-project-form .form-field input:focus,
.home-project-form .form-field select:focus,
.home-project-form .form-field textarea:focus {
  border-color: var(--blueberry-aqua);
}

.home-project-form .form-actions {
  margin-top: 4px;
}

.home-project-form .form-actions .button--form-submit-full {
  min-width: 0;
  justify-content: center;
  gap: 10px;
  --blueberry-control-primary-bg: var(--blueberry-aqua);
  --blueberry-control-primary-fg: var(--blueberry-deep);
}

.home-project-form .form-status {
  border-left-color: var(--blueberry-aqua);
  background: rgba(var(--blueberry-white-rgb), 0.1);
  color: var(--blueberry-white);
}

/* Inside BLUEBERRY */

.scroll-gallery {
  width: 100%;
  padding: var(--blueberry-space-section) 0;
  overflow: hidden;
  background: var(--blueberry-white);
}

.scroll-gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 50px;
  width: min(var(--blueberry-container), calc(100% - var(--blueberry-page-gutter)));
  margin: 0 auto 42px;
}

.scroll-gallery-head p {
  max-width: 420px;
  margin: 0;
  color: var(--blueberry-muted);
  font-size: var(--blueberry-text-meta);
  line-height: 1.7;
}

.gallery-viewport {
  display: grid;
  gap: 18px;
}

.gallery-row {
  --gallery-x: 0px;
  display: flex;
  gap: 18px;
  width: max-content;
  transform: translate3d(var(--gallery-x), 0, 0);
  will-change: transform;
}

.gallery-tile {
  flex: 0 0 380px;
  height: 300px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--blueberry-radius-medium);
}

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

/* Journal */

.journal {
  width: 100%;
  padding: var(--blueberry-space-section) max(24px, calc((100% - var(--blueberry-container)) / 2));
  background: var(--blueberry-paper);
}

.journal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.journal-head .journal-link {
  flex: 0 0 auto;
}

.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Reveal states */

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

.reveal.on {
  opacity: 1;
  transform: none;
}

.hero,
.story {
  opacity: 1;
  transform: none;
}

/* Tablet */

@media (max-width: 900px) {
  .story,
  .services,
  .projects,
  .process,
  .scroll-gallery,
  .journal {
    padding-block: 80px;
  }

  .home-project-form {
    padding-block: 80px;
  }

  .hero {
    height: 780px;
    min-height: 680px;
  }

  .hero-copy {
    top: 220px;
  }

  .hero h1 {
    font-size: var(--blueberry-display-lg);
  }

  .hero-intro {
    display: block;
  }

  .hero-intro p {
    margin-bottom: 22px;
  }

  .home-page .section-head,
  .feature {
    grid-template-columns: 1fr;
  }

  .story-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 34px;
  }

  .story-heading {
    grid-column: 1 / -1;
  }

  .story-image-tall {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: 390px;
  }

  .story-years {
    grid-column: 1;
    grid-row: 2;
    height: 260px;
    margin: 0;
  }

  .story-image-low {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    height: 290px;
    margin: 0;
  }

  .story-copy {
    grid-column: 2;
    grid-row: 3;
    margin-top: 100px;
  }

  .projects-grid {
    margin-right: 24px;
  }

  .project-card--featured {
    flex-basis: clamp(320px, 72vw, 460px);
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

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

  .stats-showcase {
    padding-block: 60px;
  }

  .stat {
    padding-inline: 24px;
  }

  .stat:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .stat:nth-child(even) {
    padding-right: 0;
  }

  .feature {
    gap: 42px;
  }

  .home-project-form-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .projects-grid {
    width: auto;
    margin-right: max(24px, calc((100vw - var(--blueberry-container)) / 2));
    padding-bottom: 15px;
    overflow-x: auto;
    animation: none;
    scroll-snap-type: x proximity;
    will-change: auto;
  }

  .project-card--featured {
    scroll-snap-align: start;
  }
}

/* Mobile */

@media (max-width: 600px) {

  .story,
  .services,
  .projects,
  .process,
  .scroll-gallery,
  .journal {
    padding-block: 64px;
  }

  .home-project-form {
    padding-block: 64px;
  }

  .hero {
    height: 690px;
    min-height: 650px;
  }

  .hero-copy {
    top: 180px;
  }

  .hero h1 {
    font-size: var(--blueberry-display-sm);
    line-height: 1.01;
  }

  .hero-lower {
    top: 430px;
    bottom: auto;
  }

  .hero-intro p {
    font-size: var(--blueberry-text-meta);
  }

  .trust-strip {
    padding: 20px;
  }

  .trust-inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .story {
    padding-inline: 20px;
  }

  .story-grid {
    display: block;
  }

  .story-heading {
    margin-bottom: 34px;
  }

  .story-heading h2,
  .home-page .section-head h2,
  .scroll-gallery-head h2,
  .journal-head h2 {
    font-size: var(--blueberry-section-title);
  }

  .home-project-form-grid {
    gap: 34px;
  }

  .home-project-form .shell {
    width: calc(100% - 40px);
  }

  .home-project-form-copy h2 {
    font-size: var(--blueberry-section-title);
  }

  .home-project-form-card {
    padding: 24px;
  }

  .home-project-enquiry {
    grid-template-columns: 1fr;
  }

  .home-project-form .form-field,
  .home-project-form .form-field-wide,
  .home-project-form .form-actions,
  .home-project-form .form-status {
    grid-column: 1;
  }

  .story-image-tall {
    width: 100%;
    height: 350px;
  }

  .story-years {
    height: auto;
    margin: 48px 0;
  }

  .story-years strong {
    font-size: var(--blueberry-stat-md);
  }

  .story-image-low {
    display: none;
    width: 100%;
    height: 300px;
  }

  .story-copy {
    margin-top: 28px;
  }

  .services,
  .process,
  .feature {
    padding-inline: 20px;
  }

  .home-page .section-head {
    display: block;
  }

  .home-page .section-head p {
    margin-top: 24px;
  }

  .projects .section-head {
    width: calc(100% - 40px);
  }

  .projects-grid {
    margin-left: 14px;
    margin-right: 14px;
  }

  .project-card--featured {
    flex-basis: 82vw;
  }

  .stats-showcase {
    display: block;
    padding: 52px 0;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .stats-showcase .shell {
    width: calc(100% - 40px);
  }

  .stat,
  .stat:nth-child(odd),
  .stat:nth-child(even) {
    padding: 24px 0 0;
    border-top: 1px solid rgba(var(--blueberry-white-rgb), 0.2);
    border-left: 0;
  }

  .stat:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step {
    min-height: 320px;
  }

  .step img {
    height: 150px;
  }

  .feature {
    min-height: auto;
  }

  .feature-image {
    height: 320px;
  }

  .checks {
    grid-template-columns: 1fr;
  }

  .scroll-gallery-head,
  .journal-head {
    align-items: flex-start;
    flex-direction: column;
    width: calc(100% - 40px);
  }

  .gallery-tile {
    flex-basis: 270px;
    height: 220px;
  }

  .journal {
    padding-inline: 20px;
  }

  .journal-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

}

@media (max-width: 340px) {
  .hero-lower {
    top: 470px;
  }
}
