@font-face {
  font-family: "Jost";
  src: url("/fonts/jost.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#f4f2ee, #121212);
  --ink: light-dark(#161616, #f2efe9);
  --muted: light-dark(#5e5a54, #a8a39b);
  --accent: light-dark(#9a5a12, #e8a84a);
  --tile: light-dark(#e4e0d8, #222120);
  --gap: clamp(0.4rem, 0.8vw, 0.75rem);
  --edge: clamp(1.25rem, 5vw, 3.5rem);
  --sans: "Jost", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.5rem, 4svh, 3rem);
  max-width: 100rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) var(--edge);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mark {
  width: 2.25rem;
  height: auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wordmark {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker::before {
  margin-right: 0.32em;
}

.kicker::before,
.kicker::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 em {
  margin-right: -0.03em;
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
}

.lead {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}

/* Homepage: intro over a curated grid of photographs. */
.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1rem, 5svh, 3.5rem) 0 clamp(2rem, 6svh, 4rem);
}

.gallery {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 58vw;
  grid-auto-rows: 42vw;
  grid-template-areas:
    "wild wild"
    "king lotus"
    "bud  bud"
    "dolo forest"
    "boat forest"
    "pep  pep"
    "bay  aur";
}

.tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 0.4rem;
  background: var(--tile);
  outline: 1px solid light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.08));
  outline-offset: -1px;
  isolation: isolate;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 0.9rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(to top, rgb(0 0 0 / 0.7), rgb(0 0 0 / 0.35) 55%, transparent);
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

.tile figcaption span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.8;
}

.t-wilderness { grid-area: wild; }
.t-kingfisher { grid-area: king; }
.t-forest { grid-area: forest; }
.t-lotus { grid-area: lotus; }
.t-budapest { grid-area: bud; }
.t-peppers { grid-area: pep; }
.t-dolomites { grid-area: dolo; }
.t-boats { grid-area: boat; }
.t-aurora { grid-area: aur; }
.t-bay { grid-area: bay; }

@media (hover: hover) {
  .tile figcaption {
    opacity: 0;
    transform: translateY(0.4rem);
    transition: opacity 0.3s, transform 0.3s;
  }

  .tile:hover figcaption {
    opacity: 1;
    transform: none;
  }

  .tile:hover img {
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile img,
  .tile figcaption {
    transition: none;
  }
}

@media (max-width: 699px) {
  .tile figcaption {
    padding: 1.75rem 0.6rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    background: linear-gradient(to top, rgb(0 0 0 / 0.8), rgb(0 0 0 / 0.5) 60%, transparent);
  }

  .tile figcaption span {
    font-size: 0.68rem;
    font-weight: 400;
  }
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: none;
    grid-auto-rows: 22vw;
    grid-template-areas:
      "wild wild king"
      "wild wild lotus"
      "bud  bud  forest"
      "bay  dolo forest"
      "pep  boat aur";
  }
}

@media (min-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(10rem, 15vw, 15rem);
    grid-template-areas:
      "wild wild king forest"
      "wild wild lotus forest"
      "bud  bud  bay  dolo"
      "pep  boat aur  dolo";
  }
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.foot p {
  margin: 0;
}

/* Page not found: one centred message. */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home {
  margin: 2.25rem 0 0;
  font-size: 1.05rem;
}

.home a {
  color: var(--ink);
  text-underline-offset: 0.25em;
  text-decoration-color: var(--accent);
}

/* Picture, topic and licence pages (not linked from the homepage). */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.foot a,
.photo-info a,
.prose a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent);
}

.photo {
  display: grid;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

.photo-figure {
  margin: 0;
  overflow: hidden;
  border-radius: 0.4rem;
  background: var(--tile);
}

.photo-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82svh;
  object-fit: contain;
}

.photo-info h1 {
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  font-weight: 400;
  line-height: 1.1;
}

.crumbs {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.crumbs a {
  color: var(--accent);
  text-decoration: none;
}

.about {
  margin: 1rem 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.photo-info .button {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border-radius: 0.4rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 1.25rem;
  margin: 1.75rem 0;
  font-size: 0.95rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.credit-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.credit {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.4rem;
  background: var(--tile);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.more h2 {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 400;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 45%), 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.4rem;
  background: var(--tile);
  outline: 1px solid light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.08));
  outline-offset: -1px;
}

.card span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (hover: hover) {
  .card:hover span {
    color: var(--accent);
  }
}

.topic h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.75rem);
}

.topic .lead {
  margin: 0.75rem 0 2rem;
  max-width: none;
}

.prose {
  max-width: 40rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  margin-bottom: 1.5rem;
}

@media (min-width: 1100px) {
  .photo {
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
