:root {
  --navy: #20324f;
  --ink: #283544;
  --muted: #66737a;
  --coral: #f06d65;
  --mint: #77b9a9;
  --mint-dark: #3f8d7c;
  --cream: #fff8ed;
  --paper: #fffdf8;
  --line: rgba(32, 50, 79, 0.12);
  --shadow: 0 20px 55px rgba(32, 50, 79, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 16%, rgba(119, 185, 169, 0.18), transparent 22rem),
    radial-gradient(circle at 92% 78%, rgba(240, 109, 101, 0.1), transparent 24rem),
    var(--cream);
}

a {
  color: inherit;
  text-decoration: none;
}

.machi-layout {
  display: grid;
  grid-template-columns: minmax(270px, 28%) minmax(420px, 44%) minmax(270px, 28%);
  height: 100svh;
  overflow: hidden;
}

.machi-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
  padding: clamp(22px, 3vw, 42px);
}

.machi-left {
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.9), rgba(255, 248, 237, 0.8)),
    url("../images/tomion/machi/machi_left_town.png") center bottom / 170% auto no-repeat;
}

.machi-right {
  justify-content: center;
  gap: 18px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(255, 248, 237, 0.84)),
    url("../images/tomion/machi/machi_cta_bg.png") center / cover no-repeat;
}

.machi-brand {
  display: inline-grid;
  gap: 4px;
  width: fit-content;
}

.machi-brand span {
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: 0.18em;
}

.machi-brand small,
.machi-kicker,
.card-label,
.right-card span,
.current-board span {
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.machi-left h1 {
  margin: 22px 0 18px;
  color: var(--navy);
  font-size: clamp(30px, 2.75vw, 40px);
  line-height: 1.46;
  letter-spacing: 0.04em;
  word-break: keep-all;
}

.machi-left h1 span {
  display: block;
  white-space: nowrap;
}

.lead {
  max-width: 32em;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.town-window {
  min-height: 190px;
  border: 10px solid rgba(255, 255, 255, 0.74);
  border-radius: 28px;
  background: url("../images/tomion/machi/machi_hero_town.png") center / cover no-repeat;
  box-shadow: var(--shadow);
  animation: townDrift 14s ease-in-out infinite alternate;
}

.current-board,
.right-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 14px 36px rgba(32, 50, 79, 0.08);
  padding: 18px;
  backdrop-filter: blur(12px);
}

.current-board strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 18px;
}

.machi-main {
  height: 100svh;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  padding: clamp(22px, 4vw, 48px);
}

