/* БАК — editorial magazine / newspaper-meets-tech */
:root {
  --paper: #F7F4EF;
  --ink: #121212;
  --ink-soft: #3a3a3a;
  --rule: #cfc8bc;
  --teal: #00A3A1;
  --teal-ink: #007a79;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    radial-gradient(rgba(18, 18, 18, 0.03) 1px, transparent 1px);
  background-size: 3px 3px;
}

a { color: var(--teal-ink); text-underline-offset: 3px; }
a:hover { color: var(--teal); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

/* —— Masthead —— */
.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}

.masthead__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.masthead__brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
}

.masthead__meta {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.masthead__issue {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead__phone {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--teal);
}

.masthead__phone:hover { color: var(--teal); }

/* —— Edition / headline —— */
.edition {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem var(--pad) 3.5rem;
}

.edition__kicker {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-ink);
  font-weight: 600;
}

.edition__headline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.35rem, 6.5vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: none;
}

.edition__rule {
  margin: 1.25rem 0 2rem;
  height: 3px;
  background: var(--ink);
  position: relative;
}

.edition__rule::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--rule);
}

/* —— Two-column magazine spread —— */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.spread__lead {
  margin: 0 0 1.75rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 34ch;
}

.features {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.features__item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.85rem;
  align-items: start;
  font-size: 0.95rem;
  line-height: 1.45;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.features__icon {
  width: 40px;
  height: 40px;
  color: var(--teal);
  display: block;
}

.features__icon svg { width: 100%; height: 100%; }

.cta {
  display: inline-block;
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 0.95rem 1.75rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.cta:hover {
  background: var(--teal);
  color: #fff;
}

/* Figure / hero photo */
.spread__figure { margin: 0; }

.spread__frame {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #e5e0d6;
  border: 1px solid var(--ink);
}

.spread__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  animation: photoFade 1.1s ease forwards;
  animation-delay: 0.15s;
}

@keyframes photoFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spread__caption {
  margin-top: 0.55rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 0.45rem;
}

/* —— Colophon footer —— */
.colophon {
  border-top: 2px solid var(--ink);
  background: #efeae2;
  padding: 1.5rem var(--pad) 2rem;
}

.colophon__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.colophon__brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.colophon__brand strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.colophon__legal {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--ink-soft);
  columns: 2;
  column-gap: 2rem;
}

.colophon__legal p { margin: 0 0 0.45rem; break-inside: avoid; }
.colophon__legal a { color: inherit; }

/* —— Quiz overlay (magazine) —— */
.quiz {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 18, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quiz[hidden] { display: none !important; }

.quiz__sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.quiz__close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink);
  padding: 0.25rem 0.4rem;
}

.quiz__folio {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-ink);
  font-weight: 600;
}

.quiz__title {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  line-height: 1.2;
}

.quiz__hint {
  margin: -0.5rem 0 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.quiz-step { display: none; }
.quiz-step.is-active { display: block; }

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.q-opt {
  display: block;
  cursor: pointer;
}

.q-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-opt span {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  background: #fff;
  font-size: 0.95rem;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.q-opt:hover span { border-color: var(--ink); }

.q-opt input:checked + span,
.q-opt.is-selected span {
  border-color: var(--teal);
  background: rgba(0, 163, 161, 0.12);
  color: var(--teal-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--teal);
}

.quiz__nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quiz__next,
.quiz__submit {
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.85rem 1.4rem;
  letter-spacing: 0.03em;
}

.quiz__next:hover,
.quiz__submit:hover { background: var(--teal); color: #fff; }

.quiz__back {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.85rem 1.2rem;
}

.quiz__back:hover { border-color: var(--teal); color: var(--teal); }

.quiz__fields { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }

.field__input {
  width: 100%;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 0.85rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}

.field__input:focus { border-color: var(--teal); }

.field__input.error,
.field__input.is-error {
  border-color: #c0392b;
  background: #fdf2f0;
}

.quiz__consent {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.quiz__consent a { color: var(--teal-ink); }

/* intl-tel-input */
.iti { width: 100%; display: block; }
.iti__tel-input,
.iti--allow-dropdown input,
.iti--separate-dial-code input { width: 100%; }
.iti__country-container { pointer-events: none; }
.iti__selected-country { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; }
.iti__selected-dial-code {
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-weight: 500;
  margin-left: 4px;
}
.iti__arrow { display: none; }
input[name="phone"].error,
input[name="phone"].is-error { border-color: #c0392b !important; }

label.error,
.field .error {
  display: block;
  font-size: 0.75rem;
  color: #c0392b;
  margin-top: 0.3rem;
}

body.quiz-open { overflow: hidden; }

/* —— Inner pages (thank / privacy) —— */
.page-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem var(--pad) 4rem;
}

.page-shell__back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.page-shell__back:hover { color: var(--teal); border-color: var(--teal); }

.page-shell h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.page-shell .lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.thank-card {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}

.thank-card p { margin: 0 0 0.75rem; }

/* Privacy: justified magazine columns */
.legal {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid var(--rule);
  text-align: justify;
  hyphens: auto;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.legal h2 {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  margin: 1.25rem 0 0.5rem;
  break-after: avoid;
  column-span: all;
  text-align: left;
}

.legal h2:first-child { margin-top: 0; }

.legal p { margin: 0 0 0.75rem; }
.legal ul { margin: 0 0 0.75rem; padding-left: 1.1rem; }
.legal li { margin-bottom: 0.35rem; }
.legal .legal__meta {
  column-span: all;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.legal .legal__date {
  column-span: all;
  margin-top: 1.5rem;
  font-style: italic;
  font-family: var(--serif);
  color: var(--ink);
}

/* —— Responsive —— */
@media (max-width: 860px) {
  .spread {
    grid-template-columns: 1fr;
  }

  .spread__figure {
    order: -1;
    max-width: 420px;
  }

  .spread__frame {
    aspect-ratio: 4 / 5;
  }

  .colophon__inner {
    grid-template-columns: 1fr;
  }

  .colophon__legal { columns: 1; }

  .legal { column-count: 1; }
}

@media (max-width: 520px) {
  .masthead__issue { display: none; }

  .edition__headline { font-size: clamp(1.9rem, 9vw, 2.6rem); }

  .quiz__sheet { padding: 1.75rem 1.15rem 1.25rem; }
}
