:root {
  --ink: #1b1b1b;
  --muted: #6d665f;
  --paper: #fffdf8;
  --panel: #ffffff;
  --line: #1b1b1b;
  --red: #e98b7d;
  --blue: #75aadb;
  --yellow: #f2c84b;
  --green: #7cad74;
  --green-deep: #4d7449;
  --shadow: 0 18px 42px rgba(27, 27, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(233, 139, 125, 0.12), transparent 28%),
    linear-gradient(225deg, rgba(117, 170, 219, 0.13), transparent 32%),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 253, 248, 0.9);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 17px;
  height: 25px;
  background: var(--red);
  clip-path: polygon(28% 0, 100% 0, 100% 58%, 28% 58%, 28% 100%, 0 100%, 0 0);
  filter: drop-shadow(3px 3px 0 var(--yellow));
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  padding: 8px 12px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.intro-section,
.map-section,
.post-section,
.spots-section,
.server-section {
  padding: clamp(38px, 6vw, 76px) clamp(16px, 4vw, 48px);
}

.intro-section {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.7fr);
  gap: 24px;
  align-items: end;
}

.intro-section p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13em;
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading {
  max-width: 1180px;
  margin: 0 auto 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 42px);
  letter-spacing: 0;
}

.map-layout {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(330px, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: stretch;
}

.map-stage {
  position: relative;
  min-height: 660px;
  border: 2.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(117, 170, 219, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(117, 170, 219, 0.08) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
  box-shadow: 8px 8px 0 rgba(242, 200, 75, 0.65);
}

.japan-map {
  position: absolute;
  inset: 3% 10%;
  width: 80%;
  height: 94%;
  opacity: 1;
  filter: drop-shadow(6px 8px 0 rgba(124, 173, 116, 0.22));
}

.island {
  fill: #fff;
  stroke: var(--line);
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pref-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.48;
}

.pin-layer {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  width: 44px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -100%);
  animation: pin-drop 680ms cubic-bezier(.18, .89, .33, 1.35) both;
}

.map-pin::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 8px;
  width: 4px;
  height: 40px;
  border-radius: 999px;
  background: var(--line);
}

.map-pin::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 7px;
  width: 23px;
  height: 18px;
  background: var(--red);
  border: 2px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%);
}

.map-pin.is-user::after {
  background: var(--blue);
}

.map-pin span {
  position: absolute;
  left: 8px;
  bottom: -3px;
  width: 22px;
  height: 10px;
  border-radius: 50%;
  background: rgba(27, 27, 27, 0.18);
}

.map-pin:hover,
.map-pin.is-active {
  animation: flag-wave 880ms ease infinite alternate;
}

.map-pin.is-active::after {
  background: var(--yellow);
}

.memory-panel,
.post-form,
.spot-card,
.server-flow {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.memory-panel {
  min-height: 520px;
  padding: clamp(22px, 4vw, 34px);
  transition: transform 260ms ease, opacity 260ms ease;
}

.memory-panel.is-changing {
  opacity: 0;
  transform: translateY(10px);
}

.memory-panel h3 {
  margin: 0;
  font-size: clamp(25px, 3.5vw, 38px);
  line-height: 1.2;
}

.memory-panel p {
  color: var(--muted);
  line-height: 1.9;
}

.memory-photo,
.memory-gallery {
  width: 100%;
  margin: 22px 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.memory-photo {
  aspect-ratio: 16 / 9;
}

.memory-photo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.memory-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.memory-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  object-fit: cover;
}

.post-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.post-facts div {
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: rgba(242, 200, 75, 0.16);
}

.post-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-facts dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.panel-meta,
.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-meta {
  margin-top: 18px;
}

.panel-meta span,
.transport-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(124, 173, 116, 0.18);
  font-size: 13px;
  font-weight: 900;
}

.post-form {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 32px);
}

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

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

label,
fieldset {
  min-width: 0;
}

label span,
legend,
.spot-tools span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.75;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(117, 170, 219, 0.25);
}

.full-field {
  display: block;
  margin: 16px 0;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(233, 139, 125, 0.08);
}

.tag-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}

.tag-options input {
  width: auto;
  min-height: auto;
}

.tag-free {
  margin-top: 12px;
}