.guide-card,
.machi-footer {
  position: relative;
  max-width: 760px;
  margin: 0 auto clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(255, 255, 255, 0.86)),
    url("../images/tomion/machi/machi_board_cards.png") center / cover no-repeat;
  box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 48px);
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.guide-card.is-visible,
.machi-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.guide-card h2,
.contact-card h2 {
  margin: 10px 0 18px;
  color: var(--navy);
  font-size: clamp(27px, 2.7vw, 40px);
  line-height: 1.45;
  letter-spacing: 0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.balanced-heading span {
  display: block;
  white-space: nowrap;
}

.guide-card p {
  color: var(--muted);
  line-height: 2;
}

.intro-card {
  min-height: calc(100svh - clamp(44px, 8vw, 96px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-board {
  min-height: 260px;
  margin: 20px 0 24px;
  border-radius: 24px;
  background: url("../images/tomion/machi/machi_hero_town.png") center / cover no-repeat;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.08);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: fit-content;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 14px 28px rgba(240, 109, 101, 0.24);
  color: #fff;
  font-weight: 900;
  padding: 0 24px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(240, 109, 101, 0.3);
}

.notice-grid,
.voice-stack {
  display: grid;
  gap: 16px;
}

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

.notice-grid article,
.service-list article,
.shop-card,
.voice-stack blockquote,
details {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(32, 50, 79, 0.06);
}

.notice-grid article {
  padding: 22px;
}

.notice-grid span {
  color: var(--coral);
  font-weight: 900;
}

.notice-grid h3,
.shop-card h3 {
  margin: 8px 0 8px;
  color: var(--navy);
}

.service-list {
  display: grid;
  gap: 12px;
}

.service-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.service-list b {
  color: var(--navy);
}

.service-list span {
  color: var(--muted);
  font-size: 13px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shop-card {
  overflow: hidden;
}

.shop-photo {
  min-height: 150px;
  background-image: url("../images/tomion/machi/machi_shop_grid.png");
  background-size: 300% 200%;
}

.shop-card h3,
.shop-card p {
  padding-right: 18px;
  padding-left: 18px;
}

.shop-card p {
  padding-bottom: 18px;
  font-size: 13px;
  line-height: 1.75;
}

.cafe .shop-photo { background-position: 0 0; }
.salon .shop-photo { background-position: 50% 0; }
.school .shop-photo { background-position: 100% 0; }
.clinic .shop-photo { background-position: 0 100%; }
.flower .shop-photo { background-position: 50% 100%; }
.office .shop-photo { background-position: 100% 100%; }

.reason-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.reason-list li {
  border-radius: 16px;
  background: rgba(119, 185, 169, 0.12);
  color: var(--ink);
  line-height: 1.7;
  padding: 14px 16px;
}

.voice-stack blockquote {
  margin: 0;
  padding: 22px;
}

.voice-stack p {
  margin-bottom: 10px;
}

.voice-stack cite {
  color: var(--mint-dark);
  font-style: normal;
  font-weight: 800;
}

details {
  margin-top: 12px;
  padding: 18px 20px;
}

summary {
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
}

details p {
  margin: 12px 0 0;
}

.contact-card {
  background:
    linear-gradient(135deg, rgba(240, 109, 101, 0.1), rgba(119, 185, 169, 0.12)),
    rgba(255, 253, 248, 0.96);
}

.machi-footer {
  overflow: hidden;
  min-height: 260px;
  text-align: center;
}

.footer-town {
  min-height: 180px;
  border-radius: 24px;
  background: url("../images/tomion/machi/machi_footer_town.png") center / cover no-repeat;
}

.machi-footer p {
  color: var(--mint-dark);
  font-weight: 900;
  letter-spacing: 0.12em;
}

.cta-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.9), rgba(255, 248, 237, 0.88)),
    url("../images/tomion/machi/machi_board_cards.png") center / cover no-repeat;
}

.cta-card h2 {
  margin: 8px 0 18px;
  color: var(--navy);
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.5;
  word-break: keep-all;
}

.cta-card h2 span {
  display: block;
  white-space: nowrap;
}

.section-nav {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.78);
  padding: 12px;
}

.section-nav a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  transition: background 180ms ease, color 180ms ease;
}

.section-nav a.is-active {
  background: var(--navy);
  color: #fff;
}

.mini-shop strong {
  display: block;
  color: var(--navy);
  line-height: 1.7;
}

.mini-shop p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.mobile-fixed-cta {
  position: fixed;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
  padding: 8px;
  backdrop-filter: blur(14px);
}

.mobile-fixed-cta a {
  display: grid;
  min-height: 42px;
  border-radius: 999px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 900;
  place-items: center;
}

.mobile-fixed-cta a:last-child {
  background: var(--coral);
  color: #fff;
}

@keyframes townDrift {
  from { background-position: 45% 50%; }
  to { background-position: 56% 50%; }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .machi-layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  .machi-side,
  .machi-main {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .machi-left,
  .machi-right {
    border: 0;
  }

  .machi-left {
    min-height: 640px;
  }

  .machi-right {
    padding-top: 0;
  }

  .section-nav {
    display: none;
  }

  .machi-main {
    padding: 20px;
  }

  .guide-card,
  .machi-footer {
    border-radius: 24px;
  }

  .mobile-fixed-cta {
    display: grid;
  }

  body {
    padding-bottom: 76px;
  }
}

@media (max-width: 640px) {
  .machi-side {
    padding: 22px 18px;
  }

  .machi-left {
    min-height: auto;
    gap: 20px;
  }

  .machi-left h1 {
    font-size: clamp(31px, 8.8vw, 42px);
  }

  .town-window {
    min-height: 160px;
  }

  .guide-card {
    padding: 24px 20px;
  }

  .guide-card h2 {
    font-size: clamp(25px, 7vw, 34px);
  }

  .notice-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .service-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-link {
    width: 100%;
  }
}

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

  .guide-card,
  .machi-footer {
    opacity: 1;
    transform: none;
  }
}
