@import url("fonts.css");

/* петербургфото.рф — чёрное на белом, крупный гротеск капсом */
:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #707070;
  --line: #e4e4e4;
  --soft: #f4f4f4;
  --pad: clamp(16px, 2.2vw, 32px);
  --header: 52px;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gap: clamp(8px, 1.2vw, 16px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 450 15px/1.5 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 100; text-decoration: none; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { padding: 0 var(--pad); }

/* мелкие подписи капсом */
.mono, .label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.muted { color: var(--muted); }

/* шапка */
.site-header { position: sticky; top: 0; z-index: 40; background: #fff; transition: background .25s; }
.site-header.over { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.site-header .wrap { height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; gap: clamp(14px, 2vw, 32px); align-items: center; }
.nav a { text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 8px 0; border-bottom: 1px solid transparent; }
.nav a.strong { font-weight: 800; }
.nav a.soft { font-weight: 450; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }
.menu-btn { display: none; background: none; border: 0; padding: 0; cursor: pointer; min-height: 44px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.menu-btn .close { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--header) 0 0 0; background: #fff;
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px var(--pad) 32px;
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  }
  .nav a { font-size: clamp(24px, 7vw, 34px); letter-spacing: -.05em; line-height: .95; padding: 6px 0; border: 0; }
  .nav a.soft { font-weight: 500; }
  .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
  body.menu-open .nav { opacity: 1; visibility: visible; }
  body.menu-open { overflow: hidden; }
  body.menu-open .site-header.over { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.menu-open .menu-btn .open { display: none; }
  body.menu-open .menu-btn .close { display: inline; }
}

/* кнопки и ссылки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; transition: background .2s, color .2s;
}
.btn:hover { background: #fff; color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .35; cursor: default; }
.btn[disabled]:hover { background: #fff; color: var(--ink); }
.arrow { text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; gap: 8px; }
.arrow::after { content: "→"; transition: transform .25s var(--ease); }
.arrow:hover::after { transform: translateX(4px); }
.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* типографика */
h1, h2, h3 { margin: 0; font-weight: 800; text-transform: uppercase; }
h1 { font-size: clamp(28px, 4.2vw, 73px); line-height: .85; letter-spacing: -.055em; margin-left: -.04em; }
h2 { font-size: clamp(20px, 2.24vw, 36px); line-height: .9; letter-spacing: -.055em; margin-left: -.03em; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.lead { font-size: clamp(15px, 1.1vw, 17px); line-height: 1.45; max-width: 34em; font-weight: 450; }

/* главная: один экран */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home { height: calc(100svh - var(--header)); min-height: 560px; display: flex; align-items: center; }
.stage { width: 100%; height: 85%; min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--gap); padding: 0 var(--pad); align-items: stretch; }
.hero-photo { margin: 0; height: 100%; min-height: 0; aspect-ratio: 2000 / 2479; justify-self: center; }
.manifest { align-self: start; justify-self: end; max-width: 300px; text-align: right; font-size: 13px; line-height: 1.5; }
.manifest p { margin: 0 0 .8em; }
.manifest p:last-child { margin: 0; }
.hero-photo img { width: 100%; height: 100%; object-fit: contain; }
.side { align-self: end; justify-self: start; display: grid; gap: clamp(24px, 4vh, 48px); text-align: left; }
.doors { display: grid; gap: clamp(16px, 2.4vh, 32px); }
.lead-form { display: grid; gap: 10px; width: min(300px, 100%); }
.lead-form input {
  width: 100%; height: 38px; padding: 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; font: inherit; font-size: 15px; color: var(--ink);
}
.lead-form input::placeholder { color: var(--muted); }
.lead-form input:focus { outline: none; border-bottom-width: 2px; }
.lead-form input[aria-invalid="true"] { border-bottom-color: #c00; }
.lead-form .btn { margin-top: 8px; justify-self: start; }
.lead-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lead-st { margin: 0; font-size: 13px; color: var(--muted); }
.lead-st:empty { display: none; }
.lead-st.ok { color: var(--ink); }
.lead-st.bad { color: #c00; }
.call { margin: 2px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.call .icons { display: inline-flex; gap: 0; margin-left: 4px; }
.call .icons a { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; color: var(--ink); transition: opacity .2s; }
.call .icons a:hover { opacity: .55; text-decoration: none; }
.call svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.call a { color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.call a:hover { text-decoration: underline; text-underline-offset: 3px; }
.door { text-decoration: none; display: block; }
.door b { display: block; font-size: clamp(25px, 3.08vw, 56px); line-height: .82; font-weight: 800; letter-spacing: -.055em; text-transform: uppercase; margin-left: -.04em; }
.door span { display: flex; gap: 8px; margin-top: 10px; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.door span::after { content: "→"; transition: transform .25s var(--ease); }
.door:hover span::after { transform: translateX(5px); }
.door:hover b { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .08em; }

[data-enter] { animation: enter 1s var(--ease) both; }
[data-enter="2"] { animation-delay: .1s; }
[data-enter="3"] { animation-delay: .2s; }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .home { height: auto; min-height: 0; padding-top: 0; }
  .stage { grid-template-columns: 1fr; align-items: start; row-gap: 0; }
  .stage { height: auto; }
  .manifest { justify-self: stretch; max-width: 34em; text-align: left; margin-bottom: 28px; font-size: 14px; }
  .hero-photo { order: -1; height: auto; align-self: start; width: 100%; max-width: 640px; margin-bottom: 16px; }
  .side { justify-self: stretch; align-self: start; gap: 32px; }
  .doors { gap: 0; }
  .lead-form { width: 100%; padding-bottom: var(--pad); }
  .door { border-top: 1px solid var(--ink); padding: 14px 0 16px; }
  .door b { font-size: clamp(28px, 8.4vw, 50px); }
  .door span { justify-content: space-between; }
}

/* разделы */
.section { padding: clamp(36px, 5vw, 72px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(16px, 2vw, 28px); flex-wrap: wrap; }

.page-head { padding: clamp(16px, 2.4vw, 32px) 0 clamp(24px, 3.5vw, 48px); }
.page-head .label { display: block; margin-bottom: clamp(8px, 1vw, 14px); }
.page-head .intro { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap) clamp(24px, 4vw, 64px); margin-top: clamp(18px, 2.4vw, 32px); align-items: start; }
.page-head .intro .cta { margin-top: 24px; }
@media (max-width: 900px) { .page-head .intro { grid-template-columns: 1fr; } }

/* ровная сетка снимков: одинаковые ячейки, кадр целиком */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
@media (min-width: 1500px) { .tiles { grid-template-columns: repeat(5, 1fr); } }
.tiles a, .tiles figure { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; margin: 0; background: #fff; cursor: zoom-in; overflow: hidden; }
.tiles img { width: 100%; height: 100%; object-fit: contain; transition: opacity .3s; }
.tiles a:hover img { opacity: .82; }
.tiles:empty { display: none; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* переключатели */
.filters, .subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: clamp(20px, 3vw, 32px); }
.filters button, .subnav a {
  border: 1px solid var(--line); background: #fff; padding: 0 14px; min-height: 36px; cursor: pointer;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center; transition: border-color .2s, background .2s, color .2s;
}
.filters button:hover, .subnav a:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* списки */
.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.list li span:last-child { color: var(--muted); text-align: right; }
.list small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.block-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 12px; margin-bottom: clamp(20px, 3vw, 32px); flex-wrap: wrap; }

/* обо мне */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap) clamp(24px, 4vw, 64px); align-items: start; }
.about-grid figure { margin: 0; }
.about-grid .who { font-size: clamp(16px, 1.3vw, 20px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; text-transform: uppercase; margin-bottom: 24px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.gear { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }
.gear h3 { margin-bottom: 10px; }
.gear .list li { display: block; }
@media (max-width: 1100px) { .gear { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gear { grid-template-columns: 1fr; } }

/* журнал */
.posts { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 2vw, 32px) var(--gap); }
.post-card { text-decoration: none; display: block; }
.post-card .cover { aspect-ratio: 4 / 5; overflow: hidden; background: #fff; margin-bottom: 12px; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.post-card:hover .cover img { opacity: .82; }
.post-card .mono { color: var(--muted); }
.post-card h3 { margin: 6px 0; font-size: 14px; }
.post-card p { color: var(--muted); font-size: 13px; margin: 0; }
@media (max-width: 1100px) { .posts { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .posts { grid-template-columns: 1fr 1fr; } }

.article { max-width: 760px; }
.article h1 { font-size: clamp(22px, 2.8vw, 42px); line-height: .92; margin: 16px 0 12px; }
.article .body { font-size: 16px; line-height: 1.6; margin-top: 28px; }
.article .body h2 { font-size: clamp(20px, 2vw, 30px); margin: 36px 0 12px; }
.article .body img { margin: 32px 0; }
.article .body ul { padding-left: 1.2em; }
.article .body li { margin: 6px 0; }
.article .cover { margin: 32px 0 0; }

/* формы */
.form { display: grid; gap: 16px; max-width: 440px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--ink); background: #fff;
  font: inherit; font-size: 16px; border-radius: 0;
}
.field textarea { padding: 12px 14px; min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.field .err { color: #b3261e; font-size: 13px; margin-top: 6px; min-height: 1.2em; }
.field .err.ok { color: var(--ink); }

/* клиентская галерея */
.g-title { font-size: clamp(24px, 3.08vw, 50px); }
.g-bar { position: sticky; top: var(--header); z-index: 30; background: #fff; border-bottom: 1px solid var(--ink); }
.g-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.g-bar .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.g-grid figure { position: relative; cursor: zoom-in; }
.g-check {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; padding: 0;
  background: transparent; display: none; align-items: center; justify-content: center; cursor: pointer;
}
.g-check::before { content: ""; width: 20px; height: 20px; border: 1.5px solid var(--ink); background: #fff; }
.g-check[aria-pressed="true"]::before { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 6.5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/100% no-repeat; }
.selecting .g-check { display: flex; }
.selecting .g-grid figure { cursor: pointer; }
.g-grid figure.picked img { opacity: .5; }
.g-status { padding: 64px var(--pad); color: var(--muted); }
.progress { height: 2px; background: var(--line); position: relative; overflow: hidden; display: none; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width .2s; }
.progress.on { display: block; }

/* просмотр */
.lb { position: fixed; inset: 0; z-index: 90; background: #fff; display: none; }
.lb.open { display: grid; grid-template-rows: auto 1fr; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 4px var(--pad); gap: 12px; }
.lb-top .tools { display: flex; gap: 4px; }
.lb-top button, .lb-top a { background: none; border: 0; min-width: 44px; min-height: 44px; padding: 0 10px; cursor: pointer; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.lb-top button:hover, .lb-top a:hover { text-decoration: underline; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 0 var(--pad) var(--pad); min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 0; bottom: 0; width: 30%; background: none; border: 0; cursor: pointer; }
.lb-nav.prev { left: 0; cursor: w-resize; }
.lb-nav.next { right: 0; cursor: e-resize; }

/* подвал: одна строка */
.site-footer { border-top: 1px solid var(--ink); margin-top: clamp(36px, 5vw, 72px); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* компактнее */
.about-grid { grid-template-columns: minmax(0, 624px) 1fr; }
.about-grid figure img { max-height: 92vh; width: auto; max-width: 100%; }
.free { margin-top: clamp(28px, 4vw, 44px); padding-top: clamp(20px, 2.4vw, 28px); border-top: 1px solid var(--ink); }
.free h2 { margin-bottom: 14px; }
.article .cover img { max-height: 72vh; width: auto; max-width: 100%; }
.article .body img { max-height: 80vh; width: auto; max-width: 100%; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .page-head .intro { row-gap: 32px; }
}

/* выравнивание по ширине: текст слева от фото на главной и текст «Обо мне» */
.manifest p, .about-grid .lead p { text-align: justify; text-align-last: left; }
.about-grid .lead p { -webkit-hyphens: auto; hyphens: auto; }
