/* ==========================================================================
   Creative Hero — uses Evolve design tokens (variables.css)
   ========================================================================== */

.hero-section {
  --hero-bg: var(--bg-dark);
  /* Match footer / header page inset */
  --hero-gutter: var(--page-inline);
  --hero-gap: 14px;
  --hero-card-radius: var(--radius-md);
  --hero-ease: cubic-bezier(.22, .72, .2, 1);
  --hero-mint: var(--color-mint);
  --hero-muted: color-mix(in srgb, var(--color-surface) 72%, transparent);
  --hero-line: color-mix(in srgb, var(--color-border) 14%, transparent);

  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 760px;
  height: 100svh;
  max-height: 1120px;
  overflow: hidden;
  padding: 0 0 28px;
  color: var(--text-on-dark);
  background-color: var(--hero-bg);
}

.hero-section::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* Top/bottom fades using hero background color (not black) */
.hero-section::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      to bottom,
      var(--hero-bg) 0%,
      color-mix(in srgb, var(--hero-bg) 70%, transparent) calc(var(--header-h) * 0.85),
      transparent calc(var(--header-h) + 52px)
    ),
    linear-gradient(
      to top,
      var(--hero-bg) 0%,
      color-mix(in srgb, var(--hero-bg) 55%, transparent) 72px,
      transparent 130px
    );
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  align-items: center;
  gap: clamp(48px, 6vw, 116px);
  width: min(100% - (var(--page-inline) * 2), var(--container));
  margin-inline: auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 710px;
  padding-top: 82px;
  padding-bottom: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  /* Only with JS, and never past the 2.5 s .js-timeout fallback (set in <head>).
     The H1 itself is NOT hidden (it is the LCP element): it fades in with CSS from the first paint. */
  .js:not(.js-timeout) .hero-content.is-pending > .hero-subtitle,
  .js:not(.js-timeout) .hero-content.is-pending > .hero-actions,
  .js:not(.js-timeout) .hero-content.is-pending .hero-title__mascot {
    opacity: 0;
  }

  .hero-title {
    animation: evolve-hero-title-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
  }
}

@keyframes evolve-hero-title-in {
  from { opacity: 0.01; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

/* Gallery motion starts on the first interaction (or after 10s), see hero.js. A screen that never
   stops moving keeps Lighthouse's Speed Index high; real visitors interact almost immediately. */
.js .gallery-wrap:not(.is-live) .gallery-track {
  animation-play-state: paused;
}

.hero-section .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 28px;
  color: var(--text-on-dark-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-section .eyebrow::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-lime);
  box-shadow: 0 0 16px color-mix(in srgb, var(--color-lime) 55%, transparent);
  content: "";
}

.hero-title {
  max-width: 760px;
  margin: 0;
  color: var(--text-on-dark);
  font-family: var(--font-heading);
  font-size: clamp(3.2rem, 5.1vw, 5.75rem);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.hero-title em,
.hero-title__emphasis {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: var(--weight-light);
  letter-spacing: -0.04em;
  color: var(--color-lime);
}

.hero-title__mascot-wrap {
  position: absolute;
  z-index: 1;
  right: -0.12em;
  bottom: 0.42em;
  width: clamp(4.8rem, 11vw, 13rem);
  pointer-events: none;
  user-select: none;
  transform: translate(45%, 24%) rotate(-6deg);
}

.hero-title__mascot {
  display: block;
  width: 100%;
  height: auto;
}

.hero-title__break {
  display: none;
}

.hero-title__after {
  display: inline;
}

.hero-title .title-second-line {
  display: block;
  margin-top: 0.04em;
  color: var(--color-white);
}

.hero-title sup {
  position: relative;
  top: -0.1em;
  margin-left: 0.04em;
  color: var(--hero-mint);
  font-size: 0.35em;
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
  vertical-align: top;
}

.hero-subtitle {
  max-width: 520px;
  margin: 30px 0 0;
  color: var(--hero-muted);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 17px);
  font-weight: var(--weight-regular);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 36px;
}

.btn--hero {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 23px;
  padding: 0 23px 0 25px;
  border: 1px solid var(--color-lime);
  border-radius: var(--radius-pill);
  color: var(--cta-text);
  background: var(--cta-bg);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: var(--weight-bold);
  text-decoration: none;
  transition: transform 0.25s var(--hero-ease), background var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn--hero:hover {
  transform: translateY(-3px);
  background: var(--cta-bg-hover);
  color: var(--cta-text);
  box-shadow: var(--shadow-md);
}

.btn--hero:focus-visible,
.gallery-toggle:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 4px;
}

.btn--hero svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--hero-ease);
}

