/* ------------------------------------------------------------------
   Бумага, плёнка и отпечатки. Палитра и раскладка — из исходника,
   шрифты заменены на те, в которых есть кириллица.
   ------------------------------------------------------------------ */
@font-face { font-family: "Literata"; src: url("/static/fonts/literata.woff") format("woff"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/static/fonts/literata-italic.woff") format("woff"); font-weight: 400 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/plexmono.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/plexmono-medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded.woff") format("woff"); font-weight: 500 800; font-display: swap; }

:root {
  --paper: #efe8d8;
  --paper-2: #e6dec9;
  --ink: #2a251d;
  --mute: #7a7161;
  --line: #cfc6b0;
  --print: #fbf8ef;
  --film: #1d1a16;
  --film-2: #26221c;
  --edge: #d6a24a;      /* надписи на краю плёнки */
  --frame: #d9cfb8;
  --serif: "Literata", Georgia, serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --wide: "Unbounded", var(--serif);
  --fh: 168px;          /* высота кадра на плёнке */
  --max: 1400px;
  --pad: clamp(1rem, 4vw, 3.5rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 19px/1.6 var(--serif);
  font-feature-settings: "kern", "onum";
  -webkit-font-smoothing: antialiased;
  /* лёгкое зерно бумаги */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .15  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.cap { font: 400 12px/1.5 var(--mono); letter-spacing: .02em; color: var(--mute); font-feature-settings: "tnum"; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- шапка ---------- */
.top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; flex-wrap: wrap;
  max-width: var(--max); margin: auto; padding: 2rem var(--pad) 1.25rem;
}
.logo { font: 700 clamp(1.15rem, 2.4vw, 1.7rem)/1 var(--wide); letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.nav > a, .has-menu > a {
  display: inline-block; font: 500 13px var(--mono); border: 1px solid var(--ink); border-radius: 99px;
  padding: .38rem .95rem; transition: background .15s, color .15s;
}
.nav > a:hover, .has-menu > a:hover, .nav a[aria-current] { background: var(--ink); color: var(--paper); }
.has-menu { position: relative; }
.menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 15rem;
  background: var(--print); border: 1px solid var(--line); box-shadow: 0 14px 30px -16px rgb(42 37 29 / .45);
  padding: .4rem 0; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.has-menu::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } /* мостик для мыши */
.has-menu:hover .menu, .has-menu:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: .35rem 1rem; font-size: 1rem; line-height: 1.35; }
.menu a:hover, .menu a:focus-visible { background: var(--paper-2); outline: none; }

.main { max-width: var(--max); margin: auto; padding: 1rem var(--pad) 0; }
.lead { max-width: 34em; color: var(--mute); margin: 0 0 2.6rem; font-size: 1.05rem; }
.empty { color: var(--mute); padding: 10vh 0; max-width: 34rem; }
.empty h1 { color: var(--ink); font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .8rem; }
.empty a { text-decoration: underline; text-underline-offset: .2em; }
.page-title { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; margin: .5rem 0 2rem; }

/* ---------- контактный лист: плёнки на столе ---------- */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.6rem; }
.roll { min-width: 0; }

/* одна поездка — несколько городов: плёнки собраны вместе, слева тонкая линия-связка */
.group-films { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; padding-left: 1.6rem; margin-top: .2rem; }
.group-films::before { content: ""; position: absolute; left: 4px; top: .7rem; bottom: 1.5rem; border-left: 1px solid var(--ink); opacity: .35; }
.city { position: relative; min-width: 0; }
.city::before { content: ""; position: absolute; left: calc(-1.6rem + 1px); top: .55rem; width: 7px; height: 7px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }
.city-head { display: flex; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; margin: 0 0 .55rem; }
.city-head h3 { font: italic 400 1.25rem/1.2 var(--serif); letter-spacing: 0; }
.city-head h3 a:hover { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.city-head .cap { margin: 0; }

/* плитки городов на странице поездки */
.city-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.6rem 1.4rem; max-width: 64rem; margin: .4rem 0 3rem; }
.tile { display: block; }
.tile-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--frame); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.3,1), opacity .2s; }
.tile:not([aria-current]) .tile-img img { opacity: .78; }
.tile:hover .tile-img img, .tile:focus-visible .tile-img img { opacity: 1; transform: scale(1.04); }
.tile-name { display: block; margin: .6rem 0 .05rem; font: italic 400 1.2rem/1.2 var(--serif); }
.tile .cap { display: block; }
.tile[aria-current] .tile-img { outline: 2px solid var(--ink); outline-offset: 4px; }
.tile[aria-current] .tile-name { font-style: normal; font-weight: 500; }
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile-name { text-decoration: underline; }
.city-title { font: italic 400 clamp(1.6rem, 3.5vw, 2.3rem)/1.1 var(--serif); margin: 0; }
.t-head .g-cap { margin: 1rem 0 1.6rem; }
.t-head .city-title + .cap { margin-top: .5rem; }
.menu small { display: block; font: 400 12px/1.3 var(--mono); color: var(--mute); }
.roll-head { display: flex; align-items: baseline; gap: .4rem 1.2rem; flex-wrap: wrap; margin: 0 0 .7rem 2px; }
.roll-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.1; }
.roll-head h2 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s; }
.roll-head h2 a:hover { background-size: 100% 1px; }
.roll-head .cap { margin: 0; }

