.scramble-line {
  display: inline-block;
  min-width: 1ch;
}

.scramble-line.is-scrambling {
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 107, 0, .18);
}

.scramble-char-noise {
  color: #ff8a34;
  opacity: .72;
}

.brand-logo {
  display: block;
  width: clamp(118px, 10vw, 158px);
  height: auto;
  object-fit: contain;
  mix-blend-mode: screen;
}

.loader-logo {
  width: min(430px, 72vw);
  height: auto;
  animation: logo-reveal .9s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes logo-reveal {
  from { opacity: 0; transform: translateY(16px) scale(.97); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 680px) {
  .brand-logo { width: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .scramble-line { text-shadow: none; }
  .loader-logo { animation: none; }
}

/* Responsive hardening for every static and product/service page. */
html,
body {
  max-width: 100%;
}

.hero-content,
.section-head > *,
.grid > *,
.feature-copy,
.contact-grid > *,
.quote-layout > * {
  min-width: 0;
}

@media (max-width: 1000px) {
  .nav.open .nav-links {
    overflow-y: auto;
    justify-content: flex-start;
    gap: clamp(.55rem, 2vh, 1.1rem);
    padding-block: clamp(2rem, 8vh, 5rem);
  }

  .hero-content {
    width: min(100%, 780px);
  }

  .hero-small {
    min-height: 72svh;
  }

  .section-head {
    align-items: flex-start;
  }

  .footer-top:has(> :nth-child(3):last-child) {
    grid-template-columns: 1.35fr 1fr 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --pad: clamp(1rem, 5vw, 1.5rem);
  }

  .hero,
  .hero-small {
    min-height: 100svh;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    padding-top: 105px;
    padding-bottom: 4.5rem;
  }

  .hero h1,
  .hero-small h1 {
    max-width: 100%;
    font-size: clamp(2.9rem, 13.6vw, 4.5rem);
    line-height: .98;
    overflow-wrap: anywhere;
  }

  .scramble-line {
    display: inline;
    min-width: 0 !important;
  }

  .hero-content p {
    max-width: 34rem;
    font-size: .98rem;
  }

  .eyebrow {
    letter-spacing: .11em;
    line-height: 1.4;
  }

  .section {
    padding-block: clamp(4.25rem, 18vw, 6rem);
  }

  .manifesto-copy {
    font-size: clamp(1.9rem, 9.5vw, 3.2rem);
  }

  .stats {
    gap: 2rem 1rem;
  }

  .feature-copy {
    padding: 2.25rem var(--pad) 3rem;
  }

  .feature-image {
    width: 100%;
    min-height: 300px;
  }

  .service-card {
    min-height: 310px;
  }

  .timeline-step {
    padding-right: 0;
  }

  .timeline-step::after {
    font-size: 3rem;
    margin-top: 1rem;
  }

  .project,
  .project.wide,
  .project.tall {
    height: min(86vw, 390px);
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .5rem;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: 0 0 auto;
  }

  .compare {
    height: 110vw;
    max-height: 560px;
  }

  .contact-panel,
  .form-card {
    padding: 1.5rem;
  }

  .map {
    min-height: 280px;
  }

  .footer-top,
  .footer-top:has(> :nth-child(3):last-child) {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-bottom {
    margin-top: 3rem;
  }

  .floating {
    right: .75rem;
    bottom: .75rem;
  }
}

@media (max-width: 380px) {
  .hero h1,
  .hero-small h1 {
    font-size: clamp(2.55rem, 13vw, 3.15rem);
  }

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

  .brand {
    width: 76px;
  }
}

@media (max-height: 620px) and (min-width: 681px) {
  .hero,
  .hero-small {
    min-height: 720px;
  }

  .hero-content {
    padding-top: 120px;
    padding-bottom: 4rem;
  }

  .nav.open .nav-links {
    font-size: clamp(1.7rem, 6vh, 2.5rem);
  }
}

/* Walking engineer for the six-step process line. */
.timeline {
  position: relative;
}

@media (min-width: 1001px) {
  .timeline-step p {
    min-height: 3.2em;
  }
}

.timeline-walker {
  position: absolute;
  z-index: 4;
  top: -47px;
  left: 0;
  width: 30px;
  height: 47px;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(255, 107, 0, .34));
  animation: walker-travel 13s linear infinite;
}

.timeline-step.is-active::before {
  top: -7px;
  left: -2px;
  width: 13px;
  height: 13px;
  background: #fff;
  box-shadow: 0 0 0 7px rgba(255, 107, 0, .2), 0 0 22px rgba(255, 107, 0, .9);
}

.timeline-step.is-active h3 {
  color: var(--orange);
}

.timeline:not(.in) .timeline-walker {
  animation-play-state: paused;
}

.walker-head {
  position: absolute;
  top: 0;
  left: 10px;
  width: 11px;
  height: 11px;
  border: 2px solid #f5f5f5;
  border-radius: 50%;
  background: #111;
}

.walker-head::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -4px;
  width: 13px;
  height: 5px;
  border-radius: 8px 8px 2px 2px;
  background: var(--orange);
}

.walker-body {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 2px;
  height: 19px;
  border-radius: 2px;
  background: #f5f5f5;
}

.walker-arm,
.walker-leg {
  position: absolute;
  left: 14px;
  width: 2px;
  border-radius: 2px;
  background: #f5f5f5;
  transform-origin: 1px 1px;
}

.walker-arm {
  top: 15px;
  height: 15px;
}

.walker-leg {
  top: 29px;
  height: 17px;
}

.walker-arm-a,
.walker-leg-b {
  animation: limb-forward .58s ease-in-out infinite alternate;
}

.walker-arm-b,
.walker-leg-a {
  animation: limb-back .58s ease-in-out infinite alternate;
}

.walker-shadow {
  position: absolute;
  left: 5px;
  bottom: -2px;
  width: 20px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 107, 0, .45);
  filter: blur(2px);
  animation: walker-shadow .58s ease-in-out infinite alternate;
}

@keyframes walker-travel {
  0% { left: 0; opacity: 0; }
  3% { left: 0; opacity: 1; }
  94% { left: calc(100% - 30px); opacity: 1; }
  100% { left: calc(100% - 30px); opacity: 0; }
}

@keyframes limb-forward {
  from { transform: rotate(-38deg); }
  to { transform: rotate(38deg); }
}

@keyframes limb-back {
  from { transform: rotate(38deg); }
  to { transform: rotate(-38deg); }
}

@keyframes walker-shadow {
  from { transform: scaleX(.65); opacity: .35; }
  to { transform: scaleX(1); opacity: .7; }
}

@media (max-width: 1000px) {
  .timeline-walker {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-walker {
    left: 0;
    animation: none;
  }

  .walker-arm,
  .walker-leg,
  .walker-shadow {
    animation: none;
  }
}

/* Uniform gallery alignment; the homepage keeps its editorial masonry layout. */
body[data-page="gallery"] .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: stretch;
}

body[data-page="gallery"] .project,
body[data-page="gallery"] .project.wide,
body[data-page="gallery"] .project.tall {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0;
}

body[data-page="gallery"] .project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Keep the homepage Selected Work cards evenly aligned. */
body[data-page="home"] .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: stretch;
}