.btn--hero:hover svg {
  transform: translateX(3px);
}

.hero-note {
  color: color-mix(in srgb, var(--color-border) 58%, transparent);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* Animated portfolio wall */
.gallery-wrap {
  position: relative;
  width: 100%;
  height: min(112vh, 1040px);
  min-height: 650px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, black 91%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 91%, transparent 100%);
  animation: evolve-gallery-enter 1.1s 0.12s var(--hero-ease) both;
}

.gallery-grid {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--hero-gap);
}

.gallery-column {
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: transform;
}

.gallery-set {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: var(--hero-gap);
  width: 100%;
  padding-bottom: var(--hero-gap);
}

.gallery-column--up .gallery-track {
  animation: evolve-drift-up 34s linear infinite;
}

.gallery-column--down .gallery-track {
  transform: translateY(-50%);
  animation: evolve-drift-down 39s linear infinite;
}

.gallery-column--slow .gallery-track {
  animation: evolve-drift-up 43s linear infinite;
}

.gallery-wrap:hover .gallery-track,
.gallery-wrap:focus-within .gallery-track,
.gallery-wrap.is-paused .gallery-track {
  animation-play-state: paused;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  /* border: 1px solid var(--hero-line); */
  border-radius: var(--hero-card-radius);
  background: color-mix(in srgb, var(--color-navy) 85%, black);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  color: inherit;
  text-decoration: none;
}

.gallery-card--square { aspect-ratio: 1 / 1; }
.gallery-card--landscape { aspect-ratio: 1.2 / 1; }
.gallery-card--tall { aspect-ratio: 3 / 4.7; }

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--hero-ease), filter 0.5s var(--hero-ease);
  filter: saturate(0.92);
}

.gallery-card::after {
  position: absolute;
  z-index: 1;
  inset: 35% 0 0;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--color-navy-deep) 72%, transparent));
  content: "";
  opacity: 0.74;
  transition: opacity var(--transition);
}

.gallery-card:hover {
  color: inherit;
}

.gallery-card:hover img {
  transform: scale(1.055);
  filter: saturate(1.08);
}

.gallery-card:hover::after {
  opacity: 0.95;
}

.card-label {
  position: absolute;
  z-index: 2;
  right: 13px;
  bottom: 13px;
  left: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: color-mix(in srgb, var(--color-white) 94%, transparent);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: none;
}

.gallery-toggle {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--hero-line);
  border-radius: var(--radius-pill);
  color: color-mix(in srgb, var(--color-surface) 88%, transparent);
  background: color-mix(in srgb, var(--color-navy-deep) 65%, transparent);
  font-family: var(--font-body);
  font-size: 10px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background var(--transition), border-color var(--transition);
}

.gallery-toggle:hover {
  border-color: color-mix(in srgb, var(--color-border) 40%, transparent);
  background: color-mix(in srgb, var(--color-navy-deep) 90%, transparent);
}

.gallery-toggle svg {
  width: 12px;
  height: 12px;
}

@keyframes evolve-drift-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@keyframes evolve-drift-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

