/* «Последнее слово» — сайт. Один файл, без сборки и зависимостей. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #605a52;
  --line: #e6e0d7;
  --accent: #2f5d50;
  --accent-hover: #24483e;
  --on-accent: #ffffff;
  --notice-bg: #fdf7ea;
  --notice-line: #e7d6ae;
  --radius: 14px;
  --measure: 64ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --ink: #ece9e4;
    --muted: #a39c93;
    --line: #2c3036;
    --accent: #7fb3a2;
    --accent-hover: #96c5b5;
    --on-accent: #10201b;
    --notice-bg: #23211a;
    --notice-line: #4a4230;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

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

.wrap {
  width: min(100% - 2.5rem, 1060px);
  margin-inline: auto;
}

.lede {
  max-width: var(--measure);
  font-size: 1.15rem;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: static;
  display: inline-block;
  padding: 0.5rem 1rem;
}

/* Шапка */

.site-head {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Секции */

section {
  padding: clamp(2.75rem, 7vw, 4.5rem) 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type {
  border-bottom: 0;
}

.hero {
  padding-top: clamp(3rem, 9vw, 5.5rem);
  border-bottom: 0;
}

.hero p {
  max-width: var(--measure);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--muted);
}

/* Врезка для получателя */

.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  margin: 2rem 0 0;
}

.notice h2 {
  font-size: 1.35rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice strong {
  color: var(--ink);
}

/* Сетки карточек */

.grid {
  display: grid;
  gap: 1.25rem;
  /* min() обязателен: без него колонка держит свою ширину и вылезает за экран телефона. */
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  padding: 0;
  margin: 2rem 0 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.step {
  counter-increment: step;
}

.step h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9rem;
  vertical-align: 2px;
}

.steps {
  counter-reset: step;
  /* Четыре шага в четыре колонки превращаются в нечитаемые столбики. */
  grid-template-columns: repeat(auto-fit, minmax(min(23rem, 100%), 1fr));
}

/* Списки с галочкой */

.plain {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
}

.plain li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
}

.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Тарифы */

.plans {
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}

.price {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  line-height: 1.1;
  margin: 0.2rem 0 0.15rem;
}

.price small {
  font-family: inherit;
  font-size: 1rem;
  color: var(--muted);
}

.plan-note {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Вопросы */

details {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
  max-width: var(--measure);
}

details:first-of-type {
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}

summary::marker {
  color: var(--accent);
}

details p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

/* Реквизиты и подвал */

.details-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
  max-width: var(--measure);
}

.details-list dt {
  color: var(--muted);
}

.details-list dd {
  margin: 0;
  /* Длинный адрес почты не переносится и в узкой колонке лезет за край. */
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .details-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .details-list dt {
    margin-top: 0.7rem;
  }

  .details-list dt:first-child {
    margin-top: 0;
  }
}

.placeholder {
  color: var(--muted);
  background: var(--notice-bg);
  border: 1px dashed var(--notice-line);
  border-radius: 5px;
  padding: 0 0.35rem;
  font-size: 0.92rem;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.site-foot p {
  max-width: var(--measure);
}

/* Оферта и политика */

.doc {
  padding: clamp(2rem, 5vw, 3.5rem) 0 1rem;
  border-bottom: 0;
}

.doc .wrap {
  max-width: 72ch;
}

.doc h2 {
  font-size: 1.3rem;
  margin-top: 2.4rem;
}

.doc h3 {
  font-size: 1.05rem;
  margin-top: 1.6rem;
}

.doc ol,
.doc ul {
  padding-left: 1.3rem;
}

.doc li {
  margin-bottom: 0.45rem;
}

.updated {
  color: var(--muted);
  font-size: 0.93rem;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Одиночные страницы: 404 и «я жив» */

.centered {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}

.centered .wrap {
  max-width: 34rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 10px;
  padding: 0.85rem 1.6rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
