/* ============================================================
   ТУРАНДОТ — stylesheet
   Standalone reimplementation of the design mockup.
   ============================================================ */

:root {
  --ink: #0C0A0A;
  --ink2: #14100F;
  --panel: #171210;
  --bordo: #6B1620;
  --bordo2: #8B1E2D;
  --red: #E11D2A;
  --gold: #B4B1AB;
  --brass: #B4B1AB;
  --cream: #F2E9DE;
  --cream2: #EDE4D6;
  --muted: #9A8F82;
  --line: rgba(180, 177, 171, 0.16);
  --disp: 'Bodoni Moda', serif;
  --ui: 'Archivo', sans-serif;
  --mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: var(--bordo2); color: var(--cream); }
a { color: inherit; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ---- Нельзя «схватить и потянуть» интерфейс: убираем призрак-перетаскивание
        у ссылок/логотипа/картинок и подсветку выделения при click-drag.
        Поля ввода остаются выделяемыми/редактируемыми. ---- */
body {
  -webkit-user-select: none; -moz-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
a, button, img, svg, model-viewer, canvas, .seat, [data-ph] {
  -webkit-user-drag: none; user-drag: none;
}
img, a { -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; -moz-user-select: text; user-select: text; }

/* ---- Hide native scrollbars everywhere (scrolling still works) ---- */
html { scrollbar-width: none; -ms-overflow-style: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---- Animations ---- */
@keyframes tnSolo {
  from { opacity: 0; transform: scale(.965); filter: blur(3px); }
  to   { opacity: 1; transform: scale(1);    filter: blur(0); }
}
@keyframes tnIntroOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes tnDust {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: .7; } 80% { opacity: .5; }
  100% { transform: translateY(-120px) translateX(20px); opacity: 0; }
}
@keyframes tnCue {
  0% { transform: translateY(0); opacity: .2; }
  50% { opacity: 1; }
  100% { transform: translateY(10px); opacity: .2; }
}
@keyframes tnMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes tnBlink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---- Scroll reveal ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1), filter .9s ease;
}
[data-reveal][data-shown] { opacity: 1 !important; transform: none !important; filter: none !important; }
[data-mask] { display: block; overflow: hidden; }
[data-maskline] { display: block; transform: translateY(118%); transition: transform 1.15s cubic-bezier(.16,1,.3,1); }
[data-shown] [data-maskline] { transform: translateY(0); }
[data-parallax], [data-parallax-x] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-maskline] { transform: none !important; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- Buttons & interactive patterns (hover/focus that the runtime did inline) ---- */
.btn-red {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--red); color: var(--cream); text-decoration: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  padding: 16px 28px; border: 1px solid var(--red);
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}
.btn-red:hover { background: #ff2f3c; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(225,29,42,0.32); }

/* Светлая (белая) кнопка — монохромный аналог btn-red */
.btn-light {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--cream); color: #0C0A0A; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em;
  padding: 16px 28px; border: 1px solid var(--cream);
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}
.btn-light:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.35); }

.nav-ticket {
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em; color: var(--cream);
  background: none; cursor: pointer; border: none; border-bottom: 1px solid var(--line); padding: 0 0 3px;
  transition: border-color .3s ease;
}
.nav-ticket:hover { border-color: var(--gold); }

/* Inline section links in the navbar (desktop) */
.nav-links { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 26px); }
.nav-links a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cream);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  opacity: .55; transition: opacity .3s ease;   /* активный/наведённый раздел ярче */
}
.nav-links a:hover, .nav-links a.active { opacity: 1; }
/* On narrow viewports collapse into the hamburger menu */
@media (max-width: 1024px) { .nav-links { display: none; } }
@media (min-width: 1025px) { #menu-open { display: none; } }   /* бургер — только в адаптиве */

/* Десктопная «Войти» в навбаре — без подчёркивания; на узких прячется (уходит в бургер) */
.nav-login {
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em; color: var(--cream);
  background: none; cursor: pointer; border: none; padding: 0; transition: color .3s ease;
}
.nav-login:hover { color: var(--gold); }
@media (max-width: 1024px) { .nav-login { display: none; } }

.menu-toggle, .menu-close {
  display: flex; align-items: center; gap: 11px; background: none; border: none; cursor: pointer;
  color: var(--cream); font-family: var(--mono); font-size: 11px; letter-spacing: .24em; padding: 0;
}

/* «Войти» внутри бургер-меню — без подчёркивания */
.menu-account {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 9px;
  background: none; cursor: pointer; color: var(--cream);
  border: 1px solid var(--line); padding: 13px 24px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em;
  transition: border-color .3s ease, color .3s ease;
}
.menu-account:hover { border-color: var(--gold); color: var(--gold); }

/* Season / repertoire rows */
.season-row {
  display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center;
  gap: clamp(14px,2.5vw,40px); padding: clamp(13px,1.9vh,20px) 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--cream); cursor: pointer;
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1),
              background .4s ease, padding-left .4s cubic-bezier(.22,1,.36,1);
}
.season-row:hover { background: linear-gradient(90deg, rgba(225,29,42,0.06), transparent 70%); padding-left: 18px; }
.season-row:hover .season-arrow { transform: translateX(8px); }
.season-arrow { font-family: var(--disp); font-size: 24px; color: var(--gold); transition: transform .4s ease; }

