/* ------------------------------------------------------------------ *
 *  Anna's Travel — editorial photo journal
 * ------------------------------------------------------------------ */

:root {
  /* Warm paper palette pulled from the photographs */
  --paper:        #f3ede1;
  --paper-deep:   #ece4d3;
  --ink:          #1d1a14;
  --ink-soft:     #3b352a;
  --ink-mute:     #6f6552;
  --rule:         #cdc2a8;
  --accent:       #b34a1f;       /* terracotta — picked from the brick around the fountain */
  --accent-soft:  #d27a4d;
  --leaf:         #4a6a3a;       /* deep paddy green */
  --night:        #0a0a14;
  --night-paper:  #15131c;
  --night-ink:    #efeadf;
  --night-mute:   #9a93a7;
  --night-accent: #f6c66d;       /* the warm yellow from the lights */

  --max:        1240px;
  --gutter:     clamp(20px, 4vw, 56px);
  --radius:     2px;             /* almost-square; reads as printed */
  --shadow-1:   0 1px 0 rgba(0,0,0,.04), 0 20px 40px -28px rgba(60,40,10,.35);
  --shadow-2:   0 30px 80px -30px rgba(0,0,0,.55);

  --serif:      "Fraunces", "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(179,74,31,.06), transparent 60%),
    radial-gradient(800px 500px at -10% 30%, rgba(74,106,58,.05), transparent 60%);
}

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

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
}

::selection { background: var(--accent); color: var(--paper); }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 50%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: .01em;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  color: var(--accent);
}

.topnav {
  display: flex;
  gap: clamp(14px, 2.6vw, 30px);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.topnav a {
  position: relative;
  padding: 4px 0;
}
.topnav a:hover { color: var(--accent); }
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transition: right .35s ease;
}
.topnav a:hover::after { right: 0; }

@media (max-width: 540px) {
  .topnav a:not(:last-child) { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: clamp(560px, 92vh, 880px);
  padding: clamp(60px, 12vh, 140px) var(--gutter) clamp(60px, 10vh, 110px);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  filter: saturate(.85) contrast(.95);
  transform: scale(1.04);
  animation: heroDrift 28s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  0%   { transform: scale(1.04) translate3d(0, 0, 0); }
  100% { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}
.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(243,237,225,.5) 0%, rgba(243,237,225,.15) 30%, rgba(243,237,225,.85) 100%),
    radial-gradient(60% 80% at 15% 80%, rgba(243,237,225,.9), transparent 60%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.eyebrow {
  margin: 0 0 24px;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: 12px;
  transform: translateY(-2px);
}

.display {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(64px, 14vw, 196px);
  line-height: .9;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.display__italic {
  font-style: italic;
  font-weight: 320;
  color: var(--accent);
}

.lede {
  font-family: var(--serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 350;
  line-height: 1.5;
  max-width: 56ch;
  margin: 0 0 30px;
  color: var(--ink-soft);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 36px;
}
.hero__meta em {
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--serif);
  color: var(--ink-soft);
  margin-right: 4px;
}
.dot { opacity: .5; }

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 24px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: transform .25s ease, background .25s ease, gap .25s ease;
  will-change: transform;
}
.hero__cta:hover {
  background: var(--accent);
  gap: 14px;
  transform: translateY(-1px);
}
.hero__cta svg { transition: transform .35s ease; }
.hero__cta:hover svg { transform: translateY(3px); }

.hero__corner {
  position: absolute;
  top: clamp(40px, 6vh, 56px);
  right: var(--gutter);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.hero__corner-no  { font-size: 14px; }
.hero__corner-rule {
  width: 36px;
  height: 1px;
  background: var(--ink-mute);
  opacity: .6;
}

/* ---------- Chapter ---------- */

.chapter {
  padding: clamp(80px, 12vh, 140px) var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.chapter__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 720px;
  margin-bottom: clamp(48px, 8vh, 80px);
}
.chapter__no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: .05em;
}
.chapter__title {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(48px, 8vw, 112px);
  line-height: .95;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}
.chapter__intro {
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 21px);
  font-weight: 350;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 6px 0 0;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
}

.card {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-deep);
  box-shadow: var(--shadow-1);
  cursor: zoom-in;
  isolation: isolate;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(.2,.65,.2,1), filter .6s ease;
}
.card:hover img {
  transform: scale(1.04);
  filter: saturate(1.06);
}
.card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: end;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .04em;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,.0) 35%, rgba(0,0,0,.65) 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.card:hover figcaption,
.card:focus-within figcaption { opacity: 1; transform: translateY(0); }

.caption__no {
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  color: var(--paper);
  opacity: .85;
}
.caption__title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
}
.caption__where {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}

