@font-face {
  font-family: Golos;
  src: url('/assets/golos-cyrillic.woff2') format('woff2');
  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;
  src: url('/assets/golos-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212;
}
@font-face {
  font-family: Brygada;
  src: url('/assets/brygada-cyrillic.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
:root {
  color-scheme: dark;
  --canvas: #090b0e;
  --paper: #12151b;
  --ink: #e6e9f1;
  --muted: #a7afc0;
  --rule: #2a3241;
  --outline: #58677f;
  --blue: #385ac9;
  --blue-dark: #2d4ebc;
  --blue-wash: #1a2544;
  --danger: #ff9aab;
  --accent: #9db1ff;
  --focus: #a8bbff;
  --field: #0e1117;
  color: var(--ink);
  background: var(--canvas);
  font: 16px/1.5 Golos, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; min-width: 280px; }
[hidden] { display: none !important; }
::selection { background: #a8bbff; color: #161f43; }
h1, h2, p, ol, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: .22em; }
:is(button, a, input, summary, select):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.shell { width: min(1120px, calc(100% - 104px)); margin-inline: auto; }
.top { background: var(--canvas); }
.masthead { display: flex; align-items: center; gap: clamp(18px, 3.2vw, 44px); min-height: 75px; border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 44px; font-size: 1.24rem; font-weight: 760; letter-spacing: -.035em; text-decoration: none; }
.brand-mark { display: block; flex: none; width: 35px; height: 35px; }
.about-link { min-height: 44px; display: inline-flex; align-items: center; margin-left: auto; font-size: .90rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.about-link:hover { color: var(--accent); text-decoration: underline; }
.credit { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.credit span { font-size: .79rem; color: var(--muted); }
.credit strong { font-size: .93rem; font-weight: 760; letter-spacing: -.018em; }
.composition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .75fr);
  grid-template-areas: 'intro object' 'upload upload' 'retention retention';
  align-items: center;
  position: relative;
  padding-block: 35px 48px;
}
.intro { grid-area: intro; padding-block: 11px 26px; }
h1 { font-family: Brygada, Georgia, serif; font-weight: 650; line-height: .96; letter-spacing: -.033em; font-synthesis: none; }
.intro h1 { font-size: clamp(2.85rem, 5.85vw, 5.3rem); }
.intro p { margin-top: 21px; color: var(--muted); font-size: clamp(1.02rem, 1.7vw, 1.25rem); }
.hero {
  grid-area: object; position: relative; justify-self: end; isolation: isolate;
  width: min(100%, 400px); height: clamp(220px, 26vw, 325px); margin-block: -18px 8px;
}
.hero::before {
  content: ''; position: absolute; inset: 13% 13% 12%;
  background: #141d2e; transform: rotate(-12deg); border: 1px solid #283650;
}
.hero::after {
  content: ''; position: absolute; inset: 15% 11% 11%;
  border: 1px solid #36455f; transform: rotate(9deg); z-index: -1;
}
.poster, .scene { width: 100%; height: 100%; position: absolute; inset: 0; }
.poster { object-fit: contain; filter: drop-shadow(4px 12px 10px #000a21a0); transition: opacity .22s ease; }
.hero.is-live .poster { opacity: 0; }
.scene { z-index: 1; opacity: 0; transition: opacity .22s ease; pointer-events: none; }
.scene.is-ready { opacity: 1; }
.scene canvas { width: 100%; height: 100%; display: block; }
.upload-panel { grid-area: upload; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; }
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(246px, .51fr); }
.file-column, .settings { min-width: 0; padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.panel-heading h2, .duration legend { font-size: 1.03rem; font-weight: 730; letter-spacing: -.02em; }
.panel-heading span { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.drop-zone {
  min-height: 151px; padding: 19px; border-radius: 7px; background: var(--field);
  border: 1px dashed var(--outline); display: grid; align-content: center; justify-items: center; gap: 11px;
}
.drop-zone.dragging { border-color: var(--blue); outline: 2px solid var(--focus); outline-offset: 2px; background: var(--blue-wash); }
.file-empty { color: var(--muted); font-size: .92rem; }
.choose-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--outline); border-radius: 6px;
  padding: 8px 13px; font-size: .92rem; font-weight: 690;
}
.choose-button:hover { border-color: var(--accent); color: var(--accent); }
.drop-zone:not(.has-files) .choose-button { background: var(--blue); border-color: var(--blue); color: #fff; }
.drop-zone:not(.has-files) .choose-button:hover { background: var(--blue-dark); }
.drop-zone:not(.has-files) .plus-icon { color: #fff; }
.plus-icon { position: relative; width: 15px; height: 15px; flex: none; color: var(--accent); }
.plus-icon::before, .plus-icon::after { content: ''; position: absolute; inset: 7px 1px auto; height: 1.5px; background: currentColor; border-radius: 2px; }
.plus-icon::after { transform: rotate(90deg); }
.file-note, .consent, .status, .retention { color: var(--muted); font-size: .85rem; }
.file-note { padding-top: 9px; }
.contact-sheet { width: 100%; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 9px; padding: 0; }
.contact-sheet li { position: relative; min-width: 0; }
.selection-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1.15; overflow: hidden; background: #1e2736; color: #aeb9d1; font-size: .8rem; border-radius: 4px; }
.selection-thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.selection-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.remove-file {
  position: absolute; top: 0; right: 0; z-index: 1; width: 44px; height: 44px;
  border: 0; background: transparent; padding: 8px; display: grid; justify-items: end; align-items: start;
}
.remove-file::before, .remove-file::after { content: ''; grid-area: 1 / 1; }
.remove-file::before { width: 26px; height: 26px; border-radius: 50%; background: #121721ed; box-shadow: 0 1px 5px #070d18a0; }
.remove-file::after { width: 11px; height: 11px; margin: 7.5px; background: linear-gradient(45deg, transparent 44%, #e0e9fa 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #e0e9fa 44% 56%, transparent 56%); }
.remove-file:hover::before { background: var(--blue-wash); }
.settings { display: flex; flex-direction: column; border-left: 1px solid var(--rule); }
.duration { border: 0; padding: 0; margin: 0; min-width: 0; }
.duration legend { margin-bottom: 10px; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 7px; background: #0d1117; }
.choices label { position: relative; min-width: 0; }
.choices input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.choices span {
  display: grid; place-items: center; min-height: 44px; border: 1px solid transparent;
  white-space: nowrap; border-radius: 5px; font-size: .85rem; font-weight: 660;
}
.choices input:checked + span { background: #263356; color: #dce5ff; border-color: #576b9c; }
.choices input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.choices input:hover:not(:checked) + span { border-color: var(--outline); }
.consent { margin-top: 13px; }
.main-button, .small-button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  background: var(--blue); color: #fff; border: 1px solid transparent; border-radius: 6px;
  min-height: 48px; padding: 10px 16px; font-size: .96rem; font-weight: 680; text-decoration: none;
  transition: background-color .15s ease;
}
.main-button:hover, .small-button:hover { background: var(--blue-dark); }
.main-button:disabled { background: #222b3b; color: #a8b0bf; cursor: default; }
.settings .main-button { width: 100%; margin-top: auto;  }
.settings .consent { margin-bottom: 14px; }
progress { margin-top: 9px; width: 100%; height: 7px; accent-color: var(--accent); }
.upload-grid > .status { grid-column: 1 / -1; margin: 0 24px 16px; }
.status[data-error] { color: var(--danger); font-weight: 610; }
.retention { grid-area: retention; padding-top: 11px; }
.result { padding: clamp(17px, 3vw, 31px); max-width: 745px; }
.result h2 { font-size: clamp(1.65rem, 3.3vw, 2.4rem); line-height: 1.1; letter-spacing: -.041em; }
.result-head p { margin: 6px 0 14px; color: var(--muted); }
.copy-row { display: flex; align-items: stretch; gap: 8px; }
.copy-row button { white-space: nowrap; }
.address { background: var(--field); border: 1px solid var(--outline); border-radius: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; }
.result-actions { display: flex; gap: 18px; margin-block: 6px; }
.text-action { display: inline-flex; align-items: center; border: 0; background: transparent; padding: 3px 0; min-height: 44px; font-size: .90rem; color: var(--accent); font-weight: 640; text-decoration: underline; }
.text-action:hover { color: #d0daff; }
details p { font-size: .88rem; margin-bottom: 8px; color: var(--muted); }
summary { width: fit-content; min-height: 44px; padding-block: 10px; font-weight: 650; font-size: .90rem; }
.result .status { margin-top: 8px; }
.visually-hidden { border: 0; clip-path: inset(50%); height: 1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
.viewer, .rules { padding-block: clamp(27px, 6vw, 62px); }
.viewer h1, .rules h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
.viewer-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 23px; }
.viewer-title p { margin-top: 8px; color: var(--muted); }
.album-total { white-space: nowrap; font-size: 1rem; }
.photo-stage { max-width: 100%; min-height: 180px; background: var(--field); display: grid; place-items: center; overflow: hidden; border-radius: 6px; }
.photo-stage img { display: block; max-width: 100%; max-height: 73vh; object-fit: contain; }
.gallery { display: grid; list-style: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; padding: 0; }
.gallery-link { display: grid; gap: 5px; padding: 6px; background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; text-decoration: none; }
.gallery-link:hover { border-color: var(--blue); }
.gallery-link img { display: block; width: 100%; aspect-ratio: 1.27; object-fit: cover; background: var(--field); }
.gallery-link span { padding-inline: 3px; color: var(--muted); font-size: .83rem; font-variant-numeric: tabular-nums; }
.viewer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.viewer-actions details { border-bottom: 1px solid var(--rule); }
.viewer-actions form { display: grid; gap: 8px; max-width: 350px; padding: 0 4px 9px; }
.viewer-actions select { min-height: 44px; padding-inline: 8px; background: var(--field); border: 1px solid var(--outline); border-radius: 6px; }
.small-button { min-height: 44px; justify-self: start; }
.viewer-actions label { font-size: .91rem; }
.lightbox { width: min(960px, calc(100% - 28px)); max-height: 94dvh; padding: 14px; border: 1px solid var(--outline); border-radius: 8px; background: #0e1117; color: var(--ink); }
.lightbox::backdrop { background: #030609eb; }
.lightbox-top, .lightbox-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lightbox figure { display: grid; place-items: center; min-height: 80px; margin-block: 10px; }
.lightbox img { display: block; max-width: 100%; max-height: 66dvh; object-fit: contain; }
.lightbox-button { min-height: 44px; background: #202a3b; color: var(--ink); border: 1px solid var(--outline); border-radius: 5px; padding: 5px 11px; font-size: .86rem; }
.lightbox-button:hover { background: #405279; }
.lightbox-button:disabled { opacity: .46; cursor: default; }
.lightbox-button:focus-visible { outline-color: #adc2ff; }
.missing p, .rules p { margin-block: 15px; max-width: 63ch; color: var(--muted); }
.rules h2 { font-size: 1.26rem; margin-top: 25px; letter-spacing: -.025em; }
@media (max-width: 890px) {
  .shell { width: calc(100% - 62px); }
  .file-column, .settings { padding: 18px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  .masthead { min-height: 59px; gap: 11px; }
  .wordmark { font-size: 1.02rem; gap: 4px; }
  .brand-mark { width: 27px; height: 27px; }
  .about-link { font-size: .76rem; }
  .credit { display: grid; gap: 3px; line-height: 1; text-align: right; }
  .credit span { font-size: .67rem; }
  .credit strong { font-size: .76rem; }
  .composition { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'upload' 'retention' 'object'; padding-block: 24px 12px; }
  .intro { padding: 0 0 19px; }
  .intro h1 { font-size: clamp(2.65rem, 10.1vw, 4.2rem); }
  .intro p { margin-top: 11px; font-size: .98rem; }
  .wide-only, .headline-break { display: none; }
  .hero { justify-self: center; width: min(100%, 300px); height: 190px; margin: 9px 0 0; }
  .upload-grid { grid-template-columns: minmax(0, 1fr); }
  .file-column, .settings { padding: 13px; }
  .settings { border-left: 0; padding-top: 4px; }
  .panel-heading { margin-bottom: 6px; }
  .drop-zone { min-height: 70px; padding: 10px; }
  .file-empty { display: none; }
  .file-note { padding-top: 6px; }
  .duration legend { margin-bottom: 6px; }
  .consent { margin: 8px 0 9px; }
  .upload-grid > .status { margin: 0 13px 10px; }
  .contact-sheet { grid-template-columns: repeat(auto-fill, minmax(77px, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .copy-row { display: grid; gap: 6px; }
}
@media (max-width: 365px) {
  .shell { width: calc(100% - 26px); }
  .masthead { gap: 8px; }
  .viewer-actions { grid-template-columns: 1fr; gap: 1px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; } }

.credit strong { color: #b6c6ff; }
.upload-panel { box-shadow: 0 14px 32px #00000029; }
.file-format { font-size: .79rem; letter-spacing: .035em; font-weight: 670; }
