/* 1TRACTOR · Первый трактор — журнал о технике.
   Editorial grid (ui-ux-pro-max), Playfair Display + Golos Text, без внешних ресурсов. */

@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/playfair-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/playfair-latin.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: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/golos-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/golos-latin.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 {
  --paper: #f3f0e8;
  --ink: #1d1c1a;
  --muted: #5b5853;
  --accent: #a3471b;
  --rule: #d8d2c6;
  --ph: #e7e1d5;
  --ph-line: #d6cfc1;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --ink: #ece7de;
    --muted: #aaa49a;
    --accent: #e08a52;
    --rule: #34312c;
    --ph: #211f1c;
    --ph-line: #2d2a26;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.skip:focus {
  top: 0.5rem;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Шапка */
.masthead {
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-height: 44px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.brand-sub {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.masthead nav {
  display: flex;
  gap: 1.25rem;
}

.masthead nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.95rem;
}

/* Подписи в духе технического чертежа */
.kicker,
.note-no,
.section-no,
.ph span,
figcaption {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.kicker,
.note-no,
.section-no {
  color: var(--accent);
  text-transform: uppercase;
}

/* Обложка */
.hero .wrap {
  display: grid;
  gap: 2rem;
  padding-top: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(2rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  margin: 0.5rem 0 1.25rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 38rem;
  font-size: 1.1875rem;
  color: var(--muted);
}

/* Заглушки под фото: размер задан заранее, страница не прыгает, когда появятся картинки */
figure {
  margin: 0;
}

.ph {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background-color: var(--ph);
  background-image: repeating-linear-gradient(-45deg, var(--ph-line) 0 1px, transparent 1px 12px);
  border: 1px solid var(--rule);
}

.ph span {
  padding: 0.25rem 0.5rem;
  background: var(--paper);
  color: var(--muted);
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
}

/* Разделы и заметки */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 2rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
}

.notes .wrap,
.about .wrap {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

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

.note {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}

.note h3 {
  margin: 0.25rem 0 1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.2;
  text-wrap: balance;
}

.note figure {
  margin-bottom: 1.25rem;
}

.note p,
.about p {
  margin: 0 0 1rem;
  max-width: 68ch;
}

.about {
  border-top: 1px solid var(--rule);
}

.dropcap::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 3.6em;
  line-height: 0.8;
  color: var(--accent);
}

/* Подвал */
.footer {
  border-top: 1px solid var(--rule);
}

.footer p {
  margin: 0;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 7fr 5fr;
    align-items: end;
    gap: 3rem;
  }

  .notes-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}
