/* dmitrygorsky.ru — v4.0 editorial */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("https://fonts.bunny.net/manrope/files/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.bunny.net/instrument-serif/files/instrument-serif-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.bunny.net/instrument-serif/files/instrument-serif-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* холодный камень — не «беж из Figma» */
  --canvas: #E2DBD2;
  --canvas-2: #D0C8BC;
  --canvas-3: #B8AFA3;
  --surface: #EDE8E0;
  --ink: #111010;
  --ink-muted: #4A4642;
  --ink-faint: #7A746C;
  /* один акцент — тёмная умбра + бронза для деталей */
  --accent: #2C241E;
  --accent-warm: #8B6F4E;
  /* тёмный разворот (Monocle / Aesop) */
  --night: #181614;
  --night-ink: #E8E2D8;
  --night-muted: #A8A096;
  --night-accent: #C9B08A;
  --rule: rgba(17, 16, 16, 0.16);
  --rule-night: rgba(232, 226, 216, 0.14);
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --rail: min(72rem, calc(100% - 3rem));
  --rail-narrow: min(40rem, calc(100% - 3rem));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-warm); }

.rail {
  width: var(--rail);
  margin-inline: auto;
}

.rail--narrow { width: var(--rail-narrow); }

/* ——— Masthead ——— */

.mast {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: color-mix(in srgb, var(--night) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-night);
  transition: background 0.6s var(--ease);
}

.mast.is-scrolled {
  background: color-mix(in srgb, var(--night) 96%, transparent);
}

.mast__inner {
  width: var(--rail);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem 0;
}

.mast__mark {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--night-ink);
}

.mast__nav {
  display: none;
  gap: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mast__nav a {
  text-decoration: none;
  color: var(--night-muted);
  transition: color 0.4s var(--ease);
}

.mast__nav a:hover,
.mast__nav a[aria-current="page"] { color: var(--night-accent); }

.mast__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.mast__toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--night-ink);
  transition: transform 0.5s var(--ease), opacity 0.4s;
}

.mast__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mast__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mast__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mast__drawer {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--rule-night);
  background: var(--night);
}

.mast__drawer.is-open { display: flex; }

.mast__drawer a {
  padding: 0.85rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--night-muted);
  border-top: 1px solid var(--rule-night);
}

.mast__drawer a:hover { color: var(--night-accent); }

@media (min-width: 900px) {
  .mast__nav { display: flex; }
  .mast__toggle { display: none; }
}

/* ——— Type ——— */

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.display {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.display--sm {
  font-size: clamp(2rem, 4vw, 3rem);
}

.lede {
  margin: 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 36em;
}

.body-copy {
  margin: 0;
  color: var(--ink-muted);
  max-width: 38em;
}

.body-copy + .body-copy { margin-top: 1.25rem; }

.meta {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.roles {
  margin: 1.5rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}

.pullquote {
  margin: 0;
  padding: 0;
  border: none;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--ink);
}

/* ——— Folds (editorial spreads) ——— */

main { padding-top: 4.5rem; }

.fold {
  padding: clamp(4rem, 10vh, 7rem) 0;
  border-bottom: 1px solid var(--rule);
}

.fold--alt { background: var(--canvas-2); }

.fold--surface { background: var(--surface); }

.fold--night {
  background: var(--night);
  border-bottom-color: var(--rule-night);
  color: var(--night-ink);
}

.fold--night .eyebrow { color: var(--night-accent); }
.fold--night .display,
.fold--night .pullquote { color: var(--night-ink); }
.fold--night .lede,
.fold--night .body-copy,
.fold--night .feature-meta dd,
.fold--night .prose p,
.fold--night .prose li { color: var(--night-muted); }
.fold--night .feature-meta dt,
.fold--night .meta { color: color-mix(in srgb, var(--night-muted) 70%, transparent); }
.fold--night .text-link {
  color: var(--night-accent);
  border-bottom-color: color-mix(in srgb, var(--night-accent) 45%, transparent);
}
.fold--night .text-link:hover { border-bottom-color: var(--night-accent); }
.fold--night .feature-card {
  background: color-mix(in srgb, var(--night) 88%, #fff 12%);
  border-color: var(--rule-night);
}
.fold--night .feature-card img { border-color: var(--rule-night); }
.fold--night .prose h2 { color: var(--night-ink); }
.fold--night .prose ul { color: var(--night-muted); }

.fold--story {
  background: linear-gradient(165deg, var(--surface) 0%, var(--canvas) 55%);
}

.fold__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .fold__grid--hero {
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 5rem);
    align-items: end;
    padding-bottom: 3rem;
  }

  .fold__grid--split {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .fold__grid--feature {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: start;
  }
}

/* ——— Hero ——— */

.hero__visual {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 78vh;
  overflow: hidden;
  background: var(--canvas-3);
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

.hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.hero__composition {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background:
    linear-gradient(155deg, var(--night) 0%, #2A2622 55%, var(--canvas-3) 100%);
}

.hero__composition::before {
  content: "";
  position: absolute;
  top: 14%;
  right: 12%;
  width: 38%;
  height: 50%;
  border: 1px solid color-mix(in srgb, var(--night-accent) 55%, transparent);
}

.hero__composition span {
  position: relative;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--night-accent);
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-faint);
  transition: color 0.5s var(--ease), gap 0.5s var(--ease);
}

.scroll-hint:hover { color: var(--accent-warm); gap: 0.75rem; }

.scroll-hint::after {
  content: "↓";
  font-size: 0.875rem;
}

/* ——— Research topics ——— */

.topics {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.topics li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.topics .ordinal {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent-warm);
}

.topics h3 {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topics p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ——— InnerData feature ——— */

.feature-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.5rem;
}

.feature-card img {
  width: 100%;
  border: 1px solid var(--rule);
}

.feature-meta {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.feature-meta dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.feature-meta dd {
  margin: 0.35rem 0 1rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.feature-meta dd:last-child { margin-bottom: 0; }

.text-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-warm);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-warm) 45%, transparent);
  padding-bottom: 0.15rem;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ——— Article index ——— */

