/* Shinni katalog: комната на видео, 3D-каталог по центру, минимум интерфейса по углам. */
:root {
  --onyx: #141414;
  --platinum: #FFFDF9;
  --serif: "PP Editorial New", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --pad: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #d9cfbf; }
body {
  color: var(--onyx);
  font-family: var(--serif);
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }

/* ── Комната ─────────────────────────────────────────────── */
.room { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #d9cfbf center / cover no-repeat; }
.floor-shadow {
  position: absolute; left: 0; top: 0; z-index: 1; width: 100px; height: 20px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(46, 32, 18, .36), rgba(46, 32, 18, .14) 55%, rgba(46, 32, 18, 0));
  opacity: 0; transform-origin: 0 0; will-change: transform, opacity;
}
#stage { z-index: 2; }
.room-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
}
.room-media.in { opacity: 1; }
/* Открытый каталог: комната уходит в расфокус. Это готовая размытая картинка поверх видео,
   а видео в это время на паузе: так открытый каталог не нагружает слабые ноутбуки. */
.room-blur {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease; pointer-events: none;
}
#app[data-mode="open"] .room-blur { opacity: 1; }

/* ── Сцена ───────────────────────────────────────────────── */
#stage {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none;
  opacity: 0; transition: opacity 1s ease; cursor: grab;
}
#app:not([data-mode="loading"]) #stage { opacity: 1; }
#stage.fade { opacity: 0 !important; transition: opacity .3s ease; }
#stage.zoomed { cursor: zoom-out; }
#stage.pointer { cursor: pointer; }
#stage.dragging { cursor: grabbing; }

/* ── Логотип и подписи по углам ─────────────────────────── */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: grid; place-items: center; padding: var(--pad); pointer-events: none; }
.logo { appearance: none; background: none; border: 0; cursor: pointer; pointer-events: auto; color: var(--platinum); padding: 6px 10px; }
.logo img { display: block; height: 34px; width: auto; }
.logo-text { font-size: 30px; line-height: 1; }

.bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: var(--pad);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
/* Внизу на видео тёмный стол: подписи светлые. */
.bar .link { color: var(--platinum); }
.bar .link:focus-visible { outline-color: var(--platinum); }
.flavors { grid-column: 2; justify-self: center; }

.link {
  appearance: none; background: none; border: 0; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 19px; line-height: 1; letter-spacing: inherit; color: var(--onyx);
  padding: 8px 2px; opacity: .82; transition: opacity .2s ease;
}
.link:hover, .link.on { opacity: 1; }
.link:focus-visible { outline: 1px solid var(--onyx); outline-offset: 4px; }
.logo:focus-visible { outline: 1px solid var(--platinum); outline-offset: 4px; }

/* Вкусы: на широком экране строкой, на узком по кнопке. */
.flavors { position: relative; display: flex; flex-direction: column; align-items: center; }
.flavors-toggle { display: none; }
.flavors-list { display: flex; flex-wrap: nowrap; gap: 4px 18px; justify-content: center; }
.flavors-list .link { font-size: 17px; opacity: .58; white-space: nowrap; }
.flavors-list .link:hover { opacity: .9; }
.flavors-list .link.on { opacity: 1; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

@media (max-width: 1180px) {
  .flavors-toggle { display: block; }
  .flavors-list {
    position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px);
    display: grid; grid-template-columns: repeat(2, auto); gap: 2px 26px; padding: 18px 24px;
    background: rgba(20, 20, 20, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -20px rgba(20, 20, 20, .35);
    opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  }
  .flavors.open .flavors-list { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
  .flavors-list .link { font-size: 18px; padding: 7px 0; }
}
@media (max-width: 760px) {
  :root { --pad: 18px; }
  .logo img { height: 26px; }
  .link { font-size: 17px; }
}

/* Без WebGL: обложка. */
.fallback { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 90px 20px; }
.fallback img { max-height: 100%; max-width: 100%; box-shadow: 0 30px 60px -20px rgba(40, 28, 14, .45); }
