:root {
  --accent: #e5212b;
  --accent-bright: #ff3a42;
  --ink: #080a0c;
  --paper: #f7f8f8;
  --line: rgba(255, 255, 255, .20);
  --gutter: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ink); scrollbar-gutter: stable; }
body { margin: 0; color: var(--paper); background: var(--ink); font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif; }
button, a { color: inherit; font: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 5px; }
[hidden] { display: none !important; }
html.viewer-open { overflow: hidden; }
.skip-link { position: fixed; z-index: 50; top: 12px; left: 12px; padding: 12px 16px; background: #fff; color: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.gallery-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: #0c0f11; }
.gallery-header__inner, .gallery-main, .gallery-footer__inner { width: min(1440px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.gallery-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 90px; }
.gallery-logo { flex: 0 0 auto; }
.gallery-logo img { display: block; width: 155px; height: auto; }
.back-link { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; font-size: 14px; font-weight: 800; text-transform: uppercase; }
.back-link > span { color: var(--accent-bright); font-size: 24px; transition: transform 180ms ease; }
.back-link:hover > span { transform: translateX(-4px); }
.gallery-main { min-height: calc(100svh - 220px); padding-bottom: 80px; }
.gallery-intro { padding-top: 66px; margin-bottom: 44px; }
.eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; font-size: 13px; font-weight: 850; text-transform: uppercase; }
.eyebrow::before { content: ""; flex: 0 0 32px; height: 3px; background: var(--accent-bright); }
h1, h2, p { overflow-wrap: break-word; }
h1 { margin: 0; font-size: clamp(48px, 6.3vw, 92px); line-height: 1; font-weight: 780; letter-spacing: -.025em; }
h1 > span { color: var(--accent-bright); white-space: nowrap; }
.gallery-intro__lead { max-width: 650px; margin: 24px 0 0; color: rgba(255,255,255,.74); font-size: 20px; line-height: 1.5; }
.album-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.album-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 410px; padding: 32px; overflow: hidden; border: 1px solid var(--line); background: #171b1f; }
.album-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.02) 20%, rgba(0,0,0,.88) 100%); pointer-events: none; }
.album-card__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.album-card:hover .album-card__image { transform: scale(1.035); }
.album-card__number, .album-card__content, .album-card__arrow { position: relative; z-index: 1; }
.album-card__number { position: absolute; top: 26px; left: 30px; font-size: 13px; font-weight: 850; text-shadow: 0 2px 8px #000; }
.album-card__content { padding-right: 62px; }
.album-card h2 { margin: 0; font-size: clamp(26px, 2.7vw, 38px); line-height: 1.08; font-weight: 780; text-shadow: 0 3px 12px #000; }
.album-card__count { margin: 14px 0 0; font-size: 15px; color: rgba(255,255,255,.82); }
.album-card__arrow { position: absolute; right: 30px; bottom: 32px; display: grid; place-items: center; width: 48px; height: 48px; background: var(--accent); transition: background 180ms ease; }
.album-card__arrow img { display: block; width: 24px; height: 24px; pointer-events: none; }
.album-card:hover .album-card__arrow { background: var(--accent-bright); }
.gallery-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; min-height: 180px; padding: 32px 0; color: rgba(255,255,255,.78); }
.gallery-notice p { margin: 0; }
.outline-button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); background: transparent; color: var(--paper); font-size: 14px; font-weight: 750; }
.outline-button:hover { border-color: var(--accent-bright); }
.spinner { display: block; width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.18); border-top-color: var(--accent-bright); border-radius: 50%; animation: gallery-spin 850ms linear infinite; }
@keyframes gallery-spin { to { transform: rotate(360deg); } }
.album-view { padding-top: 38px; }
.album-back { margin-bottom: 34px; color: rgba(255,255,255,.80); }
.album-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 38px; }
.album-heading h1 { max-width: 1000px; font-size: clamp(38px, 5vw, 72px); }
.album-heading__count { flex: 0 0 auto; margin: 0 0 4px; color: rgba(255,255,255,.66); font-size: 17px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.photo-link { position: relative; display: block; min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.10); aspect-ratio: 4 / 3; background: #171b1f; }
.photo-link img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease, opacity 200ms ease; }
.photo-link:hover img { transform: scale(1.04); opacity: .84; }
.photo-link::after { content: "↗"; position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 34px; height: 34px; background: rgba(7,9,10,.7); font-size: 21px; opacity: 0; transition: opacity 180ms ease; }
.photo-link:hover::after, .photo-link:focus-visible::after { opacity: 1; }
.photo-link.is-broken::before { content: "Открыть фотографию"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); font-size: 14px; }
.gallery-footer { border-top: 1px solid var(--line); background: #0c0f11; }
.gallery-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 125px; }
.gallery-footer p { margin: 0; font-size: 18px; font-weight: 850; }
.gallery-footer p span { display: block; margin-top: 8px; font-size: 13px; line-height: 1.5; font-weight: 400; color: rgba(255,255,255,.6); }
.gallery-footer a { font-size: 14px; font-weight: 800; text-transform: uppercase; }
.gallery-footer a span { color: var(--accent-bright); margin-left: 10px; }

