/* ============================================================
   Hannah Janicke — vending machine
   Rebuilt to match the author's own Figma design.
   ============================================================ */

:root {
  --yellow: #f6d227;
  --ink: #111111;
  --gray: #8a8a8a;

  --pink: #f2acb3;
  --pink-trim: rgba(255, 255, 255, 0.45);
  --tray: #e893a0;

  --panel: #142317;
  --panel-line: rgba(255, 255, 255, 0.08);

  --lcd-green: #49e26a;
  --lcd-green-dim: rgba(73, 226, 106, 0.5);
  --lcd-red: #ff5d5d;

  --key: #d7bd7a;
  --key-ink: #1c1c1c;

  --c-blog: #d9362c;
  --c-tool: #2f6fb3;
  --c-artlab: #e8842a;
  --c-realty: #2f7d4f;
  --c-pdfspace: #7c3fa1;
  --c-artforge: #e0b93c;

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --ease-soft: cubic-bezier(.16, 1, .3, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-mono);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

/* ---------- Header ---------- */
.hero {
  text-align: center;
  padding: clamp(40px, 8vw, 72px) 20px 20px;
}
.brand-outline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(46px, 11vw, 104px);
  line-height: 0.94;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.brand-outline span {
  display: block;
  color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--ink);
}
.hint {
  margin: 18px 0 0;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
}

/* ---------- Machine ---------- */
.machine-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 16px 32px;
}
.machine {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--pink);
  border: 5px solid var(--ink);
  border-radius: 30px;
  padding: 22px 22px 24px;
  box-shadow: 0 18px 0 rgba(0, 0, 0, 0.08), 0 30px 46px rgba(0, 0, 0, 0.18);
}
.machine-trim {
  height: 6px;
  border-radius: 4px;
  background: var(--pink-trim);
  margin: 2px 34px 20px;
}

.wordmark-outline {
  text-align: center;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 38px);
  letter-spacing: 0.03em;
  color: var(--yellow);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Panels ---------- */
.panels {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--panel-line);
}
.panel-cans {
  flex: 1.6;
  display: flex;
  flex-direction: column;
}
.panel-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Cans ---------- */
.cans-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.can-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 2px;
  border-radius: 8px;
}
.can {
  position: relative;
  width: 100%;
  max-width: 58px;
  aspect-ratio: 0.42;
  border-radius: 10px 10px 4px 4px;
  background: var(--can, #999);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--ease-pop), box-shadow 0.25s var(--ease-soft), outline-color 0.2s;
  outline: 3px solid transparent;
  outline-offset: 2px;
}
.can-cap {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: #c7c7c7;
  border-radius: 2px;
}
.can-label {
  color: var(--can-ink, #fff);
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 0 3px;
  word-break: break-word;
}
.can-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
}

.can-cell.is-launching .can {
  outline-color: var(--lcd-green);
  box-shadow: 0 0 4px var(--lcd-green), 0 0 16px var(--lcd-green-dim), 0 3px 6px rgba(0, 0, 0, 0.45);
  transform: translateY(-4px);
}
.can-cell.is-launching .can-code { color: var(--lcd-green); }

.status-strip {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lcd-green-dim);
}

/* ---------- Display + keypad + menu ---------- */
.display-label {
  margin: 0 0 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.lcd {
  background: #0a1410;
  border: 2px solid rgba(73, 226, 106, 0.3);
  border-radius: 6px;
  padding: 10px 6px;
  min-height: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--lcd-green);
  text-shadow: 0 0 6px rgba(73, 226, 106, 0.5);
  transition: color 0.2s;
}
.lcd.is-invalid { color: var(--lcd-red); text-shadow: 0 0 6px rgba(255, 93, 93, 0.5); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.key {
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--key);
  color: var(--key-ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 0;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.key:hover { filter: brightness(1.05); }
.key:active,
.key.is-pressed {
  transform: translateY(3px);
  box-shadow: none;
}
.key-ok { background: var(--lcd-green); }
.key-back { font-size: 15px; }

.menu-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
}
.menu-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.menu-code { width: 20px; flex-shrink: 0; opacity: 0.6; }

/* ---------- Tray ---------- */
.tray {
  position: relative;
  margin-top: 16px;
  background: var(--tray);
  border-radius: 14px;
  padding: 20px 16px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.tray-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.16);
}
.tray-can-wrap[hidden] { display: none; }
.tray-can-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: pop-in 0.3s var(--ease-pop);
}
@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tray-can {
  all: unset;
  cursor: pointer;
  position: relative;
  width: 54px;
  aspect-ratio: 0.42;
  border-radius: 10px 10px 4px 4px;
  background: var(--can, #999);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-soft);
  animation: tray-pulse 1.8s ease-out infinite;
}
.tray-can::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: #c7c7c7;
  border-radius: 2px;
}
.tray-can::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--can-ink, #fff);
  padding: 0 3px;
  text-align: center;
}
.tray-can:hover { transform: translateY(-3px); animation-play-state: paused; }
.tray-can:active,
.tray-can.is-clicked { transform: translateY(1px) scale(0.94); }
@keyframes tray-pulse {
  0%, 100% { box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(73, 226, 106, 0.55); }
  50% { box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 0 0 7px rgba(73, 226, 106, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .tray-can { animation: none; }
}
.tray-can-hint {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.35);
}

.flying-can {
  position: fixed;
  z-index: 999;
  border-radius: 10px 10px 4px 4px;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

/* ---------- Feet ---------- */
.feet {
  display: flex;
  justify-content: space-around;
  padding: 0 15%;
  margin-top: 14px;
}
.foot {
  width: 42px;
  height: 12px;
  background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 4px;
}

/* ---------- Footer ---------- */
.instructions {
  text-align: center;
  padding: 0 20px 48px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}

@media (max-width: 560px) {
  .panels { flex-direction: column; }
}