body[data-page="home"] .project,
body[data-page="home"] .project.wide,
body[data-page="home"] .project.tall {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0;
}

body[data-page="home"] .project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-visual img {
  transition: opacity .28s ease, transform .55s cubic-bezier(.2,.8,.2,1), filter .28s ease;
}

.product-visual img.is-switching {
  opacity: 0;
  transform: scale(.985);
}

@media (max-width: 1000px) {
  body[data-page="gallery"] .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="home"] .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body[data-page="gallery"] .project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  body[data-page="home"] .project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  body[data-page="gallery"] .project,
  body[data-page="gallery"] .project.wide,
  body[data-page="gallery"] .project.tall {
    height: auto;
    margin: 0;
    aspect-ratio: 4 / 3;
  }

  body[data-page="home"] .project,
  body[data-page="home"] .project.wide,
  body[data-page="home"] .project.tall {
    height: auto;
    margin: 0;
    aspect-ratio: 4 / 3;
  }
}

/* Minimal social footer */
.footer:not(.footer-minimal) {
  display: none;
}

.footer.footer-minimal {
  padding: 1.75rem 0 1.55rem;
  color: #48604e;
  background: #f6f0e6;
  border-top: 1px solid rgba(72, 96, 78, 0.12);
}

.footer-minimal .shell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.footer-social {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #48604e;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(72, 96, 78, 0.2);
  border-radius: 50%;
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.footer-social:hover,
.footer-social:focus-visible {
  color: #fff;
  background: #48604e;
  border-color: #48604e;
  transform: translateY(-3px);
}

.footer-social svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-social img {
  width: 21px;
  height: 21px;
  display: block;
}

.footer-social[aria-label="WhatsApp"]:hover,
.footer-social[aria-label="WhatsApp"]:focus-visible {
  color: #48604e !important;
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(72, 96, 78, 0.2) !important;
}

.footer-social[aria-label="WhatsApp"]:hover img,
.footer-social[aria-label="WhatsApp"]:focus-visible img {
  opacity: 1;
}

.footer-social svg .social-fill,
.footer-social svg .social-dot {
  fill: currentColor;
  stroke: none;
}

.footer-social-facebook {
  padding-top: 2px;
  font: 700 1.55rem/1 Arial, sans-serif;
}

.footer .footer-credit {
  margin: 0;
  color: #52645a;
  font-size: clamp(0.88rem, 1.2vw, 1.05rem);
  line-height: 1.55;
  text-align: center;
}

.footer-credit strong {
  color: #3f5948;
  font-weight: 700;
}

.footer-divider {
  margin: 0 0.38rem;
}

/* Keep content sections compact and avoid oversized empty bands. */
.section {
  padding-block: clamp(3rem, 5vw, 5rem);
}

@media (max-width: 680px) {
  .section {
    padding-block: 3rem;
  }

  .footer.footer-minimal {
    padding: 1.45rem 0 1.3rem;
  }

  .footer-socials {
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .footer-social {
    width: 44px;
    height: 44px;
  }

  .footer .footer-credit {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-divider {
    display: none;
  }

  .footer-credit strong {
    margin-top: 0.2rem;
  }
}
