/*
 * День открытых дверей Лампы.
 * Дизайн-система — как у lampa-open: бумага, чернила, оранжевые кнопки, без теней.
 * Мобильная вёрстка по умолчанию, десктоп — от 900px.
 */
:root {
  --orange: #FFAB38;
  --orange-hover: #F59A1C;
  --green: #5AA052;
  --blue: #0C89DA;
  --coral: #FF5457;
  --night: #1F3366;
  --cream: #F8F4EC;
  --paper-2: #EFE8DA;
  --ink: #122A33;
  --muted: #3D5058;
  --white: #FFFFFF;
  --black: #000000;

  --font-display: 'Dela Gothic One', 'Arial Black', sans-serif;
  --font-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 14px;
  --container: 1200px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
}
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 400; line-height: 1.15; }
p, figure, ol, ul { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border: 0; border-radius: var(--radius);
  font: 700 17px/1.2 var(--font-body); color: var(--ink);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.btn--primary { background: var(--orange); }
.btn--primary:hover { background: var(--orange-hover); }
.btn:active { transform: scale(.98); }
.btn--block { display: flex; width: 100%; }

/* ---------- Шапка ---------- */
/* Линия под шапкой — как в lampa-open (фирменный приём). */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: 1px solid var(--ink); }
.site-header__inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__icon { width: 32px; height: 32px; }
.logo__word { width: auto; height: 16px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a:not(.btn) {
  display: none; align-items: center; min-height: 44px; padding: 0 8px;
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.site-nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav .btn { min-height: 44px; padding: 0 16px; font-size: 15px; border-radius: 12px; }

/* ---------- Первый экран ---------- */
.hero { padding: 28px 0 40px; }
.hero__grid { display: grid; gap: 28px; }
.hero__text { display: flex; flex-direction: column; gap: 18px; }
.hero__title { font-size: min(30px, 7.6vw); line-height: 1.1; letter-spacing: -.01em; }
.hero__date { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.hero__lead { font-size: 17px; line-height: 1.55; }
.hero__cta { display: flex; flex-direction: column; gap: 10px; }

.media-frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 16px; background: var(--paper-2); }
.media-frame video, .media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame video { transform: scale(1.04); animation: drift 18s var(--ease) infinite alternate; }
@keyframes drift { to { transform: scale(1.12) translate(-2%, -1%); } }

/* ---------- Секции ---------- */
.section { padding: 48px 0; }
.section--tone { background: var(--paper-2); }
.section__title { font-size: 26px; }
.section__lead { margin-top: 10px; font-size: 17px; line-height: 1.55; max-width: 640px; }

/* ---------- Программа: переключатель часового пояса ---------- */
.program__head { display: flex; flex-direction: column; gap: 18px; }
.tz { display: flex; flex-direction: column; gap: 8px; }
.tz__label { font-size: 14px; font-weight: 600; }
.tz__select {
  width: 100%; min-height: 50px; padding: 0 44px 0 16px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 0; border-radius: 12px; background-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23122A33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  font: 600 16px var(--font-body); color: var(--ink);
  transition: background-color .15s;
}
.tz__select:hover, .tz__select:focus { background-color: var(--orange-hover); }
.tz__select option { background: var(--white); color: var(--ink); }

/* ---------- Программа: события ---------- */
.day { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 12px; }
.day__part { margin: 20px 0 2px; font-family: var(--font-display); font-size: 20px; }
.day__part:first-child { margin-top: 0; }
.slot {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 16px; padding: 16px;
  transition: background-color .2s;
}
.slot.is-picked { background: #FFF1DA; }
.slot__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.slot__time { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.slot__time b { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; }
.slot__time small { font-size: 14px; font-weight: 600; color: var(--muted); }
.slot__time .slot__day { flex-basis: 100%; margin-top: 4px; color: var(--coral); }
.slot__time .slot__day:empty { display: none; }
.slot__meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; align-items: center; gap: 6px 10px; font-size: 14px; font-weight: 600; text-align: right; }
.slot__age { padding: 3px 9px; border-radius: 8px; background: var(--paper-2); white-space: nowrap; }
.slot__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot__title { font-family: var(--font-body); font-weight: 700; font-size: 20px; line-height: 1.25; }
.slot__desc { display: grid; gap: 8px; font-size: 16px; line-height: 1.5; }
.slot__desc p { margin: 0; }
.slot__hosts { display: grid; gap: 10px; margin-top: 8px; }
.slot__host { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.slot__host strong { display: block; font-weight: 700; }
.slot__host span { color: var(--muted); }
.slot__host .slot__ava {
  flex: none; width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--orange); color: var(--ink);
  font-family: var(--font-display); font-size: 18px;
}
.slot__pick {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--orange); color: var(--ink); font: 700 16px var(--font-body);
  transition: background-color .15s, transform .1s;
}
.slot__pick:hover { background: var(--orange-hover); }
.slot__pick:active { transform: scale(.97); }
.slot__pick svg { width: 20px; height: 20px; }
.slot__pick .i-check { display: none; }
.slot__pick[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.slot__pick[aria-pressed="true"] .i-plus { display: none; }
.slot__pick[aria-pressed="true"] .i-check { display: block; }

/* ---------- Как это проходит ---------- */
.flow { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 24px; }
.flow li { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--paper-2); }
.flow strong { font-size: 18px; line-height: 1.3; }
.flow span { font-size: 15px; line-height: 1.5; }
.flow li:last-child { background: var(--orange); }

/* ---------- Финальный призыв ---------- */
.cta { background: var(--night); color: var(--cream); padding: 56px 0; }
.cta__inner { display: flex; flex-direction: column; gap: 18px; }
.cta__title { font-size: 30px; line-height: 1.12; }
.cta__lead { font-size: 17px; line-height: 1.55; max-width: 560px; }
.cta .btn { align-self: stretch; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--black); color: var(--cream); padding: 40px 0 32px; }
.site-footer a { color: var(--cream); }
.site-footer__top { display: flex; flex-direction: column; gap: 24px; }
.site-footer__logo { display: flex; align-items: center; gap: 12px; align-self: flex-start; text-decoration: none; }
.site-footer__logo img:first-child { width: 40px; height: 40px; }
.site-footer__logo img:last-child { width: auto; height: 20px; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; font-size: 15px; }
.footer-nav a { padding: 10px 0; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.social { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.social__links { display: flex; flex-wrap: wrap; gap: 8px; }
.social__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--cream); border-radius: 12px; font-weight: 600; text-decoration: none;
}
.social__links a:hover { background: rgba(248, 244, 236, .12); }
.site-footer__bottom {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 32px; font-size: 13px; opacity: .8;
}
.site-footer__bottom a { padding: 6px 0; }

/* ---------- Панель выбранного (мобильная) ---------- */
.picked {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--ink); color: var(--cream);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transform: translateY(110%); transition: transform .3s var(--ease);
}
.picked.is-on { transform: none; }
.picked__count { font-size: 15px; font-weight: 600; line-height: 1.3; }
.picked__count b { display: block; font-size: 13px; font-weight: 500; opacity: .8; }
.picked .btn { min-height: 48px; padding: 0 20px; font-size: 16px; border-radius: 12px; flex: 0 0 auto; }
body.has-picked .site-footer { padding-bottom: 104px; }

