:root {
  --bg: #ffffff;
  --text: #121212;
  --muted: #6d6d6d;
  --line: #d9d9d9;
  --soft: #f7f7f5;
  --ink: #222222;
  --disabled: #d8d8d2;
  --active: #111111;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Serif JP", serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px clamp(24px, 6vw, 80px);
}

.site-title {
  display: inline-flex;
  align-items: center;
  font-family: "DM Mono", monospace;
  font-size: 13px;
  letter-spacing: 0;
  min-height: 44px;
  padding-right: 6px;
  text-decoration: none;
}

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.intro {
  margin-bottom: 96px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-family: "Cormorant Garamond", "Noto Serif JP", serif;
  font-weight: 500;
  line-height: 1;
}

h1 {
  max-width: 780px;
  font-size: clamp(64px, 12vw, 152px);
}

h2 {
  font-size: clamp(42px, 7vw, 88px);
}

.map-section {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: clamp(32px, 7vw, 88px);
  align-items: start;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  position: sticky;
  top: 24px;
}

.map-shell {
  min-height: 360px;
  overflow: hidden;
}

.travel-map {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  color: var(--ink);
}

.map-frame {
  fill: var(--soft);
  stroke: var(--line);
  stroke-width: 1.5;
}

.map-label {
  fill: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
  pointer-events: none;
  text-transform: uppercase;
}

.map-region {
  outline: none;
}

.japan-prefecture {
  fill: var(--disabled);
  stroke: var(--bg);
  stroke-width: 2;
  cursor: default;
  outline: none;
  pointer-events: all;
  transition: fill 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.japan-prefecture.has-photos {
  fill: #55534d;
  cursor: pointer;
}

.japan-prefecture.has-photos:hover,
.japan-prefecture.has-photos:focus {
  fill: var(--active);
}

.japan-prefecture.no-photos {
  opacity: 0.72;
}

.japan-prefecture.no-photos:hover,
.japan-prefecture.no-photos:focus {
  opacity: 0.95;
}

.map-region .region-shape {
  fill: var(--disabled);
  stroke: var(--bg);
  stroke-width: 2;
  pointer-events: none;
  transition: fill 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.region-hit-area {
  fill: transparent;
  stroke: transparent;
  stroke-width: 28;
  pointer-events: all;
}

.map-region.is-active {
  cursor: pointer;
}

.map-region.is-active .region-shape {
  fill: #55534d;
}

.map-region.is-active:hover .region-shape,
.map-region.is-active:focus .region-shape {
  fill: var(--active);
  transform: translateY(-2px);
}

.map-region.is-disabled {
  cursor: default;
}

.map-region.is-disabled .region-shape {
  opacity: 0.72;
}

.map-region.is-disabled:hover .region-shape,
.map-region.is-disabled:focus .region-shape {
  opacity: 0.95;
}

.tooltip {
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--text);
  background: var(--bg);
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 120ms ease;
}

.tooltip.is-visible {
  opacity: 1;
}

.gallery-page {
  padding-top: 72px;
}

.place-hero {
  margin-bottom: 72px;
}

.place-description {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.photo-count {
  margin: 24px 0 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

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

.country-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: inherit;
  text-decoration: none;
}

.country-card.is-active {
  cursor: pointer;
}

.country-card.is-active:hover,
.country-card.is-active:focus-visible {
  border-color: var(--text);
  outline: none;
}

.country-card.is-disabled {
  color: var(--muted);
}

.country-mark {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, transparent 46%, rgba(18, 18, 18, 0.12) 47%, rgba(18, 18, 18, 0.12) 54%, transparent 55%),
    var(--bg);
}

.country-card.is-active .country-mark {
  background:
    linear-gradient(135deg, transparent 46%, rgba(255, 255, 255, 0.18) 47%, rgba(255, 255, 255, 0.18) 54%, transparent 55%),
    var(--active);
}

.country-name {
  font-family: "Cormorant Garamond", "Noto Serif JP", serif;
  font-size: 36px;
  line-height: 1;
}

.country-status {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.photo-grid {
  column-count: 3;
  column-gap: 24px;
}

.photo-card {
  display: block;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  break-inside: avoid;
  touch-action: manipulation;
  text-align: left;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--soft);
  filter: saturate(0.9);
  transition: opacity 160ms ease, transform 160ms ease;
}

.photo-card:hover img,
.photo-card:focus-visible img,
.photo-card.is-touching img {
  opacity: 0.84;
  transform: translateY(-2px);
}

.photo-card:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 6px;
}

.photo-caption {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.has-lightbox {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 16px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.94);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  display: grid;
  gap: 16px;
  justify-items: center;
  margin: 0;
  min-width: 0;
}

.lightbox-image {
  display: block;
  max-width: min(920px, 100%);
  max-height: calc(100vh - 152px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--soft);
}

.lightbox-caption,
.lightbox-count {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.lightbox-count {
  margin: -8px 0 0;
}

.lightbox-close,
.lightbox-nav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
  touch-action: manipulation;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: var(--text);
  color: var(--bg);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 28px;
}

.lightbox-nav {
  justify-self: center;
  font-size: 42px;
}

@media (max-width: 760px) {
  .site-header {
    padding: 20px;
  }

  main {
    width: min(100% - 40px, 1120px);
    padding: 44px 0 72px;
  }

  .site-title {
    min-height: 48px;
    padding-right: 10px;
  }

  .intro {
    margin-bottom: 64px;
  }

  .map-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 48px 0;
  }

  .section-heading {
    position: static;
  }

  .map-shell {
    min-height: 0;
  }

  .gallery-page {
    padding-top: 40px;
  }

  .place-hero {
    margin-bottom: 44px;
  }

  .place-description {
    margin-top: 20px;
    font-size: 14px;
  }

  .photo-grid {
    column-count: 1;
    column-gap: 0;
  }

  .photo-card {
    margin-bottom: 32px;
  }

  .photo-caption {
    margin-top: 12px;
  }

  .country-grid {
    grid-template-columns: 1fr;
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 12px;
    padding: 72px 20px 24px;
  }

  .lightbox-figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 204px);
  }

  .lightbox-close,
  .lightbox-nav {
    width: 52px;
    height: 52px;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
    font-size: 30px;
  }

  .lightbox-prev {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .lightbox-next {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

@media (hover: none) {
  .map-region.is-active:hover .region-shape,
  .photo-card:hover img {
    opacity: 1;
    transform: none;
  }

  .photo-card:active img,
  .photo-card.is-touching img {
    opacity: 0.84;
    transform: translateY(-1px);
  }
}

@media (min-width: 761px) and (max-width: 1024px) {
  .photo-grid {
    column-count: 2;
  }

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