.film-wrap { position: relative; }
.film {
  position: relative; overflow-x: auto; overflow-y: hidden;
  background: var(--film); border-radius: 3px;
  box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 18px 28px -22px rgb(29 26 22 / .7);
  scrollbar-width: none; cursor: grab; scroll-behavior: smooth;
  overscroll-behavior-x: contain;
}
.film::-webkit-scrollbar { display: none; }
.film.dragging { cursor: grabbing; scroll-behavior: auto; }
.film.dragging .frame { pointer-events: none; }
.frames {
  display: flex; gap: 12px; list-style: none; margin: 0;
  padding: 40px 18px 42px; width: max-content; min-width: 100%;
  /* перфорация: «дырочки», сквозь которые видно бумагу */
  --holes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Crect x='6' y='1' width='12' height='10' rx='2.2' fill='%23efe8d8'/%3E%3C/svg%3E");
  background: var(--holes) 0 9px / 24px 12px repeat-x, var(--holes) 0 calc(100% - 9px) / 24px 12px repeat-x;
}
.frames li { position: relative; flex: none; }
.frame { display: block; background: #000; border-radius: 2px; overflow: hidden; }
.frame img { height: var(--fh); width: auto; max-width: none; transition: filter .2s, transform .35s; }
.frame:hover img, .frame:focus-visible img { filter: brightness(1.08); transform: scale(1.03); }
.frame:focus-visible { outline-color: var(--edge); outline-offset: 2px; }
.n { position: absolute; bottom: -24px; left: 2px; font: 500 10px var(--mono); color: var(--edge); letter-spacing: .06em; opacity: .9; }
.n-a { left: auto; right: 2px; opacity: .55; }
.edge {
  position: sticky; left: 18px; display: block; width: max-content; height: 0; transform: translateY(24px);
  font: 500 10px var(--mono); letter-spacing: .32em; color: var(--edge); opacity: .85; white-space: pre;
}
.film-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(239 232 216 / .92); color: var(--ink); font: 1.6rem/1 var(--serif);
  box-shadow: 0 4px 14px rgb(0 0 0 / .35); opacity: 0; transition: opacity .2s;
}
.film-btn.prev { left: -14px; } .film-btn.next { right: -14px; }
.film-wrap:hover .film-btn, .film-btn:focus-visible { opacity: 1; }
.film-btn:hover { background: var(--print); }

/* ---------- фото без рамок ---------- */
.print { display: block; overflow: hidden; }
.print img { width: 100%; background: var(--frame); transition: transform .5s cubic-bezier(.2,.7,.3,1), opacity .2s; }

.index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 3.2rem 3.5rem; }
.card { display: block; }
.card .print img { aspect-ratio: 3 / 2; object-fit: cover; }
.card h2 { font-size: 1.6rem; margin: 1rem 0 .1rem; }
.card:hover .print img, .card:focus-visible .print img { transform: scale(1.03); }
.pr .print:hover img, .pr .print:focus-visible img { opacity: .92; }
.card:focus-visible { outline: none; }
.card:focus-visible h2 { text-decoration: underline; }

/* ---------- страница поездки ---------- */
.back { display: inline-block; margin: .5rem 0 1.6rem; }
.back:hover { color: var(--ink); }
.t-head h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: .95; letter-spacing: -0.035em; }
.t-head .cap { margin: 1rem 0 2rem; font-size: 13px; }
.story { max-width: 36em; margin: 0 0 2.5rem; font-size: 1.1rem; }
.story p { margin: 0 0 1em; }
.story p:first-child::first-letter { font-size: 3.1em; float: left; line-height: .85; margin: .08em .1em 0 0; font-weight: 500; }
.notes {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.6rem 2.4rem;
  border-top: 1px solid var(--line); padding-top: 1.4rem; margin-bottom: 4.5rem; max-width: 62rem;
}
.notes h3 { margin: 0 0 .3rem; letter-spacing: .04em; }
.notes p { margin: 0; font-size: 1.02rem; line-height: 1.5; }

