/* KULEK x ПИР Экспо. Один экран: история интерьеров + оффер и регистрация. Шрифт Raleway (брендбук). */

/* Raleway со своего сервера (без Google): один вариативный файл на все начертания, лицензия OFL */
@font-face {
  font-family: 'Raleway'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/fonts/raleway-cyrillic-wght-normal.woff2) format('woff2-variations'), url(assets/fonts/raleway-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Raleway'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(assets/fonts/raleway-latin-wght-normal.woff2) format('woff2-variations'), url(assets/fonts/raleway-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F3ECE2;
  --paper: #FFFDF9;
  --ink: #2A1812;
  --muted: #6B5248;
  --line: rgba(42, 24, 18, .18);
  --coral: #FF6144;
  --error: #B42318;
  --sans: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --frame: 5.5s;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
/* у Raleway по умолчанию «книжные» цифры. Шорткат font: (CSS Fonts 4) сбрасывает font-variant-numeric
   и font-feature-settings у каждого элемента, поэтому ровные цифры закреплены через !important */
*, *::before, *::after, input::placeholder { font-variant-numeric: lining-nums !important; font-feature-settings: 'lnum' 1 !important; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
p, h1, h2, h3, ul { margin: 0; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 3px; }

.layout {
  height: 100vh; height: 100svh;            /* vh: запасной вариант для iOS < 15.4 */
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr);
  gap: clamp(16px, 2vw, 28px); padding: clamp(12px, 1.6vw, 22px);
}

/* ---------- история интерьеров ---------- */
.story { position: relative; overflow: hidden; border-radius: 4px; background: #1a120e; isolation: isolate; }
.story__frames { position: absolute; inset: 0; }
.frame { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.1s ease; }
.frame.is-on { opacity: 1; }
.frame img { width: 100%; height: 100% !important; object-fit: cover; }
.frame.is-on img { animation: drift calc(var(--frame) + 1.2s) linear forwards; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.story::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(10, 6, 4, .32) 0%, rgba(10, 6, 4, 0) 16%, rgba(10, 6, 4, 0) 62%, rgba(10, 6, 4, .62) 100%); }

.story__bars { position: absolute; z-index: 3; top: 14px; left: 14px; right: 14px; display: flex; gap: 4px; }
.story__bar { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 253, 249, .35); overflow: hidden; }
.story__bar i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.story__bar.is-done i { transform: scaleX(1); }
.story__bar.is-on i { animation: fill var(--frame) linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.story.is-paused .story__bar.is-on i, .story.is-paused .frame.is-on img { animation-play-state: paused; }

.story__nav { position: absolute; z-index: 2; top: 0; bottom: 0; width: 50%; }
.story__nav--prev { left: 0; cursor: w-resize; }
.story__nav--next { right: 0; cursor: e-resize; }
.story__caption { position: absolute; z-index: 3; left: clamp(18px, 2.4vw, 30px); right: 18px; bottom: clamp(16px, 2.2vw, 28px); color: #fff; pointer-events: none; }
.story__place { font: 700 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.story__addr { margin-top: 8px; font: 500 15px/1.35 var(--sans); opacity: .9; }

/* ---------- оффер ---------- */
.offer { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; padding: clamp(6px, 1.2vw, 18px) clamp(4px, 1.6vw, 24px) 4px; }
.offer__logo { width: 112px; }
.offer__body { align-self: center; max-width: 440px; }
.offer__kicker { margin-bottom: 26px; font: 700 13px/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.offer__title { margin-bottom: 40px; font-weight: 500; }
.offer__num { display: block; margin-bottom: 12px; font: 800 clamp(96px, 9.5vw, 156px)/.86 var(--sans); letter-spacing: -.035em; }
.offer__text { display: block; font: 500 clamp(20px, 1.7vw, 26px)/1.2 var(--sans); }
.btn.offer__open { display: none; }
.offer__places { justify-self: start; min-height: 40px; font: 600 14px var(--sans); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.offer__places:hover { text-decoration-color: var(--ink); }

/* ---------- регистрация ---------- */
.reg__form { display: grid; gap: 18px; min-width: 0; }
.reg__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.f { display: grid; gap: 2px; min-width: 0; }   /* иначе поле не сжимается меньше встроенной ширины и форма вылезает за край */
.f__label { font: 700 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.f input {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; font: 500 17px var(--sans); color: var(--ink);   /* 17px: без автозума на iOS */
}
.f input::placeholder { color: rgba(42, 24, 18, .35); }
.f input:focus-visible { outline: none; border-bottom-color: var(--ink); }
.f input[aria-invalid="true"] { border-bottom-color: var(--error); }
.f__err { font-size: 12px; color: var(--error); }
.f__err:empty { display: none; }
.f__code { font-weight: 700 !important; font-size: 24px !important; letter-spacing: .3em; }
.chk { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.chk a { text-underline-offset: 2px; }
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 22px;
  border-radius: 4px; background: var(--ink); color: var(--paper); text-decoration: none;
  font: 700 14px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  transition: background-color .2s;
}
.btn:hover { background: #3d2419; }
.btn[disabled] { opacity: .6; cursor: progress; }
.reg__status { font-size: 14px; color: var(--error); }
.reg__status:empty { display: none; }
.reg__lead { font-size: 15px; }
.reg__demo { font-size: 12px; color: var(--muted); }
.reg__links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.link { min-height: 40px; font: 600 14px var(--sans); text-decoration: underline; text-underline-offset: 3px; }
.link[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.reg__done { display: grid; gap: 12px; }
.reg__done-title { font: 700 clamp(26px, 2.4vw, 34px)/1.1 var(--sans); letter-spacing: -.01em; }
.reg__done-title:focus { outline: none; }
.reg__done-text { color: var(--muted); }

/* памятка о баллах */
.memo { margin-top: 22px; border-top: 1px solid var(--line); }
.memo summary { display: flex; justify-content: space-between; align-items: center; min-height: 46px; cursor: pointer; list-style: none; font: 600 15px var(--sans); }
.memo summary::-webkit-details-marker { display: none; }
.memo summary::after { content: ''; width: 8px; height: 8px; margin-right: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.memo[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.memo ul { padding: 0 0 6px; list-style: none; display: grid; gap: 7px; font-size: 14px; color: var(--muted); }
.memo li { position: relative; padding-left: 14px; }
.memo li::before { content: ''; position: absolute; left: 1px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.memo b { color: var(--ink); font-weight: 600; }

/* ---------- шторка ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(12, 7, 5, .5); opacity: 0; transition: opacity .3s; }
.backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(100%, 520px);
  max-height: 92vh; max-height: 92svh; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 24px calc(26px + env(safe-area-inset-bottom));
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px -24px rgba(0, 0, 0, .45);
  transform: translate(-50%, 100%); transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.sheet__close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font-size: 24px; line-height: 40px; }
.sheet__head { margin: 10px 0 22px; }
.sheet__num { font: 800 56px/.88 var(--sans); letter-spacing: -.035em; }
.sheet__title { margin-top: 8px; font: 500 16px/1.3 var(--sans); }
.places__title { margin-top: 10px; font: 700 22px/1.2 var(--sans); }
.places__hours { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }
.places__sub { margin: 18px 0 8px; font: 700 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.places__list { list-style: none; padding: 0; display: grid; }
.places__list a { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.places__list b { font-weight: 600; }
.places__list span { font-size: 13px; color: var(--muted); }
.places__note { margin-top: 16px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.noscript { position: fixed; left: 12px; right: 12px; bottom: 12px; padding: 12px; background: var(--paper); border-radius: 8px; text-align: center; }

/* ---------- телефон: легче, меньше элементов ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 18px; padding: 10px 10px max(14px, env(safe-area-inset-bottom)); }
  .offer { grid-template-rows: auto auto; padding: 0 8px; }
  .offer__logo { display: none; }
  .offer__body { max-width: none; }
  .offer__body > .reg { display: none; }       /* регистрация открывается шторкой */
  .offer__kicker { margin-bottom: 10px; font-size: 12px; }
  /* число и подпись в две колонки, низ подписи = базовая линия числа (у Raleway при этих line-height они совпадают) */
  .offer__title { margin-bottom: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; column-gap: 12px; }
  .offer__num { margin: 0; font-size: 56px; }
  .offer__text { font-size: 16px; line-height: 1.2; text-wrap: balance; }
  .btn.offer__open { display: flex; width: 100%; }
  .offer__places { justify-self: center; min-height: 36px; font-size: 13px; }
  .story__addr { font-size: 14px; }
}
@media (max-width: 860px) and (max-height: 620px) {
  .layout { gap: 12px; }
  .offer__kicker { margin-bottom: 6px; }
  .offer__title { margin-bottom: 12px; }
  .offer__num { font-size: 44px; }
  .btn.offer__open { min-height: 48px; }
  .story__addr { display: none; }
  .sheet__head { margin: 6px 0 14px; }
  .sheet__num { font-size: 42px; }
  .reg__form { gap: 12px; }
  .memo { margin-top: 12px; }
}
/* телефон боком */
@media (max-height: 520px) and (orientation: landscape) {
  .layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: 1fr; gap: 14px; padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); }
  .offer { grid-template-rows: 1fr auto; }
  .offer__logo { display: none; }
  .offer__body > .reg { display: none; }
  .offer__kicker { margin-bottom: 6px; font-size: 11px; }
  .offer__title { margin-bottom: 10px; }
  .offer__num { font-size: 44px; }
  .offer__text { font-size: 15px; }
  .btn.offer__open { display: flex; width: 100%; min-height: 44px; }
  .story__addr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .frame, .sheet, .backdrop { transition: none; }
  .frame.is-on img, .story__bar.is-on i { animation: none; }
  .story__bar.is-on i { transform: scaleX(1); }
}

/* самые узкие экраны (iPhone SE 1): надзаголовок в одну строку */
@media (max-width: 350px) {
  .offer__kicker { font-size: 11px; letter-spacing: .1em; }
}
