:root {
  color-scheme: light;
  --ink: #10233b;
  --indigo: #0b315f;
  --deep-indigo: #061b34;
  --paper: #fbf5e7;
  --paper-strong: #fffaf0;
  --line: rgba(16, 35, 59, 0.16);
  --aizome: #1f5f86;
  --leaf: #1f6e5c;
  --persimmon: #a84f2e;
  --gold: #d1a84d;
  --shadow: 0 18px 42px rgba(4, 20, 41, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--ink);
  background: #0b2943;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(251, 245, 231, 0.15), rgba(6, 27, 52, 0.28)),
    url("assets/kamiyama-indigo-mountains.png") center / cover no-repeat;
}

body::after {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 12%, rgba(209, 168, 77, 0.18), transparent 28%),
    linear-gradient(90deg, rgba(4, 20, 41, 0.35), transparent 26%, transparent 74%, rgba(4, 20, 41, 0.32));
  mix-blend-mode: multiply;
}

button,
input,
a {
  font: inherit;
}

button {
  min-height: 64px;
  border: 0;
  cursor: pointer;
}

button:active,
.detail-link:active,
.phone-link:active {
  transform: scale(0.97);
}

.transition-effect {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
}

.transition-effect::before,
.transition-effect::after {
  position: absolute;
  inset: 50%;
  width: 34vmax;
  height: 34vmax;
  content: "";
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}

.transition-effect::before {
  background:
    radial-gradient(circle, rgba(255, 250, 240, 0.32), rgba(31, 95, 134, 0.24) 36%, rgba(6, 27, 52, 0) 68%),
    repeating-radial-gradient(circle, rgba(255, 250, 240, 0.38) 0 2px, rgba(255, 250, 240, 0) 2px 16px);
  mix-blend-mode: screen;
}

.transition-effect::after {
  background:
    conic-gradient(from 20deg, rgba(11, 49, 95, 0), rgba(31, 110, 92, 0.34), rgba(209, 168, 77, 0.18), rgba(11, 49, 95, 0));
  filter: blur(8px);
}

.transition-effect.effect-active {
  animation: effectVeil 720ms ease-out both;
}

.transition-effect.effect-active::before {
  animation: indigoRipple 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.transition-effect.effect-active::after {
  animation: indigoRipple 920ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(209, 168, 77, 0.85);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 20px 52px;
}

.site-header {
  padding: 28px 0 22px;
  color: var(--paper-strong);
  text-shadow: 0 2px 12px rgba(4, 20, 41, 0.38);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  font-size: 54px;
  line-height: 1.15;
}

.lead {
  width: min(560px, 100%);
  margin: 14px 0 0;
  font-size: 24px;
  line-height: 1.7;
}

.app {
  margin-top: 8px;
}

.screen {
  display: none;
}

.screen-active {
  display: block;
}

.screen-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  color: var(--paper-strong);
  text-shadow: 0 2px 12px rgba(4, 20, 41, 0.36);
}

.screen-heading h2,
.results-top h2 {
  margin: 0;
  font-size: 40px;
  line-height: 1.25;
}

.total-count,
.selected-kicker,
.result-count {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.total-count {
  color: #f3d998;
}

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

.category-card {
  min-height: 224px;
  padding: 26px;
  border: 1px solid rgba(255, 250, 240, 0.58);
  border-radius: 8px;
  color: var(--paper-strong);
  text-align: left;
  background:
    linear-gradient(145deg, rgba(11, 49, 95, 0.88), rgba(31, 110, 92, 0.78)),
    rgba(11, 49, 95, 0.72);
  box-shadow: var(--shadow);
  animation: cardFloatIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 50ms);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 245, 231, 0.92);
  box-shadow: 0 24px 54px rgba(4, 20, 41, 0.28);
}

.category-card-name {
  display: block;
  margin-bottom: 18px;
  font-size: 34px;
  font-weight: 800;
}

.category-card-description {
  display: block;
  min-height: 50px;
  font-size: 19px;
  line-height: 1.6;
  color: rgba(255, 250, 240, 0.88);
}

.category-card-count {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #0d2944;
  font-size: 17px;
  font-weight: 800;
  background: #f3d998;
}

.results-screen {
  padding-bottom: 26px;
}

.results-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  color: var(--paper-strong);
  text-shadow: 0 2px 12px rgba(4, 20, 41, 0.36);
}

.back-button,
.empty-button {
  padding: 0 20px;
  border-radius: 8px;
  color: var(--paper-strong);
  font-weight: 800;
  background: var(--persimmon);
  box-shadow: 0 12px 26px rgba(4, 20, 41, 0.22);
  transition: transform 140ms ease, filter 140ms ease;
}