/* ---------- Форма заявки (диалог) ---------- */
.lead-dialog {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%;
  max-height: 100dvh; background: transparent; color: var(--ink);
}
.lead-dialog::backdrop { background: rgba(18, 42, 51, .55); }
.lead-dialog[open] { animation: sheet-in .25s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.lead { position: relative; background: var(--cream); border-radius: 20px 20px 0 0; overflow: hidden auto; max-height: 100dvh; }
.lead__close {
  position: absolute; top: 10px; right: 8px; z-index: 1;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--cream); cursor: pointer;
}
.lead__side { background: var(--night); color: var(--cream); padding: 14px 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.lead__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--cream); opacity: .5; margin: 0 auto; }
.lead__title { font-size: 26px; line-height: 1.15; padding-right: 44px; }
.lead__info { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(248, 244, 236, .1); font-size: 15px; }
.lead__info > div { display: flex; align-items: flex-start; gap: 10px; }
.lead__info svg { flex: 0 0 20px; margin-top: 1px; color: var(--orange); }
.lead__body { padding: 22px 16px 28px; }
.lead-form { display: flex; flex-direction: column; gap: 14px; }
.lead-form__row { display: grid; gap: 14px; }
.events { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.events legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.event-chk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--white); border: 1.5px solid var(--ink); cursor: pointer; font-size: 15px; line-height: 1.35; }
.event-chk input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 20px; accent-color: var(--night); }
.event-chk b { display: block; }
.event-chk small { font-size: 13px; color: var(--muted); }
.event-chk:has(input:checked) { background: #FFF1DA; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid var(--ink); border-radius: 12px; background: var(--white);
  font: 500 16px var(--font-body); color: var(--ink);
}
.field input::placeholder { color: #6B7C84; }
.field input[aria-invalid="true"] { border-color: var(--coral); border-width: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: var(--night); }
.lead-form__error { font-size: 13px; line-height: 1.4; background: #FFE3E3; border: 1.5px solid var(--coral); border-radius: 10px; padding: 10px 12px; }
.lead-form .btn { min-height: 54px; margin-top: 4px; }
.lead-form__note { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- Появление при прокрутке ---------- */
.js .rise { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rise.is-in { opacity: 1; transform: none; }
/* Первый экран появляется сам, без ожидания прокрутки */
.js .hero .rise { opacity: 1; transform: none; transition: none; animation: rise-in .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }

/* ==========================================================================
   Десктоп
   ========================================================================== */
@media (min-width: 900px) {
  :root { --gutter: 24px; }
  html { scroll-padding-top: 88px; }

  .site-header__inner { min-height: 72px; }
  .logo { gap: 12px; }
  .logo__icon { width: 40px; height: 40px; }
  .logo__word { height: 20px; }
  .site-nav { gap: 12px; }
  .site-nav a:not(.btn) { display: inline-flex; font-size: 16px; }
  .site-nav .btn { min-height: 48px; padding: 0 22px; font-size: 16px; }

  .hero { padding: 64px 0 80px; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .hero__text { gap: 24px; }
  .hero__title { font-size: 52px; line-height: 1.02; letter-spacing: -.02em; }
  .hero__date { font-size: 32px; }
  .hero__lead { font-size: 19px; max-width: 580px; }
  .hero__cta { flex-direction: row; align-items: center; gap: 12px; }
  .hero .btn { padding: 0 36px; }

  .section { padding: 96px 0; }
  .section__title { font-size: 40px; }
  .section__lead { margin-top: 12px; font-size: 18px; }

  .program__head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; }
  .tz { flex: 0 0 auto; }
  .tz__select { width: auto; min-width: 360px; }

  .day { margin-top: 40px; gap: 14px; }
  .day__part { margin: 28px 0 2px; font-size: 24px; }
  .slot {
    display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px;
    grid-template-areas: "time meta pick" "time body pick";
    align-items: start; gap: 6px 32px; padding: 24px 28px;
  }
  .slot__top { display: contents; }
  .slot__time { grid-area: time; flex-direction: column; align-items: flex-start; gap: 4px; }
  .slot__time b { font-size: 36px; }
  .slot__meta { grid-area: meta; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; }
  .slot__body { grid-area: body; }
  .slot__title { font-size: 22px; }
  .slot__pick { grid-area: pick; margin-top: 0; min-height: 52px; }

  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
  .flow li { padding: 24px; gap: 10px; }
  .flow strong { font-size: 20px; }
  .flow span { font-size: 16px; }

  .cta { padding: 96px 0; }
  .cta__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 48px; row-gap: 16px; align-items: end; }
  .cta__title { font-size: 48px; grid-column: 1; }
  .cta__lead { font-size: 19px; grid-column: 1; }
  .cta .btn { grid-column: 2; grid-row: 1 / span 2; align-self: end; padding: 0 36px; }

  .site-footer { padding: 48px 0 36px; }
  .site-footer__top { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
  .site-footer__logo { align-self: center; }
  .site-footer__logo img:first-child { width: 44px; height: 44px; }
  .site-footer__logo img:last-child { height: 22px; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 16px; }
  .social { flex-direction: row; align-items: center; gap: 12px; }
  .site-footer__bottom { flex-direction: row; gap: 28px; margin-top: 40px; }

  .picked { left: auto; right: 24px; bottom: 24px; border-radius: 16px; padding: 12px 12px 12px 20px; gap: 20px; transform: translateY(160%); }
  body.has-picked .site-footer { padding-bottom: 36px; }

  .lead-dialog { margin: auto; width: calc(100% - 48px); max-width: 880px; }
  .lead-dialog[open] { animation-name: dialog-in; }
  @keyframes dialog-in { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
  .lead { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); border-radius: 20px; max-height: calc(100dvh - 48px); }
  .lead__close { top: 8px; color: var(--ink); }
  .lead__close:hover { background: var(--paper-2); }
  .lead__grip { display: none; }
  .lead__side { padding: 36px 32px; }
  .lead__title { font-size: 32px; padding-right: 0; }
  .lead__body { padding: 40px 32px 32px; }
  .lead-form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rise, .js .hero .rise { opacity: 1; transform: none; }
}

/* ---------- Согласие на cookie (как в lampa-open) ---------- */
.cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--ink); color: var(--cream);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px;
  font-size: 13px; line-height: 1.4;
}
.cookie[hidden] { display: none; }
.cookie p { flex: 1 1 260px; margin: 0; }
.cookie a { color: var(--cream); }
.cookie__actions { display: flex; gap: 8px; }
.cookie__actions button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
  font: 700 14px var(--font-body); cursor: pointer;
}
.cookie__accept { background: var(--orange); color: var(--ink); }
.cookie__accept:hover { background: var(--orange-hover); }
.cookie__decline { background: transparent; color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.lead-form button[type="submit"]:disabled { opacity: .6; cursor: progress; }
@media (min-width: 900px) {
  .cookie { padding-top: 12px; padding-bottom: 12px; font-size: 14px; }
  .cookie p { flex: 0 1 auto; }
}
