@font-face {
  font-family: "Lora";
  src: url("../fonts/lora.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-italic.woff") format("woff");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --sky: #dbe6ee;        /* фон: голубой конверт */
  --sky-deep: #c3d4e1;
  --ink: #1f3044;        /* чернила */
  --ink-soft: #4a5b6e;
  --paper: #fffdf7;      /* бумага открытки */
  --wine: #7a2231;       /* бордо с логотипа */
  --holly: #2f5a3c;      /* зелень с логотипа */
  --wax: #b98b3e;        /* сургуч */
  --line: rgba(31, 48, 68, 0.28);
  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif", serif;
  --wrap: 1080px;
}

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

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

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: lining-nums;
}

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

a { color: var(--wine); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--wax);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

/* Кайма авиапочты */
.airmail {
  height: 14px;
  background: repeating-linear-gradient(
    135deg,
    var(--wine) 0 18px,
    var(--paper) 18px 30px,
    var(--ink) 30px 48px,
    var(--paper) 48px 60px
  );
}

/* Шапка */
.masthead {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 1.1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 600;
  margin-right: auto;
}
.brand img { width: 52px; height: 52px; }
.nav { display: flex; gap: 1.5rem; }
.nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }

.button {
  display: inline-block;
  background: var(--wine);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.8em 1.5em;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button.small { font-size: 0.95rem; padding: 0.55em 1.15em; }

/* Первый экран: оборот открытки */
.hero { padding-block: 1.5rem 4.5rem; }
.card-back {
  background: var(--paper);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  min-height: 30rem;
  padding: 2.75rem;
  box-shadow: 0 1px 0 #fff inset, 0 22px 40px -18px rgba(31, 48, 68, 0.45), 0 2px 6px rgba(31, 48, 68, 0.12);
  transform: rotate(-0.8deg);
}
.card-message {
  padding-right: 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-message h1 {
  font-style: italic;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.card-message p { font-size: 1.15rem; max-width: 30em; color: var(--ink-soft); }
.card-message .button { align-self: flex-start; margin-top: 1.25rem; }

.card-address {
  border-left: 1px solid var(--line);
  padding-left: 2.75rem;
  display: flex;
  flex-direction: column;
}
.stamp {
  align-self: flex-end;
  width: 132px;
  padding: 7px;
  background:
    radial-gradient(circle at 6px 6px, var(--paper) 3.4px, transparent 3.9px) -6px -6px / 12px 12px,
    var(--sky-deep);
  transform: rotate(3deg);
}
.stamp-face {
  background: var(--sky);
  padding: 10px 10px 6px;
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink);
}
.stamp-face img { width: 100%; margin-bottom: 4px; }

.address {
  margin: auto 0 0;
  padding-top: 2rem;
}
.address div {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0 0.4rem;
}
.address dt { color: var(--ink-soft); font-size: 0.95rem; min-width: 4.6em; }
.address dd { margin: 0; font-style: italic; font-size: 1.2rem; }

/* Разделы */
.section { padding-block: 4rem; }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-style: italic; margin-bottom: 0.75rem; }
.section-head p { color: var(--ink-soft); }

/* Открытки на столе */
.table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2.25rem;
  align-items: start;
}
.postcard { margin: 0; }
.postcard a {
  display: block;
  background: var(--paper);
  padding: 12px;
  box-shadow: 0 16px 28px -16px rgba(31, 48, 68, 0.5), 0 1px 4px rgba(31, 48, 68, 0.15);
  transition: transform 0.2s ease;
}
.postcard:nth-child(1) a { transform: rotate(-1.6deg); }
.postcard:nth-child(2) a { transform: rotate(1.1deg) translateY(14px); }
.postcard:nth-child(3) a { transform: rotate(-0.7deg); }
.postcard a:hover, .postcard a:focus-visible { transform: rotate(0) translateY(-4px); }
.postcard figcaption { margin-top: 1.4rem; text-align: center; font-style: italic; font-size: 1.1rem; }
.postcard:nth-child(2) figcaption { margin-top: 2.2rem; }

.sheet {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 300px) 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--sky-deep);
  padding: 2rem;
}
.sheet a { display: block; background: #fff; padding: 10px; transform: rotate(1.4deg); box-shadow: 0 14px 24px -14px rgba(31, 48, 68, 0.5); }
.sheet h3 { font-size: 1.6rem; font-style: italic; margin-bottom: 0.6rem; }
.sheet p { color: var(--ink-soft); max-width: 34em; }

.more { margin-top: 3rem; font-size: 1.1rem; }

/* Как заказать */
.steps-band { background: var(--ink); color: var(--paper); }
.steps-band .section-head p { color: #b9c8d6; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.steps li { counter-increment: step; border-top: 1px solid rgba(255, 253, 247, 0.3); padding-top: 1.1rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-style: italic;
  font-size: 2.6rem;
  line-height: 1;
  color: #e7c98b;
  margin-bottom: 0.8rem;
}
.steps h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.steps p { color: #c9d5e0; font-size: 1rem; }
.steps-band .button { margin-top: 2.75rem; background: var(--paper); color: var(--ink); }
.steps-band .button:hover { background: #e7c98b; color: var(--ink); }

/* Условия */
.terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.terms h3 { font-size: 1.45rem; font-style: italic; color: var(--wine); margin-bottom: 0.8rem; }
.terms ul { margin: 0 0 1em; padding-left: 1.1em; }
.terms li { margin-bottom: 0.3em; }
.terms .note { color: var(--ink-soft); font-size: 0.98rem; }

/* Подвал */
.footer { padding-block: 2.5rem 3rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.footer .brand { font-size: 1.1rem; }
.footer .brand img { width: 40px; height: 40px; }
.footer p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 3rem; }
.lost h1 { font-style: italic; font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.lost p { color: var(--ink-soft); margin-bottom: 1.75rem; }

@media (max-width: 900px) {
  .nav { display: none; }
  .card-back { grid-template-columns: 1fr; padding: 1.75rem; min-height: 0; transform: none; }
  .card-message { padding-right: 0; padding-bottom: 2rem; }
  .card-address { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 1.75rem; }
  .stamp { width: 104px; }
  .address { padding-top: 1rem; }
  .table { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .terms { grid-template-columns: 1fr; gap: 2rem; }
  .sheet { grid-template-columns: 1fr; }
  .sheet a { max-width: 300px; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .section { padding-block: 3rem; }
  .hero { padding-bottom: 3rem; }
  .table { grid-template-columns: 1fr; gap: 2.5rem; }
  .postcard { max-width: 340px; margin-inline: auto; }
  .postcard:nth-child(2) a { transform: rotate(1.1deg); }
  .postcard:nth-child(2) figcaption { margin-top: 1.4rem; }
  .steps { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .footer .brand span { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .postcard a, .button { transition: none; }
}
