@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #090909;
  --graphite: #171513;
  --graphite-soft: #211d19;
  --orange: #f47a1f;
  --orange-bright: #ff9a38;
  --orange-deep: #bd4907;
  --cream: #fff8ee;
  --muted: #c8bbae;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--cream);
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 84% 10%, rgba(244, 122, 31, 0.16), transparent 27%),
    linear-gradient(145deg, #050505 0%, #12100e 55%, #070707 100%);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.display-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: clamp(12px, 1.8vh, 22px);
  padding: clamp(22px, 2.8vh, 40px) clamp(28px, 3vw, 56px) clamp(16px, 2vh, 28px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status { margin: 0; }

.slides {
  min-height: 0;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.45vw, 26px);
  opacity: 0;
  transform: translateY(22px) scale(0.99);
  pointer-events: none;
  transition: opacity 650ms ease, transform 650ms cubic-bezier(.2,.75,.2,1);
}

.slide.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.price-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(190px, 35%) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 1.45vw, 28px);
  border: 1px solid rgba(255, 154, 56, 0.34);
  border-radius: clamp(18px, 1.5vw, 28px);
  padding: clamp(12px, 1vw, 20px) clamp(18px, 1.35vw, 26px) clamp(12px, 1vw, 20px) clamp(14px, 1.05vw, 20px);
  background:
    linear-gradient(165deg, rgba(255,255,255,0.055), transparent 45%),
    linear-gradient(145deg, rgba(33,29,25,0.96), rgba(14,13,12,0.98));
  box-shadow: 0 24px 68px rgba(0,0,0,0.32);
}

.price-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(var(--orange-bright), var(--orange-deep));
}

.product-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: clamp(13px, 1.05vw, 20px);
  background-image: url("/images/bakery-products-sprite.png");
  background-repeat: no-repeat;
  background-size: 600% 300%;
  background-position:
    calc(var(--image-column) * 20%)
    calc(var(--image-row) * 50%);
  box-shadow: inset 0 0 0 1px rgba(255, 154, 56, 0.26);
}

.product-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 1.5vh, 22px);
}

.price-card.featured {
  border-color: rgba(255, 154, 56, 0.72);
  background:
    linear-gradient(165deg, rgba(244,122,31,0.15), transparent 48%),
    linear-gradient(145deg, #241b14, #100e0d);
}

.product-name {
  margin: 0;
  font-size: clamp(27px, 2.05vw, 40px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.price-block {
  align-self: flex-start;
  padding-top: 0;
}

.price-label {
  margin: 0 0 4px;
  color: var(--orange-bright);
  font-size: clamp(12px, 0.8vw, 16px);
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.price {
  display: flex;
  align-items: baseline;
  gap: clamp(8px, 0.8vw, 16px);
  white-space: nowrap;
}

.currency {
  color: var(--orange-bright);
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 800;
}

.amount {
  color: var(--cream);
  font-size: clamp(45px, 3.55vw, 69px);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
}

.unit {
  color: var(--muted);
  font-size: clamp(22px, 1.8vw, 34px);
  font-weight: 700;
}

.display-footer {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 9px;
}

.progress-dot {
  width: clamp(26px, 2.4vw, 46px);
  height: 5px;
  border: 0;
  border-radius: 99px;
  background: #413831;
  transition: background 250ms ease, transform 250ms ease;
}

.progress-dot.active {
  background: var(--orange);
  transform: scaleX(1.12);
}

.status {
  color: #8f8378;
  font-size: clamp(13px, 1vw, 18px);
  text-align: right;
}

.status.warning { color: #ffb164; }

.loading-card,
.error-card {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: clamp(22px, 2vw, 34px);
}

.loading-dot {
  width: 38px;
  aspect-ratio: 1;
  border: 5px solid #3a312a;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.controls {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
}

.controls[hidden] { display: none; }

.controls button {
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  background: var(--orange);
  color: #111;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .display-shell {
    gap: 10px;
    padding: 16px 18px 12px;
  }

  .slide { gap: 10px; }

  .price-card {
    grid-template-columns: minmax(78px, 35%) minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 17px;
  }

  .price-card::before { width: 5px; }
  .product-image { border-radius: 11px; }
  .product-copy { gap: 7px; }
  .product-name { font-size: clamp(16px, 3.1vw, 23px); }
  .price-label { margin-bottom: 2px; font-size: 8px; letter-spacing: 0.11em; }
  .price { gap: 4px; }
  .currency { font-size: 12px; }
  .amount { font-size: clamp(27px, 5.5vw, 41px); }
  .unit { font-size: 15px; }
  .display-footer { min-height: 24px; }
  .status { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
