:root {
  --navy: #10477a;
  --blue: #167ba8;
  --pale: #effaff;
  --orange: #e97b0b;
  --cream: #fff8e8;
  --radius: 24px;
  --space: clamp(40px, 6vw, 80px);
}

/* Shared foundations and layouts */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  color: var(--navy);
  font:
    500 15px/1.9 "M PLUS Rounded 1c",
    "Hiragino Maru Gothic ProN",
    sans-serif;
  letter-spacing: 0.025em;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.5;
  text-wrap: balance;
}
h2 {
  font-size: clamp(25px, 2.7vw, 34px);
  margin-bottom: 16px;
}
h3 {
  font-size: 18px;
}
p {
  overflow-wrap: anywhere;
}
p + p {
  margin-top: 12px;
}
.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}
.section {
  padding-block: var(--space);
}
.section-blue {
  background: var(--pale);
}
.section-cream {
  background: var(--cream);
}
.split,
.about-grid {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.split > *,
.about-grid > * {
  min-width: 0;
}
.split p,
.about-copy p {
  max-width: 34em;
}
.intro-note {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.panel {
  padding: 24px;
  background: #fff;
  border-radius: var(--radius);
}
.photo {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3 / 2;
}
.photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section-heading h2 span {
  display: inline-block;
}
.section-heading {
  text-align: center;
  margin-bottom: 28px;
}
.section-heading > p:last-child,
.little-note {
  color: #547286;
  font-size: 13px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  margin-top: 24px;
  border-radius: 40px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.button:hover {
  background: var(--navy);
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 5px;
}

/* Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 8px max(20px, calc((100% - 1120px) / 2));
  background: #fffffff2;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}
.brand img {
  width: 52px;
}
.brand small {
  display: block;
  font-size: 10px;
}
.site-nav,
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.site-nav {
  font-size: 13px;
  font-weight: 700;
}
.site-nav a {
  padding-block: 8px;
}
.site-nav a[aria-current] {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 8px;
}
.menu-toggle {
  display: none;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 50;
  background: white;
  padding: 10px;
}
.skip-link:focus {
  top: 10px;
}

/* Hero: the character and its note stay in normal flow at every size. */
.hero {
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background: url("../img/bankan.jpg") center / cover;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #effafff0, #effaffb0 45%, #effaff20);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 24px;
  padding-block: 48px 80px;
}
.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: 0.035em;
  margin-block: 16px 24px;
}
.hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.hero-copy > p:last-child {
  max-width: 27em;
}
.hero-character {
  display: grid;
  justify-items: center;
}
.character-button {
  border: 0;
  background: none;
  padding: 0;
  width: min(100%, 420px);
  animation: float 5s ease-in-out infinite;
}
.character-button:hover {
  animation-play-state: paused;
}
.hero-comment {
  position: relative;
  max-width: 100%;
  margin-top: 12px;
  padding: 16px 24px;
  border: 2px solid #7ccfe6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 6px 20px #10477a14;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.hero-comment::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 32%;
  width: 20px;
  height: 20px;
  border-top: 2px solid #7ccfe6;
  border-left: 2px solid #7ccfe6;
  background: #fff;
  transform: rotate(45deg);
}
.wave,
.footer-wave {
  position: absolute;
  left: 0;
  width: 100%;
  height: 40px;
  pointer-events: none;
}
.wave {
  bottom: -1px;
  width: 200%;
  height: 64px;
  fill: var(--pale);
  animation: wave-drift 18s linear infinite;
}
.wave-back {
  fill: #bceafa;
}
@keyframes wave-drift {
  to {
    transform: translateX(-50%);
  }
}

/* Character introduction and profile */
.about-grid {
  grid-template-columns: 1.2fr 1fr;
  max-width: 900px;
}
.about-character {
  width: min(100%, 340px);
  justify-self: center;
}
.about-copy .little-note {
  margin-top: 16px;
}
.charm-panel {
  margin-top: 32px;
}
.charms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.charm {
  --accent: #507f28;
  --tint: #f0f7e6;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
  align-items: center;
  gap: 24px;
}
.mikan {
  --accent: #a95e0d;
  --tint: #fff3d9;
}
.shell {
  --accent: #ad527e;
  --tint: #fff0f5;
}
.charm h3 {
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 10px;
}
.charm p {
  font-size: 13px;
}
.charm-zoom {
  width: 150px;
  margin-inline: auto;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.charm-zoom img {
  position: absolute;
  max-width: none;
  width: 340%;
  transform: translate(-25%, -14%);
}
.shell .charm-zoom img {
  width: 370%;
  transform: translate(-49%, -24%);
}
.mikan .charm-zoom img {
  width: 550%;
  transform: translate(-12%, -44.5%);
}
.dolphin {
  --accent: #237da6;
  --tint: #e3f6ff;
}
.dolphin .charm-zoom img {
  width: 100%;
  transform: none;
}
.details {
  padding-top: 0;
  background: var(--pale);
}
.profile-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.profile-buttons button {
  --tint: #e3f6ff;
  --accent: #237da6;
  display: grid;
  place-content: center;
  gap: 8px;
  aspect-ratio: 1;
  padding: 12px 4px;
  border: 1px dashed var(--accent);
  border-radius: 50%;
  background: var(--tint);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  outline: 5px solid #ffffff90;
  outline-offset: -8px;
}
.profile-buttons button:nth-child(3n + 2) {
  --tint: #fff1cc;
  --accent: #a77819;
}
.profile-buttons button:nth-child(3n) {
  --tint: #ffe7ef;
  --accent: #b45f80;
}
.profile-buttons button:nth-child(4) {
  --tint: #ebf5d9;
  --accent: #638d32;
}
.profile-buttons button span {
  font-size: 30px;
  line-height: 1.2;
  color: var(--accent);
}
.profile-buttons button:hover {
  box-shadow: 0 5px 18px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Town, photography and map */
.citrus h2 {
  color: var(--orange);
}
.citrus-photo {
  position: relative;
}
.town-photo {
  background: url("../img/bankan.jpg") left 68% / 180%;
}
.story-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
  text-align: center;
}
.card-symbol {
  display: block;
  font-size: 32px;
  line-height: 1.5;
  color: var(--blue);
  margin-bottom: 8px;
}
.story-cards h3 {
  margin-bottom: 8px;
}
.story-cards article > p:last-child {
  font-size: 13px;
}
.map {
  position: relative;
}
.map > img:first-child {
  width: 100%;
  height: 280px;
  object-fit: contain;
}
.map .map-character {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 110px;
}
footer {
  position: relative;
  background: var(--blue);
  color: #fff;
  padding-block: 28px;
}
.footer-wave {
  bottom: calc(100% - 1px);
  fill: var(--blue);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12px;
}
.footer-inner small {
  font-size: 11px;
}

/* Native dialog handles keyboard focus and Escape. */
dialog {
  width: min(480px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 40px 24px 16px;
  border: 1px solid #a0d6e9;
  border-radius: var(--radius);
  color: var(--navy);
  text-align: center;
}
dialog::backdrop {
  background: #13466866;
  backdrop-filter: blur(5px);
}
dialog img {
  margin-inline: auto;
}
#dialog-copy {
  white-space: pre-line;
}
.dialog-close {
  position: absolute;
  right: 8px;
  top: 4px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  padding: 0;
  font:
    28px/1 Arial,
    sans-serif;
}
body.dialog-open {
  overflow: hidden;
}
@keyframes float {
  50% {
    transform: translateY(-8px);
  }
}

/* Two structural breakpoints; spacing and type scale fluidly above. */
@media (max-width: 960px) {
  .charms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-grid {
    grid-template-columns: 1.4fr 1fr;
  }
  .profile-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .story-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .menu-toggle {
    display: block;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #c5e6f3;
    border-radius: 12px;
    background: white;
    font-size: 13px;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    padding: 16px 20px 24px;
    background: white;
    border-bottom: 1px solid #c5e6f3;
  }
  .site-nav.is-open {
    display: grid;
    gap: 4px;
  }
}
@media (max-width: 640px) {
  .charms {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-inner,
  .split,
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-inner {
    padding-block: 32px 64px;
    gap: 28px;
  }
  .hero-copy > p:last-child {
    max-width: 26em;
  }
  .hero-character {
    max-width: 340px;
    width: 100%;
    margin-inline: auto;
  }
  .character-button {
    width: 280px;
    margin-block: -12px;
  }
  .hero-comment {
    font-size: 12px;
  }
  .about-character {
    width: min(240px, 70%);
    margin: -12px auto;
  }
  .town-intro > .town-photo {
    order: 1;
  }
  .profile-buttons {
    gap: 10px;
  }
  .profile-buttons button {
    font-size: 12px;
    padding-inline: 4px;
  }
  .story-cards .panel {
    padding: 20px 12px;
  }
  .story-cards h3 {
    font-size: 16px;
  }
  .map > img:first-child {
    height: 240px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-inner nav {
    justify-content: center;
    gap: 16px;
  }
  .split p br,
  .about-copy p br {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .character-button,
  .wave {
    animation: none;
  }
}

/* Shared entrance and interaction motion; content stays visible without JavaScript. */
.button,
.profile-buttons button,
.dialog-close {
  transition:
    background-color 0.2s,
    box-shadow 0.2s,
    translate 0.2s;
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.65s ease,
    transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1),
    background-color 0.2s,
    box-shadow 0.2s,
    translate 0.2s;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.button:hover,
.profile-buttons button:hover {
  translate: 0 -4px;
}
.dialog-close {
  border-radius: 50%;
}
.dialog-close:hover {
  background: var(--pale);
}
dialog:focus {
  outline: none;
}
.dialog-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 0;
}
dialog[open] {
  animation: pop-in 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
dialog[open]::backdrop {
  animation: backdrop-in 0.25s ease;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
  .reveal,
  .button,
  .profile-buttons button,
  .dialog-close {
    transition: none;
  }
  .button:hover,
  .profile-buttons button:hover {
    translate: none;
  }
  dialog[open],
  dialog[open]::backdrop {
    animation: none;
  }
}

/* Citrus collection: native touch/trackpad scrolling and keyboard access. */
.citrus-collection {
  margin-top: var(--space);
}
.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.collection-heading p,
.citrus-source {
  font-size: 12px;
  color: #705f4c;
}
.scroll-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.scroll-controls button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #e5cead;
  border-radius: 50%;
  background: white;
  font: 22px/1 sans-serif;
}
.scroll-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.citrus-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(260px, 30vw, 320px);
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 20px;
  scrollbar-color: #d6b478 #f7ecd6;
  scrollbar-width: thin;
}
.citrus-card {
  scroll-snap-align: start;
}
.citrus-card h4 {
  font-size: 23px;
  color: #a95e0d;
  margin-top: 20px;
}
.citrus-card p {
  font-size: 13px;
}
.citrus-card .citrus-tagline {
  margin: 8px 0 12px;
  font-weight: 700;
}
.citrus-source {
  margin-top: 16px;
}
.citrus-source a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fruit-stage {
  display: grid;
  place-items: center;
  height: 160px;
  background: #fff6df;
  border-radius: 16px;
}
.fruit {
  position: relative;
  width: 120px;
  height: 100px;
  border-radius: 48%;
  background: radial-gradient(
    ellipse at 32% 28%,
    #ffce62,
    #ffa014 60%,
    #ed8210
  );
  box-shadow:
    inset -7px -7px 12px #bc65051a,
    0 10px 12px #a95e0d12;
}
.fruit::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 32px;
  height: 18px;
  background: #639849;
  border-radius: 0 90% 0 90%;
  transform: rotate(-20deg);
}
.ponkan .fruit {
  height: 108px;
  width: 110px;
}
.shiranui .fruit {
  height: 112px;
  width: 112px;
}
.shiranui .fruit::after {
  content: "";
  position: absolute;
  top: -14px;
  left: 40px;
  width: 33px;
  height: 24px;
  border-radius: 45% 45% 0 0;
  background: #ffb530;
}
.shiranui .fruit::before {
  top: -21px;
  z-index: 1;
}
.bankan {
  background: #faf7dd;
}
.bankan .fruit {
  width: 125px;
  height: 120px;
  background: radial-gradient(
    ellipse at 32% 28%,
    #fff5a6,
    #f3d34d 65%,
    #dcba35
  );
}
@media (prefers-reduced-motion: reduce) {
  .citrus-cards {
    scroll-behavior: auto;
  }
}