.photo-field {
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: rgba(117, 170, 219, 0.1);
}

.file-note {
  margin-top: 8px;
  color: var(--muted);
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.photo-preview img {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

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

.primary-button,
.ghost-button,
.spot-open {
  cursor: pointer;
}

.primary-button,
.ghost-button {
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  background: var(--green);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--yellow);
}

.ghost-button {
  background: #fff;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  box-shadow: 5px 6px 0 rgba(27, 27, 27, 0.12);
}

.spot-tools {
  max-width: 1180px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: flex-end;
}

.spot-tools label {
  width: min(260px, 100%);
}

.spot-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.spot-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.spot-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 9px 0 rgba(117, 170, 219, 0.35);
}

.spot-eyecatch {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 2px solid var(--line);
  background: #fff;
}
.spot-eyecatch.placeholder svg {
  width: 100%;
  height: 100%;
  display: block;
}

.spot-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  width: 100%;
  padding: 20px;
  border: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 200, 75, 0.08));
  color: var(--ink);
  text-align: left;
}

.spot-open h3 {
  margin: 10px 0;
  font-size: 22px;
}

.spot-open p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.75;
}

.card-date,
.spot-tags {
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
}

.spot-tags {
  margin-top: 12px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 2px dashed rgba(27, 27, 27, 0.1);
  background: #fff;
}

.like-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-button:hover {
  background: rgba(242, 200, 75, 0.15);
  transform: translateY(-2px);
  box-shadow: 2px 2px 0 var(--line);
}

.like-button .star {
  font-size: 18px;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.like-button.liked {
  background: rgba(242, 200, 75, 0.2);
  color: var(--ink);
  border-color: var(--line);
}
.like-button.liked .star {
  color: #ff9800;
  text-shadow: 0 0 4px rgba(255, 152, 0, 0.4);
  transform: scale(1.15);
}

.server-flow {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.server-flow div {
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-right: 2px solid var(--line);
  font-weight: 900;
  text-align: center;
}

.server-flow div:nth-child(1) {
  background: rgba(233, 139, 125, 0.24);
}

.server-flow div:nth-child(2) {
  background: rgba(117, 170, 219, 0.24);
}

.server-flow div:nth-child(3) {
  background: rgba(242, 200, 75, 0.26);
}

.server-flow div:nth-child(4) {
  background: rgba(124, 173, 116, 0.24);
  border-right: 0;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.image-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-modal img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
}

.site-footer {
  padding: 28px clamp(16px, 4vw, 48px);
  color: var(--muted);
  border-top: 2px solid var(--line);
  text-align: center;
}

.post-body {
  background: var(--paper);
}

.post-main {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 84px) clamp(18px, 4vw, 40px);
}

.back-link {
  color: var(--green-deep);
  font-weight: 900;
  text-decoration: none;
}

.post-hero {
  margin-top: 28px;
}

.post-hero h1 {
  max-width: 100%;
  font-size: clamp(34px, 6vw, 60px);
}

.post-meta {
  color: var(--muted);
  font-weight: 800;
}

.post-image {
  min-height: 320px;
  margin: 28px 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post-image svg {
  display: block;
  width: 100%;
  height: 100%;
}

.post-content {
  display: grid;
  gap: 22px;
  font-size: 17px;
  line-height: 2;
}

.post-content h2 {
  margin: 18px 0 0;
}

@keyframes pin-drop {
  from {
    opacity: 0;
    transform: translate(-50%, -130%) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

@keyframes flag-wave {
  from {
    transform: translate(-50%, -100%) rotate(-2deg);
  }
  to {
    transform: translate(-50%, -103%) rotate(3deg);
  }
}

@media (max-width: 980px) {
  .intro-section,
  .map-layout,
  .field-grid,
  .form-row,
  .spot-grid,
  .server-flow {
    grid-template-columns: 1fr;
  }

  .server-flow div {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .server-flow div:last-child {
    border-bottom: 0;
  }

  .map-stage {
    min-height: 560px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .map-stage {
    min-height: 450px;
  }

  .japan-map {
    inset: 4% 3%;
    width: 94%;
  }

  .post-facts,
  .photo-preview,
  .memory-gallery {
    grid-template-columns: 1fr;
  }
}

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