.prints { display: flex; gap: 4.5rem; align-items: flex-start; }
.prints .col { flex: 1; min-width: 0; }
.prints .col + .col { padding-top: 6rem; }   /* правая колонка начинается ниже — как разложенные на столе фото */
figure.pr { margin: 0 0 3.6rem; }
figure.pr .print { width: var(--w, 100%); margin-left: var(--m, 0); cursor: zoom-in; }
figure.pr figcaption { margin: .75rem 0 0 var(--m, 0%); max-width: 32em; }
figure.pr figcaption b { display: block; font: italic 400 1rem/1.4 var(--serif); margin-bottom: .15rem; }
figure.pr:target .print { outline: 2px solid var(--edge); outline-offset: 4px; }

.t-nav { display: flex; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.4rem; }
.t-nav a { font-size: 1.35rem; line-height: 1.2; }
.t-nav a .cap { display: block; margin-bottom: .2rem; }
.t-nav a:hover { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.t-nav .newer { text-align: right; }

/* ---------- обо мне ---------- */
.about { max-width: 34rem; padding-bottom: 2rem; }
.about h1 { font-size: 2.4rem; margin: .5rem 0 1.2rem; }
.about p { margin: 0 0 1rem; }
.about-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.about-links a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* ---------- подвал ---------- */
.foot { max-width: var(--max); margin: 7rem auto 0; padding: 2rem var(--pad) 2.4rem; border-top: 1px solid var(--line); }
.f1 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4vw; }
.foot h3 { margin: 0 0 .8rem; font-weight: 500; }
.entry { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.entry:hover span:first-child { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.f1 p { margin: .15rem 0; }
.f1 a:hover { text-decoration: underline; }
.f-note { color: var(--mute); font-size: .95rem; margin-top: 1rem !important; }
.cp { margin: 2.4rem 0 0; }

/* ---------- просмотр ---------- */
.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgb(26 22 16 / .97); color: #efe8d8;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.lb:not([open]) { display: none; }
.lb::backdrop { background: rgb(26 22 16 / .97); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 3.5rem 5rem 0; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 8.5rem); max-height: calc(100dvh - 8.5rem); width: auto; height: auto; box-shadow: 0 10px 40px rgb(0 0 0 / .5); cursor: pointer; user-select: none; }
.lb-cap { padding: 1rem 1.5rem 1.4rem; text-align: center; min-height: 4.5rem; }
.lb-cap b { display: block; font: italic 400 1.05rem/1.4 var(--serif); margin-bottom: .2rem; }
.lb-cap .cap { color: #c9bfa6; white-space: pre-wrap; }
.lb button { position: absolute; background: none; border: 0; color: #efe8d8; cursor: pointer; padding: 1rem; font: 2.4rem/1 var(--serif); opacity: .75; }
.lb button:hover { opacity: 1; }
.lb-x { top: .4rem; right: .8rem; }
.lb-p, .lb-n { top: 45%; transform: translateY(-50%); }
.lb-p { left: .5rem; } .lb-n { right: .5rem; }
.lb :focus-visible { outline-color: var(--edge); }

/* ---------- адаптив ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  :root { --fh: 118px; }
  .top { padding-top: 1.25rem; }
  .nav > a, .has-menu > a { font-size: 12px; padding: .32rem .75rem; }
  .menu { display: none; }
  .sheet { gap: 2rem; }
  .frames { padding: 34px 14px 36px; gap: 9px; }
  .film-btn { display: none; }
  .prints { flex-direction: column; gap: 0; }
  .prints .col { display: contents; }
  figure.pr { order: var(--o); }
  figure.pr .print { width: 100%; margin-left: 0; }
  figure.pr figcaption { margin-left: 0; }
  .f1 { grid-template-columns: 1fr; gap: 2.4rem; }
  .entry { flex-direction: column; gap: 0; }
  .lb-stage { padding: 3rem 0 0; }
  .lb-p, .lb-n { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 760px) {
  .group-films { padding-left: 1.1rem; gap: 1.1rem; }
  .city-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem .9rem; margin-bottom: 2.2rem; }
  .tile-name { font-size: 1.05rem; }
  .city::before { left: calc(-1.1rem + 1px); }
}
