/* =========================================================
   Hikari — Photography Portfolio
   Minimal, light, editorial.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf8;
  --ink: #111111;
  --ink-soft: #6b6b6b;
  --ink-faint: #a8a8a8;
  --line: #ececec;
  --accent: #111111;

  --serif: 'Cormorant Garamond', 'Times New Roman', 'Songti SC', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',
    'PingFang SC', 'Microsoft YaHei', sans-serif;

  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
  --section-gap: clamp(80px, 12vw, 160px);
  --photo-gap: clamp(16px, 2vw, 28px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 7vw, 96px); line-height: 1.02; }
h2 { font-size: clamp(28px, 4vw, 48px); line-height: 1.1; }
h3 { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.2; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.serif { font-family: var(--serif); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.04em;
}
.brand small {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-left: 8px;
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 14vw, 180px) var(--gutter) clamp(60px, 10vw, 120px);
}
.hero__eyebrow { margin-bottom: 28px; }
.hero h1 { max-width: 14ch; margin-bottom: 36px; }
.hero__lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--ink-soft);
  max-width: 38ch;
  line-height: 1.5;
}
.hero__meta {
  margin-top: 56px;
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero__meta span strong {
  display: block;
  color: var(--ink);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: none;
  margin-top: 4px;
  font-family: var(--serif);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-gap);
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 80px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section__head h2 { font-style: italic; }
.section__head .right {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Cities index ---------- */
.cities {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 2.4vw, 36px);
}
.city-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-soft);
}
.city-card__img {
  aspect-ratio: 4/5;
  overflow: hidden;
}
.city-card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.95);
}
.city-card:hover .city-card__img img { transform: scale(1.05); filter: saturate(1.05); }
.city-card__meta {
  padding: 20px 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.city-card__name {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.01em;
}
.city-card__name .cn {
  font-family: var(--serif);
  color: var(--ink-soft);
  margin-left: 10px;
  font-size: 0.7em;
}
.city-card__year {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.city-card__tag {
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.4;
}
.cities > .city-card:nth-child(1) { grid-column: span 7; }
.cities > .city-card:nth-child(2) { grid-column: span 5; }
.cities > .city-card:nth-child(3) { grid-column: span 4; }
.cities > .city-card:nth-child(4) { grid-column: span 4; }
.cities > .city-card:nth-child(5) { grid-column: span 4; }
.cities > .city-card:nth-child(n+4) { grid-column: span 4; }
.cities > .city-card:nth-child(1) .city-card__img { aspect-ratio: 16/10; }
.cities > .city-card:nth-child(2) .city-card__img { aspect-ratio: 16/10; }

/* ---------- City page header ---------- */
.city-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--gutter) clamp(40px, 6vw, 80px);
}
.city-hero .crumbs {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 36px;
}
.city-hero .crumbs a:hover { color: var(--ink); }
.city-hero h1 { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.city-hero h1 .cn { font-size: 0.55em; color: var(--ink-soft); }
.city-hero .tagline {
  margin-top: 24px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--ink-soft);
  max-width: 40ch;
}
.city-hero .meta-row {
  margin-top: 56px;
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.city-hero .meta-row div span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.city-hero .meta-row div strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
}

/* ---------- Photo grid (city page) ---------- */
/* Pure CSS columns masonry — every photo keeps its real aspect ratio,
   columns auto-balance so there's no jagged bottom edge and no awkward
   empty strips. */
.photo-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-gap);
  column-count: 3;
  column-gap: var(--photo-gap);
  column-fill: balance;
}
.photo {
  display: block;
  break-inside: avoid;
  margin: 0 0 var(--photo-gap) 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: zoom-in;
}
.photo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.2s var(--ease), opacity 0.6s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.96);
  opacity: 0;
}
.photo img.loaded { opacity: 1; }
.photo:hover img { transform: scale(1.03); filter: saturate(1.05); }
.photo .idx {
  position: absolute; left: 14px; top: 14px;
  font-family: var(--serif);
  font-style: italic;
  color: #fff;
  background: rgba(0,0,0,0.32);
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 2;
}
.photo:hover .idx { opacity: 1; }

@media (max-width: 900px) {
  .photo-grid { column-count: 2; }
}
@media (max-width: 560px) {
  .photo-grid { column-count: 1; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* leave room for: top counter (~40px) + bottom caption (~100px) */
  padding: clamp(64px, 9vh, 96px) clamp(20px, 4vw, 60px) clamp(80px, 11vh, 120px);
  gap: clamp(16px, 2.4vh, 24px);
}
.lightbox.is-open { display: flex; animation: lb-fade 0.4s var(--ease); }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__img-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,0.08);
}
.lightbox__caption {
  flex: 0 0 auto;
  text-align: center;
  color: var(--ink);
  font-family: var(--serif);
  max-width: 90vw;
}
.lightbox__caption .title { font-size: clamp(20px, 2vw, 26px); margin-bottom: 4px; line-height: 1.25; }
.lightbox__caption .sub {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
  font-size: 16px;
  z-index: 2;
}
.lightbox__close:hover, .lightbox__nav:hover { background: #fff; transform: scale(1.06); }
.lightbox__close { top: clamp(16px, 3vh, 32px); right: clamp(20px, 3vw, 40px); }
.lightbox__nav.prev { left: clamp(20px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lightbox__nav.next { right: clamp(20px, 3vw, 40px); top: 50%; transform: translateY(-50%); }
.lightbox__nav.prev:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__nav.next:hover { transform: translateY(-50%) scale(1.06); }
.lightbox__count {
  position: absolute;
  top: clamp(16px, 3vh, 32px);
  left: clamp(20px, 3vw, 40px);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 2;
}

/* ---------- About ---------- */
.about {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--gutter) var(--section-gap);
}
.about .eyebrow { margin-bottom: 28px; }
.about h1 { margin-bottom: 56px; max-width: 16ch; }
.about p {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 1.4em;
}
.about p.lead::first-letter {
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  margin: 0.06em 0.12em 0 0;
  color: var(--ink);
}
.about__signature {
  margin-top: 64px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  gap: 24px;
  flex-wrap: wrap;
}
.about__signature .name {
  font-family: var(--serif);
  font-size: 28px;
}
.about__signature .social a {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-left: 20px;
}
.about__signature .social a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--gutter);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Fade-in on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured-grid, .cities {
    grid-template-columns: repeat(6, 1fr);
  }
  .featured-grid > a,
  .cities > .city-card {
    grid-column: span 6 !important;
    aspect-ratio: 4/3 !important;
  }
  .city-card__img { aspect-ratio: 4/3 !important; }
  .nav { gap: 18px; }
}

@media (max-width: 560px) {
  .site-header__inner { padding: 14px var(--gutter); }
  .brand small { display: none; }
  .nav a { font-size: 12px; }
  .hero { padding-top: 64px; }
  .hero__meta { gap: 28px; }
  .lightbox__nav.prev, .lightbox__nav.next { width: 36px; height: 36px; }
}