/* The marquee sign: teal cabinet with bulbs, the name plate (topper) and
   the letter board. The original's sign CSS was not in the assets, so this
   is rebuilt from the screenshots; the inked frames are the original
   nine-slice images in scene/sign-art.generated.css. */

.sign-wrap {
  width: min(100%, 273px);
  margin-inline: auto;
}

.sign {
  position: relative;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(to bottom, var(--sign-cabinet-hi), var(--sign-cabinet));
  /* The lip under the cabinet; the frame's ink draws its edge. */
  box-shadow: 0 5px 0 #1f5355;
}

/* The cabinet's inked outline, rivets and lip (image 64 x 72; the face
   outline runs 2 px inside it and the lip ends 12 px below the face). */
.sign::after {
  position: absolute;
  inset: -2px -2px -12px;
  border-style: solid;
  border-color: transparent;
  border-width: 14px 14px 22px;
  border-image: var(--sign-frame-cabinet) 14 14 22 14 / 14px 14px 22px 14px;
  content: "";
  pointer-events: none;
}

/* ── Bulbs ── */

.sign__bulbs {
  position: absolute;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.sign__bulbs--top,
.sign__bulbs--bottom {
  right: 15px;
  left: 15px;
  height: 5px;
}

.sign__bulbs--top { top: 4.5px; }
.sign__bulbs--bottom { bottom: 4.5px; }

.sign__bulbs--left,
.sign__bulbs--right {
  top: 17px;
  bottom: 17px;
  flex-direction: column;
  width: 5px;
}

.sign__bulbs--left { left: 4.5px; }
.sign__bulbs--right { right: 4.5px; }

.sign__bulbs i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bulb);
  box-shadow: 0 0 4px 1px rgb(255 226 150 / 55%);
}

.sign__bulbs i:nth-child(even) {
  background: #fff2c9;
}

/* ── Name plate and letter board ── */

.sign__topper,
.sign__board {
  position: relative;
  border-radius: 6px;
  background: var(--sign-board);
  box-shadow: inset 0 -3px 0 rgb(29 31 36 / 6%);
}

.sign__topper::after,
.sign__board::after {
  position: absolute;
  inset: -2px;
  border: 12px solid transparent;
  border-image: var(--sign-frame-board) 12 / 12px;
  content: "";
  pointer-events: none;
}

.sign__topper::after {
  border-image-source: var(--sign-frame-topper);
}

.sign__topper {
  margin-bottom: 7px;
  padding: 6px 12px 7px;
  overflow: hidden;
  color: var(--brand-teal);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sign__board {
  container-type: inline-size;
  padding: 5px 8px;
}

.sign__row {
  --row-max: 1.36rem;
  display: block;
  padding: 0.12em 0 0.1em;
  color: var(--ink);
  font-family: var(--font-sign);
  /* Fits any line on one row: shrink by character count, never past --row-max. */
  font-size: min(var(--row-max), calc(94cqi / (var(--chars, 12) * 0.56)));
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

.sign__row + .sign__row {
  border-top: 1.5px solid var(--sign-rule);
}

/* On phones the name is the big line, as in the reference. */
.sign__row--title {
  --row-max: 2.15rem;
}

.sign__letters {
  display: inline-block;
}

.sign__letters .ch {
  display: inline-block;
  transform-origin: 50% 0;
  animation: sign-letter-hang 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) backwards;
}

.sign__letters .sp {
  display: inline-block;
  width: 0.3em;
}

/* Each letter hangs a little off true, by position, so a line reads hand-set. */
.sign__letters .ch:nth-child(4n + 1) { transform: rotate(-1.6deg) translateY(0.02em); }
.sign__letters .ch:nth-child(4n + 2) { transform: rotate(1.2deg); }
.sign__letters .ch:nth-child(4n + 3) { transform: rotate(-0.6deg) translateY(0.04em); }
.sign__letters .ch:nth-child(4n) { transform: rotate(1.8deg) translateY(-0.01em); }
.sign__letters--1 .ch:nth-child(3n) { transform: rotate(-2deg); }
.sign__letters--2 .ch:nth-child(5n) { transform: rotate(2.2deg) translateY(0.03em); }

/* Letters swing in one after another when a line changes. */
.sign__letters .ch:nth-child(2) { animation-delay: 30ms; }
.sign__letters .ch:nth-child(3) { animation-delay: 60ms; }
.sign__letters .ch:nth-child(4) { animation-delay: 90ms; }
.sign__letters .ch:nth-child(5) { animation-delay: 120ms; }
.sign__letters .ch:nth-child(6) { animation-delay: 150ms; }
.sign__letters .ch:nth-child(7) { animation-delay: 180ms; }
.sign__letters .ch:nth-child(8) { animation-delay: 210ms; }
.sign__letters .ch:nth-child(9) { animation-delay: 240ms; }
.sign__letters .ch:nth-child(n + 10) { animation-delay: 270ms; }

@keyframes sign-letter-hang {
  from {
    opacity: 0;
    transform: rotate(-14deg) translateY(-0.3em);
  }
}

/* ── Posts ── */

.sign__posts {
  display: flex;
  justify-content: space-between;
  height: 1.5rem;
  padding-inline: 26%;
}

.sign__posts span {
  width: 9px;
  border-inline: 2px solid var(--brand-black);
  background: linear-gradient(to right, #8b939c, #5c636c);
}

/* ── Larger screens: the sign sits at the left of the content column ── */

@media (min-width: 1024px) {
  .sign-wrap {
    width: 300px;
    margin-inline: 0;
  }

  .sign__row--title {
    --row-max: 1.5rem;
  }

  .sign__row {
    --row-max: 1.45rem;
  }
}

/* ── The board's light at night ──
   A warm halo behind the cabinet: off by day, half at evening, full at
   night, easing between them as the daypart changes. */

.sign-wrap {
  position: relative;
  isolation: isolate;
}

.sign__glow {
  position: absolute;
  z-index: -1;
  inset: -18% -22% 30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 214 140 / 55%), rgb(255 190 110 / 22%) 55%, transparent);
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}

.menu-page.daypart-evening .sign__glow { opacity: 0.5; }
.menu-page.daypart-night .sign__glow { opacity: 1; }

/* ── Lights out: the sign while the menu server is down (down-state.js) ── */

.sign--down {
  background: linear-gradient(to bottom, #3f5c5d, #304b4c);
}

.sign--down .sign__bulbs i,
.sign--down .sign__bulbs i:nth-child(even) {
  background: #7d858c;
  box-shadow: inset 0 0 0 1px rgb(29 31 36 / 30%);
}

.sign--down .sign__topper,
.sign--down .sign__board {
  background: #e3e7e2;
}

.sign--down .sign__topper {
  color: #4f6e70;
}

.sign--down + .sign__posts span {
  background: linear-gradient(to right, #6f777f, #4b5159);
}

.hero--down .sign__glow {
  display: none;
}
