:root {
  color-scheme: light;
  --accent: #e54411;
  --dark-text: #30302f;
  --background-color: #d9d7d2;
  --ui-font-size: clamp(.8125rem, .9vw, 1.0625rem);
  --ui-body-size: clamp(.8125rem, .95vw, 1.0625rem);
  --ui-small-size: .75rem;
  --nav-height: 72px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--dark-text);
  background: var(--background-color);
}
* {
  box-sizing: border-box;
}
body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  line-height: 1.6;
}
.experience {
  overflow: clip;
  overflow-anchor: none;
}
.experience:fullscreen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--background-color);
}
button,
input {
  font: inherit;
}
button {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}


/* The header and room share the wall. Only the room enters fullscreen. */
.site-header, .experience {
  grid-area: 1 / 1;
}
.site-header {
  align-self: start;
  width: 100%;
}
.background-wrapper {
  --scene-height: var(--scene-viewport-height, 100svh);
  --tv-width: min(60vw, max(600px, calc((var(--scene-height) - 210px) * 1.05)));
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: var(--scene-height);
  padding-top: calc(var(--nav-height) + clamp(20px, 3.2svh, 52px));
}
.scene-layer {
  pointer-events: none;
  background-repeat: no-repeat;
}
.scene-back {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('../images/bg-for-tv-wide-back.webp');
  background-size: cover;
  background-position: center bottom;
}
.showcase-intro {
  align-self: center;
  width: min(calc(100% - 40px), 60rem);
  text-align: center;
}
.showcase-intro h1 {
  margin: 0 0 .22em;
  color: var(--dark-text);
  font-size: clamp(1.875rem, 2.7vw, 3rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.showcase-intro p {
  margin: 0;
  color: #393939;
  font-size: clamp(.9rem, 1.2vw, 1.125rem);
  line-height: 1.5;
  text-wrap: balance;
}
.container.horizontal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--tv-width) minmax(0, 1fr);
  align-items: start;
  margin-top: 4px;
}
.right-panel {
  position: relative;
  grid-area: 1 / 2;
  container-type: inline-size;
}
/* The mockup includes a shadow beneath the bezel. The backs of the
   seats line up with its lower transparent edge, as in the reference. */
.right-panel::after {
  content: '';
  display: block;
  height: 31.1cqw;
}
.scene-front {
  position: absolute;
  bottom: 0;
  left: -154.2cqw;
  width: 394cqw;
  aspect-ratio: 3840 / 717;
  background-image: url('../images/bg-for-tv-wide-front.webp');
  background-size: 100% 100%;
}
.block-buttons.left-panel {
  grid-area: 1 / 1;
  justify-self: end;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, .55svh, 8px);
  width: min(calc(100% - 24px), clamp(172px, 16vw, 242px));
  margin-top: calc(var(--tv-width) * .057);
  margin-right: 8px;
}
.block-btn,
.fullscreen-toggle {
  font-size: var(--ui-font-size);
  white-space: nowrap;
}
.block-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(36px, 4.3svh, 48px);
  width: 100%;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 9px;
  background: rgb(255 255 255 / 48%);
  box-shadow: 0 2px 10px rgb(0 0 0 / 4%);
  color: var(--dark-text);
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.25s,
    box-shadow 0.25s,
    color 0.25s;
}
.btn-text {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.block-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgb(229 68 17 / 20%);
}
.shuffle-icon {
  display: none;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-left: 1px solid rgb(255 255 255 / 40%);
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3e%3c/svg%3e")
    right center / 16px no-repeat;
}
.block-btn.active .shuffle-icon {
  display: block;
}
.playback-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.autoplay-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
  margin-top: 0;
  font-size: var(--ui-font-size);
  white-space: nowrap;
}
.autoplay-switch label {
  cursor: pointer;
}
.autoplay-switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 20px;
  background: rgb(0 0 0 / 20%);
  cursor: pointer;
  transition: background 0.25s;
}
.autoplay-switch input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
}
.autoplay-switch input:checked {
  background: var(--accent);
}
.autoplay-switch input:checked::before {
  transform: translateX(16px);
}
.fullscreen-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  min-height: 44px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 10px;
  background: rgb(255 255 255 / 30%);
  color: var(--dark-text);
  cursor: pointer;
}
.fullscreen-toggle::before {
  content: '';
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) left top / 5px 1.5px,
    linear-gradient(currentColor, currentColor) left top / 1.5px 5px,
    linear-gradient(currentColor, currentColor) right top / 5px 1.5px,
    linear-gradient(currentColor, currentColor) right top / 1.5px 5px,
    linear-gradient(currentColor, currentColor) left bottom / 5px 1.5px,
    linear-gradient(currentColor, currentColor) left bottom / 1.5px 5px,
    linear-gradient(currentColor, currentColor) right bottom / 5px 1.5px,
    linear-gradient(currentColor, currentColor) right bottom / 1.5px 5px;
  background-repeat: no-repeat;
}
.fullscreen-toggle:hover {
  background: rgb(255 255 255 / 60%);
}
.fullscreen-toggle[hidden],
.fullscreen-status[hidden] {
  display: none;
}
.fullscreen-status {
  margin: 0;
  font-size: var(--ui-small-size);
  text-align: center;
}


