:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #27251f;
  background: #f7f6f2;
  color-scheme: light;
  --panel: #fff;
  --soft: #eeede7;
  --line: #deddd5;
  --muted: #6b6a62;
  --accent: #a33c00;
  --ink: #27251f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
header {
  max-width: 1280px;
  margin: auto;
  padding: 26px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink);
  font-size: 25px;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -1px;
}
.brand:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 22px;
  transform: skew(-16deg);
  background: #ef7625;
  margin-right: 12px;
  border-radius: 3px;
}
nav {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
}
nav a {
  color: var(--ink);
  text-decoration: none;
}
nav a:last-child {
  background: var(--ink);
  color: var(--panel);
  padding: 12px 17px;
  border-radius: 9px;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 36px 40px 90px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(34px, 4.5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  margin-bottom: 24px;
  max-width: 920px;
  overflow-wrap: anywhere;
}
h2 {
  font-size: clamp(23px, 2.5vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.eyebrow {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 750;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}
.back-link {
  display: inline-block;
  margin-bottom: 36px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.material-heading {
  margin-bottom: 30px;
}
.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  max-width: 740px;
  overflow-wrap: anywhere;
}
.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.specs span {
  padding: 8px 12px;
  background: var(--soft);
  border-radius: 7px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gallery figure {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.gallery figure:first-child {
  grid-column: 1/-1;
}
.gallery a {
  display: block;
}
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1.4;
  object-fit: contain;
  padding: 12px;
}
.gallery figure:not(:first-child) img {
  aspect-ratio: 1.25;
  padding: 5px;
}
.estimate {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
}
.estimate h2 {
  max-width: 340px;
}
.price-options {
  margin: 24px 0;
}
.price-option {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
}
.price-option > span {
  font-size: 13px;
  color: var(--muted);
}
.price-option strong {
  font-size: clamp(23px, 2.3vw, 31px);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.price-option small {
  font-size: 0.7em;
  color: var(--muted);
}
.price-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  background: #b54708;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.button:hover {
  background: #923705;
}
.reading {
  max-width: 800px;
  padding-top: 42px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
}
.prose {
  white-space: pre-wrap;
  line-height: 1.85;
  overflow-wrap: anywhere;
  font-size: 16px;
}
.updated {
  font-size: 12px;
  color: var(--muted);
  margin: 26px 0 0;
}
.catalog-heading {
  padding: 28px 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.cards article {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.cards a {
  text-decoration: none;
  color: var(--ink);
}
.cards img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--soft);
  border-radius: 12px;
  margin-bottom: 20px;
}
.cards h2 {
  font-size: 23px;
  margin: 0 6px 12px;
  overflow-wrap: anywhere;
}
.cards p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 6px 10px;
  overflow-wrap: anywhere;
}
img {
  max-width: 100%;
  height: auto;
}
footer {
  max-width: 1200px;
  margin: auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
footer p:empty {
  display: none;
}
a:focus-visible {
  outline: 3px solid #df6a21;
  outline-offset: 5px;
}
a:hover {
  text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color: #f3f0e9;
    background: #181916;
    color-scheme: dark;
    --ink: #f3f0e9;
    --panel: #22241f;
    --soft: #2c2e28;
    --line: #3c3e36;
    --muted: #b6b7ab;
    --accent: #ffb177;
  }
}
@media (max-width: 900px) {
  .material-layout {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .estimate {
    padding: 22px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header,
  main {
    padding-left: 24px;
    padding-right: 24px;
  }
  footer {
    margin: 0 24px;
  }
}
@media (max-width: 640px) {
  header {
    padding: 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  nav {
    gap: 14px;
    font-size: 12px;
  }
  nav a:last-child {
    padding: 10px;
  }
  main {
    padding: 26px 20px 56px;
  }
  .back-link {
    margin-bottom: 26px;
  }
  .material-layout {
    grid-template-columns: 1fr;
  }
  .material-heading {
    margin-bottom: 24px;
  }
  .lead {
    font-size: 15px;
  }
  .estimate {
    padding: 24px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .reading {
    margin-top: 28px;
    padding-top: 28px;
  }
  .gallery img {
    aspect-ratio: 1.35;
  }
  footer {
    margin: 0 20px;
  }
  .price-option strong {
    font-size: 28px;
  }
}

:root[data-theme="dark"] {
  color: #f3f0e9;
  background: #181916;
  color-scheme: dark;
  --ink: #f3f0e9;
  --panel: #22241f;
  --soft: #2c2e28;
  --line: #3c3e36;
  --muted: #b6b7ab;
  --accent: #ffb177;
}

/* Переключатель занимает крайнее правое место в шапке, как на главной. */
header nav {
  margin-left: auto;
}
header .theme-toggle {
  margin-left: 0;
}
header .theme-toggle .face svg {
  --glow: #f5f7fa;
}
@media (max-width: 640px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 18px;
  }
  header .brand {
    grid-column: 1;
    grid-row: 1;
  }
  header .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    width: 64px;
    height: 44px;
    flex-basis: 64px;
    --font-size: 13px;
  }
  header nav {
    grid-column: 1/-1;
    grid-row: 2;
    margin-left: 0;
    justify-content: space-between;
  }
}
