/* ---------------------------------------------------------------------
   The World By Arnoud — public site
   Concept: field notebook / contact sheet. Photos butt together like
   frames on a strip; captions read like a photographer's log line
   (location set in monospace, as if it were exposure data).
--------------------------------------------------------------------- */

:root {
  --ink: #14151a;
  --ink-soft: #2b2d35;
  --paper: #f5f5f1;
  --paper-dim: #e6e5df;
  --accent: #ff4d2e;
  --accent-ink: #14151a;
  --line-on-paper: rgba(20, 21, 26, 0.14);
  --line-on-ink: rgba(245, 245, 241, 0.18);

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --gutter: 28px;
  color-scheme: light;
}

@media (max-width: 700px) {
  :root {
    --gutter: 16px;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body > main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

a {
  color: inherit;
}

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

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Nav ---------- */

.site-nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--gutter) var(--gutter) 18px;
  gap: 16px;
}

.site-nav__wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: lowercase;
  color: var(--ink);
}

.site-nav__links {
  display: flex;
  gap: 22px;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.site-nav__links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-nav__links a:hover,
.site-nav__links a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Home hero (vertically centered intro + carousel) ---------- */

.home-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  padding: 32px var(--gutter);
  text-align: center;
}

.home-intro {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.35;
  color: var(--ink-soft);
}

.home-cta {
  padding: 12px 26px;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.home-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Home carousel (auto-advancing, most recent photos) ---------- */

.carousel {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: carouselFadeIn 0.9s ease forwards 0.15s;
}

@keyframes carouselFadeIn {
  to {
    opacity: 1;
  }
}

.carousel__viewport {
  overflow: hidden;
  background: var(--ink-soft);
}

.carousel__track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel__slide {
  position: relative;
  flex: 0 0 100%;
  height: min(64vh, 560px);
}

.carousel__slide-link {
  display: block;
  width: 100%;
  height: 100%;
}

.carousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__slide-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 40px 22px 18px;
  background: linear-gradient(to top, rgba(10, 10, 12, 0.8), rgba(10, 10, 12, 0));
  color: var(--paper);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.carousel__slide-link:hover .carousel__slide-overlay,
.carousel__slide-link:focus-visible .carousel__slide-overlay {
  opacity: 1;
  transform: translateY(0);
}

.carousel__slide-overlay-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.carousel__slide-overlay-location {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  opacity: 0.85;
}

.carousel__arrow {
  position: absolute;
  top: calc(min(64vh, 560px) / 2);
  transform: translateY(-50%);
  background: rgba(20, 21, 26, 0.55);
  color: var(--paper);
  border: none;
  width: 48px;
  height: 48px;
  font-size: 26px;
  line-height: 1;
}

.carousel__arrow:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.carousel__arrow--prev {
  left: 12px;
}

.carousel__arrow--next {
  right: 12px;
}

.carousel__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
  min-height: 24px;
}

.carousel__counter {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--accent);
}

.carousel__caption-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.carousel__caption-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.carousel__caption-location {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 14px;
}

.carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--line-on-paper);
}

.carousel__dot:hover {
  background: var(--ink-soft);
}

.carousel__dot.is-active {
  background: var(--accent);
}

@media (max-width: 700px) {
  .carousel__slide {
    height: min(46vh, 360px);
  }

  .carousel__arrow {
    top: calc(min(46vh, 360px) / 2);
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

/* ---------- Empty states ---------- */

.empty-state {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 14px;
}

.empty-state--home {
  min-height: 70vh;
}

/* ---------- Gallery page ---------- */

.gallery-page {
  padding: 0 var(--gutter) 60px;
}

.gallery-header {
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--line-on-paper);
  margin-bottom: 28px;
}

.gallery-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 8vw, 84px);
  line-height: 0.9;
  margin: 0;
  text-transform: lowercase;
}

.gallery-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-row {
  display: flex;
  align-items: stretch;
  gap: var(--gutter);
}

.gallery-row--photo-right {
  flex-direction: row-reverse;
}

.gallery-row__photo {
  position: relative;
  flex: 1 1 60%;
  min-width: 0;
  margin: 0;
  cursor: pointer;
  background: var(--ink-soft);
  overflow: hidden;
}

.gallery-row__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-row__photo:hover img {
  transform: scale(1.03);
}

.gallery-row__info {
  flex: 1 1 40%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}

.gallery-row__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.05;
  margin: 0 0 8px;
  text-transform: lowercase;
}

.gallery-row__location {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin: 0 0 20px;
}

.gallery-row__download {
  align-self: flex-start;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}

.gallery-row__download:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

@media (max-width: 720px) {
  .gallery-row,
  .gallery-row--photo-right {
    flex-direction: column;
    gap: 0;
  }

  .gallery-row__photo {
    aspect-ratio: 4 / 3;
  }

  .gallery-row__info {
    padding: 18px 2px 32px;
  }
}

/* Extra breathing room on wide viewports — the gallery rows no longer run
   edge-to-edge. The carousel centers itself independently via max-width. */
@media (min-width: 1000px) {
  .gallery-page {
    padding-left: clamp(64px, 8vw, 140px);
    padding-right: clamp(64px, 8vw, 140px);
  }
}

/* ---------- Photo detail page ---------- */

.photo-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px var(--gutter) 60px;
}

.photo-page__stage {
  position: relative;
  display: flex;
  justify-content: center;
  background: var(--ink);
  padding: 24px 0;
}

.photo-page__image {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-page__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 21, 26, 0.55);
  color: var(--paper);
  border: none;
  text-decoration: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.photo-page__arrow:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.photo-page__arrow--prev {
  left: 12px;
}

.photo-page__arrow--next {
  right: 12px;
}

.photo-page__info {
  padding-top: 28px;
  max-width: 680px;
}

.photo-page__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
  margin: 0 0 6px;
  text-transform: lowercase;
}

.photo-page__location {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin: 0 0 20px;
}

.photo-page__description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.photo-page__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.photo-page__back {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.photo-page__back:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 700px) {
  .photo-page__image {
    max-height: 50vh;
  }

  .photo-page__arrow {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter) 28px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.site-footer__brand {
  opacity: 0.6;
}

.site-footer__credit a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.site-footer__credit a:hover {
  color: var(--accent);
}