.content-footer {
  grid-area: 1 / 2;
  justify-self: center;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  overflow: hidden;
  width: 82%;
  max-width: 740px;
  margin-top: calc(var(--tv-width) * .548 + 3px);
  padding: 5px 14px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 10px;
  background: rgb(255 255 255 / 64%);
}
.block-desc {
  grid-area: 1 / 1;
  text-align: center;
  font-size: var(--ui-body-size);
  line-height: 1.35;
}
.caption-reserve {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}
.caption-reserve > span { grid-area: 1 / 1; }

@media (hover: none), (pointer: coarse) {
  .block-btn, .fullscreen-toggle, .autoplay-switch { min-height: 44px; }
}
@media (hover: hover) and (pointer: fine) {
  .block-btn:hover {
    background: rgb(255 255 255 / 72%);
    box-shadow: 0 6px 20px rgb(0 0 0 / 7%);
  }
  .block-btn.active:hover {
    background: #d83e0d;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


.experience:fullscreen .background-wrapper {
  --tv-width: min(62vw, calc(var(--scene-height) * .99));
  padding-top: 0;
  justify-content: end;
}
.experience:fullscreen .showcase-intro { display: none; }

@media (max-width: 980px), (max-aspect-ratio: 6/5) {
  :root {
    --stacked-tv-width: min(100%, max(760px, calc(var(--scene-viewport-height, 100svh) * .78)));
    /* The opaque frame spans pixels 86–1111 of the 1198px mockup. */
    --bezel-width: calc(var(--stacked-tv-width) * 1026 / 1198);
  }
  .showcase-intro { width: var(--bezel-width); }
  .background-wrapper,
  .experience:fullscreen .background-wrapper {
    --tv-width: var(--stacked-tv-width);
    justify-content: space-between;
  }
  .container.horizontal-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 10px;
  }
  .right-panel {
    grid-area: 3 / 1;
    width: var(--tv-width);
    justify-self: center;
  }
  .content-footer, .block-buttons.left-panel {
    width: var(--bezel-width);
    max-width: none;
    margin: 0;
    justify-self: center;
  }
  .content-footer {
    grid-area: 2 / 1;
    margin-top: 6px;
    padding: 5px 12px;
  }
  .block-buttons.left-panel {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .block-btn { padding: 8px 5px; min-height: 44px; }
  .btn-text { white-space: normal; }
  .playback-options {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 16px;
  }
  .fullscreen-status { grid-column: 1 / -1; }
  .fullscreen-toggle { min-height: 44px; }
  /* Keep the label width stable when the category's replay icon appears. */
  .shuffle-icon { display: block; visibility: hidden; margin-left: 2px; }
  .block-btn.active .shuffle-icon { visibility: visible; }
  .experience:fullscreen .container.horizontal-layout { margin-top: auto; padding-top: 10px; }
}

@media (max-width: 640px) {
  :root { --nav-height: 56px; }
  .background-wrapper { padding-top: calc(var(--nav-height) + 14px); }
  .showcase-intro p { font-size: .875rem; }
  .block-buttons.left-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A sideways phone has enough room for a menu beside the screen. Keep the
   film in view while choosing a category, including in native fullscreen. */
@media (min-width: 600px) and (orientation: landscape) and (max-height: 560px) {
  .background-wrapper, .experience:fullscreen .background-wrapper {
    --tv-width: min(56vw, calc(var(--scene-height) * .99));
    justify-content: end;
  }
  .background-wrapper { padding-top: calc(var(--nav-height) + 12px); }
  .experience:fullscreen .background-wrapper { padding-top: 0; }
  .showcase-intro { width: calc(100% - 32px); }
  .showcase-intro h1 { font-size: 1.65rem; }
  .showcase-intro p { font-size: .85rem; }
  .container.horizontal-layout {
    grid-template-columns: minmax(0, 1fr) var(--tv-width) minmax(12px, .15fr);
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  .block-buttons.left-panel {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: end;
    width: min(320px, calc(100% - 16px));
    margin: 12px 0 0;
    gap: 4px;
  }
  .block-btn { min-height: 44px; padding: 6px 4px; font-size: .75rem; white-space: normal; }
  .block-btn .shuffle-icon, .block-btn.active .shuffle-icon { display: none; }
  .playback-options { grid-column: 1 / -1; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 4px 12px; }
  .right-panel { width: 100%; grid-area: 1 / 2 / 3 / 3; align-self: end; }
  .content-footer {
    grid-area: 2 / 1;
    justify-self: end;
    width: min(320px, calc(100% - 16px));
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 6px;
  }
  .block-desc { font-size: .72rem; }
}
