/* ============================================================
   Hana's Japan — cartoon vending-machine landing page
   ============================================================ */

:root {
  --bg1: #ffd9e0;
  --bg2: #b8e3f0;
  --machine: #e0473f;        /* candy red body */
  --machine-dark: #b5322c;
  --machine-edge: #7e211d;
  --panel: #2a2320;
  --neon: #ffe14d;
  --glass: #dff3fb;
  --tag: #ff7a1a;
  --hand: "Caveat", cursive;
  --pop: "Mochiy Pop One", system-ui, sans-serif;
  --type: "Special Elite", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--pop);
  color: #2a2320;
  background:
    radial-gradient(1200px 500px at 50% -10%, #fff7 0, transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.scene { width: 100%; max-width: 480px; text-align: center; }

.mute-btn {
  position: fixed;
  top: 12px; right: 12px;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.15s ease, background 0.2s ease;
}
.mute-btn:hover { transform: scale(1.08); background: #fff; }

.page-title {
  font-family: var(--hand);
  font-size: clamp(2.6rem, 9vw, 3.8rem);
  margin: 0.2rem 0 0;
  color: #c0392b;
  text-shadow: 2px 2px 0 #fff;
}
.page-sub {
  font-family: var(--type);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #5a4a44;
  margin: 0.2rem 0 1.4rem;
}

/* ---------------- The machine ---------------- */
.machine {
  position: relative;
  background: linear-gradient(150deg, var(--machine), var(--machine-dark));
  border: 4px solid var(--machine-edge);
  border-radius: 26px;
  padding: 14px;
  box-shadow:
    0 22px 40px rgba(60, 20, 18, 0.35),
    inset 0 3px 0 rgba(255,255,255,0.25),
    inset 0 -8px 0 rgba(0,0,0,0.15);
}

.machine__top {
  background: var(--panel);
  border-radius: 14px;
  padding: 0.7rem;
  text-align: center;
  border: 2px solid #000;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.6);
  margin-bottom: 12px;
}
.brand {
  display: block;
  font-family: var(--pop);
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
  color: var(--neon);
  text-shadow: 0 0 8px rgba(255,225,77,0.8), 0 0 2px #fff;
  letter-spacing: 0.04em;
}
.brand-sub {
  font-family: var(--type);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: #7fe3ff;
}

/* glass display case */
.machine__window {
  position: relative;
  background: linear-gradient(160deg, #eafaff, #bfe6f2);
  border: 3px solid #2a2320;
  border-radius: 12px;
  padding: 12px 10px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,60,90,0.18);
}
.glare {
  position: absolute;
  top: 0; left: -30%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-12deg);
  pointer-events: none;
}

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 6px;
}

/* a product = one day */
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(255,255,255,0.15));
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* the shelf under each product */
  box-shadow: 0 3px 0 rgba(0,0,0,0.18);
}
.slot:hover, .slot:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 7px 12px rgba(0,0,0,0.22);
  outline: none;
}

/* the can/bottle */
.can {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 7px 7px 9px 9px;
  background-size: cover;
  background-position: center;
  background-color: #cdd6db;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.25);
}
.can .cap {
  position: absolute;
  top: -5px; left: 50%;
  width: 42%; height: 7px;
  transform: translateX(-50%);
  background: #b9c3c9;
  border-radius: 4px 4px 2px 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.slot--empty .can { filter: grayscale(1) brightness(0.9); background-color: #b9b4ad; }
.sold {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pop);
  font-size: 0.62rem;
  color: #fff;
  background: rgba(180,40,40,0.62);
  border-radius: 7px;
  letter-spacing: 0.05em;
}

/* price-tag style day button */
.tag {
  font-family: var(--type);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--tag);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  white-space: nowrap;
}
.slot--empty .tag { background: #8a8077; }

/* vend animation */
.slot.vending { animation: shake 0.22s ease 1; }
@keyframes shake {
  0%,100% { transform: translateY(-3px) rotate(0); }
  30% { transform: translateY(-3px) rotate(-5deg); }
  70% { transform: translateY(-3px) rotate(5deg); }
}

/* the chosen item, falling into the tray */
.falling-can {
  position: fixed;
  z-index: 60;
  border-radius: 7px 7px 9px 9px;
  background-size: cover;
  background-position: center;
  background-color: #cdd6db;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6), 0 6px 14px rgba(0,0,0,0.4);
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------------- Control panel ---------------- */
.machine__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #3a302c, #241d1a);
  border: 2px solid #000;
  border-radius: 12px;
}
.display {
  font-family: var(--type);
  background: #10241a;
  color: #57ff8f;
  text-shadow: 0 0 8px rgba(87,255,143,0.7);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  border: 1px solid #000;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
}
.panel-right { display: flex; align-items: center; gap: 8px; }
.coin-slot {
  width: 10px; height: 30px;
  background: #0c0c0c;
  border-radius: 3px;
  box-shadow: inset 0 0 4px rgba(255,255,255,0.3);
}
.coin-return {
  width: 26px; height: 18px;
  background: #1a1410;
  border-radius: 4px;
  border: 2px solid #000;
}

/* ---------------- Pickup tray ---------------- */
.machine__tray {
  margin-top: 12px;
  background: #2a2320;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 10px;
}
.tray-mouth {
  height: 46px;
  background:
    linear-gradient(180deg, #000 0%, #15110f 45%, #2a2320 46%);
  border-radius: 8px;
  box-shadow: inset 0 10px 16px rgba(0,0,0,0.85);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  transition: box-shadow 0.3s ease;
}
.tray-mouth span {
  font-family: var(--type);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: #6b6058;
}
.machine.dispensing .tray-mouth {
  box-shadow: inset 0 10px 16px rgba(0,0,0,0.85), 0 0 22px 4px rgba(255,225,77,0.6);
}

.legs {
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
}
.legs span {
  display: block;
  width: 26px; height: 12px;
  background: var(--machine-edge);
  border-radius: 0 0 7px 7px;
}

.all-link {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--type);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #c0392b;
  text-decoration: none;
  border-bottom: 2px dotted #c0392b;
  padding-bottom: 2px;
}
.all-link:hover { color: #7e211d; }

@media (max-width: 380px) {
  .tag { font-size: 0.52rem; padding: 2px 4px; }
  .display { font-size: 0.8rem; }
}
