:root {
  --paper: #f6f1e7;
  --paper-2: #ebe2d2;
  --ink: #171a17;
  --muted: #65665e;
  --line: #c8bfad;
  --line-dark: #8e897d;
  --field: #334735;
  --rust: #9b4f35;
  --blue: #40677a;
  --gold: #a98138;
  --white: #fffaf0;
  --mono: "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(64, 103, 122, 0.07), transparent 28%, rgba(155, 79, 53, 0.06)),
    radial-gradient(circle at 1px 1px, rgba(23, 26, 23, 0.11) 1px, transparent 1.6px) 0 0 / 22px 22px,
    var(--paper);
  font-family: var(--sans);
}

img {
  max-width: 100%;
  display: block;
}

.photo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
}

a {
  color: inherit;
  text-decoration-color: rgba(23, 26, 23, 0.35);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid rgba(64, 103, 122, 0.55);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand svg {
  width: 24px;
  height: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav a {
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 750;
}

.page {
  width: calc(100% - 36px);
  max-width: 1180px;
  margin: 0 auto;
}

.hero {
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.64fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(48px, 8vw, 104px) 0 36px;
  border-bottom: 1px solid var(--line);
}

.home-hero {
  min-height: 0;
  grid-template-columns: 1fr;
  align-items: end;
  padding: clamp(56px, 9vw, 118px) 0 clamp(42px, 7vw, 86px);
}

.trip-hero {
  min-height: 0;
  grid-template-columns: 1fr;
  padding: clamp(38px, 6vw, 76px) 0 clamp(34px, 6vw, 64px);
}

.hero > *,
.section-head > *,
.page-title > * {
  min-width: 0;
  max-width: 100%;
}

.spatial-hero {
  align-items: stretch;
}

.spatial-hero > div:first-child {
  align-self: end;
}

.hero h1,
.page-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.spatial-hero h1 {
  font-size: clamp(4rem, 9vw, 8rem);
}

.hero h1.home-title {
  font-size: clamp(4rem, 10vw, 9.4rem);
  font-weight: 500;
  line-height: 0.92;
  color: var(--ink);
  white-space: nowrap;
}

.title-line {
  display: block;
}

.dek {
  max-width: 720px;
  margin: 28px 0 0;
  color: #282c27;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  line-height: 1.22;
  overflow-wrap: break-word;
}

.meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  text-transform: uppercase;
}

.hero-card,
.photo-placeholder {
  border: 1px solid var(--line-dark);
  background:
    linear-gradient(135deg, rgba(64, 103, 122, 0.22), transparent 35%),
    linear-gradient(35deg, rgba(155, 79, 53, 0.25), rgba(246, 241, 231, 0.25)),
    #252a25;
  color: var(--white);
  aspect-ratio: 4 / 5;
  display: grid;
  align-content: end;
  padding: 18px;
  overflow: hidden;
}

.hero-card.has-image,
.photo-placeholder.has-image {
  display: block;
  align-content: initial;
  padding: clamp(14px, 2.2vw, 28px);
  background: #fff;
  aspect-ratio: auto;
}

.hero-card.has-image::before,
.photo-placeholder.has-image::before {
  display: none;
}

.hero-card::before,
.photo-placeholder::before {
  content: "";
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  background:
    linear-gradient(transparent 0 18%, rgba(255, 250, 240, 0.13) 18% 19%, transparent 19% 45%, rgba(255, 250, 240, 0.16) 45% 46%, transparent 46%),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 250, 240, 0.08) 28px 29px);
}

.hero-card > *,
.photo-placeholder > * {
  grid-area: 1 / 1;
  align-self: end;
}

.hero-card.has-image > *,
.photo-placeholder.has-image > * {
  grid-area: auto;
  align-self: auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 760;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.section {
  padding: clamp(38px, 7vw, 82px) 0;
  border-bottom: 1px solid var(--line);
}

.page-title + .section {
  padding-top: clamp(24px, 4vw, 46px);
}

.section-head,
.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
}

.section h2,
.page-title h1 {
  margin: 0;
}

.section h2 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 0.95;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border-top: 1px solid var(--line-dark);
  padding-top: 14px;
}

.image-link {
  display: block;
  text-decoration: none;
}

.card h3 {
  margin: 10px 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.05;
}

.card p,
.prose p,
.caption {
  color: #3a3d37;
  line-height: 1.6;
}

.trip-list .card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
}

