/* Layout: a vending-machine front — copy on the left, a lit slot with one foil card on the right;
   below, the machine's own vocabulary (slot codes, trays, price tags) carries the sections. */
:root {
  --paper: #eceef5;      /* cool machine-panel grey */
  --panel: #ffffff;      /* glass / raised surfaces */
  --ink: #1c2140;        /* deep indigo, text and frame */
  --ink-soft: #4b5175;   /* secondary text */
  --steel: #c5cad9;      /* coils, borders, dividers */
  --tag: #ffd23f;        /* price-tag yellow, the one accent */
  --tag-ink: #1c2140;
  --glass: #dfe3ee;      /* inside of the machine window */
  --slot-dim: #cfd4e2;
  --map-filter: grayscale(.85) contrast(1.02) brightness(1.03);

  --f-sans: "Commissioner", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.4rem, 5.4vw, 4.2rem);

  --radius-machine: 22px;
  --radius-small: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12152a;
    --panel: #1b1f3a;
    --ink: #e8eaf4;
    --ink-soft: #a6abc8;
    --steel: #353a5c;
    --tag: #ffd23f;
    --tag-ink: #1c2140;
    --glass: #0d1022;
    --slot-dim: #232845;
    --map-filter: grayscale(.9) invert(.92) hue-rotate(200deg) brightness(.9) contrast(.95);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12152a;
  --panel: #1b1f3a;
  --ink: #e8eaf4;
  --ink-soft: #a6abc8;
  --steel: #353a5c;
  --tag: #ffd23f;
  --tag-ink: #1c2140;
  --glass: #0d1022;
  --slot-dim: #232845;
  --map-filter: grayscale(.9) invert(.92) hue-rotate(200deg) brightness(.9) contrast(.95);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--tag); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 1000;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--steel);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.bm-card { fill: var(--tag); stroke: var(--ink); stroke-width: 2; }
.bm-box { fill: var(--ink); }
.bm-lid { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.brand-word {
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.04em;
}
.nav { display: flex; align-items: center; gap: 22px; font-weight: 500; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.lang {
  font: inherit;
  font-weight: 700;
  font-size: .85rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.lang:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) {
  .nav a { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-small);
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--panel); }
.btn-tag { background: var(--tag); color: var(--tag-ink); }
.btn-tag:hover { transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 96px); }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero-copy { display: grid; gap: 24px; min-width: 0; }
.hero h1 {
  font-size: var(--step-4);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 14ch;
}
.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* the machine */
.machine {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 12px;
  padding: 14px;
  background: var(--ink);
  border-radius: var(--radius-machine);
  box-shadow: 0 30px 60px -30px rgba(20, 24, 60, .55);
  max-width: 460px;
  justify-self: end;
  width: 100%;
}
.machine-glass {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  padding: 12px;
  background: var(--glass);
  border-radius: 12px;
  overflow: hidden;
}
.machine-glass::after { /* reflection on the glass */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.18) 47%, transparent 56%);
  pointer-events: none;
}
.slot {
  position: relative;
  min-height: 120px;
  border-radius: 8px;
  background: var(--slot-dim);
  display: grid;
  place-items: center;
}
.slot-dim::before { /* a stack of packs, seen from the front */
  content: "";
  width: 46%;
  height: 58%;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, var(--steel) 0 6px, transparent 6px 9px);
  opacity: .8;
}
.slot-feature {
  grid-row: span 2;
  min-height: 260px;
  background: var(--panel);
  padding: 18px 18px 40px;
}
.slot-code {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-weight: 800;
  font-size: .8rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.slot-feature .slot-code { color: var(--ink); font-size: .95rem; }
.price-tag {
  position: absolute;
  right: 8px;
  bottom: 6px;
  background: var(--tag);
  color: var(--tag-ink);
  font-weight: 800;
  font-size: .85rem;
  padding: 2px 8px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.coil {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--steel) 0 3px, transparent 3px 10px);
  opacity: .6;
}
.slot-feature { grid-column: 2; grid-row: 1 / span 2; }
.machine-glass .slot:nth-child(1) { grid-column: 1; grid-row: 1; }
.machine-glass .slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.machine-glass .slot:nth-child(4) { display: none; }