/* Calendar nav buttons */
.cal-btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted);
  background: none; cursor: pointer; border: 1px solid var(--line); padding: 9px 14px;
  transition: border-color .3s ease, color .3s ease;
}
.cal-btn:hover { border-color: var(--gold); color: var(--cream); }

/* Schedule rows */
.schedule-row {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center;
  gap: clamp(14px,2vw,26px); padding: 16px 0; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: padding-left .35s ease, background .35s ease;
}
.schedule-row:hover { padding-left: 14px; background: linear-gradient(90deg, rgba(180,177,171,0.06), transparent 70%); }

.book-btn {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--cream);
  background: none; cursor: pointer; border: 1px solid var(--line); padding: 11px 16px;
  white-space: nowrap; transition: border-color .3s ease, color .3s ease;
}
.book-btn:hover { border-color: var(--red); color: var(--red); }

/* Footer links */
.footer-link { text-decoration: none; transition: color .25s ease; }
.footer-link:hover { color: var(--gold); }

/* Newsletter */
.news-form { display: flex; gap: 0; max-width: 420px; border: 1px solid var(--line); }
.news-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--cream);
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; padding: 16px 18px;
  transition: background .3s ease;
}
.news-input:focus { background: rgba(180,177,171,0.05); }
.news-submit {
  background: var(--cream); color: #0C0A0A; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; padding: 0 22px;
  transition: background .3s ease;
}
.news-submit:hover { background: var(--gold); }

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,10,10,0.6); border: 1px solid var(--line); cursor: pointer; color: var(--cream);
  font-family: var(--mono); font-size: 14px; transition: border-color .3s ease;
}
.modal-close:hover { border-color: var(--gold); }

.menu-link {
  display: flex; align-items: baseline; gap: clamp(14px,2vw,28px); padding: clamp(8px,1.4vh,16px) 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--cream);
  opacity: .5; transition: opacity .3s ease, padding-left .35s ease;
}
.menu-link:hover { opacity: 1; padding-left: 10px; }
.menu-link.active { opacity: 1; }

/* Seat buttons get inline styles from JS; just a base reset */
.seat { padding: 0; flex: none; }

/* ---- Light chapter theme: auto-flips text colours on bright backgrounds ---- */
body.theme-light {
  --cream: #16130f;
  --cream2: #26211b;
  --muted: #7d7468;
  --line: rgba(22, 18, 14, 0.18);
}
/* dark panels keep light text even in the light theme */
body.theme-light #menu, body.theme-light #modal-panel, body.theme-light #tn-toast {
  --cream: #F2E9DE;
  --cream2: #EDE4D6;
  --muted: #9A8F82;
  --line: rgba(180, 177, 171, 0.16);
}

/* ---- One-page chapters (scroll-jacking on home) ---- */
body.no-scroll { overflow: hidden; height: 100vh; }
#home.fullpage { position: fixed; inset: 0; overflow: hidden; z-index: 2; }   /* контент — над 3D-сценой (z1) и фоном (z0) */
#home.fullpage > .chapter {
  /* !important — sections carry inline position:relative from the design */
  position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  opacity: 0; pointer-events: none;
  transform: translateY(34px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22, 1, .36, 1);
  overflow-y: auto; overflow-x: hidden;
}
#home.fullpage > .chapter-active { opacity: 1; pointer-events: auto; transform: translateY(0); }
#home.fullpage > .chapter-leaving { opacity: 0; transform: translateY(-26px); }   /* уходит вверх */

/* Toast */
#tn-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  z-index: 120; background: var(--panel); border: 1px solid var(--gold);
  color: var(--cream); font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  padding: 14px 22px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .4s ease, transform .4s cubic-bezier(.16,1,.3,1);
  max-width: 90vw; text-align: center;
}
#tn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Мобильные поправки (узкие экраны) ---- */
@media (max-width: 480px) {
  #hero h1 { font-size: clamp(38px, 13.5vw, 56px) !important; }   /* не обрезать название */
  #hero { padding-left: 18px !important; padding-right: 18px !important; }
}
@media (max-width: 560px) {
  /* репертуар: дата и стрелка встают под название, автору — вся ширина */
  .season-row { grid-template-columns: 34px minmax(0,1fr); row-gap: 8px; }
  .season-row > div:last-child { grid-column: 2; justify-content: flex-start; }
}
/* Мобильные: «Календарь» переполнял экран (сетка месяца + дублирующий список
   спектаклей). Убираем список «СПЕКТАКЛИ МЕСЯЦА» — визуальная сетка-календарь и
   так показывает даты спектаклей; секция перестаёт быть перегруженной.
   В футере прячем нефункциональные демо-ссылки политик — лишний хлам внизу. */
@media (max-width: 700px) {
  #calendar div:has(> #schedule-list) { display: none; }
  #contact .demo-link { display: none; }
}