.selected-kicker {
  margin-bottom: 6px;
  color: #f3d998;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.search-field {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(16, 35, 59, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
}

.search-field span {
  font-size: 17px;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  min-height: 62px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 19px;
  background: #fffdf6;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.category-tab {
  min-height: 108px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 250, 240, 0.55);
  border-radius: 8px;
  color: var(--paper-strong);
  font-weight: 800;
  font-size: 17px;
  background: rgba(6, 27, 52, 0.72);
  box-shadow: 0 12px 26px rgba(4, 20, 41, 0.2);
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
}

.category-tab[aria-pressed="true"] {
  color: #071c31;
  background: #f3d998;
}

.swipe-picker {
  position: relative;
  margin: 18px 0 20px;
  padding: 18px 0 12px;
  overflow: hidden;
  perspective: 1200px;
}

.swipe-picker::before {
  position: absolute;
  inset: 44px 8% 40px;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(243, 217, 152, 0.24), transparent 32%),
    radial-gradient(circle at 65% 52%, rgba(31, 110, 92, 0.26), transparent 42%);
  filter: blur(18px);
  opacity: 0.9;
  pointer-events: none;
}

.swipe-picker::after {
  position: absolute;
  inset: 52% -20% auto;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 250, 240, 0.82), rgba(243, 217, 152, 0.8), transparent);
  opacity: 0;
  transform: translateY(-50%) scaleX(0.35);
  pointer-events: none;
}

.swipe-picker.swipe-pulse::after {
  animation: swipeScan 520ms ease-out both;
}

.swipe-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--paper-strong);
  text-shadow: 0 2px 12px rgba(4, 20, 41, 0.36);
}

.swipe-heading h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.swipe-status {
  margin: 0;
  color: #f3d998;
  font-size: 19px;
  font-weight: 800;
}

.swipe-viewport {
  position: relative;
  z-index: 1;
  min-height: 430px;
  overflow: hidden;
  border-radius: 8px;
  outline: none;
  touch-action: pan-y;
}

.swipe-viewport::before,
.swipe-viewport::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 12%;
  content: "";
  pointer-events: none;
}

.swipe-viewport::before {
  left: 0;
  background: linear-gradient(90deg, rgba(6, 27, 52, 0.86), transparent);
}

.swipe-viewport::after {
  right: 0;
  background: linear-gradient(270deg, rgba(6, 27, 52, 0.86), transparent);
}

.swipe-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-height: 410px;
  padding: 14px 0 22px;
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.swipe-viewport.is-dragging .swipe-track {
  transition: none;
}

.swipe-card {
  position: relative;
  flex: 0 0 min(520px, 76vw);
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.38);
  border-radius: 8px;
  color: var(--paper-strong);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(5, 17, 34, 0.08), rgba(5, 17, 34, 0.78)),
    linear-gradient(145deg, rgba(31, 95, 134, 0.96), rgba(31, 110, 92, 0.84));
  box-shadow: 0 22px 54px rgba(4, 20, 41, 0.34);
  opacity: 0.46;
  transform: scale(0.78) rotateY(18deg) translateY(20px);
  transform-origin: center;
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.swipe-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 250, 240, 0.28), transparent 24%),
    linear-gradient(120deg, rgba(255, 250, 240, 0.16), transparent 34%, rgba(255, 250, 240, 0.08));
  opacity: 0;
  transition: opacity 360ms ease;
  pointer-events: none;
}

.swipe-card.is-before {
  transform: scale(0.82) rotateY(22deg) translateY(18px);
}

.swipe-card.is-after {
  transform: scale(0.82) rotateY(-22deg) translateY(18px);
}

.swipe-card.is-active {
  z-index: 2;
  opacity: 1;
  border-color: rgba(243, 217, 152, 0.9);
  box-shadow: 0 34px 80px rgba(4, 20, 41, 0.46);
  transform: scale(1) rotateY(0deg) translateY(0);
}

.swipe-card.is-active::before {
  opacity: 1;
}

.swipe-card-image,
.swipe-card-placeholder {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  background: linear-gradient(145deg, rgba(31, 95, 134, 0.94), rgba(31, 110, 92, 0.86));
}

.swipe-card-image {
  display: block;
  object-fit: cover;
}

.swipe-card-placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  font-size: 28px;
  font-weight: 900;
}

.swipe-card-body {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 22px;
}

.swipe-card h4 {
  margin: 0;
  font-size: 31px;
  line-height: 1.28;
}

.swipe-card p {
  margin: 0;
  color: rgba(255, 250, 240, 0.88);
  font-size: 18px;
  line-height: 1.65;
}

