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

:root {
  --bg: #FBF6EE;
  --ink: #2A1F16;
  --muted: #6F5E4E;
  --accent: #A3542F;
  --line: #E6D8C6;
  --surface: #FFF9F1;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --measure: 800px;
  --paper: #FFFCF7;
  --shadow: 0 16px 60px rgba(67, 43, 24, 0.05);
}

html[data-theme="dark"] {
  --bg: #1A1511;
  --ink: #F0E6D8;
  --muted: #C4B3A1;
  --accent: #E08A62;
  --line: #3A3028;
  --surface: #231C17;
  --paper: #1E1915;
  --shadow: 0 16px 60px rgba(0, 0, 0, 0.12);
}

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

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(163, 84, 47, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(163, 84, 47, 0.05), transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  transition: background 0.25s ease, color 0.25s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(224, 138, 98, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(224, 138, 98, 0.06), transparent 45%),
    var(--bg);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.mark:hover {
  text-decoration: none;
}

.mark-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.mark-name {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.site-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: var(--measure);
  margin: 0 auto 2rem;
  padding: clamp(1.25rem, 5vw, 3rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 0.4rem 0 1.5rem;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 500;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  text-wrap: balance;
  line-height: 1.2;
  margin: 0 0 1.1rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0;
  width: 100%;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.8vw, 1.65rem);
  line-height: 1.4;
  text-wrap: balance;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
  color: var(--ink);
}

p {
  margin: 1rem 0;
  overflow-wrap: anywhere;
}

/* Russian automatic hyphenation keeps justified lines readable on phones. */
.container p {
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.container .hero p,
.container .pull {
  text-align: start;
}

.callout p {
  margin: 0;
}

.callout {
  font-family: var(--sans);
  font-size: 1.05rem;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 16px;
  padding: 1.2rem 1.25rem;
  margin: 1rem 0;
}

.card img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.card-media {
  text-align: center;
  margin: 0.35rem 0 1rem;
}

.card-media img.portrait {
  width: 280px;
  border-radius: 16px;
}

.pull {
  font-size: 1.22rem;
  line-height: 1.45;
  margin: 0 0 0.4rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.contact-btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

html[data-theme="dark"] .contact-btn {
  color: #1A1511;
}

.card-note,
.note {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}

.note {
  font-style: italic;
  margin-top: 1rem;
}

.draft {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.45rem;
}

.timeline {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 1.45rem 1.15rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.timeline-item p {
  margin: 0.35rem 0 0;
}

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.65rem 0;
}

summary {
  font-family: var(--serif);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.02rem;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 500;
}

details[open] summary::after {
  content: "−";
}

.details-body {
  margin-top: 0.75rem;
  font-size: 0.98rem;
}

ul {
  padding-left: 1.35rem;
}

li {
  margin: 0.4rem 0;
}

.contacts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
  text-align: center;
  margin: 1.5rem 0;
}

.container .contacts p {
  text-align: center;
}

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

.disclaimer {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.5rem 0;
  line-height: 1.65;
}

footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

@media (max-width: 860px) {
  .site-header,
  .container {
    width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
    line-height: 1.8;
  }

  .site-header {
    padding: 0.9rem 0;
  }

  .container {
    width: calc(100% - 1rem);
    border-radius: 18px;
    padding: 1rem;
  }

  .hero {
    padding-top: 0;
  }

  .hero h1 {
    letter-spacing: -0.025em;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav a {
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.55rem 0.5rem;
    border-radius: 12px;
    text-align: center;
  }

  .card,
  .contacts {
    padding: 1rem;
    border-radius: 12px;
  }

  .pull {
    font-size: 1.12rem;
  }

  .contact-btn {
    display: flex;
    width: 100%;
  }

  h2 {
    margin-top: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body,
  .theme-toggle {
    transition: none;
  }
}
