:root {
  --text: #151515;
  --muted: #666;
  --line: #d9d9d9;
  --paper: #f7f6f1;
  --panel: #fff;
  --accent: #e60012;
  --ink: #1f1f1f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(247, 246, 241, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: min(260px, 54vw);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.64);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(330px, 480px);
  gap: clamp(32px, 7vw, 92px);
  align-items: center;
  min-height: 500px;
  padding: clamp(72px, 9vw, 118px) clamp(18px, 6vw, 88px) clamp(52px, 7vw, 84px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfaf6 0%, var(--paper) 100%);
}

.section-label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.hero h1,
.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1 span {
  display: block;
}

.hero p:not(.section-label),
.section-head p,
.map-panel p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.hero-copy {
  max-width: 760px;
}

.hero-map-card {
  display: grid;
  gap: 14px;
  align-self: stretch;
  min-width: 0;
}

.hero-map-card img {
  width: 100%;
  height: min(310px, 34vw);
  min-height: 240px;
  object-fit: contain;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
}

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

.hero-stats div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 90px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.hero-stats strong {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}

.hero-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.map-section,
.list-section {
  padding: clamp(56px, 9vw, 110px) clamp(18px, 6vw, 88px);
}

.section-head {
  max-width: 820px;
  margin-bottom: 34px;
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 54px);
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(640px, 1fr) minmax(280px, 380px);
  gap: 24px;
}

.japan-map {
  position: relative;
  min-height: 660px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.map-image {
  position: absolute;
  right: 0;
  top: 50%;
  width: min(78%, 760px);
  height: auto;
  max-height: 94%;
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.pin-layer {
  position: absolute;
  right: 0;
  top: 50%;
  width: min(78%, 760px);
  aspect-ratio: 1 / 1;
  z-index: 4;
  pointer-events: none;
  transform: translateY(-50%);
}

.map-region,
.map-pin {
  border: 1px solid rgba(0, 0, 0, 0.18);
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.map-region {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 112px;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
  z-index: 3;
}

.map-region strong,
.map-pin strong {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
}

.map-region:hover,
.map-region.is-active,
.map-pin:hover,
.map-pin.is-active {
  color: #fff;
  background: var(--ink);
  transform: translateY(-3px);
}

.map-region:hover strong,
.map-region.is-active strong,
.map-pin:hover strong,
.map-pin.is-active strong {
  color: var(--ink);
  background: #fff;
}

.region-hokkaido {
  left: 4%;
  top: 6%;
}

.region-tohoku {
  left: 4%;
  top: 16%;
}

.region-kanto {
  left: 4%;
  top: 26%;
}

.region-chubu {
  left: 4%;
  top: 36%;
}

.region-kansai {
  left: 4%;
  top: 46%;
}

.region-chugoku {
  left: 4%;
  top: 56%;
}

.region-shikoku {
  left: 4%;
  top: 66%;
}

.region-kyushu {
  left: 4%;
  top: 76%;
}

.map-pin {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  z-index: 1;
  pointer-events: auto;
}

.map-pin span {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  display: block;
  width: max-content;
  max-width: 120px;
  padding: 5px 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.map-pin strong {
  min-width: 0;
  width: 100%;
  height: 100%;
  color: #fff;
  background: transparent;
  font-size: 12px;
}

.map-pin:hover,
.map-pin:focus-visible,
.map-pin.is-active {
  color: #fff;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.25);
  z-index: 8;
}

.map-pin:hover span,
.map-pin:focus-visible span,
.map-pin.is-active span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.map-pin:hover strong,
.map-pin:focus-visible strong,
.map-pin.is-active strong {
  color: #fff;
  background: transparent;
}

.map-panel {
  display: grid;
  align-content: start;
  gap: 28px;
  min-height: 620px;
  padding: 28px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  background: #fff;
}

.map-panel h3 {
  margin: 0;
  font-size: 34px;
}

.region-actions {
  display: grid;
  gap: 10px;
}

.region-actions button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.region-actions button.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.list-head > div {
  max-width: 760px;
}

.search-box {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-box input {
  min-height: 52px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.company-grid {
  display: grid;
  gap: 34px;
}

.company-region-group {
  display: grid;
  gap: 16px;
}

.company-region-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--ink);
}

.company-region-heading h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}

.company-region-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

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

.company-empty {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.company-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  min-height: 360px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
}

.company-card.is-hidden {
  display: none;
}

.company-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.company-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.company-card .company-location {
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.company-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: #ecebe6;
}

.company-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.company-thumb:hover img {
  transform: scale(1.04);
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.company-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.company-links a.secondary {
  color: var(--text);
  border: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 980px) {
  .hero,
  .map-shell,
  .list-head,
  .company-region-grid {
    grid-template-columns: 1fr;
  }

  .hero-map-card img {
    height: auto;
    min-height: 0;
    object-fit: contain;
  }

  .japan-map {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: auto;
    padding: 20px;
  }

  .map-image {
    position: static;
    grid-column: 1 / -1;
    width: min(100%, 620px);
    max-height: none;
    margin: 0 auto 8px;
    transform: none;
  }

  .map-region {
    position: static;
    width: 100%;
  }

  .pin-layer {
    display: none;
  }

  .list-head {
    align-items: stretch;
  }

  .company-region-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .company-region-heading p {
    margin: 0;
  }

  .map-panel {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    display: grid;
    gap: 12px;
  }

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

  .nav a {
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }

  .hero {
    min-height: auto;
    padding-top: 52px;
  }

  .hero h1 {
    font-size: clamp(32px, 11vw, 48px);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats div {
    min-height: 78px;
  }

  .japan-map {
    grid-template-columns: 1fr;
  }

  .map-region {
    width: auto;
  }

  .region-hokkaido {
    top: auto;
  }

  .region-tohoku {
    top: auto;
  }

  .region-kanto {
    top: auto;
  }

  .region-chubu {
    top: auto;
  }

  .region-kansai {
    top: auto;
  }

  .region-chugoku {
    top: auto;
  }

  .region-shikoku {
    top: auto;
  }

  .region-kyushu {
    top: auto;
  }

  .map-image {
    opacity: 1;
  }
}
