/* Tokens (palette from the rockset.ru template) */
:root {
  --ink: #0c0a09;
  --accent: #ba8a60;
  --accent-dark: #7a522f;
  --soft: #f6f2ee;
  --line: #e6ded5;
  --muted: #4a423c;
}

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 18px/30px system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
}

/* Top block: text column + illustration.
   minmax(0, 1fr) lets the column shrink below the min-content width of its
   longest word, which is what prevents horizontal overflow at 360px. */
main > section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 40px max(16px, calc((100% - 1152px) / 2)) 80px;
  background: var(--ink);
  color: #fff;
}
main > section h1 {
  margin: 0 0 16px;
  padding-left: 16px;
  border-left: 4px solid var(--accent);
  font-size: 26px;
  line-height: 32px;
  overflow-wrap: anywhere;
  hyphens: auto;
}
main > section p {
  margin: 0 0 24px;
  color: #d9cfc6;
}
main > section a {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
main > section a:hover { background: #cb884a; }
main > section a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
main > section img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Three short benefits overlapping the top block */
main > dl {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: calc(100% - 32px);
  max-width: 1152px;
  margin: -48px auto 40px;
  padding: 0;
}
main > dl > div {
  padding: 20px 24px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 24px #e3dbd2;
}
dt {
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
}
dd {
  margin: 0;
  color: var(--muted);
}

main > article {
  width: calc(100% - 32px);
  max-width: 704px;
  margin: 0 auto 64px;
}
strong { font-weight: 700; }

/* A paragraph is a div so that headings can sit inside the sentence: <p> may
   not contain h2-h6, while <div> accepts text mixed with headings. The
   headings are reset to inline text with inherited font. */
article > div { margin: 0 0 20px; }
article > div > :is(h2, h3, h4, h5, h6) {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
}

article > figure {
  margin: 32px 0;
  padding: 0;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
}
figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
  text-align: center;
}

/* Checklist: the only figure that contains a list */
article > figure:has(ul) {
  padding: 20px 24px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
}
figure:has(ul) figcaption {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}
figure ul {
  margin: 0;
  padding-left: 20px;
}
figure li { margin-bottom: 8px; }
figure li:last-child { margin-bottom: 0; }
figure li::marker { color: var(--accent-dark); }

article > table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 24px;
}
caption {
  padding-bottom: 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
  text-align: left;
}
th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
thead th { background: var(--ink); color: #fff; }
tbody th { font-weight: 600; }
tbody td:last-child { background: var(--soft); font-weight: 600; }

@media (min-width: 768px) {
  body { font-size: 20px; line-height: 34px; }
  main > section { padding-top: 64px; padding-bottom: 96px; }
  main > section h1 { font-size: 48px; line-height: 56px; }
  main > dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  main > section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main > section h1 { font-size: 40px; line-height: 48px; }
}

@media (min-width: 1280px) {
  main > section h1 { font-size: 48px; line-height: 56px; }
}

/* Narrow screens: each table row becomes a stacked block, column names come
   from generated content, so the table never needs a horizontal scrollbar. */
@media (max-width: 639px) {
  table, caption, tbody, tr, th, td { display: block; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  th, td { padding: 4px 0; border: 0; }
  tbody th { font-weight: 700; }
  tbody td:last-child { background: none; }
  tbody td:nth-child(2)::before { content: "Акустика: "; color: var(--muted); }
  tbody td:nth-child(3)::before { content: "Электроакустика: "; color: var(--muted); }
  tbody td:nth-child(4)::before { content: "Трансакустика: "; color: var(--muted); }
}
