:root {
  --ink: #10100f;
  --paper: #f5f1e9;
  --brass: #c9a57d;
  --gutter: clamp(20px, 4vw, 48px);
  --content-width: min(1044px, calc(100% - 2 * var(--gutter)));
  --content-edge: max(var(--gutter), calc((100% - 1044px) / 2));
  color-scheme: dark;
  font-family: Onest, system-ui, sans-serif;
  background: var(--ink);
  color: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 5px; }
main, .page, .site-header, .contact, .stats { width: 100%; }
.content { width: var(--content-width); }
.site-header { min-height: 84px; height: auto; padding-block: 12px; }
.site-header .content { flex: none; min-height: 59px; }
.site-nav a:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero { background: url(assets/speaker-hero.webp) center / cover no-repeat; }
.hero-title, .hero-copy, .hero-action, .gallery { left: var(--content-edge); }
.hero-title, .hero-copy { max-width: var(--content-width); }
.gallery-caption {
  right: var(--content-edge);
  left: auto;
  border: 0;
}
.gallery button {
  position: relative;
  min-width: 23px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
}
.gallery button[aria-pressed="true"] { width: 42px; }
.gallery button[aria-pressed="false"] { width: 23px; }
.gallery button::after {
  position: absolute;
  inset: 15px 0 auto;
  height: 2px;
  background: #68665f;
  content: "";
}
.gallery button[aria-pressed="true"]::after { background: var(--brass); }
.gallery-caption:hover { background: var(--ink); }
.hero-action:hover, .download-patents:hover, .contact-form button:not(:disabled):hover { background: #dec19f; }

.author-photo { display: block; object-fit: cover; }
.stats { min-height: 249px; height: auto; box-sizing: border-box; }
.dossier { width: 100%; min-height: 714px; height: auto; box-sizing: border-box; }
.dossier-figure img { display: block; object-fit: cover; }
.contact { min-height: 614px; height: auto; box-sizing: border-box; }
.contact-form { min-width: 0; }
.contact-form :is(input, textarea) {
  display: block;
  min-width: 0;
  border: 1px solid #55524d;
  outline: none;
  border-radius: 0;
}
.contact-form :is(input, textarea):focus-visible { border-color: var(--brass); }
.contact-form :is(input, textarea)::placeholder { color: #b1ada5; opacity: 1; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button { border: 0; }
.contact-form button:disabled { opacity: .65; cursor: default; }
#contact-status { color: #b1ada5; max-width: 52ch; }
#contact-status:empty { display: none; }

#photo-dialog {
  width: min(900px, calc(100% - 32px));
  padding: 0;
  color: var(--paper);
  background: #191918;
  border: 1px solid #55524d;
}
#photo-dialog::backdrop { background: #000c; }
.photo-dialog-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  gap: 16px;
}
.photo-dialog-bar button {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  font-size: 26px;
}
#large-photo { display: block; width: 100%; max-height: 78vh; object-fit: contain; }

@media (max-width: 1100px) {
  .site-header .content { gap: 20px; }
  .site-nav { gap: clamp(12px, 2vw, 22px); }
  .hero-title span { font-size: clamp(65px, 9.4vw, 104px); line-height: 1; }
  .dossier-figure { width: 48.3%; }
  .dossier-figure img { height: auto; aspect-ratio: 504 / 333; }
  .dossier { min-height: 0; }
  .contact .content > :first-child { width: 39%; }
  .contact { min-height: 0; }
}

@media (max-width: 900px) {
  .site-header .content { flex-wrap: wrap; }
  .site-nav { order: 1; width: 100%; }
  .site-nav a { padding-block: 6px; }
  .stats { min-height: 0; }
  .stats .content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .stats .content > * { width: auto; height: auto; min-width: 0; padding-left: 14px; border-left: 1px solid #393834; margin: 0; }
  .author-photo { width: min(38%, 328px); }
  .partners [data-pencil-name="Действие"] { white-space: normal; }
  .site-footer .content { flex-wrap: wrap; gap: 12px 28px; }
}

@media (max-width: 720px) {
  .hero { min-height: 620px; height: auto; background-position: 68% top; }
  .hero::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #10100f 0%, #10100fcc 34%, #10100f00 84%);
    content: "";
  }
  .hero-title { top: auto; bottom: 262px; }
  .hero-title span {
    font-size: clamp(39px, 11vw, 75px);
    line-height: 1;
    letter-spacing: -.032em;
    white-space: normal;
  }
  .hero-copy { top: auto; bottom: 160px; }
  .hero-action { top: auto; bottom: 92px; }
  .gallery { top: auto; bottom: 28px; gap: 9px; }
  .gallery-caption { top: auto; bottom: 25px; max-width: 44%; text-align: left; }
  .gallery-caption span { white-space: normal; font-size: 13px; }
  .author, .dossiers, .partners, .contact { padding-block: 42px; }
  .author .content, .contact .content, .dossier-layout,
  .partners [data-pencil-name="Этапы оценки технологии"] { flex-direction: column; gap: 24px; }
  .author-photo { width: min(100%, 328px); height: auto; aspect-ratio: 328 / 354; }
  .dossier-figure, .contact .content > :first-child, .contact-form { width: 100%; }
  .partners [data-pencil-name="Этапы оценки технологии"] > * { width: 100%; height: auto; }
  .dossier-meta { flex-wrap: wrap; gap: 8px 20px; }
  main h2 { font-size: clamp(36px, 9.5vw, 56px); line-height: 1.05; white-space: normal; }
  .dossier h3 { font-size: clamp(32px, 8vw, 48px); line-height: 1.05; }
  .download-patents div, .site-footer .content > * { white-space: normal; }
}

@media (max-width: 500px) {
  .site-header .content { align-items: flex-start; flex-direction: column; gap: 12px; }
  .site-header [data-pencil-name="Геометрия звука"] { font-size: 15px; }
  .site-nav { order: 0; justify-content: space-between; gap: 10px; }
  .site-nav a { font-size: 16px; }
  .contact-form [data-pencil-name="Имя и телефон"] { flex-direction: column; }
  .contact-form [data-pencil-name="Имя и телефон"] > * { width: 100%; }
}
