/* Keep the complete mark visible at every iPhone size. */
.home-gallery-tile {
  transition: opacity .75s ease, transform .75s ease !important;
  will-change: opacity, transform;
}

/* Invisible slots keep the gallery footprint stable. Only the photograph
   carries the card shadow, hover target and credit overlay. */
.home-gallery-slot {
  position: relative;
  min-width: 0;
}

.home-gallery-slot .home-gallery-tile {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 100%;
  background: transparent;
  --tile-angle: -1.3deg;
}

.home-gallery-slot:nth-child(even) .home-gallery-tile { --tile-angle: 1deg; }
.home-gallery-slot:nth-child(3n) .home-gallery-tile { --tile-angle: -.7deg; }

.home-gallery-tile img {
  width: 100%;
  height: auto;
}

.home-featured { position: relative; z-index: 2; }

.home-gallery-tile.is-changing {
  opacity: 0 !important;
  transform: translateY(8px) scale(.985) rotate(var(--tile-angle, 0deg)) !important;
}

.home-intro {
  max-width: 1520px;
}

.home-intro-layout {
  grid-template-columns: minmax(0, 760px) minmax(460px, 520px);
  justify-content: space-between;
  gap: 60px;
}

.home-intro-copy {
  max-width: 760px;
}

.home-intro h2 {
  max-width: 100%;
  font-size: clamp(40px, 4.4vw, 66px);
  overflow-wrap: break-word;
}

.home-masonry {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 18px;
  columns: auto;
  column-count: auto;
  column-width: auto;
}

.home-visual-column {
  width: 100%;
  max-width: 520px;
}

.home-fac-seal {
  --seal-spring-x: 0px;
  --seal-spring-y: 0px;
  --seal-spring-rotate: 0deg;
  position: relative;
  z-index: 1;
  display: block;
  width: 300px;
  height: 300px;
  margin: 52px 0 0 auto;
  border-radius: 50%;
  line-height: 0;
  filter: drop-shadow(0 11px 16px rgba(24, 17, 14, .13));
  transform: translate3d(var(--seal-spring-x), var(--seal-spring-y), 0) rotate(var(--seal-spring-rotate));
  transform-origin: 50% 42%;
  transition: filter .28s ease;
  will-change: transform;
}

.home-fac-seal img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}

.home-fac-seal .theme-seal-dark { display: none; }
html[data-theme="dark"] .home-fac-seal .theme-seal-light { display: none; }
html[data-theme="dark"] .home-fac-seal .theme-seal-dark { display: block; }

.home-fac-seal:hover {
  filter: drop-shadow(0 14px 22px rgba(24, 17, 14, .16));
}

.home-fac-seal:hover img { transform: translateY(-4px) scale(1.012); }

.home-fac-seal:focus-visible {
  outline: 3px solid #ff6247;
  outline-offset: 6px;
}

.home-gallery-column { display: grid; align-content: start; gap: 18px; }

/* Continue the editorial image rhythm into the open area below the browse
   link. The clearance leaves a calm landing zone for the compact sticky
   search control before the next images begin. */
.home-gallery-continuation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 138px;
}

.home-gallery-continuation[hidden] { display: none; }