.article-list {
  margin: 2rem 0 0;
  border-top: 1px solid var(--rule);
}

.article-list a {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.4s var(--ease);
}

.article-list a:hover h3 { color: var(--accent-warm); }

.article-list h3 {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.3;
  transition: color 0.4s var(--ease);
}

/* ——— Status note ——— */

.status {
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border-left: 2px solid var(--accent-warm);
}

.status p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* ——— Contacts ——— */

.contact-list {
  margin: 2rem 0 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

@media (min-width: 640px) {
  .contact-list { grid-template-columns: 1fr 1fr; }
}

.contact-list a {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-size: 1.125rem;
  font-weight: 500;
  transition: color 0.4s var(--ease);
}

.contact-list a:hover { color: var(--accent-warm); }

.contact-list .meta { display: block; margin-bottom: 0.35rem; }

/* ——— Page header ——— */

.page-head {
  padding: clamp(3rem, 8vh, 5rem) 0 clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--rule);
  background: var(--canvas-2);
}

.crumbs {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.crumbs a {
  text-decoration: none;
  color: var(--ink-faint);
}

.crumbs a:hover { color: var(--accent-warm); }

.crumbs li:not(:last-child)::after {
  content: "·";
  margin-left: 0.5rem;
}

/* ——— Articles page tools ——— */

.tools {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.tools input {
  width: 100%;
  max-width: 20rem;
  padding: 0.65rem 0;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  outline: none;
}

.tools input:focus { border-bottom-color: var(--accent-warm); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.filter {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.4s, border-color 0.4s;
}

.filter.is-on,
.filter:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.empty {
  padding: 3rem 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9375rem;
}

/* ——— About ——— */

.about-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 14rem 1fr;
    gap: 4rem;
    align-items: start;
  }
}

.about-photo {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--canvas-3);
  outline: 1px solid var(--rule);
  outline-offset: -1px;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
}

.prose h2:first-child { margin-top: 0; }

.prose p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.7;
}

.prose p + p { margin-top: 1.15rem; }

.prose ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--ink-muted);
}

.prose li + li { margin-top: 0.35rem; }

/* ——— Footer ——— */

.foot {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  background: var(--night);
  color: var(--night-muted);
}

.foot__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--night-muted);
}

@media (min-width: 640px) {
  .foot__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.foot__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.foot__nav a {
  text-decoration: none;
  color: var(--night-muted);
  transition: color 0.4s;
}

.foot__nav a:hover { color: var(--night-accent); }

/* ——— 404 ——— */

.err {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.err__code {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 8rem);
  font-style: italic;
  line-height: 1;
  color: var(--canvas-2);
  -webkit-text-stroke: 1px var(--rule);
}

/* ——— Reveal ——— */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