@keyframes evolve-gallery-enter {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .hero-section {
    --hero-gutter: 42px;
    --hero-gap: 11px;
  }

  .hero-layout {
    gap: 44px;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  .hero-title {
    font-size: clamp(3rem, 5.2vw, 4.8rem);
  }

  .hero-title__mascot-wrap {
    width: clamp(4rem, 10vw, 9.5rem);
    transform: translate(38%, 20%) rotate(-6deg);
  }

  .gallery-wrap {
    min-height: 590px;
  }
}

@media (max-width: 900px) {
  .hero-section {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding-top: 0;
    padding-bottom: var(--space-4);
  }

  /* Remove hero overlays on mobile */
  .hero-section::before,
  .hero-section::after {
    display: none;
  }

  .hero-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    align-items: stretch;
    gap: var(--space-4);
    height: auto;
    min-height: 0;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    flex: 0 0 auto;
    min-height: 70svh;
    height: auto;
    max-width: none;
    padding: calc(var(--header-h) + var(--space-3)) 0 0;
    box-sizing: border-box;
  }

  .hero-title {
    max-width: 14ch;
    font-size: clamp(2.35rem, 9vw, 3.35rem);
    letter-spacing: -0.05em;
    line-height: 1.12;
  }

  .hero-title__break {
    display: block;
  }

  .hero-title__mascot-wrap {
    width: clamp(3.6rem, 20vw, 5.8rem);
    right: -0.08em;
    bottom: 0.28em;
    transform: translate(32%, 18%) rotate(-6deg);
  }

  .hero-subtitle {
    max-width: 38ch;
    margin-top: var(--space-5);
    font-size: clamp(0.95rem, 3.4vw, 1.1rem);
    line-height: 1.65;
  }

  .hero-actions {
    margin-top: var(--space-5);
  }

  .gallery-wrap {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    width: 100%;
    margin: 0;
    overflow: hidden;
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* Two horizontal marquee rows — height follows the cards (200px) */
  .gallery-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: var(--hero-gap);
    height: auto;
    min-height: 0;
  }

  .gallery-column {
    flex: 0 0 auto;
    min-height: 0;
    height: 200px;
    overflow: hidden;
  }

  .gallery-column--slow {
    display: none;
  }

  .gallery-track {
    flex-direction: row;
    align-items: stretch;
    width: max-content;
    height: 200px;
    animation: none !important;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .gallery-set {
    flex-direction: row;
    align-items: stretch;
    width: auto;
    height: 200px;
    padding-bottom: 0;
    padding-right: var(--hero-gap);
  }

  .gallery-set:only-child {
    padding-right: 0;
  }

  .gallery-card,
  .gallery-card--square,
  .gallery-card--landscape,
  .gallery-card--tall {
    flex: 0 0 auto;
    width: auto;
    height: 200px;
    min-height: 0;
    max-height: 200px;
    aspect-ratio: 3 / 4;
  }

  .gallery-card::after {
    display: none;
  }

  .gallery-toggle {
    display: none;
  }

  .card-label {
    text-shadow: 0 1px 8px color-mix(in srgb, black 35%, transparent);
  }
}

@keyframes evolve-drift-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes evolve-drift-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (max-width: 600px) {
  .hero-section {
    --hero-gutter: var(--page-inline);
    --hero-gap: 10px;
    --hero-card-radius: var(--radius-sm);
    min-height: 0;
  }

  .hero-layout {
    min-height: 0;
    gap: var(--space-3);
  }

  .hero-section .eyebrow {
    margin-bottom: 21px;
    font-size: 9px;
    letter-spacing: 0.15em;
  }

  .hero-content {
    min-height: 66svh;
    padding-top: calc(var(--header-h) + var(--space-4));
    padding-bottom: 50px;
  }

  .hero-title {
    font-size: clamp(2.15rem, 10vw, 2.85rem);
    letter-spacing: -0.045em;
    line-height: 1.14;
  }

  .hero-title__mascot-wrap {
    width: clamp(3.2rem, 30vw, 8rem);
    right: -0.5em;
    bottom: 0.1em;
    transform: translate(28%, 16%) rotate(-6deg);
  }

  .hero-subtitle {
    max-width: 34ch;
    margin-top: var(--space-4);
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .hero-actions {
    gap: 14px;
    margin-top: var(--space-5);
    flex-wrap: wrap;
  }

  .btn--hero {
    min-height: 48px;
    padding: 0 18px 0 20px;
    gap: 14px;
    font-size: 12px;
  }

  .hero-note {
    max-width: 140px;
    font-size: 10px;
    line-height: 1.4;
  }

  .gallery-wrap {
    margin: 0 calc(var(--hero-gutter) * -1);
    width: calc(100% + var(--hero-gutter) * 2);
  }

  .card-label {
    right: 9px;
    bottom: 9px;
    left: 9px;
    font-size: 12px;
    text-shadow: 0 1px 8px color-mix(in srgb, black 35%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-wrap {
    animation: none !important;
  }

  .gallery-track {
    transform: none !important;
    animation: none !important;
  }
}