html[data-theme="dark"] .home-search {
  background: #211f1d;
  border-color: #4b4641;
  box-shadow: 0 19px 38px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .home-search input {
  color: #f4f1ee;
  background: transparent;
}

html[data-theme="dark"] .home-search input::placeholder { color: #b7b0aa; }
html[data-theme="dark"] .home-search svg { stroke: #e7e0da; }

@media (min-width: 761px) {
  .home-search-wrap {
    transition: top .45s cubic-bezier(.22,.8,.28,1), width .45s cubic-bezier(.22,.8,.28,1), margin-left .45s cubic-bezier(.22,.8,.28,1), margin-right .45s cubic-bezier(.22,.8,.28,1), transform .2s ease-out;
  }

  .home-search-wrap.is-compact {
    width: min(410px, calc(100% - 32px));
    margin-left: clamp(16px, 5vw, 88px);
    margin-right: auto;
    top: var(--compact-search-top, 216px);
  }

  .home-search {
    transition: height .45s cubic-bezier(.22,.8,.28,1), padding .45s cubic-bezier(.22,.8,.28,1), gap .45s cubic-bezier(.22,.8,.28,1), box-shadow .45s cubic-bezier(.22,.8,.28,1);
  }

  .home-search-wrap.is-compact .home-search {
    height: 60px;
    gap: 10px;
    padding: 7px 8px 7px 16px;
    box-shadow: 0 10px 24px rgba(24, 17, 14, .2);
  }

  .home-search input, .home-search button, .home-search svg { transition: font-size .45s cubic-bezier(.22,.8,.28,1), height .45s cubic-bezier(.22,.8,.28,1), min-width .45s cubic-bezier(.22,.8,.28,1), width .45s cubic-bezier(.22,.8,.28,1); }
  .home-search-wrap.is-compact .home-search input { font-size: 16px; }
  .home-search-wrap.is-compact .home-search button { height: 46px; min-width: 92px; }
  .home-search-wrap.is-compact .home-search svg { width: 21px; height: 21px; }
}

@media (min-width: 1101px) {
  .home-search-wrap.is-featured-docked {
    position: fixed;
    top: 18px;
    left: 54%;
    width: min(440px, calc(100vw - 800px));
    margin: 0;
    transform: translateX(-50%) !important;
    transition: top .7s cubic-bezier(.22,.8,.28,1), left .7s cubic-bezier(.22,.8,.28,1), width .7s cubic-bezier(.22,.8,.28,1), transform .7s cubic-bezier(.22,.8,.28,1);
  }

  .home-search-wrap.is-featured-docked .home-search {
    height: 60px;
    gap: 10px;
    padding: 7px 8px 7px 16px;
    box-shadow: 0 14px 34px rgba(24,17,14,.22);
  }

  .home-search-wrap.is-featured-docked .home-search input { font-size: 16px; }
  .home-search-wrap.is-featured-docked .home-search button { height: 46px; min-width: 92px; }
  .home-search-wrap.is-featured-docked .home-search svg { width: 21px; height: 21px; }
}

.home-gallery-tile {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .home-gallery-tile { transition-duration: .01ms !important; }
  .home-fac-seal { transform: none; transition: none; will-change: auto; }
  .home-fac-seal img { transition: none; }
}

@media (max-width: 1100px) {
  .home-intro-layout {
    grid-template-columns: 1fr;
  }

  .home-masonry {
    max-width: 840px;
  }

  .home-visual-column {
    max-width: 840px;
  }

  .home-fac-seal {
    width: min(300px, 70vw);
    height: auto;
    aspect-ratio: 1;
    margin: 38px auto 0;
  }

  .home-gallery-continuation {
    display: none;
  }
}

@media (min-width: 1101px) and (max-width: 1400px) {
  .home-intro-layout {
    grid-template-columns: minmax(0, 600px) minmax(480px, 560px);
    gap: 42px;
  }

  .home-intro-copy {
    max-width: none;
  }

  .home-masonry {
    max-width: 560px;
  }
}

@media (min-width: 1101px) {
  .home-intro h2 {
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .home-intro {
    padding-top: 90px;
  }
}

@media (max-width: 760px) {
  .home-intro {
    padding-top: 67px;
  }

  .home-search input {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
  }

  .home-masonry {
    gap: 10px;
  }

  .home-gallery-column { gap: 10px; }

  .home-gallery-tile {
    margin-bottom: 0;
  }
}

/* iPad mini (744px current models; 768px earlier models) uses the compact
   navigation breakpoint, but its wider logo extends much farther down than
   it does on a phone. Keep the sticky search control below that mark. */
@media (min-width: 700px) and (max-width: 800px) and (min-height: 900px) and (orientation: portrait) and (pointer: coarse) {
  .home-search-wrap {
    top: 300px;
  }
}

/* Safari can report a wide layout viewport on an iPhone. Target portrait
   directly so no blurred/masked header layer can bleed into the logo. */
@media (orientation: portrait) {
  .home-actions::before {
    inset: -30px -30px -30px -4px;
  }

  .home-brand,
  .home-brand img {
    overflow: visible !important;
  }

  .home-brand::before {
    display: none !important;
  }

  .home-brand img {
    filter: none !important;
    opacity: 1 !important;
    z-index: 2 !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    transform: translateZ(0);
  }
}

/* Landscape iPhones exceed the 760px width breakpoint, so they need their
   own compact brand treatment instead of inheriting the desktop logo. */
@media (max-height: 540px) and (orientation: landscape) {
  .home-nav {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 16px;
  }

  .home-nav nav {
    padding-top: 0;
  }

  .home-brand {
    width: 260px;
    height: 76px;
    flex: 0 0 260px;
  }

  .home-brand img {
    width: 260px;
    left: 0;
    top: -22px;
  }

  .home-actions {
    flex: 0 0 150px;
  }
}