.swipe-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}

.swipe-button {
  width: 72px;
  min-height: 72px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 50%;
  color: var(--paper-strong);
  font-size: 32px;
  font-weight: 900;
  background: rgba(6, 27, 52, 0.76);
  box-shadow: 0 16px 32px rgba(4, 20, 41, 0.28);
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.swipe-button:hover {
  border-color: rgba(243, 217, 152, 0.92);
  background: rgba(11, 49, 95, 0.88);
}

.swipe-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.swipe-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.38);
  transition: width 240ms ease, background-color 240ms ease, transform 240ms ease;
}

.swipe-dot.is-active {
  width: 30px;
  background: #f3d998;
  transform: translateY(-1px);
}

.result-count {
  margin: 0 0 14px;
  color: var(--paper-strong);
  text-shadow: 0 2px 12px rgba(4, 20, 41, 0.36);
}

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

.place-card,
.empty-state {
  border: 1px solid rgba(16, 35, 59, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
}

.place-card {
  animation: cardFloatIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 34ms);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.place-card.is-selected {
  border-color: rgba(243, 217, 152, 0.95);
  box-shadow:
    0 0 0 4px rgba(243, 217, 152, 0.18),
    0 24px 58px rgba(4, 20, 41, 0.34);
  transform: translateY(-4px);
}

.place-image,
.image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, rgba(31, 95, 134, 0.85), rgba(31, 110, 92, 0.78));
}

.place-image {
  display: block;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  padding: 20px;
  color: rgba(255, 250, 240, 0.88);
  font-weight: 800;
  font-size: 20px;
  text-align: center;
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.category-pill,
.subcategory-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
}

.category-pill {
  color: var(--paper-strong);
  background: var(--leaf);
}

.subcategory-pill {
  color: var(--ink);
  background: #ead8af;
}

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

.description {
  margin: 0;
  color: #314156;
  font-size: 18px;
  line-height: 1.7;
}

.details {
  display: grid;
  gap: 8px;
  margin: 0;
  color: #24364d;
  font-size: 17px;
}

.details div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
}

.details dt {
  font-weight: 800;
}

.details dd {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.detail-link,
.phone-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease;
}

.detail-link {
  color: var(--paper-strong);
  background: var(--indigo);
}

.phone-link {
  color: var(--ink);
  background: #f3d998;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 30px;
}

.empty-state p {
  margin: 0 0 18px;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .category-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .category-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .swipe-card {
    flex-basis: min(500px, 82vw);
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 22px 14px 36px;
  }

  .site-header h1 {
    font-size: clamp(36px, 9.6vw, 42px);
  }

  .lead {
    font-size: 21px;
  }

  .screen-heading h2,
  .results-top h2 {
    font-size: 34px;
  }

  .screen-heading,
  .results-top {
    display: grid;
    align-items: start;
  }

  .results-top {
    grid-template-columns: 1fr;
  }

  .back-button {
    width: 100%;
  }

  .category-grid,
  .card-grid,
  .category-tabs {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 184px;
  }

  .category-tab {
    min-height: 76px;
  }

  .swipe-heading {
    display: grid;
    align-items: start;
  }

  .swipe-heading h3 {
    font-size: 30px;
  }

  .swipe-status {
    font-size: 18px;
  }

  .swipe-viewport {
    min-height: 424px;
    margin-right: -14px;
    margin-left: -14px;
    border-radius: 0;
  }

  .swipe-track {
    gap: 12px;
    min-height: 400px;
  }

  .swipe-card {
    flex-basis: min(330px, 78vw);
  }

  .swipe-card h4 {
    font-size: 25px;
  }

  .swipe-card p {
    font-size: 17px;
  }

  .swipe-card-body {
    padding: 18px;
  }

  .swipe-card-placeholder {
    font-size: 24px;
  }

  .swipe-actions {
    grid-template-columns: 64px 1fr 64px;
  }

  .swipe-button {
    width: 64px;
    min-height: 64px;
    font-size: 28px;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .detail-link,
  .phone-link {
    width: 100%;
  }
}

@keyframes effectVeil {
  0% {
    opacity: 0;
    backdrop-filter: saturate(1) brightness(1);
  }
  28% {
    opacity: 1;
    backdrop-filter: saturate(1.18) brightness(0.88);
  }
  100% {
    opacity: 0;
    backdrop-filter: saturate(1) brightness(1);
  }
}

@keyframes indigoRipple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18) rotate(0deg);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(5.2) rotate(34deg);
  }
}

@keyframes cardFloatIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes swipeScan {
  0% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.18);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(1);
  }
}

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