.trip-list .photo-placeholder.has-image {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trip-list .photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trip-list .card > .meta {
  margin: 18px 0 0;
}

.trip-list .card h3 {
  margin-bottom: 0;
}

.trip-list .card h3 + p {
  margin-top: 12px;
  min-height: 4.8em;
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 40px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.photo-strip .photo-placeholder {
  aspect-ratio: 4 / 3;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-strip .photo-placeholder:nth-child(2) {
  min-height: 0;
}

.photo-strip .photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero .dek {
  max-width: 620px;
  margin-top: clamp(18px, 3vw, 30px);
  color: #111511;
}

.portfolio-grid {
  column-count: 4;
  column-gap: 14px;
}

.portfolio-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.portfolio-item figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.essay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.65fr);
  gap: clamp(20px, 5vw, 68px);
  align-items: start;
}

.photo-sequence {
  display: grid;
  gap: clamp(16px, 3vw, 34px);
}

.photo-frame {
  margin: 0;
}

.photo-frame.wide .photo-placeholder {
  aspect-ratio: auto;
}

.photo-frame.portrait {
  width: min(680px, 100%);
}

.photo-frame.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photo-frame.pair .photo-placeholder.has-image {
  min-height: clamp(360px, 52vw, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame.pair .photo-img {
  width: auto;
  max-width: 100%;
  max-height: clamp(330px, 48vw, 620px);
  margin: auto;
}

.photo-frame.pair figcaption {
  grid-column: 1 / -1;
}

.photo-frame figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.manifest {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.35);
  padding: 18px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  overflow-wrap: anywhere;
}

.map-plate {
  position: relative;
  min-height: min(580px, 64vh);
  border: 1px solid var(--line-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 20% 25%, transparent 0 18%, rgba(64, 103, 122, 0.16) 18.3% 18.9%, transparent 19.2% 28%, rgba(64, 103, 122, 0.14) 28.3% 28.9%, transparent 29.2%),
    radial-gradient(circle at 70% 58%, transparent 0 15%, rgba(155, 79, 53, 0.18) 15.3% 15.9%, transparent 16.2% 24%, rgba(155, 79, 53, 0.14) 24.3% 24.9%, transparent 25.2%),
    #fff;
  overflow: hidden;
  padding: clamp(16px, 2vw, 24px);
  display: grid;
  align-content: end;
}

.map-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(23, 26, 23, 0.08) 42.2% 42.6%, transparent 42.8% 56%, rgba(23, 26, 23, 0.07) 56.2% 56.6%, transparent 56.8%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(23, 26, 23, 0.08) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(23, 26, 23, 0.08) 47px 48px);
  opacity: 0.55;
}

.map-line {
  position: absolute;
  left: 13%;
  top: 15%;
  width: 74%;
  height: 50%;
  border: 2px solid var(--blue);
  border-radius: 46% 54% 42% 58%;
  transform: rotate(-16deg);
}

.map-line.alt {
  left: 25%;
  top: 31%;
  width: 54%;
  height: 36%;
  border-color: var(--rust);
  border-radius: 58% 42% 55% 45%;
  transform: rotate(17deg);
}

.map-grid {
  position: absolute;
  inset: clamp(16px, 2vw, 24px);
  border: 1px solid rgba(23, 26, 23, 0.32);
  background:
    linear-gradient(rgba(23, 26, 23, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 23, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.38;
}

.map-plate .meta {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.84);
}

.site-footer {
  padding: 34px clamp(18px, 4vw, 56px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

@media (max-width: 1050px) {
  .portfolio-grid {
    column-count: 3;
  }
}

@media (max-width: 780px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .essay-grid,
  .grid,
  .grid.two,
  .section-head,
  .page-title {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 42px;
  }

  .home-hero {
    padding: 42px 0 34px;
  }

  .map-plate {
    min-height: 320px;
  }

  .hero h1,
  .page-title h1 {
    font-size: clamp(2.15rem, 9vw, 4rem);
    line-height: 1.03;
    overflow-wrap: anywhere;
  }

  .hero h1.home-title {
    font-size: clamp(2.7rem, 10.5vw, 4.6rem);
    white-space: nowrap;
  }

  .home-hero .dek {
    max-width: 100%;
  }

  .dek {
    font-size: 1.05rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .button-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .button {
    width: 100%;
    min-width: 0;
  }

  .photo-strip,
  .photo-frame.pair {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    column-count: 1;
  }

  .photo-frame.pair .photo-placeholder.has-image {
    min-height: 0;
  }

  .photo-frame.pair .photo-img {
    width: 100%;
    max-height: none;
  }

  .hero-card.has-image,
  .photo-placeholder.has-image {
    padding: 10px;
    max-width: 100%;
  }

  .photo-frame,
  .photo-frame.wide,
  .photo-frame.portrait,
  .photo-frame.pair {
    width: 100%;
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
