:root {
  --night: #121a2e;
  --red: #d8352a;
  --amber: #ffb347;
  --steam: #f4efe6;
  --navy: #23345e;
  --maple: #e86a2c;
  --silver: #c9ced6;
  --wood: #7a4b2a;
  --display: "Rampart One", "Arial Black", sans-serif;
  --body: "Kosugi Maru", "Hiragino Maru Gothic ProN", Arial, sans-serif;
  --mono: "Spline Sans Mono", "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--steam);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  background: var(--night) url("/images/bridge.webp") repeat;
  background-size: 380px;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a,
button {
  color: inherit;
  cursor: pointer;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(1160px, 100% - 32px);
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border: 2px solid var(--steam);
  border-radius: 4px;
  font-family: var(--body);
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--steam);
  background: var(--navy);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: #2e4579;
}

.btn--red {
  border-color: var(--red);
  background: var(--red);
}

.btn--red:hover {
  background: #e84638;
}

.title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--steam);
  text-shadow: 3px 3px 0 var(--red);
}

/* header: the short cloth curtain of the cart, three flaps */
.top {
  padding-top: 0;
}

.noren {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6px;
  max-width: 640px;
  margin: 0 auto;
}

.flap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px 12px 12px;
  border-radius: 0 0 6px 6px;
  font-size: 1.05rem;
  text-decoration: none;
  background: linear-gradient(#1b2848, var(--navy));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 8px 16px rgba(0, 0, 0, 0.4);
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.flap:hover {
  transform: rotate(-3deg);
}

.flap:nth-child(2):hover {
  transform: rotate(3deg);
}

.flap-logo {
  justify-content: flex-start;
  font-family: var(--display);
  font-size: 1.25rem;
}

.flap-logo img {
  border-radius: 50%;
  border: 2px solid var(--steam);
}

/* hero: the cart framed like a wide shop window */
.hero {
  padding: clamp(46px, 7vw, 86px) 0 40px;
}

.shopfront {
  position: relative;
  padding: 0 0 0;
  border: 14px solid var(--wood);
  border-radius: 6px;
  background: var(--wood);
  box-shadow: inset 0 0 0 3px #4a2c17, 0 20px 40px rgba(0, 0, 0, 0.55);
}

.sign {
  position: absolute;
  z-index: 3;
  top: -0.52em;
  left: 50%;
  display: flex;
  gap: 0.28em;
  margin: 0;
  padding: 0.08em 0.4em 0.12em;
  font-family: var(--display);
  font-size: clamp(2.6rem, 8.4vw, 6.6rem);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: var(--steam);
  text-shadow: 0.05em 0.05em 0 var(--red);
  background: rgba(18, 26, 46, 0.86);
  border: 4px solid var(--red);
  border-radius: 8px;
  transform: translateX(-50%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.sign-yen {
  position: relative;
}

.sign-leaf {
  position: absolute;
  right: -0.42em;
  top: -0.36em;
  width: 0.62em;
  height: 0.62em;
  background: url("/images/leaf.webp") center / contain no-repeat;
  transform: rotate(24deg);
}

.shot {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.shot-cart {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.leaves {
  position: absolute;
  inset: 0;
}

.leaf {
  position: absolute;
  top: 0;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  background: url("/images/leaf.webp") center / contain no-repeat;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4));
  will-change: transform;
}

.leaf:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
  border-radius: 50%;
}

.leaf.is-coin {
  background-image: url("/images/coin.webp");
  pointer-events: none;
}

.plus {
  position: absolute;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--amber);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  animation: rise 0.9s ease-out forwards;
}

@keyframes rise {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.ledge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 2px;
  background: var(--wood);
}

.ledge-line {
  font-size: 1.15rem;
}

.wallet {
  font-family: var(--mono);
  font-size: 1rem;
  white-space: nowrap;
}

.wallet b {
  display: inline-block;
  min-width: 4.5ch;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 1.4rem;
  text-align: right;
  color: var(--night);
  background: var(--silver);
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.hint {
  max-width: 30em;
  color: var(--silver);
}

.sunrise {
  color: var(--amber);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* menu board and ticket machine */
.menu {
  padding: 40px 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.board {
  padding: 22px 24px 26px;
  border: 10px solid #4a2c17;
  border-radius: 6px;
  background: linear-gradient(#8a5a35, var(--wood));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.5);
}

.bowls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.bowl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 8px 12px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  text-align: left;
  color: var(--night);
  background: var(--steam);
  box-shadow: 0 5px 0 #4a2c17;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bowl:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 #4a2c17;
}

.bowl:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #4a2c17;
}

.bowl img {
  border-radius: 4px;
}

.bowl-name {
  margin-top: 8px;
  font-size: 1.15rem;
}

.bowl-price {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--red);
}

.bowl-price::after {
  content: " yen";
  font-weight: 400;
  color: #6b6b6b;
}

.machine {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.machine > img {
  width: 190px;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5));
}

.served {
  width: 100%;
  padding: 14px;
  border-radius: 6px;
  background: rgba(18, 26, 46, 0.85);
  border: 1px solid rgba(201, 206, 214, 0.3);
}

.served-bowl {
  width: 120px;
  margin: 0 auto 10px;
  border-radius: 50%;
  animation: slide-on 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes slide-on {
  from {
    transform: translateX(-60px) rotate(-20deg);
  }
  to {
    transform: none;
  }
}

.served-line {
  font-size: 1rem;
}

/* story: paper slips pinned to the cart */
.story {
  padding: 40px 0;
}

.slips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.slip {
  position: relative;
  margin: 0;
  padding: 12px 12px 18px;
  color: var(--night);
  background: var(--steam);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.slip::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}

.slip:nth-child(1) {
  transform: rotate(-1.5deg);
}

.slip:nth-child(2) {
  transform: rotate(1deg) translateY(20px);
}

.slip:nth-child(3) {
  transform: rotate(-0.5deg);
}

.slip p {
  margin-top: 12px;
  line-height: 1.45;
}

/* the coin: a paper ticket from the machine */
.coin {
  padding: 60px 0 50px;
}

.ticket {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  padding: 30px 32px;
  color: var(--night);
  text-align: center;
  background: #f6ecd2;
  border-left: 3px dashed #c7b58c;
  border-right: 3px dashed #c7b58c;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  transform: rotate(-1deg);
}

.ticket-top {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
}

.ticker {
  font-family: var(--display);
  font-size: clamp(3.2rem, 10vw, 5.6rem);
  line-height: 1;
  color: var(--night);
  text-shadow: 3px 3px 0 var(--red);
}

.ticket-line {
  margin-top: 8px;
}

.ca-box {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 2px solid var(--night);
  border-radius: 4px;
  background: #fffaf0;
}

.ca-text {
  display: block;
  font-family: var(--mono);
  font-size: clamp(11px, 3.2vw, 18px);
  font-weight: 600;
  overflow-wrap: anywhere;
  color: var(--night);
}

.ca-status {
  display: block;
  margin-top: 4px;
  color: var(--red);
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.ticket-actions .btn:not(.btn--red) {
  border-color: var(--night);
}

/* footer */
.end {
  padding: 20px 0 40px;
}

.end-frame {
  position: relative;
  border: 14px solid var(--wood);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.end-frame img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.end-title {
  position: absolute;
  left: 4%;
  bottom: 8%;
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  line-height: 1;
  color: var(--steam);
  text-shadow: 0.06em 0.06em 0 var(--red);
}

.end-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
}

.end-note {
  max-width: 40em;
  font-size: 0.95rem;
  color: var(--silver);
}

/* 404 */
.lost {
  padding: 50px 0 70px;
}

.lost-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: center;
  padding: 30px;
  border: 10px solid #4a2c17;
  border-radius: 6px;
  background: linear-gradient(#8a5a35, var(--wood));
}

.lost-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--red);
}

.lost-card p {
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .machine {
    grid-template-columns: 140px 1fr;
    align-items: center;
  }

  .machine > img {
    width: 140px;
  }

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

  .hero-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .lost-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .flap {
    min-height: 60px;
    font-size: 0.95rem;
  }

  .flap-logo {
    font-size: 1rem;
  }

  .flap-logo img {
    width: 34px;
    height: 34px;
  }

  .shopfront {
    border-width: 8px;
  }

  .sign {
    font-size: clamp(2rem, 11vw, 3.2rem);
    top: -0.45em;
  }

  .shot-cart {
    aspect-ratio: 4 / 3;
  }

  .leaf {
    width: 46px;
    height: 46px;
  }

  .ledge {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 8px 4px;
  }

  .board {
    padding: 16px 12px 18px;
    border-width: 6px;
  }

  .bowls {
    gap: 10px;
  }

  .slips {
    grid-template-columns: 1fr;
    padding: 0 4%;
  }

  .slip:nth-child(n) {
    transform: none;
  }

  .ticket {
    padding: 24px 16px;
  }

  .end-frame {
    border-width: 8px;
  }

  .end-frame img {
    aspect-ratio: 4 / 3;
  }

  .end-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