/* By-day grid layout (5 photos) */
.grid--day .card--feature  { grid-column: span 7; aspect-ratio: 1 / 1; }
.grid--day .card--tall:nth-of-type(2) { grid-column: span 5; aspect-ratio: 4 / 5; }
.grid--day .card--tall:nth-of-type(3) { grid-column: span 5; aspect-ratio: 4 / 5; }
.grid--day .card--wide     { grid-column: span 7; aspect-ratio: 7 / 6; }
.grid--day .card--regular  { grid-column: span 12; aspect-ratio: 16 / 9; }

/* By-night grid layout (8 photos) */
.grid--night .card--feature { grid-column: span 12; aspect-ratio: 21 / 9; }
.grid--night .card--tall:nth-of-type(2) { grid-column: span 4; aspect-ratio: 4 / 7; }
.grid--night .card--tall:nth-of-type(3) { grid-column: span 4; aspect-ratio: 4 / 7; }
.grid--night .card--wide:nth-of-type(4) { grid-column: span 4; aspect-ratio: 4 / 7; }
.grid--night .card--regular:nth-of-type(5) { grid-column: span 5; aspect-ratio: 3 / 4; }
.grid--night .card--tall:nth-of-type(6) { grid-column: span 7; aspect-ratio: 4 / 5; }
.grid--night .card--regular:nth-of-type(7) { grid-column: span 5; aspect-ratio: 3 / 4; }
.grid--night .card--wide:nth-of-type(8) { grid-column: span 7; aspect-ratio: 4 / 3; }

/* Responsive grids */
@media (max-width: 900px) {
  .grid--day  > .card { grid-column: span 12 !important; aspect-ratio: 4 / 3 !important; }
  .grid--day  .card--tall { aspect-ratio: 4 / 5 !important; }
  .grid--night > .card { grid-column: span 12 !important; }
  .grid--night .card--feature { aspect-ratio: 4 / 3 !important; }
  .grid--night .card--tall    { aspect-ratio: 4 / 5 !important; }
  .grid--night .card--regular { aspect-ratio: 3 / 4 !important; }
  .grid--night .card--wide    { aspect-ratio: 4 / 3 !important; }
}

/* Caption visible by default on touch — no hover */
@media (hover: none) {
  .card figcaption { opacity: 1; transform: none; }
}

/* ---------- Aside ---------- */

.aside {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 18px;
  margin: clamp(40px, 6vh, 70px) 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-mute);
  max-width: 720px;
}
.aside__rule {
  display: block;
  height: 1px;
  background: var(--rule);
}

/* ---------- Divider ---------- */

.divider {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  color: var(--ink-mute);
}
.divider__line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.divider__star {
  font-size: 16px;
  color: var(--accent);
}

/* ---------- Night chapter ---------- */

.chapter--night {
  background: var(--night);
  color: var(--night-ink);
  max-width: none;
  margin: 0;
  position: relative;
  isolation: isolate;
  padding: clamp(80px, 12vh, 140px) var(--gutter);
}
.chapter--night::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(246,198,109,.08), transparent 60%),
    radial-gradient(700px 400px at 0% 80%, rgba(82,140,255,.08), transparent 60%);
  z-index: -1;
}
.chapter--night > .chapter__head,
.chapter--night > .grid { max-width: var(--max); margin-left: auto; margin-right: auto; }

.chapter__no--night     { color: var(--night-accent); }
.chapter__title--night  { color: var(--night-ink); }
.chapter__intro--night  { color: var(--night-mute); }

.card.dark {
  background: var(--night-paper);
  box-shadow: var(--shadow-2);
}
.card.dark figcaption { color: #fff; }

/* ---------- Colophon ---------- */

.colophon {
  padding: clamp(80px, 12vh, 130px) var(--gutter);
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
}
.colophon__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.colophon__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 18px;
}
.colophon p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.colophon__sign {
  font-style: italic;
  color: var(--ink) !important;
  margin-top: 24px !important;
}
.colophon__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 4, .94);
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

.lightbox__stage {
  position: relative;
  margin: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
}
.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.8);
  opacity: 0;
  transform: scale(.98);
  transition: opacity .35s ease, transform .35s ease;
}
.lightbox.is-open .lightbox__img { opacity: 1; transform: scale(1); }

.lightbox__caption {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-items: end;
  color: #f1ece0;
  font-size: 13px;
  letter-spacing: .04em;
  max-width: 720px;
}
.lightbox__no {
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  color: var(--night-accent);
}
.lightbox__title {
  font-family: var(--serif);
  font-size: 19px;
}
.lightbox__where {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.4);
  transform: scale(1.04);
}
.lightbox__close { top: clamp(16px, 3vw, 32px); right: clamp(16px, 3vw, 32px); }
.lightbox__nav--prev { left: clamp(12px, 3vw, 28px); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: clamp(12px, 3vw, 28px); top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.04); }
.lightbox__nav--next:hover { transform: translateY(-50%) scale(1.04); }

@media (max-width: 640px) {
  .lightbox__nav { display: none; }  /* swipe / tap-to-advance instead */
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.65,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .hero__bg { animation: none; }
  .card img { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto; }
}
