:root {
  color-scheme: light;
  --paper: #f5f3ee;
  --ink: #181b25;
  --muted: #535865;
  --blue: #293fc5;
  --rule: #d7d7d5;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  font-family: var(--sans);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, p, figure, dl, dd { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }

.shell {
  width: min(calc(100% - 7rem), 79rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  padding: .6rem 1rem;
  background: var(--paper);
}

.skip-link:focus { transform: none; }
.accent { color: var(--blue); }
.site-header { border-bottom: 1px solid var(--rule); }

.header-inner, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
}

.mark {
  width: 1.65rem;
  height: 1.65rem;
  background: var(--blue);
  border-radius: .2rem;
  position: relative;
}

.mark::before, .mark::after {
  content: "";
  position: absolute;
  top: .37rem;
  width: .16rem;
  height: .88rem;
  background: white;
  transform: skewX(-24deg);
}

.mark::before { left: .53rem; }
.mark::after { left: .86rem; }

nav { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
nav a, .site-footer a { text-underline-offset: .3em; text-decoration: none; }
nav a:hover, .site-footer a:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4.25rem);
  align-items: center;
  padding-block: clamp(2.75rem, 6vw, 5.25rem) 3.75rem;
}

.hero-copy { padding-bottom: 1.75rem; }

.eyebrow, .note-topic {
  color: var(--blue);
  font: 700 .82rem/1.45 var(--mono);
  text-transform: uppercase;
  letter-spacing: .075em;
}

.eyebrow { display: flex; align-items: center; gap: .6rem; }
.eyebrow span { width: .5rem; height: .5rem; background: currentColor; }

h1 {
  margin-block: .85rem 1.25rem;
  font-size: clamp(3.25rem, 7.1vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.088em;
  font-weight: 800;
}

.hero-description {
  max-width: 29rem;
  font-size: clamp(1.05rem, 1.6vw, 1.23rem);
  color: var(--muted);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  margin-top: 1.8rem;
  padding: .6rem 1.25rem;
  color: white;
  background: var(--blue);
  border-radius: .2rem;
  font-weight: 650;
  text-decoration: none;
}

.primary-link:hover { background: #1e2e9d; }

.hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.43;
  object-fit: cover;
  background: #081428;
  border-radius: .35rem;
}

.hero-figure figcaption {
  display: flex;
  gap: .55rem;
  margin-top: .7rem;
  font: .8rem/1.5 var(--mono);
  color: var(--muted);
}

.hero-figure figcaption span { color: var(--blue); }

.notes, .tools { scroll-margin-top: 1rem; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.12;
  letter-spacing: -.06em;
  font-weight: 750;
}

.section-heading p { color: var(--muted); }

.notes-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.note {
  background: #fcfbf8;
  border: 1px solid var(--rule);
  border-radius: .3rem;
}

.note:hover, .note[open] { border-color: #9da6db; }

.note summary {
  display: flex;
  flex-direction: column;
  min-height: 15.5rem;
  gap: .62rem;
  padding: 1.35rem;
  list-style: none;
  cursor: pointer;
}

.note summary::-webkit-details-marker { display: none; }
.note summary:focus-visible { outline-offset: -4px; }

.note-title {
  max-width: 16ch;
  font-size: clamp(1.45rem, 2.25vw, 1.9rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.045em;
}

.note-description { color: var(--muted); }

.read-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: .55rem;
  color: var(--blue);
  font-size: .94rem;
  font-weight: 650;
}

.read-more::before { content: "Читать заметку"; }
.note[open] .read-more::before { content: "Свернуть заметку"; }

.toggle {
  display: inline-grid;
  width: 1.72rem;
  height: 1.72rem;
  place-items: center;
  border: 1px solid #b9c1ec;
  border-radius: .18rem;
}

.toggle::before { content: "+"; font-size: 1.1rem; line-height: 1; }
.note[open] .toggle::before { content: "−"; }

.note-body {
  margin-inline: 1.35rem;
  padding-block: 1rem 1.35rem;
  border-top: 1px solid var(--rule);
}

.note-body ol { padding-inline-start: 1.3rem; margin: 0 0 1rem; }
.note-body li + li { margin-top: .6rem; }
.note-body code { font-size: .9em; color: var(--blue); }

.tools {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 2rem 3rem;
  margin-block: clamp(3rem, 7vw, 5.5rem) 3rem;
  padding: clamp(1.5rem, 4.5vw, 3.35rem);
  border-radius: .4rem;
  background: #171e32;
  color: #f7f7ff;
}

.tools-intro p { margin-top: .9rem; max-width: 23rem; color: #ccd1e4; }
.tools-intro code { color: #ccd4ff; }
.commands { min-width: 0; border-top: 1px solid #414b67; }
.commands div { padding: .65rem 0; border-bottom: 1px solid #414b67; }
.commands code { font-size: .9rem; color: #bac8ff; }
.commands dd { margin-top: .15rem; font-size: .92rem; color: #ccd1e4; }

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .95rem;
}

.site-footer span { font-weight: 700; }

@media (max-width: 58rem) {
  .shell { width: calc(100% - 3.5rem); }
  .hero { gap: 1.5rem; }
  h1 { font-size: clamp(3.1rem, 7.5vw, 5rem); }
  .note summary { min-height: 17.25rem; padding: 1rem; }
  .note-body { margin-inline: 1rem; }
}

@media (max-width: 44rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: 4rem; }
  nav { gap: .5rem 1rem; font-size: .92rem; }
  .wordmark { gap: .45rem; font-size: .9rem; }
  .mark { flex: none; }
  .hero { grid-template-columns: 1fr; padding-block: 2.6rem 2.5rem; }
  .hero-copy { padding: 0; }
  h1 { font-size: clamp(3rem, 11.9vw, 5.3rem); }
  .hero-figure img { aspect-ratio: 1.6; }
  .notes-grid, .tools { grid-template-columns: 1fr; }
  .note summary { min-height: auto; }
  .note-title { max-width: none; }
  .section-heading { align-items: start; flex-direction: column; gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
