/* Stepan war story · mobile-first vintage warm/cold palette */

:root {
  --warm-bg: #f7efe2;       /* sepia paper */
  --warm-fg: #2d2419;       /* dark cocoa */
  --warm-muted: #6b5d4a;
  --cold-bg: #2a2f3a;       /* night blue-gray */
  --cold-fg: #e6e3dc;
  --cold-muted: #93948f;
  --dark-bg: #1a1612;       /* almost-black warm */
  --dark-fg: #d8c8a8;
  --accent: #8b3a2f;        /* dried-blood red, restrained */
  --accent-soft: #c9a07a;   /* faded gold */
  --serif: "Georgia", "Iowan Old Style", "Palatino", serif;
  --sans:  "Helvetica Neue", "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--warm-fg);
  background: var(--warm-bg);
  -webkit-font-smoothing: antialiased;
}

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

/* ---- HERO ---- */

.hero {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 30%, rgba(139, 58, 47, 0.05), transparent 60%),
    linear-gradient(180deg, #ece1ce 0%, var(--warm-bg) 80%);
  display: flex;
  align-items: center;
  padding: 4rem 1.25rem;
}

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.hero__photo {
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  overflow: hidden;
  background: #d6c9b0 url('assets/stepan_face.jpeg') center/cover;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.hero__photo img { width: 100%; height: 100%; object-fit: cover; }

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

.hero__name {
  font-size: clamp(2rem, 7vw, 3.4rem);
  margin: 0 0 0.5rem;
  font-weight: 400;
  line-height: 1.05;
}

.hero__dates {
  font-style: italic;
  color: var(--warm-muted);
  margin: 0 0 2rem;
}

.hero__lede {
  margin: 0 auto 1rem;
  max-width: 32em;
}

.hero__lede--quiet {
  color: var(--warm-muted);
  font-size: 0.95em;
}

.hero__scroll {
  margin-top: 3rem;
  font-size: 1.5rem;
  color: var(--warm-muted);
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ---- SECTIONS ---- */

.sec {
  padding: 4rem 1.25rem;
}

.sec h2 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  margin: 0 0 0.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.sec__quiet {
  font-style: italic;
  color: var(--warm-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95em;
}

.sec__body {
  max-width: 36em;
  margin: 0 auto;
}

.sec__body p { margin: 0 0 1rem; }

.sec__big {
  font-size: 1.4em;
  line-height: 1.3;
  margin: 1.5em 0;
}

.sec__body strong { color: var(--accent); font-weight: 600; }

/* Inline source link at the end of a narrative section */
.sec-source {
  margin: 1.8em 0 0;
  padding-top: 0.9em;
  border-top: 1px dashed currentColor;
  font-family: var(--sans);
  font-size: 0.85em;
  opacity: 0.78;
}
.sec-source a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.sec-source a:hover { opacity: 0.7; }

/* warm */
.sec--warm { background: var(--warm-bg); color: var(--warm-fg); }
.sec--warm .sec__quiet { color: var(--warm-muted); }

/* cold */
.sec--cold { background: var(--cold-bg); color: var(--cold-fg); }
.sec--cold h2 { color: var(--accent-soft); }
.sec--cold .sec__quiet { color: var(--cold-muted); }
.sec--cold .sec__body strong { color: var(--accent-soft); }

/* dark — for tragic moments */
.sec--dark {
  background: var(--dark-bg);
  color: var(--dark-fg);
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
}
.sec--dark h2 { color: var(--accent); }
.sec--dark .sec__big { color: #f0e0c0; }

/* narrative */
.sec--narrative {
  background: linear-gradient(180deg, #ece1ce 0%, var(--warm-bg) 100%);
}

/* map */
.sec--map { background: #1d2026; color: var(--cold-fg); padding: 4rem 0 0; }
.sec--map h2,
.sec--map .sec__body { padding: 0 1.25rem; max-width: 720px; margin-left: auto; margin-right: auto; }
.sec--map h2 { color: var(--accent-soft); }

.map {
  width: 100%;
  height: 60vh;
  min-height: 380px;
  background: #15171c;
}

.map__legend {
  list-style: none;
  margin: 0;
  padding: 1.5rem 1.25rem 4rem;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.6;
  counter-reset: legend;
}

.map__legend li {
  position: relative;
  padding-left: 2.4em;
  margin-bottom: 0.75em;
  color: var(--cold-fg);
}

.map__legend li::before {
  counter-increment: legend;
  content: counter(legend);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  text-align: center;
  line-height: 1.7em;
  font-size: 0.85em;
  font-weight: bold;
  font-family: var(--serif);
}

/* summary / cost */
.sec--summary {
  background: var(--warm-bg);
  color: var(--warm-fg);
}
.cost-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
  max-width: 36em;
}
@media (min-width: 600px) {
  .cost-grid { grid-template-columns: repeat(3, 1fr); }
}

.cost { text-align: center; }
.cost__num {
  font-size: 1.6em;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.2em;
  line-height: 1.1;
}
.cost__label {
  font-size: 0.92em;
  color: var(--warm-muted);
  font-family: var(--sans);
  line-height: 1.35;
}

/* coda */
.sec--coda {
  background: linear-gradient(180deg, var(--dark-bg) 0%, #221d18 100%);
  color: var(--dark-fg);
  padding: 5rem 1.25rem;
}
.coda__lede {
  font-size: 1.15em;
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 1.25em;
  margin: 0 0 1.5em;
}
.coda__big {
  font-size: 1.6em;
  line-height: 1.3;
  margin: 2em 0 0;
  color: var(--accent-soft);
  text-align: center;
}

.coda__epilogue {
  margin: 3em auto 0;
  padding-top: 2em;
  border-top: 1px solid #3a322a;
  max-width: 32em;
  font-size: 0.94em;
  font-style: italic;
  opacity: 0.85;
}

/* contact section */
.sec--contact {
  background: var(--warm-bg);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid #d6c9b0;
  padding: 4rem 1.25rem;
}
.sec--contact h2 { color: var(--accent); text-align: center; }
.sec--contact .sec__body { max-width: 32em; }

.contact-list {
  list-style: none;
  margin: 1.6em 0 0;
  padding: 0;
  font-family: var(--sans);
}
.contact-list li {
  font-size: 1.02em;
  margin: 0.6em 0;
  line-height: 1.5;
}
.contact-list a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* footer */
.foot {
  background: #14110d;
  color: #6b5d4a;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.84em;
  font-family: var(--sans);
}
.foot__quiet { margin: 0 auto 0.75em; max-width: 36em; line-height: 1.55; }

/* ---- LINEAGE (compact family tree) ---- */

.sec--lineage {
  background: #f0e6d2;
  color: var(--warm-fg);
  padding: 3rem 1.25rem;
}
.sec--lineage h2 { text-align: center; }
.sec--lineage > .sec__quiet,
.sec--lineage > p {
  max-width: 36em;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.lin {
  list-style: none;
  margin: 2rem auto;
  padding: 0;
  max-width: 36em;
  position: relative;
}

.lin-row {
  position: relative;
  background: #fdf8ec;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 0 0 0.6rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

/* Down-arrow between rows */
.lin-row + .lin-row::before {
  content: "↓";
  position: absolute;
  left: 50%;
  top: -0.8em;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 1.2em;
  opacity: 0.7;
}

.lin-pair {
  font-family: var(--serif);
  font-size: 1.05em;
  margin: 0 0 0.3em;
  line-height: 1.3;
}

.lin-name {
  font-weight: 600;
  color: var(--warm-fg);
}

.lin-and {
  margin: 0 0.5em;
  color: var(--accent);
}

.lin-meta {
  font-family: var(--sans);
  font-size: 0.82em;
  color: var(--warm-muted);
  line-height: 1.4;
  margin-top: 0.3em;
}

.lin-meta-inline {
  font-family: var(--sans);
  font-size: 0.8em;
  color: var(--warm-muted);
  font-weight: 400;
}

/* Children chip list */
.lin-row--children {
  background: rgba(139, 58, 47, 0.04);
  padding: 0.9rem 1rem;
}
.lin-children__label {
  font-family: var(--sans);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warm-muted);
  margin: 0 0 0.7em;
  text-align: center;
}
.lin-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em 0.6em;
}
.lin-children li {
  font-family: var(--serif);
  font-size: 0.95em;
  padding: 0.25em 0.7em;
  background: #fdf8ec;
  border: 1px solid #d6c9b0;
  border-radius: 999px;
  white-space: nowrap;
}
.lin-children li em {
  font-style: normal;
  font-size: 0.78em;
  color: var(--warm-muted);
  margin-left: 0.35em;
}
.lin-child--anatoly {
  background: var(--accent) !important;
  color: #fff;
  border-color: var(--accent) !important;
}
.lin-child--anatoly em { color: #f7e0c8 !important; }
.lin-child--anatoly strong { color: #fff; }

/* ---- FIGURE (image + caption) ---- */

.figure {
  margin: 2em 0;
  padding: 0;
}
.figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  filter: sepia(0.08) contrast(1.02);
}
.figure figcaption {
  font-family: var(--sans);
  font-size: 0.85em;
  line-height: 1.5;
  color: var(--warm-muted);
  margin: 0.7em 0 0;
}
.figure figcaption small {
  font-size: 0.85em;
  display: block;
  margin-top: 0.3em;
  opacity: 0.85;
}

/* Figure variants */
.figure--inline {
  margin: 1.2em 0;
}
.figure--inline img { box-shadow: 0 2px 10px rgba(0,0,0,0.18); }

.figure--banner {
  margin: 0 auto 2.5em;
  max-width: 880px;
  padding: 0 1.25rem;
}
.figure--banner img {
  filter: sepia(0.12) contrast(1.04) brightness(0.97);
}
.figure--banner figcaption {
  text-align: center;
  padding: 0 1rem;
}

.figure--portrait {
  margin: 2em auto;
  max-width: 320px;
  text-align: center;
}
.figure--portrait img {
  border-radius: 50%;
  filter: sepia(0.18) contrast(1.05) brightness(0.95);
}
.figure--portrait figcaption {
  text-align: center;
  font-style: italic;
}

.sec--cold .figure figcaption,
.sec--dark .figure figcaption,
.sec--map  .figure figcaption { color: var(--cold-muted); }

/* ---- INLINE CALLOUT BOX ---- */

.callout {
  margin: 2em 0 0;
  padding: 1.2em 1.4em;
  border-left: 3px solid var(--accent);
  background: rgba(139, 58, 47, 0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.95em;
}
.callout h3 {
  margin: 0 0 0.6em;
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 600;
}
.callout p { margin: 0 0 0.7em; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent); font-weight: 600; }

.callout--region {
  max-width: 36em;
  margin: 2.5em auto 0;
  background: rgba(139, 58, 47, 0.05);
}
.callout--region p { margin-bottom: 0.7em; }
.callout__source {
  font-family: var(--sans);
  font-size: 0.8em;
  color: var(--warm-muted);
  font-style: italic;
  margin-top: 0.8em !important;
}

.sec--cold .callout { background: rgba(255,255,255,0.04); }
.sec--dark .callout {
  background: rgba(255,255,255,0.04);
  border-left-color: var(--accent);
}

/* ---- TIMELINE (parallel two-track) ---- */

.sec--timeline {
  background: linear-gradient(180deg, var(--warm-bg) 0%, #ece1ce 100%);
}
.sec--timeline h2 { text-align: center; }
.sec--timeline > .sec__quiet {
  text-align: center;
  max-width: 36em;
  margin: 0 auto 2rem;
}

.tl {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

/* Center line (desktop) / left line (mobile) */
.tl::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 1.2rem;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 8%,
    var(--accent) 92%,
    transparent 100%);
}

.tl-year {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 1.8rem 0 0.6rem;
  padding-left: 3rem;
  color: var(--accent);
  position: relative;
}
/* Mobile: small dot on the rail to the LEFT of the year text */
.tl-year::before {
  content: "";
  position: absolute;
  left: calc(1.2rem - 5px);
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px var(--warm-bg);
}

.tl-event {
  position: relative;
  padding: 0.7em 0 0.7em 3rem;
  margin: 0.2em 0;
}
.tl-event::before {
  content: "";
  position: absolute;
  left: calc(1.2rem - 6px);
  top: 1.1em;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--warm-bg);
  border: 2px solid var(--warm-muted);
}

.tl-event__date {
  font-family: var(--sans);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warm-muted);
  margin: 0 0 0.2em;
}

.tl-event__text {
  font-size: 0.95em;
  line-height: 1.45;
}

.tl-event__text strong {
  color: var(--accent);
  font-weight: 600;
}

/* Side colors: left (Stepan) is bright, right (family) is muted blue */
.tl-event--left::before  { background: #fff; border-color: var(--accent); }
.tl-event--right::before { background: #fff; border-color: #5a6e88; }

.tl-event--accent::before { background: var(--accent); border-color: var(--accent); }
.tl-event--dark::before   { background: #2a2520; border-color: #2a2520; }

.tl-event--right .tl-event__text { color: #3a4658; }
.tl-event--right .tl-event__date { color: #5a6e88; }
.tl-event--dark .tl-event__text strong { color: var(--accent); }

@media (min-width: 720px) {
  /* Desktop: split into two columns */
  .tl::before { left: 50%; }

  /* Year header sits BELOW (or on its own line) so dot doesn't overlap digits.
     Render as a centered chip with rail dot above it. */
  .tl-year {
    text-align: center;
    padding-left: 0;
    margin: 2.8rem 0 1rem;
  }
  .tl-year::before {
    left: 50%;
    top: -1rem;
    transform: translateX(-50%);
    width: 14px; height: 14px;
    box-shadow: 0 0 0 4px var(--warm-bg);
  }

  .tl-event {
    width: 50%;
    padding: 0.8em 1.5em;
    box-sizing: border-box;
  }
  .tl-event--left {
    margin-left: 0;
    text-align: right;
    padding-left: 0;
    padding-right: 2.2em;
  }
  .tl-event--left::before {
    left: auto;
    right: -7px;
    top: 1.1em;
  }
  .tl-event--right {
    margin-left: 50%;
    padding-left: 2.2em;
    padding-right: 0;
  }
  .tl-event--right::before {
    left: -7px;
    top: 1.1em;
  }
}

/* desktop tweaks (still mobile-first design) */
@media (min-width: 720px) {
  body { font-size: 19px; }
  .sec { padding: 6rem 1.25rem; }
  .hero { padding: 6rem 1.25rem; }
}
