/* Hallmark · P5 H5 E4 S5 R5 V4 · атмосферный дизайн · вступление и полноэкранные истории */
@font-face {
  font-family: "Golos Text"; src: url("/golos.woff2") format("woff2");
  font-style: normal; font-weight: 400 900; font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Golos Text"; src: url("/golos-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F,U+2191-2193,U+2212,U+2215;
}
:root {
  color-scheme: dark;
  --bg: #161222;
  --panel: #211a31;
  --tray: #1d172d;
  --border: #3d3451;
  --rule: #a38cd02e;
  --text: #faf6ea;
  --muted: #bbb0cd;
  --accent: #e3fa86;
  --ink: #232913;
  --lavender: #c7b5f7;
  --wash: #4a2d821e;
  --shadow: #0c081866;
  --danger: #ffc0ca;
  --font: "Golos Text", Arial, sans-serif;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { min-width: 0; overflow-x: clip }
body {
  margin: 0;
  min-height: 100dvh;
  font: 16px/1.5 var(--font);
  background: radial-gradient(ellipse at 75% 16%, var(--wash), transparent 58%), var(--bg);
  color: var(--text);
}
button, select { font: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .48 }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px }
.masthead {
  max-width: 1320px;
  min-height: 78px;
  padding: max(14px, env(safe-area-inset-top)) 42px 12px;
  margin: auto;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 800;
  padding: 0;
  white-space: nowrap;
}
.brand-secondary { color: var(--lavender) }
.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: relative;
  background: var(--accent);
}
.brand-icon::after {
  content: "";
  position: absolute;
  inset: 7px 6px 6px 7px;
  background: var(--ink);
  clip-path: polygon(0 41%,100% 0,74% 100%,49% 70%,27% 86%,33% 60%);
}
.mast-meta { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; white-space: nowrap }
.mast-year { border: 1px solid var(--border); padding: 3px 11px; border-radius: 20px; color: var(--text) }
.landing {
  max-width: 1210px;
  padding: 52px 42px 44px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  gap: clamp(32px, 7vw, 110px);
  align-items: center;
}
.intro { animation: enter .55s both }
.edition {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--lavender);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .15em;
  margin: 0 0 21px;
}
.edition span { color: var(--accent); font-size: 19px }
h1, h2 { overflow-wrap: anywhere; min-width: 0 }
h1 {
  font-size: clamp(62px, 7.45vw, 101px);
  line-height: .91;
  letter-spacing: -.057em;
  font-weight: 820;
  margin: 0;
}
h1 span { color: var(--accent) }
.intro-copy { max-width: 440px; font-size: 18px; color: var(--muted); margin: 28px 0 34px }
.import-panel { border-top: 1px solid var(--rule); padding-top: 21px; max-width: 460px }
.import-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px }
.import-head h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.025em }
.year-label { display: flex; gap: 5px; align-items: center; font-size: 13px; color: var(--muted) }
select { border: 1px solid var(--border); background: var(--panel); border-radius: 9px; color: var(--text); padding: 4px 6px }
.import-actions { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 9px }
.import-actions.dragging { outline: 2px dashed var(--accent); outline-offset: 5px; border-radius: 10px }
.button {
  border-radius: 10px;
  min-height: 50px;
  padding: 8px 13px;
  white-space: nowrap;
  font-weight: 750;
  transition: filter .2s, transform .2s, border-color .2s;
}
.button:not(:disabled):hover { filter: brightness(1.09); transform: translateY(-2px) }
.button:not(:disabled):active { transform: translateY(1px) }
.button-primary { background: var(--accent); color: var(--ink); border: 1px solid var(--accent) }
.button-secondary { background: var(--panel); color: var(--text); border: 1px solid var(--border) }
.file-icon { margin-right: 5px }
.text-button {
  background: none;
  border: 0;
  color: var(--lavender);
  font-size: 14px;
  font-weight: 660;
  padding: 4px 0;
  text-decoration: none;
  white-space: nowrap;
}
.text-button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px }
.import-meta { display: flex; justify-content: space-between; gap: 7px; flex-wrap: wrap; margin-top: 8px }
.guide-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--border) }
.import-status { color: var(--lavender); margin: 9px 0 0 }
.import-status[data-error="true"] { color: var(--danger) }
.privacy { color: var(--muted); display: flex; gap: 8px; align-items: baseline; margin: 23px 0 0; font-size: 13px }
.lock { display: inline-block; flex: 0 0 auto; width: 10px; height: 8px; border: 1px solid currentColor; border-radius: 2px; position: relative }
.lock::before { content: ""; position: absolute; width: 4px; height: 4px; border: 1px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; top: -5px; left: 1px }
.preview { min-width: 0; animation: enter .66s .08s both }
.tray {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 16px;
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 50% 50% / 29px 29px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 50% 50% / 29px 29px,
    var(--tray);
  border: 1px solid var(--border);
  padding: 47px 30px 19px;
  border-radius: 18px;
}
.tray-label, .tray-code { position: absolute; top: 16px; font-size: 10px; color: var(--muted); font-weight: 750; letter-spacing: .12em }
.tray-label { left: 17px }
.tray-label span { color: var(--accent); margin-right: 4px }
.tray-code { right: 17px }
.preview-tile {
  padding: 0;
  display: block;
  line-height: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(100%, 318px);
  overflow: clip;
  box-shadow: 12px 19px 34px var(--shadow);
  transform: rotate(3deg);
  transition: transform .42s cubic-bezier(.2,.8,.2,1);
}
.preview-tile:hover, .preview-tile:focus-visible { transform: rotate(0) scale(1.025) }
canvas { display: block; width: 100%; height: auto }
.preview-link { padding-inline: 8px; background: var(--tray); z-index: 1 }
.preview-link span { padding-left: 4px }
.story { min-height: calc(100dvh - 78px); padding: 12px 16px 6px }
.story-shell { width: min(100%, 410px, calc((100dvh - 214px) * .667)); min-width: min(100%, 242px); margin: auto }
.story-head { margin: 0 0 9px }
.story-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px }
.story-top .text-button { padding: 0; font-size: 14px }
.progress { display: flex; gap: 4px; margin-top: 5px }
.progress button { flex: 1 1 0; min-width: 0; padding: 0; border: 0; height: 17px; background: none; position: relative }
.progress button::after { content: ""; position: absolute; inset: 6px 0; border-radius: 8px; background: var(--border) }
.progress button[aria-current="step"]::after { background: var(--accent) }
.progress button.visited::after { background: var(--lavender) }
.story-picture { position: relative; border: 1px solid var(--border); border-radius: 15px; overflow: clip; background: var(--tray) }
.story-picture canvas { touch-action: pan-y }
.story-picture canvas.play { animation: slide .43s cubic-bezier(.15,.83,.3,1) both }
.hotspot { position: absolute; top: 0; bottom: 0; width: 34%; padding: 0; border: 0; background: transparent; touch-action: pan-y }
.prev-zone { left: 0 }
.next-zone { right: 0 }
.story-controls { display: grid; grid-template-columns: 45px minmax(0, 1fr) 45px; gap: 7px; margin-top: 9px; align-items: center }
.circle {
  aspect-ratio: 1;
  width: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  line-height: 1;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 100%;
  font-size: 25px;
}
.circle:hover:not(:disabled) { border-color: var(--lavender) }
.share { min-height: 43px; padding: 5px; font-size: 14px }
.share span:first-child { margin-right: 5px }
.invite { display: block; margin: 5px auto 0 }
.story-status { min-height: 1.3em; font-size: 12px; text-align: center; color: var(--muted); margin: 2px 0 0 }
dialog { width: min(calc(100vw - 28px), 580px); max-height: 85dvh; border: 1px solid var(--border); border-radius: 15px; padding: 23px; color: var(--text); background: var(--panel) }
dialog::backdrop { background: var(--shadow); backdrop-filter: blur(7px) }
.guide-head { display: flex; justify-content: space-between; gap: 10px; align-items: center }
.guide-head h2 { margin: 0; line-height: 1.2; font-size: 24px }
.guide-head .circle { flex: 0 0 42px }
dialog ol { padding-left: 20px }
dialog li + li { margin-top: 11px }
dialog p { color: var(--muted) }
@keyframes enter { from { opacity: 0; transform: translateY(13px) } to { opacity: 1; transform: translateY(0) } }
@keyframes slide { from { opacity: .2; transform: scale(1.045) translateY(8px) } to { opacity: 1; transform: scale(1) translateY(0) } }
@media (max-width: 960px) {
  .masthead { padding-inline: 27px }
  .landing { padding-inline: 27px; gap: 30px }
  h1 { font-size: clamp(52px, 8vw, 83px) }
  .tray { padding-inline: 20px }
}
@media (max-width: 710px) {
  .masthead { min-height: 58px; padding-inline: 16px }
  .mast-meta > :first-child { display: none }
  .landing { display: block; width: min(100%, 479px); padding: 25px 16px 26px }
  h1 { font-size: clamp(49px, 12vw, 77px); letter-spacing: -.055em }
  .edition { margin-bottom: 11px }
  .intro-copy { font-size: 16px; margin: 19px 0 22px }
  .import-panel { padding-top: 14px }
  .privacy { margin-top: 13px }
  .preview { margin-top: 23px }
  .tray { gap: 13px; padding-bottom: 12px }
  .preview-tile { width: min(65%, 242px) }
  .story { min-height: calc(100dvh - 58px); padding-top: 8px }
  .story-shell { width: min(100%, 410px, calc((100dvh - 192px) * .667)) }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important }
}