.site-credit {
  padding: 0 18px 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}
.site-credit .site-credit__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  text-underline-offset: 3px;
  text-transform: none;
}
.site-credit .site-credit__link:hover { color: var(--accent); text-decoration: underline; }
.site-credit .site-credit__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.no-script { margin-top: 36px; line-height: 1.5; }

.photo-viewer { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: rgba(5,7,8,.98); color: var(--paper); }
.photo-viewer::backdrop { background: #050708; }
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.photo-viewer__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; padding: 16px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.photo-viewer__header p { margin: 0 0 5px; font-size: 16px; font-weight: 800; }
.photo-viewer__header span { color: rgba(255,255,255,.58); font-size: 13px; font-variant-numeric: tabular-nums; }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255,255,255,.27); background: rgba(7,9,10,.72); color: #fff; line-height: 1; appearance: none; }
.icon-button svg { display: block; width: 24px; height: 24px; pointer-events: none; }
.icon-button:hover { border-color: var(--accent-bright); background: var(--accent); }
.photo-viewer__media { position: relative; display: grid; place-items: center; min-height: 0; padding: 18px 92px; touch-action: pan-y pinch-zoom; }
.photo-viewer__image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; object-fit: contain; opacity: 1; }
.photo-viewer__image.is-loading { opacity: 0; }
.photo-viewer__previous, .photo-viewer__next { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); }
.photo-viewer__previous { left: 24px; }
.photo-viewer__next { right: 24px; }
.photo-viewer__status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 80px; text-align: center; }
.photo-viewer__status p { margin: 0; color: rgba(255,255,255,.74); font-size: 15px; }
.photo-viewer__hint { margin: 0; padding: 14px 24px 20px; color: rgba(255,255,255,.42); font-size: 12px; text-align: center; }

@media (max-width: 1000px) {
  :root { --gutter: 36px; }
  .album-card { min-height: 340px; padding: 26px; }
  .album-card__arrow { right: 24px; bottom: 26px; }
  .album-card__number { left: 26px; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .gallery-header__inner { min-height: 68px; gap: 14px; }
  .gallery-logo img { width: 132px; }
  .back-link { gap: 9px; font-size: 12px; }
  .gallery-intro { padding-top: 42px; margin-bottom: 28px; }
  .eyebrow { gap: 12px; margin-bottom: 16px; font-size: 11px; }
  .eyebrow::before { flex-basis: 26px; }
  h1 { font-size: clamp(42px, 11vw, 72px); line-height: 1.02; }
  .gallery-intro h1 > span { display: block; margin-top: 4px; }
  .gallery-intro__lead { margin-top: 19px; font-size: 16px; line-height: 1.5; }
  .gallery-main { padding-bottom: 48px; }
  .album-overview { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .album-card { min-height: 320px; padding: 24px; }
  .album-card h2 { font-size: 30px; }
  .album-card__number { top: 22px; left: 24px; }
  .album-card__arrow { right: 24px; bottom: 24px; width: 44px; height: 44px; }
  .album-card__count { margin-top: 12px; font-size: 14px; }
  .album-view { padding-top: 26px; }
  .album-back { margin-bottom: 28px; }
  .album-heading { display: block; margin-bottom: 26px; }
  .album-heading h1 { font-size: clamp(35px, 9vw, 54px); }
  .album-heading__count { margin-top: 17px; font-size: 14px; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .gallery-footer__inner { min-height: 115px; gap: 16px; }
  .gallery-footer p { font-size: 16px; }
  .gallery-footer p span { max-width: 185px; font-size: 12px; }
  .gallery-footer a { font-size: 12px; }
  .photo-viewer__header { min-height: 76px; padding: 12px 16px; }
  .photo-viewer__header p { font-size: 14px; }
  .photo-viewer__header span { font-size: 12px; }
  .photo-viewer__close { width: 44px; height: 44px; }
  .photo-viewer__media { padding: 10px 0; }
  .photo-viewer__previous, .photo-viewer__next { width: 44px; height: 48px; }
  .photo-viewer__previous { left: 8px; }
  .photo-viewer__next { right: 8px; }
  .photo-viewer__status { padding-inline: 58px; }
  .photo-viewer__hint { padding: 14px 12px max(18px,env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
