/* ===== Reset & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f4f3f1;
  --color-surface: #ffffff;
  --color-text: #1f1f1f;
  --color-text-secondary: #3a3a3a;
  --color-text-muted: #6b6b6b;
  --color-heading: #111111;
  --color-accent: #8b3a3a;
  --color-link: #1a5fb4;
  --color-border: #d0d0d0;
  --color-placeholder: #b8b8b8;
  --font-main: "Zen Maru Gothic", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  --layout-width: 640px;
  --pad-x: 1.125rem;
  --radius: 6px;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 2.1;
  letter-spacing: 0.035em;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  font-feature-settings: "palt" 1;
}

.layout {
  width: 100%;
  max-width: var(--layout-width);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

img,
.article-photo {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0 1.125rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  text-align: center;
}

.site-brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.site-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ===== Article — премиальная типографика ===== */
.article {
  width: 100%;
  max-width: var(--layout-width);
  margin: 1.25rem auto 0;
  padding: 2.25rem var(--pad-x) 2.75rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-size: clamp(1.35rem, 5.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--color-heading);
  text-align: center;
  text-wrap: balance;
}

/* Изображения */
.article-media {
  margin: 2.25rem auto;
  padding: 0;
  border: none;
  width: 100%;
  max-width: 100%;
}

.article-media--last {
  margin-bottom: 0;
}

.img-placeholder {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--color-placeholder);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-photo {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

/* Основной текст — изысканная типографика */
.article p {
  margin-bottom: 1.7rem;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 2.15;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  text-align: justify;
  text-align-last: left;
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: auto;
}

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

/* Подзаголовки — красиво и не монотонно */
.article-subhead {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-heading);
  letter-spacing: 0.06em;
  margin: 2.75rem 0 1.5rem;
  padding-top: 0.75rem;
  text-align: center;
  position: relative;
  text-wrap: balance;
}

.article-subhead::before {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-accent), transparent);
  margin: 0 auto 0.9rem;
}

.article-subhead::after {
  content: "・";
  display: block;
  font-size: 0.75rem;
  color: var(--color-accent);
  letter-spacing: 0.4em;
  margin-top: 0.4rem;
}

/* Красная врезка — как на макете */
.article-highlight {
  margin-block: 1.75rem;
  padding: 1rem 1.25rem 1rem 1.35rem;
  background: #fdfaf9;
  border-left: 4px solid #912f2f;
  border-radius: 0 var(--radius) var(--radius) 0;
  text-wrap: pretty;
}

.article-highlight,
.article-highlight p {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.85;
  color: var(--color-text);
  text-align: left;
  text-align-last: left;
}

.article-highlight p {
  margin: 0;
}

.article-highlight p + p {
  margin-top: 1rem;
}

/* Жирный акцент внутри текста */
.article strong {
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

/* Pullquote — красивая цитата */
.article-pullquote {
  margin: 2.25rem auto;
  padding: 1.5rem 2rem;
  max-width: 92%;
  background: #f9f6f6;
  border-radius: var(--radius);
  position: relative;
}

.article-pullquote::before {
  content: "「";
  position: absolute;
  top: 0.15rem;
  left: 0.65rem;
  font-size: 2.25rem;
  color: var(--color-accent);
  opacity: 0.2;
  font-family: serif;
  line-height: 1;
}

.article-pullquote::after {
  content: "」";
  position: absolute;
  bottom: -0.35rem;
  right: 0.65rem;
  font-size: 2.25rem;
  color: var(--color-accent);
  opacity: 0.2;
  font-family: serif;
  line-height: 1;
}

.article-pullquote--final {
  background: #f5f0f0;
  border-left: 3px solid var(--color-accent);
  padding: 1.35rem 1.75rem;
  max-width: 100%;
}

.article-pullquote--final::before,
.article-pullquote--final::after {
  display: none;
}

.article-pullquote p {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.75;
  color: var(--color-text);
  text-align: center;
  text-align-last: center;
  position: relative;
  z-index: 1;
}

.article-pullquote p + p {
  margin-top: 1rem;
}

/* ===== CTA ===== */
.article-cta {
  margin-top: 2.5rem;
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, #faf7f7 0%, #f3ecec 100%);
  border: 1px solid #e0d4d4;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(139, 58, 58, 0.08);
}

.article-cta-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: #fff;
  border: 1px solid #e0d4d4;
  border-radius: 999px;
  text-align: center;
}

.article-cta-title {
  font-size: clamp(1.125rem, 4.5vw, 1.375rem);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--color-heading);
  margin-bottom: 0.875rem;
  text-wrap: balance;
}

.article-cta-text {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.article .article-cta p,
.article-cta-title {
  text-align: center;
  text-align-last: center;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  padding: 0.875rem 1.5rem;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(139, 58, 58, 0.35);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.article-cta-btn:hover {
  background: #753232;
  box-shadow: 0 6px 16px rgba(139, 58, 58, 0.4);
  transform: translateY(-1px);
}

.article-cta-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 58, 58, 0.3);
}

.article-cta-note {
  margin-top: 1rem;
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 1.25rem;
  padding: 2rem 0 1.75rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  color: var(--color-heading);
}

.footer-legal p {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 0.875rem;
  text-align: left;
}

.company-info {
  list-style: none;
  margin-top: 1.125rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.85;
  text-align: left;
}

.company-info li {
  overflow-wrap: anywhere;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.footer-sep {
  display: none;
}

.footer-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-link);
  cursor: pointer;
  padding: 0.875rem 1.125rem;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.footer-link:hover,
.footer-link:active {
  color: #0d4a8f;
}

.footer-copy {
  margin-top: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 700;
  padding: 1rem 3rem 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  color: var(--color-heading);
  text-align: center;
}

.modal-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
  text-align: left;
}

.modal-body p {
  margin-bottom: 1rem;
}

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

.modal-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 1.25rem 0 0.5rem;
}

.modal-body > .modal-heading:first-child {
  margin-top: 0;
}

.modal-list {
  list-style: none;
  margin-bottom: 1rem;
  padding: 0;
}

.modal-list li {
  margin-bottom: 0.35rem;
  line-height: 1.75;
}

/* ===== Tablet & desktop ===== */
@media (min-width: 480px) {
  :root {
    --pad-x: 1.5rem;
    --layout-width: 680px;
  }

  .article {
    margin-top: 1.75rem;
    padding: 2.75rem 2.25rem 3.25rem;
  }

  .article p {
    font-size: 1.125rem;
    margin-bottom: 1.75rem;
  }

  .article-media {
    margin: 2.5rem auto;
  }

  .article-subhead {
    margin: 3rem 0 1.75rem;
    font-size: 1.375rem;
  }

  .article-highlight {
    padding: 1.15rem 1.5rem 1.15rem 1.5rem;
    font-size: 1.125rem;
  }

  .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.125rem;
  }

  .footer-sep {
    display: inline;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    user-select: none;
  }

  .footer-link {
    padding: 0.375rem 0.625rem;
    min-height: auto;
  }
}

@media (min-width: 768px) {
  :root {
    --layout-width: 720px;
  }

  .article {
    padding: 3.25rem 3rem 3.75rem;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-pullquote {
    max-width: 85%;
    padding: 1.75rem 2.5rem;
  }

  .article-cta {
    padding: 2rem 2rem 1.75rem;
  }

  .article-cta-btn {
    max-width: 360px;
    min-height: 56px;
    font-size: 1.125rem;
  }
}
