:root {
  --wall: #e4e4e2;
  --ink: #1f2023;
  --ink-soft: #5d5f63;
  --glass: rgba(255, 255, 255, .34);
  --glass-edge: rgba(255, 255, 255, .78);
  --shade: 34, 34, 30;           /* цвет теней на гипсе */
  --cw: min(31vw, 520px);       /* ширина окна-сайта */
  --font: 'Onest', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--wall); color: var(--ink); }
body { font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
p { margin: 0; }

.hero { position: relative; height: 100svh; min-height: 640px; overflow: hidden; }
.hero__wall { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s ease-out; touch-action: none; } /* иначе браузер забирает палец себе и буквы не качаются */
.hero__wall.is-ready { opacity: 1; }

/* Текст для поисковиков и читалок; виден, только если 3D не запустилось */
.hero__title {
  position: absolute; inset: 0 0 auto; height: 52%; margin: 0; display: grid; place-items: center;
  font: 600 clamp(48px, 11vw, 180px)/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  color: var(--wall); text-shadow: 0 -2px 2px rgba(0,0,0,.18), 0 2px 1px #fff;
}
.webgl .hero__title { clip-path: inset(50%); }

/* девиз под логотипом: never settle по-испански, тоже вдавлен в стену */
.hero__motto {
  position: absolute; left: 0; right: 0; top: calc(var(--logo-bottom, 36%) + clamp(26px, 3.4vw, 46px)); margin: 0; text-align: center; pointer-events: none;
  font: 500 clamp(15px, 1.5vw, 22px)/1 var(--font); letter-spacing: .32em; text-transform: lowercase;
  /* выдавлено в гипсе: буквы темнее стены, светлая кромка снизу */
  color: rgba(var(--shade), .5); text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 -1px 1px rgba(var(--shade), .18);
  z-index: 1; opacity: 0; transition: opacity 1.2s ease-out .9s;
}
.webgl .hero__motto { opacity: 1; }

.hero__lead { position: absolute; left: 32px; top: 26px; font-size: 15px; color: var(--ink-soft); max-width: 22ch; }
.hero__actions { position: absolute; right: 28px; top: 20px; display: flex; gap: 10px; z-index: 2; }
.hero__calc { background: var(--ink); color: #fff; border-color: transparent; }

/* ——— Стекло: матовая подложка, светлая кромка сверху, мягкая тень на гипс ——— */
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.55), var(--glass) 55%, rgba(255,255,255,.22));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(var(--shade), .06),
    0 14px 34px -14px rgba(var(--shade), .35);
}
.glass--pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  font: 500 15px/1 var(--font); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.glass--pill:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 18px 38px -14px rgba(var(--shade), .45); }
.glass--pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ——— Кольцо окон ——— */
.ring { position: absolute; inset: 37% 0 0; }
.ring__stage { position: absolute; inset: 0 0 176px; perspective: 1700px; perspective-origin: 50% 35%; touch-action: pan-y; cursor: grab; user-select: none; }
.ring__stage.is-dragging { cursor: grabbing; }
.ring__track { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; transform-style: preserve-3d; }

.card {
  position: absolute; left: 50%; top: 50%; width: var(--cw); aspect-ratio: 16 / 10;
  margin: calc(var(--cw) * -.3125) 0 0 calc(var(--cw) / -2);
  transform-style: preserve-3d;
}
.card__face {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.card__front {
  background: #111;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7), 0 34px 60px -24px rgba(var(--shade), .55);
  cursor: pointer;
}
.card__front video, .card__front img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* блик стекла поверх кадра; --fog — туман цвета стены у окон, ушедших вбок */
.card__front::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(rgba(228,228,226, var(--fog, 0)), rgba(228,228,226, var(--fog, 0))),
    linear-gradient(115deg, rgba(255,255,255,.22), rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(255,255,255,.12);
}
.card__open {
  position: absolute; right: 14px; bottom: 14px; opacity: 0; transform: translateY(6px);
  transition: opacity .2s ease-out, transform .2s ease-out; pointer-events: none;
}
.card.is-front .card__front:hover .card__open { opacity: 1; transform: none; }

/* табличка как у экспоната */
.ring__label {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px)); padding: 12px 20px 13px; border-radius: 18px; text-align: left;
  transition: opacity .18s ease-out;
}
.ring__label.is-fading { opacity: 0; }
.ring__name { font-weight: 600; font-size: 17px; }
.ring__what { color: var(--ink); font-size: 15px; margin-top: 2px; }
.ring__meta { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
/* пояснение, почему работа показана не целиком */
.ring__note {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(var(--shade), .1);
  font-size: 13px; line-height: 1.4; color: var(--ink-soft);
}
.ring__note[hidden] { display: none; }
.ring__hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: var(--ink-soft); }

/* ——— Просмотр ролика ——— */
/* 100dvh — видимая высота: в мобильных браузерах 100vh выше экрана, и кнопка «Закрыть» уходила под адресную строку */
.player { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; }
.player::backdrop { background: rgba(228,228,226,.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.player__body { position: absolute; inset: 0; margin: auto; width: min(92vw, 1280px); height: fit-content; max-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.player__video { display: block; width: 100%; border-radius: 16px; box-shadow: 0 40px 80px -30px rgba(var(--shade), .6); }
.player__info { display: none; padding: 14px 16px 16px; border-radius: 18px; }
.player__name { font-weight: 600; font-size: 17px; }
.player__what { margin-top: 2px; font-size: 15px; }
.player__note { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.player__turn { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.player__cta { margin-top: 12px; background: var(--ink); color: #fff; border-color: transparent; }
/* телефон стоя: ролик шире экрана нельзя, поэтому под ним — подпись и кнопка, чтобы экран не был пустым */
@media (max-width: 760px) and (orientation: portrait) {
  /* телефон стоя: всё сверху вниз без пустоты — «Закрыть», ролик, подпись */
  .player__body { inset: 64px 8px auto; margin: 0; width: auto; max-height: calc(100% - 72px); overflow-y: auto; }
  .player__info { display: block; }
  .player__close { top: 12px; right: 8px; }
}
/* телефон лёжа: ролик на весь экран */
@media (max-height: 500px) and (orientation: landscape) {
  .player__body { width: auto; height: 100%; }
  .player__video { height: 100%; width: auto; max-width: 100vw; margin: 0 auto; border-radius: 0; }
}
.player__close { position: absolute; right: 24px; top: 20px; }

@media (max-width: 760px) {
  :root { --cw: 76vw; }
  .hero__lead { left: 16px; top: 16px; font-size: 13px; max-width: 46%; }
  .hero__actions { right: 16px; top: 12px; gap: 6px; }
  .hero__actions .glass--pill { padding: 8px 12px; font-size: 13px; }
  .hero__contact { display: none; }
  /* кольцо — сразу под девизом: на узком окне компьютера (500–760 px) 23% налезало на «nunca conforme» */
  .ring { inset: calc(var(--logo-bottom, 15%) + 46px) 0 0; }
  .ring__stage { bottom: 150px; perspective: 900px; }
  .ring__label { bottom: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .card__open, .glass--pill, .ring__label { transition: none; }
}
