html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

@media (min-width: 768px) {
  html {
    scroll-padding-top: 0;
  }
}

body {
  background-color: #000;
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body > header,
body > #home,
body > .flex {
  width: 100%;
  max-width: 1800px;
  margin-inline: auto;
}

body > .flex,
body > .flex > .flex-1,
main {
  min-width: 0;
}

.hero {
  aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
  .hero {
    aspect-ratio: 21 / 9;
  }
}

.image-card {
  aspect-ratio: 3 / 4;
}

.gallery-item {
  aspect-ratio: 3 / 4;
  min-width: 0;
  max-width: 100%;
}

.half-image {
  aspect-ratio: 16 / 9;
}

main .grid.gap-4 {
  gap: 2rem;
}

@media (min-width: 768px) {
  main .grid.gap-4 {
    gap: 2.75rem;
  }
}

main .bottom-image {
  margin-block: 2.5rem;
}

main .bottom-image.bottom-image--tight-top {
  margin-top: 0;
}

main .bottom-image.bottom-image--tight-bottom {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  main .bottom-image {
    margin-block: 4rem;
  }
}

.bottom-image {
  aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
  .bottom-image {
    aspect-ratio: 21 / 9;
  }

  .footer-image {
    aspect-ratio: 3 / 2;
  }
}

.nav-link.active {
  color: #fff;
}

.nav-link:not(.active) {
  color: rgb(255 255 255 / 0.5);
}

.nav-link:not(.active):hover {
  color: rgb(255 255 255 / 0.8);
}


.lang-switcher-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-link {
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgb(255 255 255 / 0.4);
  transition: color 150ms;
}

.lang-link:hover {
  color: rgb(255 255 255 / 0.75);
}

.lang-link.active {
  color: #fff;
}

/* Story and article body copy — readable without breaking the thin aesthetic */
.font-light {
  font-weight: 400;
}

main .max-w-3xl.space-y-6.text-sm {
  max-width: 60rem;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: #eaeaeac7;
  letter-spacing: 0.5px;
}

main header .max-w-lg.text-sm {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: #eaeaeac7;
  letter-spacing: 0.5px;
}

.mobile-welcome p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: #eaeaeac7;
  letter-spacing: 0.5px;
}

.sidebar-scroll-progress {
  display: none;
}

.image-card img,
.gallery-item img,
.half-image img,
.hero img,
.bottom-image img,
.bottom-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-sneaky-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.footer-image img {
  object-position: center top;
}

.image-card:hover img {
  transform: scale(1.05);
}

.image-card img {
  transition: transform 700ms;
}

/* ——— Mobile layout enhancements ——— */

