:root {
  --ink: #20201f;
  --muted: #75726e;
  --line: #e8e5e0;
  --paper: #fff;
  --wash: #f7f5f1;
  --accent: #e9574f;
  --accent-soft: #fbedeb;
  --sage: #829787;
  --shadow: 0 12px 32px rgba(44, 39, 32, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #eeeae4;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 42px rgba(43, 38, 32, .09);
}

.profile-header { padding: 24px 16px 20px; }

.eyebrow,
.section-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.profile-mark {
  position: relative;
  display: grid;
  flex: 0 0 78px;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid #dcd7d0;
  border-radius: 50%;
  background: #262523;
  color: #fff;
  box-shadow: inset 0 0 0 5px #f8f5f0;
  font-family: Georgia, serif;
}

.profile-mark span { font-size: 38px; line-height: 1; }
.profile-mark small { position: absolute; right: 20px; bottom: 15px; color: #d7b59f; font-size: 9px; }

.profile-copy { min-width: 0; }
.profile-copy h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 7vw, 28px); font-weight: 500; letter-spacing: .04em; line-height: 1.15; }
.profile-kana { margin: 5px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.profile-description { margin: 20px 0 0; }

.profile-stats { display: flex; gap: 30px; margin: 18px 0 0; }
.profile-stats div { display: flex; align-items: baseline; gap: 5px; }
.profile-stats dt { font-family: Georgia, serif; font-size: 20px; }
.profile-stats dd { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .1em; }

.view-tabs {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.view-tab {
  position: relative;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.view-tab strong { margin-left: 4px; color: inherit; }
.view-tab.is-active { color: var(--ink); font-weight: 700; }
.view-tab.is-active::after { position: absolute; right: 16px; bottom: -1px; left: 16px; height: 2px; background: var(--ink); content: ""; }

.content-section { padding: 30px 14px 4px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; letter-spacing: .04em; line-height: 1.2; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }

.spot-card {
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  scroll-margin-top: 72px;
}

.card-media { position: relative; overflow: hidden; width: 100%; aspect-ratio: 4 / 5; background: #eae6df; }
.spot-image { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: var(--image-position, center center); transform: scale(1); filter: none; transition: transform .35s ease, filter .35s ease, opacity .2s; }
.card-media.is-missing img { opacity: 0; }
.card-media.is-missing::after { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #8b857d; background: linear-gradient(135deg, #ece6de, #dcd7d0); content: "OSAKAGRAM\A IMAGE COMING SOON"; white-space: pre; text-align: center; font-family: Georgia, serif; font-size: 13px; letter-spacing: .12em; }

.heart-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #292826;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}
.heart-button.is-favorite { color: var(--accent); }
.heart-button:focus-visible, .details-toggle:focus-visible, .category-toggle:focus-visible, .view-tab:focus-visible { outline: 3px solid rgba(53, 113, 165, .45); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .spot-card:hover .spot-image { transform: scale(1.04); filter: brightness(1.03); }
}

.card-media:active:not(:has(.heart-button:active)) .spot-image { transform: scale(.985); filter: none; }

.limited-badge { position: absolute; bottom: 12px; left: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(32,32,31,.88); color: #fff; line-height: 1.2; }
.limited-badge strong { display: block; font-size: 10px; letter-spacing: .16em; }
.limited-badge span { font-size: 11px; }

.card-body { padding: 17px 16px 18px; }
.card-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.spot-name { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 19px; line-height: 1.45; }
.spot-area { flex: 0 0 auto; margin-top: 3px; color: var(--muted); font-size: 11px; }
.spot-description { margin: 11px 0 0; color: #4d4b48; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 4px 8px; border-radius: 999px; background: var(--wash); color: #615d58; font-size: 11px; }

.details-toggle,
.external-link {
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid #d6d6d6;
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  touch-action: manipulation;
  transform: translateY(0) scale(1);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.details-toggle { width: 100%; margin-top: 16px; }

.spot-details { border-top: 1px solid var(--line); }
.details-inner { padding: 18px 16px 20px; }
.details-copy { margin: 0 0 16px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.notes { margin: 16px 0 0; padding: 13px 14px 13px 31px; border-radius: 12px; background: var(--wash); color: #5e5a55; font-size: 13px; }
.external-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.external-links.is-single { grid-template-columns: minmax(0, 1fr); }
.external-link { display: grid; min-width: 0; place-items: center; text-decoration: none; white-space: nowrap; }
.details-toggle:focus-visible, .external-link:focus-visible { outline: 3px solid rgba(17, 17, 17, .25); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .details-toggle:hover, .external-link:hover { border-color: #111; background: #111; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, .12); }
}

.details-toggle:active, .external-link:active { transform: translateY(0) scale(.97); box-shadow: 0 2px 5px rgba(0, 0, 0, .1); }

.grid-section { padding: 3px 2px 8px; }
.spot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.spot-grid-item { position: relative; display: block; min-width: 0; aspect-ratio: 1 / 1; overflow: hidden; padding: 0; border: 0; background: #e8e5e0; cursor: pointer; transform: scale(1); transition: transform .18s ease; }
.spot-grid-item img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--image-position, center center); transition: transform .3s ease, filter .3s ease, opacity .2s; }
.spot-grid-item.is-missing img { opacity: 0; }
.spot-grid-item.is-missing::after { position: absolute; inset: 0; display: grid; place-items: center; color: #8b857d; background: linear-gradient(135deg, #ece6de, #dcd7d0); content: "OSAKA"; font-family: Georgia, serif; font-size: 10px; letter-spacing: .12em; }
.grid-favorite-mark, .grid-limited { position: absolute; z-index: 2; top: 6px; display: grid; min-width: 24px; min-height: 24px; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); pointer-events: none; }
.grid-favorite-mark { right: 6px; color: var(--accent); font-size: 14px; }
.grid-limited { left: 6px; padding: 0 7px; color: var(--ink); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.spot-grid-item:focus-visible { z-index: 3; outline: 3px solid rgba(17, 17, 17, .35); outline-offset: -3px; }
.spot-grid-item:active { transform: scale(.97); }

@media (hover: hover) and (pointer: fine) {
  .spot-grid-item:hover img { transform: scale(1.05); filter: brightness(.88); }
}

.category-list { display: grid; gap: 10px; }
.category-block { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.category-toggle { display: grid; width: 100%; min-height: 72px; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: var(--paper); text-align: left; cursor: pointer; }
.category-title { display: block; font-family: Georgia, serif; font-size: 17px; letter-spacing: .035em; }
.category-description { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.category-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--wash); font-size: 20px; transition: transform .2s; }
.category-toggle[aria-expanded="true"] .category-icon { transform: rotate(45deg); }
.category-panel { padding: 5px 10px 2px; border-top: 1px solid var(--line); background: #fbfaf8; }
.category-panel .spot-card { margin: 12px 0; box-shadow: none; }

.empty-state { margin: 56px 16px 100px; padding: 42px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--wash); text-align: center; }
.empty-heart { display: block; margin-bottom: 12px; color: #aaa49c; font-size: 34px; }
.empty-state p { margin: 0; }

.site-footer { margin-top: 46px; padding: 32px 16px 38px; border-top: 1px solid var(--line); background: #262523; color: #fff; }
.footer-mark { font-family: Georgia, serif; letter-spacing: .1em; }
.site-footer p { margin: 5px 0 18px; color: #d9bca9; }
.site-footer small { display: block; color: #aaa6a0; font-size: 10px; line-height: 1.8; }

[hidden] { display: none !important; }

@media (min-width: 431px) {
  body { padding: 20px 0; }
  .app-shell { border-radius: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .details-toggle:hover, .details-toggle:active, .external-link:hover, .external-link:active { transform: none; }
  .spot-card:hover .spot-image, .card-media:active .spot-image { transform: none !important; filter: none !important; }
  .spot-grid-item:hover img, .spot-grid-item:active { transform: none !important; filter: none !important; }
}