/* the foil card — the page's one bold element */
.holo {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative;
  width: 100%;
  max-width: 150px;
  aspect-ratio: 63 / 88;   /* standard trading-card proportions, 63 × 88 mm */
  border-radius: 9px;
  padding: 8px;
  background: #23284d;
  border: 3px solid #f2c94c;
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .25s ease-out;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  overflow: hidden;
  box-shadow: 0 14px 24px -12px rgba(0,0,0,.5);
}
.holo-art {
  border-radius: 5px;
  background:
    radial-gradient(circle at 30% 20%, #8be9ff 0, transparent 45%),
    radial-gradient(circle at 80% 70%, #ff9de2 0, transparent 50%),
    linear-gradient(160deg, #3a3f8f, #1c2140);
  display: grid;
  place-items: center;
}
.holo-art svg { width: 72%; }
.ha-ring { fill: none; stroke: #ffffff; stroke-opacity: .55; stroke-width: 3; }
.ha-star { fill: #ffd23f; }
.holo-foot {
  display: flex;
  justify-content: space-between;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #f2c94c;
}
.holo-shine {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.55), transparent 40%),
    linear-gradient(115deg,
      transparent 20%,
      rgba(139, 233, 255, .45) 35%,
      rgba(255, 157, 226, .45) 48%,
      rgba(255, 230, 109, .45) 60%,
      transparent 75%);
  background-size: 100% 100%, 220% 220%;
  background-position: center, var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  pointer-events: none;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .holo { transition: none; transform: none; }
}

.machine-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}
.keypad-display {
  background: #0b0e1f;
  color: var(--tag);
  font-weight: 800;
  font-size: 1.1rem;
  text-align: center;
  padding: 8px 0;
  border-radius: 6px;
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.keypad span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 5px;
  background: #2d335c;
  color: #c9cdf0;
  font-size: .72rem;
  font-weight: 700;
}
.nfc {
  margin-top: 6px;
  display: grid;
  place-items: center;
  height: 54px;
  border-radius: 8px;
  border: 1.5px dashed #5a6196;
  color: #8f96cc;
  font-weight: 800;
  font-size: .7rem;
  letter-spacing: .06em;
}

/* ---------- sections ---------- */
section h2 {
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-lede { color: var(--ink-soft); max-width: 56ch; }

.how { padding-block: clamp(56px, 8vw, 96px); background: var(--panel); border-block: 1px solid var(--steel); }
.how .wrap { display: grid; gap: 36px; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 18px;
  border-top: 3px solid var(--ink);
}
.steps li::before {
  content: counter(step);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.steps h3 { font-size: var(--step-1); font-weight: 700; }
.steps p { color: var(--ink-soft); }

.inside { padding-block: clamp(56px, 8vw, 96px); }
.inside .wrap { display: grid; gap: 16px; }
.tray {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
.tray li {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px 20px 26px;
  border-right: 1px solid var(--steel);
  position: relative;
}
.tray li:last-child { border-right: 0; }
.tray li::after { /* the spiral coil under each tray */
  content: "";
  position: absolute;
  left: 20px; right: 20px; bottom: 10px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--steel) 0 3px, transparent 3px 10px);
}
.tray-code {
  justify-self: start;
  font-weight: 800;
  font-size: .8rem;
  background: var(--tag);
  color: var(--tag-ink);
  padding: 2px 8px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.tray h3 { font-size: var(--step-1); font-weight: 700; }
.tray p { color: var(--ink-soft); font-size: .95rem; }

/* ---------- map ---------- */
.map-section { padding-block: clamp(56px, 8vw, 96px); background: var(--panel); border-top: 1px solid var(--steel); }
.map-section .wrap { display: grid; gap: 28px; }
.map-head { display: grid; gap: 8px; }
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.map-frame {
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  min-height: 460px;
  background: var(--glass);
  position: relative;
}
#leaflet-map { position: absolute; inset: 0; }
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-container { font-family: var(--f-sans); background: var(--glass); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-size: .9rem; line-height: 1.45; }
.leaflet-popup-content strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-soft); }

.pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--ink);
  border: 3px solid var(--tag);
  box-shadow: 0 6px 12px -4px rgba(0,0,0,.45);
}
.pin span {
  transform: rotate(45deg);
  color: var(--tag);
  font-weight: 900;
  font-size: .8rem;
}
.pin.is-soon { background: var(--panel); border-color: var(--ink-soft); }
.pin.is-soon span { color: var(--ink-soft); }

.locations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  max-height: 460px;
  overflow-y: auto;
}
.loc {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid var(--steel);
  border-radius: 10px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.loc:hover, .loc.is-active { border-color: var(--ink); }
.loc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.loc-name { font-weight: 700; }
.loc-addr, .loc-hours { color: var(--ink-soft); font-size: .9rem; }
.loc-status {
  flex: none;
  font-size: .72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}
.loc-status.is-soon { background: transparent; color: var(--ink-soft); border: 1px solid var(--ink-soft); }
.loc-dir { font-size: .88rem; font-weight: 700; margin-top: 4px; }
.loc-empty { color: var(--ink-soft); padding: 14px 0; }

/* ---------- shop ---------- */
.shop { padding-block: clamp(56px, 8vw, 88px); background: var(--ink); color: var(--paper); }
.shop-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.shop-inner > div { display: grid; gap: 12px; max-width: 60ch; min-width: 0; }
.shop p { opacity: .82; }

/* ---------- footer ---------- */
.footer { padding-block: 44px 56px; border-top: 1px solid var(--steel); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 28px;
  font-size: .92rem;
}
.footer-inner > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.footer-brand p, .footer-legal p { color: var(--ink-soft); }
.footer-h { font-size: .92rem; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .machine { justify-self: start; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tray li:nth-child(2) { border-right: 0; }
  .tray li:nth-child(-n+2) { border-bottom: 1px solid var(--steel); }
  .map-layout { grid-template-columns: 1fr; }
  .map-frame { min-height: 380px; }
  .locations { max-height: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-legal { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .machine { grid-template-columns: 1fr 64px; padding: 10px; }
  .slot-feature { min-height: 220px; padding: 14px 12px 36px; }
  .steps, .tray { grid-template-columns: 1fr; }
  .tray li { border-right: 0; border-bottom: 1px solid var(--steel); }
  .tray li:last-child { border-bottom: 0; }
  .footer-inner { grid-template-columns: 1fr; }
}