@media (max-width: 767px) {
  html {
    scroll-padding-bottom: 5rem;
  }

  body {
    overflow-x: hidden;
    padding-bottom: 4.75rem;
  }

  body > .flex,
  body > .flex > .flex-1,
  main,
  main > section {
    min-width: 0;
    max-width: 100%;
  }

  main,
  main > section {
    overflow-x: clip;
  }

  /* Scroll progress under sticky header */
  body > header {
    background-color: #000;
    padding-top: 3px;
  }

  .scroll-progress {
    height: 3px;
    background: rgb(255 255 255 / 0.12);
  }

  .scroll-progress-bar {
    height: 100%;
    width: 100%;
    background: #ffffffb8;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 80ms linear;
  }

  /* Full-bleed hero beats every 5th grid image */
  .gallery-grid {
    --mobile-gallery-inset: 3.25rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    padding-inline: var(--mobile-gallery-inset) !important;
  }

  .gallery-grid > .gallery-item {
    width: 100%;
  }

  .gallery-grid > .gallery-item:nth-child(5n) {
    grid-column: 1 / -1;
    width: calc(100% + (var(--mobile-gallery-inset) * 2));
    max-width: none;
    margin-inline: calc(var(--mobile-gallery-inset) * -1);
    aspect-ratio: 5 / 6 !important;
  }

  /* Half-width pairs — match the inset of normal grid photos */
  main .grid:has(> .half-image) {
    padding-inline: 3.25rem !important;
  }

  main .half-image {
    aspect-ratio: 16 / 10;
  }

  /* Alternating aspect ratios between hero beats */
  .gallery-grid > .gallery-item:nth-child(4n + 1):not(:nth-child(5n)) {
    aspect-ratio: 4 / 5;
  }

  .gallery-grid > .gallery-item:nth-child(4n + 2):not(:nth-child(5n)) {
    aspect-ratio: 16 / 10;
  }

  .gallery-grid > .gallery-item:nth-child(4n + 3):not(:nth-child(5n)) {
    aspect-ratio: 4 / 5;
  }

  .gallery-grid > .gallery-item:nth-child(4n):not(:nth-child(5n)) {
    aspect-ratio: 6 / 5;
  }

  /* Full-width figures — break out of horizontal padding only */
  main .bottom-image {
    width: calc(100% + 3rem);
    max-width: none;
    margin-inline: -1.5rem;
    margin-block: 2.75rem;
  }

  /* Videos stay within the viewport — no full-bleed crop */
  main .bottom-image:has(video) {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    aspect-ratio: auto;
    height: auto;
  }

  main .bottom-image:has(video) video {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    vertical-align: top;
  }

  main .footer-image {
    aspect-ratio: 3 / 4;
  }

  /* Horizontal swipe strips — scroll contained, must not widen the page */
  .gallery-strip-mobile {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-inline: 2rem;
    scrollbar-width: none;
  }

  .gallery-strip-mobile::-webkit-scrollbar {
    display: none;
  }

  .gallery-strip-mobile > .gallery-item {
    flex: 0 0 78vw;
    width: 78vw;
    max-width: 78vw;
    scroll-snap-align: center;
    aspect-ratio: 4 / 5;
  }

  .gallery-strip-mobile::after {
    content: "";
    flex: 0 0 2rem;
  }

  /* Bottom nav */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid rgb(255 255 255 / 0.1);
    background: rgb(0 0 0 / 0.95);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.25rem 0.55rem;
    font-size: 0.5625rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgb(255 255 255 / 0.4);
    transition: color 150ms;
  }

  .mobile-nav-link svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.25;
  }

  .mobile-nav-link.active {
    color: #fff;
  }

  .mobile-nav-link.active svg {
    stroke-width: 1.75;
  }

  .gallery-carousel-btn {
    display: none;
  }
}

@media (min-width: 768px) {
  .scroll-progress,
  .mobile-bottom-nav {
    display: none !important;
  }

  .sidebar-scroll-progress {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgb(255 255 255 / 0.12);
    pointer-events: none;
  }

  .sidebar-scroll-progress-bar {
    width: 100%;
    height: 100%;
    background: rgb(255 255 255 / 0.38);
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 80ms linear;
  }

  .gallery-carousel {
    min-width: 0;
  }

  .gallery-carousel-btn {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 9999px;
    background: rgb(0 0 0 / 0.65);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    transition: border-color 150ms, background-color 150ms, opacity 150ms;
  }

  .gallery-carousel-btn:hover:not(:disabled) {
    border-color: rgb(255 255 255 / 0.45);
    background: rgb(0 0 0 / 0.85);
  }

  .gallery-carousel-btn:disabled {
    opacity: 0.25;
    cursor: default;
  }

  .gallery-carousel-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
  }

  .gallery-carousel-btn--prev {
    left: 0.75rem;
  }

  .gallery-carousel-btn--next {
    right: 0.75rem;
  }

  .gallery-carousel-track {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 2.75rem;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-inline: 0.25rem;
  }

  .gallery-carousel-track::-webkit-scrollbar {
    display: none;
  }

  .gallery-carousel-track > .gallery-item {
    flex: 0 0 18rem;
    width: 18rem;
    max-width: 18rem;
    scroll-snap-align: start;
  }
}
