/* The index page: photo-grid landing, a hand-picked gallery, three photo doorways to stories, specialties and projects, about. */

/* * === landing: staggered columns of photos over the forest floor, title on top */

.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
  /* The forest floor, darkened and softened so it reads as mood behind the photos. */
  background: #10130f var(--background) center / cover no-repeat;
  /* Pointer position as percentages, moved by index.js; the foil follows it. */
  --hx: 50%;
  --hy: 50%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 11, 0.62);
  backdrop-filter: blur(3px);
}

/* Wider than the screen so the outer columns bleed off both edges. */
.hero-grid {
  position: absolute;
  top: 0;
  left: -6vw;
  right: -6vw;
  display: flex;
  gap: var(--grid-gap);
  --grid-gap: clamp(10px, 1.2vw, 18px);
}

.grid-column {
  flex: 1 1 0;
  min-width: 0;
}

.grid-column-inner {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

.grid-print {
  position: relative;
  display: block;
}

.grid-print img {
  width: 100%;
}

/* Rainbow foil that shows only on the print under the pointer, like a holo card. */
.grid-print::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 25%,
    rgba(255, 110, 196, 0.5) 38%,
    rgba(120, 225, 255, 0.5) 48%,
    rgba(255, 238, 140, 0.45) 58%,
    rgba(170, 140, 255, 0.45) 66%,
    transparent 78%
  );
  background-size: 260% 260%;
  background-position: var(--hx) var(--hy);
  mix-blend-mode: color-dodge;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.grid-print:hover::after {
  opacity: 0.7;
}

/* Darkens the middle so the title reads over the photos, and the top so the header does:
   the header inverts whatever is behind it, which over bright prints left it patchy. */
.hero-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(10, 12, 9, 0.88), rgba(10, 12, 9, 0.6) 64px, transparent 150px),
    radial-gradient(ellipse 55% 40% at 50% 50%, rgba(10, 12, 9, 0.78), transparent 100%);
}

.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 var(--gutter);
  text-align: center;
  color: #f4efe6;
  pointer-events: none;
}

.hero-text .label {
  color: rgba(244, 239, 230, 0.72);
}

/* "Nagouda" in the display face at a medium weight, "Collection" in the italic serif, the
   same pairing as the section headings. */
.hero-title {
  font: 500 clamp(48px, 8.6vw, 168px) / 0.9 var(--display);
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hero-title .serif {
  font: italic 400 1.08em / 0.9 var(--serif);
  letter-spacing: -0.015em;
}

/* Each part clips its own slide-up intro. */
.hero-title .part {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.06em;
  vertical-align: bottom;
}

.hero-title .part > span {
  display: inline-block;
}

/* The footer's lighter vermilion, since --accent is too dark to read on the photos. */
.hero-title .dot {
  color: #ff8a65;
}

.hero-cue {
  position: absolute;
  bottom: 24px;
}

/* * === gallery: the photos picked in content/gallery.yaml */

/* Close under the landing, so the gallery reads as its photos carrying on. */
#gallery-section {
  padding-top: clamp(40px, 5vw, 72px);
}

/* * === doorways: three photo tiles, to all stories, all specialties and all projects */

/* Side by side and as far apart as the gallery's columns, so they read as its last, largest
   row. Close under the gallery for the same reason. */
.doorways {
  display: flex;
  gap: var(--collage-gap);
  padding-top: var(--collage-gap);
  --collage-gap: clamp(10px, 1.4vw, 24px);
}

/* A photo fills the tile and index.js steps through more on hover, as on a story's card. The
   colours are fixed, as on the landing: the type is always on a darkened photo. */
.doorway {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  height: clamp(320px, 64svh, 680px);
  overflow: hidden;
  color: #f4efe6;
  background: #10130f;
}

.doorway .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* index.js hides a doorway with nothing to show; `display: flex` above would keep it visible. */
.doorway[hidden] {
  display: none;
}

/* The first photo eases closer on hover; the ones that follow are already still. */
.doorway .photo:not(.peek) {
  transition: opacity 0.9s ease, scale 1.6s var(--ease-out);
}

.doorway:hover .photo:not(.peek) {
  scale: 1.05;
}

/* Comes after the photos, so it darkens whichever one is showing; lighter on hover. */
.doorway::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(10, 12, 9, 0.3), rgba(10, 12, 9, 0.72));
  transition: opacity 0.6s ease;
}

.doorway:hover::after {
  opacity: 0.75;
}

.doorway-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 2.6vw, 44px);
}

.doorway-text .label {
  color: rgba(244, 239, 230, 0.78);
}

/* Sized for three tiles in a row: "specialties" has to fit a third of the screen. */
.doorway strong {
  font: 600 clamp(36px, 3.8vw, 72px) / 0.9 var(--display);
  letter-spacing: -0.045em;
}

.doorway em {
  font: italic 400 1.05em/0.9 var(--serif);
  letter-spacing: -0.01em;
}

/* The footer's lighter vermilion, since --accent is too dark to read on a photo. */
.doorway:hover strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #ff8a65;
}

/* * === about: the portrait, with the statement written on it */

/* As far below the doorways as the footer is below the portrait, so it sits evenly between
   the two instead of after a long pause. */
#about {
  padding-top: clamp(32px, 4vw, 64px);
}

/* Shrinks to the photo's own size so the text sits on the photo, not beside it. Bare, like
   the gallery and the doorways above it. */
.portrait {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

/* Most of the screen's height, not all of it, so the portrait stands in the page with paper
   around it instead of filling the screen. */
.portrait img {
  max-height: 76svh;
  width: auto;
}

.portrait-text {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(24px, 4vw, 56px);
  padding-top: 30%;
  color: #f4efe6;
  /* A soft dark scrim under the words; the top of the photo stays untouched. */
  background: linear-gradient(to top, rgba(10, 10, 8, 0.72), transparent);
}

.portrait-text .label {
  color: rgba(244, 239, 230, 0.72);
  margin-bottom: 14px;
}

.statement {
  font: 500 clamp(24px, 3vw, 48px) / 1.1 var(--display);
  letter-spacing: -0.03em;
  max-width: 22ch;
}

.statement .word {
  display: inline-block;
  opacity: 0.25;
}

/* The rule above out-specifies the `.photo { transition: none }` in style.css, so the zoom and
   the fade are switched off here as well. */
@media (prefers-reduced-motion: reduce) {
  .doorway .photo:not(.peek) {
    transition: none;
  }
}

/* * === small screens */

@media (max-width: 760px) {
  /* Smaller type on a phone: at desktop scale it pulled the eye away from the photos. */
  .hero-title {
    font-size: 32px;
  }

  .doorway strong {
    font-size: 24px;
  }

  .statement {
    font-size: 18px;
  }

  /* A taller, darker glow: on a phone the title covers more of the busy grid. */
  .hero-veil {
    background:
      linear-gradient(rgba(10, 12, 9, 0.88), rgba(10, 12, 9, 0.6) 64px, transparent 150px),
      radial-gradient(ellipse 95% 32% at 50% 50%, rgba(10, 12, 9, 0.85), transparent 100%);
  }

  /* Stacked, since side by side none would be large enough. */
  .doorways {
    flex-direction: column;
  }

  .doorway {
    flex: none;
    height: 42svh;
  }

  /* Too little photo to write on; the statement moves below it. */
  .portrait-text {
    position: static;
    padding: 20px 0 0;
    color: var(--ink);
    background: none;
  }

  .portrait-text .label {
    color: var(--ink-soft);
  }
}
