/* =========================================================
   Ksenia Kandalintseva — writer's site
   Dark warm palette · Onest sans · Source Serif 4 for long-form prose
   ========================================================= */

:root {
  /* Dark warm palette */
  --bg:        #0e0b07;
  --bg-soft:   #15110b;
  --surface:   #1c1810;
  --surface-2: #25201a;
  --ink:       #ede4d0;
  --ink-soft:  #b6ad97;
  --muted:     #8a8170;
  --rule:      #2a251e;
  --rule-soft: #1f1b15;
  --accent:    #d9b878;
  --accent-soft: #b89865;

  /* Reading palette (story long-form) */
  --prose-fg: #e8dfc8;

  /* Fonts */
  --sans:  "Onest", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Lora", Georgia, "Times New Roman", serif;

  --measure: 42rem;
  --measure-wide: 56rem;
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

/* Keyboard focus ring (a11y) — shown for keyboard users, not on mouse clicks. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Skip-to-content link — off-screen until focused (keyboard / screen-reader users). */
.skip-link {
  position: fixed; left: 0; top: 0; z-index: 1000;
  transform: translateY(-120%); transition: transform 0.2s ease;
  background: var(--accent); color: #1a1206; font-family: var(--sans);
  font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { transform: translateY(0); }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

@media (min-width: 768px) {
  html { font-size: 18px; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "ss01" 1;
  hanging-punctuation: first last;
  min-height: 100vh;
  transition: background-color 1.2s var(--ease-soft);
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

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

/* =========================================================
   Site header (top navigation, shared across pages)
   ========================================================= */

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.5rem, 4vw, 3rem);
  width: 100%;
}

.logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  padding: 0.3rem 0;
}

.logo:hover { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.site-nav a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.4rem 0;
  position: relative;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--ink);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.lang {
  display: inline-flex;
  align-items: center;
  margin-left: clamp(0.5rem, 2vw, 1.5rem);
  padding-left: clamp(0.8rem, 2vw, 1.6rem);
  border-left: 1px solid var(--rule);
  gap: 0.5rem;
}

.lang a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding: 0.4rem 0.25rem;
}

.lang a.is-active {
  color: var(--ink);
}

.lang a:hover { color: var(--ink); }

/* Mobile nav: one tight, non-wrapping row under the logo */
@media (max-width: 720px) {
  .site-header {
    padding: 1rem 1.1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .site-nav {
    gap: 0.9rem;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 0.3rem 0;
  }
  .lang {
    margin-left: auto;
    padding-left: 0.85rem;
    gap: 0.4rem;
  }
  .lang a {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 0.3rem 0.15rem;
  }
  /* Keep the story hero title/byline clear of the floating dock */
  body.has-dock .hero-story__content { padding-bottom: clamp(8rem, 16vh, 10rem); }
}

/* =========================================================
   Home page hero — two-column (text left, portrait right)
   ========================================================= */

.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  /* Use dvh (dynamic vh) where supported, fallback to vh.
     Subtract approximate header height so content stays in first fold. */
  height: calc(100svh - 5rem);
  min-height: 560px;
  max-height: 100vh;
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem clamp(1.5rem, 5vw, 5rem);
  max-width: 36rem;
  overflow: hidden;
}

.hero__name {
  font-family: var(--sans);
  font-weight: 700;
  /* Cap by both viewport width and viewport height so it shrinks on short screens */
  font-size: clamp(2.2rem, min(5.2vw, 8.5vh), 4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.hero__bio {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
  max-width: 26rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  align-self: flex-start;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, transform 0.3s var(--ease-soft);
}

.hero__cta:hover {
  border-bottom-color: var(--accent);
  transform: translateX(3px);
}

.hero__cta .arrow { display: inline-block; transition: transform 0.3s var(--ease-soft); }
.hero__cta:hover .arrow { transform: translateX(4px); }

.hero__photo {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.95) contrast(1.04) saturate(0.95);
}

.hero__photo::after {
  /* Smooth fade from dark background into the photo on three edges:
     left, top, and bottom — photo dissolves into the page on all sides
     except the viewport edge. */
  content: "";
  position: absolute;
  inset: 0;
  background:
    /* Left fade */
    linear-gradient(90deg,
      var(--bg) 0%,
      rgba(14, 11, 7, 0.7) 6%,
      rgba(14, 11, 7, 0.35) 14%,
      transparent 24%),
    /* Right fade — the edge we missed; noticeable on iPhone where the photo is full-width */
    linear-gradient(270deg,
      var(--bg) 0%,
      rgba(14, 11, 7, 0.6) 5%,
      rgba(14, 11, 7, 0.28) 12%,
      transparent 20%),
    /* Top fade */
    linear-gradient(180deg,
      var(--bg) 0%,
      rgba(14, 11, 7, 0.7) 5%,
      rgba(14, 11, 7, 0.3) 12%,
      transparent 20%),
    /* Bottom fade */
    linear-gradient(0deg,
      var(--bg) 0%,
      rgba(14, 11, 7, 0.65) 5%,
      rgba(14, 11, 7, 0.3) 12%,
      transparent 22%);
  pointer-events: none;
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: 40vh 1fr;
    min-height: auto;
  }
  .hero__text {
    padding: 2rem 1.5rem 3rem;
    order: 2;
  }
  .hero__photo {
    order: 1;
    height: 40vh;
  }
}

/* =========================================================
   Latest text card (below hero on home)
   ========================================================= */

.latest {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
  max-width: 56rem;
}

.latest__kicker {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.latest__card {
  display: block;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  transition: border-color 0.3s, padding 0.3s var(--ease-soft);
}

.latest__card:hover {
  padding-left: 0.5rem;
  border-top-color: var(--accent);
}

.latest__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.latest__excerpt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 0.8rem;
  max-width: 36rem;
  line-height: 1.5;
}

.latest__date {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   Generic page (about, contacts, texts)
   ========================================================= */

.page {
  padding: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem) 6rem;
  max-width: 64rem;
  margin: 0 auto;
}

.page__title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 3rem;
}

.page__lede {
  font-family: var(--sans);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 40rem;
  margin: 0 0 3rem;
}

.page__section {
  margin: 3rem 0;
}

.page__section h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.2rem;
  font-weight: 500;
}

.page__section p {
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
  max-width: 38rem;
}

.page__section a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
}
.page__section a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Home sections mirror the hero ──
   Left block = section title + intro (aligned under «Ксения Кандалинцева»);
   right block = the actual content (story list / bio / contacts), where the hero
   photo sits. Only the home page uses .home-sec; standalone /about stays .page. */
.home-sec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 0 clamp(1.5rem, 4vw, 3rem);
  max-width: none;
  margin: 0;
  padding: clamp(3rem, 8vw, 6.5rem) 0;
}
.home-sec__head {
  padding-left: clamp(1.5rem, 5vw, 5rem);
  padding-right: 1rem;
  max-width: 38rem;
}
.home-sec__head .page__title { margin: 0 0 1.4rem; font-size: clamp(2rem, 4vw, 3.2rem); }
.home-sec__head .page__lede { margin: 0; max-width: none; }
.home-sec__body { padding-right: clamp(1.5rem, 5vw, 5rem); min-width: 0; }
.home-sec__body > :first-child,
.home-sec__body .texts-list,
.home-sec__body .page__section:first-of-type { margin-top: 0; }

@media (max-width: 760px) {
  .home-sec { grid-template-columns: 1fr; gap: 1.1rem 0; padding: clamp(2.5rem, 9vw, 4rem) 0; }
  .home-sec__head { padding-right: clamp(1.5rem, 5vw, 5rem); max-width: none; }
  .home-sec__body { padding-left: clamp(1.5rem, 5vw, 5rem); }
}

/* About page — two-column with portrait */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-grid__photo {
  margin: 0;
  background: var(--surface);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.about-grid__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.95);
}

.about-grid__photo figcaption {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.8rem;
  font-style: normal;
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Texts list — Tolentino-style numbered */
.texts-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  max-width: 44rem;
}

.texts-list__item + .texts-list__item {
  border-top: 1px solid var(--rule);
}

/* Title + year/type grouped tight on the left (not flung to opposite edges), quote below.
   Small bottom padding keeps the first-line quote close to the title. */
.texts-list__link {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  padding: 1.3rem 0 0.5rem;   /* no left inset → title lines up with the first-line quote below */
}

/* Hover: underline the title in the accent colour (no horizontal shift). */
.texts-list__link:hover .texts-list__title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.26em;
  text-decoration-thickness: 2px;
}

.texts-list__num {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.texts-list__title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.texts-list__meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Mobile: stack the list left-aligned — title, then meta, then the first-line quote,
   all flush left and tight (no numbering). */
@media (max-width: 640px) {
  .texts-list__link { padding: 1.1rem 0 0.4rem; gap: 0.2rem 0.7rem; }
  .texts-list__title { font-size: 1.35rem; }
  .texts-list__meta { white-space: normal; }
  .texts-list__first { padding-left: 0 !important; padding-right: 0 !important; text-align: left; }
}

/* Contacts list */
.contacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 36rem;
}

.contacts-list__item {
  display: grid;
  grid-template-columns: clamp(7rem, 28vw, 10rem) 1fr;
  align-items: baseline;
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
  gap: 0.4rem 1.5rem;
}

.contacts-list__item:last-child {
  border-bottom: 1px solid var(--rule);
}

.contacts-list__label {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.contacts-list__value {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.contacts-list__value:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* =========================================================
   Site footer
   ========================================================= */

.site-footer {
  padding: 2.5rem clamp(1.5rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.site-footer a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.site-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent-soft);
}

/* =========================================================
   STORY PAGE — long-form reading
   Sans for chrome, serif for body prose
   ========================================================= */

.story {
  background: var(--bg);
  color: var(--ink);
}

/* Reading progress — thin accent hairline at the very top, width grows with scroll */
.progress {
  position: fixed;
  top: 0;             /* desktop: flush to the very top edge (no island band there) */
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 10000;     /* ABOVE the safe-top cover (9999) so the gold line is visible on it */
  transition: width 0.1s linear;
}
/* Phones only: the inline safe-top script draws a 5px band over the Dynamic Island
   (§9, gated on min viewport dim ≤ 440 = portrait phone). Drop the line into the band's
   bottom 2px so it sits just below the island, not at the very screen edge. The 440px
   here mirrors that JS gate — it's not a layout breakpoint, don't "normalize" it. */
@media (max-width: 440px) {
  .progress { top: 3px; }
}

/* Hero */
.hero-story {
  position: relative;
  height: 90vh;
  height: 90svh; /* small-viewport height: stable against the iOS toolbar show/hide (no on-load jump) */
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  margin-bottom: 5rem;
}

.hero-story__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65) saturate(0.85) contrast(1.05);
  z-index: 1;
}

.hero-story__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 11, 7, 0.5) 0%,
    rgba(14, 11, 7, 0.35) 50%,
    rgba(14, 11, 7, 0.9) 100%
  );
  z-index: 2;
}

.hero-story__content {
  position: relative;
  z-index: 3;
  padding: 0 clamp(1.5rem, 5vw, 5rem) clamp(3rem, 6vw, 5rem);
  max-width: var(--measure-wide);
  margin: 0 auto;
  width: 100%;
}

.hero-story__kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 1.5rem;
  color: var(--accent);
}

.hero-story__title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.hero-story__meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.hero-story__meta::before {
  content: "\2014\00a0\00a0";
  opacity: 0.6;
}

/* Prose body */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 2rem);
}

.prose p {
  font-family: var(--serif);
  font-size: 1.13rem;
  line-height: 1.7;
  margin: 0 0 1.5rem;
  color: var(--prose-fg);
  font-weight: 400;
  font-feature-settings: "onum" 1;
}

.prose p.lead::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 4.6rem;
  line-height: 0.78;
  font-weight: 400;
  padding: 0.18rem 0.55rem 0 0;
  color: var(--accent);
  font-style: italic;
}

.prose em {
  font-style: italic;
  color: var(--ink);
}

/* Story figures */
.figure {
  margin: 4rem auto;
  max-width: var(--measure-wide);
  padding: 0 clamp(1.5rem, 5vw, 2rem);
}

.figure img {
  width: 100%;
  filter: saturate(0.9) brightness(0.95);
}

/* Cell room photograph */
.figure--cell {
  max-width: 36rem;
  margin: 4rem auto 4.5rem;
}

.figure__frame {
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.figure__frame img {
  width: 100%;
  height: auto;
  display: block;
  filter: sepia(0.45) saturate(0.7) brightness(0.85) contrast(1.05);
  transform-origin: center;
  animation: cell-breathe 18s ease-in-out infinite;
}

@keyframes cell-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}

.figure--cell .figure__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 220, 140, 0.14), transparent 65%),
    linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.3) 100%);
}

/* Wisdom quotes (Marcello) */
.wisdom {
  max-width: 34rem;
  margin: 4rem auto;
  padding: 0 2rem;
  text-align: center;
}

.wisdom__mark {
  width: 22px;
  height: 22px;
  margin: 0 auto 1.5rem;
  opacity: 0.55;
  color: var(--accent);
}

.wisdom__text {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.42;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}

.wisdom__attribution {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.5rem;
}

.wisdom__attribution::before {
  content: "\2014\00a0";
  opacity: 0.7;
}

/* Schedule */
.schedule {
  max-width: 28rem;
  margin: 3.5rem auto 4rem;
  padding: 2.5rem 2.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  position: relative;
}

.schedule::before,
.schedule::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--rule);
}
.schedule::before { top: -1.5rem; height: 1.5rem; }
.schedule::after  { bottom: -1.5rem; height: 1.5rem; }

.schedule__heading {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.5rem;
}

.schedule__list { list-style: none; margin: 0; padding: 0; }

.schedule__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
}

.schedule__time {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.schedule__dots {
  flex: 1;
  border-bottom: 1px dotted var(--rule);
  margin: 0 0.5rem;
  transform: translateY(-0.3rem);
}

.schedule__act { text-align: right; }

.schedule__footnote {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

/* Menu */
.menu {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 0 2rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
}

.menu__heading {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.menu__list { font-size: 1.08rem; line-height: 2; color: var(--ink-soft); }
.menu__list span { display: block; }
.menu__list span + span::before {
  content: "\00b7";
  display: block;
  color: var(--muted);
  margin: 0.3rem 0;
  font-size: 0.8rem;
}

/* Section break * * * */
.section-break {
  text-align: center;
  margin: 4rem auto 3.5rem;
  max-width: var(--measure);
  padding: 0 1.5rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 1.2em;
  text-indent: 1.2em;
  line-height: 1;
  user-select: none;
}

/* Whisper blocks */
.whisper {
  max-width: 34rem;
  margin: 3rem auto;
  padding: 2rem 1.5rem 1.6rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.whisper__text {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}

.whisper__attr {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.2rem;
}

.whisper__attr::before {
  content: "\2014\00a0";
  opacity: 0.7;
}

/* Serpent SVG */
.serpent {
  display: block;
  margin: 3rem auto;
  width: 280px;
  height: 60px;
  color: var(--accent-soft);
  opacity: 0.6;
}

.serpent svg { width: 100%; height: 100%; overflow: visible; }
.serpent path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  /* draw very slowly, left → right, as if the snake is gliding through */
  transition: stroke-dashoffset 6s var(--ease-soft);
}
.serpent.is-visible path { stroke-dashoffset: 0; }
/* the head only catches up once the body has been drawn */
.serpent circle { opacity: 0; transition: opacity 1s ease 5.2s; }
.serpent.is-visible circle { opacity: 1; }

/* Forest animals list */
.forest-list {
  margin: 2rem auto 3rem;
  padding: 1.5rem 2rem;
  max-width: 32rem;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.forest-list span {
  display: inline-block;
  margin: 0 0.3rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-soft), transform 0.45s var(--ease-soft),
              color 0.4s ease, text-shadow 0.4s ease;
}
.forest-list.is-visible span { opacity: 1; transform: translateY(0); }
/* reveal cadence — words are the odd children, separators the even */
.forest-list__a:nth-child(1) { transition-delay: 0.10s; }
.forest-list__s:nth-child(2) { transition-delay: 0.22s; }
.forest-list__a:nth-child(3) { transition-delay: 0.34s; }
.forest-list__s:nth-child(4) { transition-delay: 0.46s; }
.forest-list__a:nth-child(5) { transition-delay: 0.58s; }
.forest-list__s:nth-child(6) { transition-delay: 0.70s; }
.forest-list__a:nth-child(7) { transition-delay: 0.82s; }
.forest-list__s:nth-child(8) { transition-delay: 0.94s; }
.forest-list__a:nth-child(9) { transition-delay: 1.10s; }
/* the wolf is the ominous one — it settles in gold */
.forest-list__a--wolf { color: var(--accent); }
/* separators stay quiet and don't react to the pointer */
.forest-list__s { color: var(--muted); pointer-events: none; }

/* Mobile has NO hover, so the strip must stay alive on its own: once revealed,
   a slow, gentle ember-glow ripples from one animal to the next — like eyes
   catching firelight in the dark — staggered so they never pulse in unison. */
.forest-list.is-visible .forest-list__a {
  animation: forestEmber 7s var(--ease-soft) infinite;
}
.forest-list.is-visible .forest-list__a:nth-child(1) { animation-delay: 1.4s; }
.forest-list.is-visible .forest-list__a:nth-child(3) { animation-delay: 2.3s; }
.forest-list.is-visible .forest-list__a:nth-child(5) { animation-delay: 3.2s; }
.forest-list.is-visible .forest-list__a:nth-child(7) { animation-delay: 4.1s; }
.forest-list.is-visible .forest-list__a--wolf { animation-delay: 5.2s; }
@keyframes forestEmber {
  0%, 100% { color: var(--accent); text-shadow: none; transform: translateY(0); }
  50%      { color: #f4ecd8; text-shadow: 0 0 16px rgba(217, 184, 120, 0.45); transform: translateY(-3px); }
}
/* a tap (touch) lights one animal up brighter than the ambient ripple */
.forest-list.is-visible .forest-list__a:active {
  color: #fff; text-shadow: 0 0 24px rgba(217, 184, 120, 0.7);
  transform: translateY(-5px) scale(1.08);
}
@media (hover: hover) {
  .forest-list__a { cursor: default; }
  .forest-list.is-visible .forest-list__a:hover {
    color: #fff;
    transform: translateY(-4px) scale(1.06);
    text-shadow: 0 0 22px rgba(217, 184, 120, 0.6);
    animation-play-state: paused;   /* pointing at one freezes its glow under your cursor */
  }
}

/* Headlines fading */
.headlines {
  max-width: 36rem;
  margin: 3rem auto;
  padding: 0 1.5rem;
  font-family: var(--sans);
  text-align: center;
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 2;
}

.headlines span {
  display: block;
  opacity: 0.6;
  letter-spacing: 0.02em;
}

/* The world's noise receding as she disconnects — slow + meditative.
   ~1.2s between lines, ~5.2s for each to dissolve (sped up 1.25× from 1.5s/6.5s). */
.headlines.is-visible span { animation: fadeOut 5.2s var(--ease-soft) forwards; }
.headlines.is-visible span:nth-child(1) { animation-delay: 0.64s; }
.headlines.is-visible span:nth-child(2) { animation-delay: 1.84s; }
.headlines.is-visible span:nth-child(3) { animation-delay: 3.04s; }
.headlines.is-visible span:nth-child(4) { animation-delay: 4.24s; }
.headlines.is-visible span:nth-child(5) { animation-delay: 5.44s; }

@keyframes fadeOut {
  0%   { opacity: 0.6; }
  60%  { opacity: 0.15; }
  100% { opacity: 0.05; }
}

/* Gentle, unobtrusive replay — fades in only once all the lines have dissolved. */
.headlines__replay {
  display: block;
  margin: 1.8rem auto 0;
  padding: 0.45rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 1.4s var(--ease-soft), transform 1.4s var(--ease-soft), color 0.35s ease;
}
.headlines__replay.is-on { opacity: 0.45; transform: translateY(0); pointer-events: auto; }
.headlines__replay:hover { opacity: 0.9; color: var(--accent); }
.headlines__replay svg { display: block; }

/* Night section — already dark, just deepen */
.night-section {
  position: relative;
  padding: 6rem 0 8rem;
  margin-top: 4rem;
  background: #050402;
  color: #e8e2c8;
  overflow: hidden;
}

/* Soft fade at the very bottom so the black night dissolves into the footer's
   --bg (#0e0b07) instead of a hard seam. Sits above the starfield, below text. */
.night-section::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 160px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(14, 11, 7, 0) 0%, #0e0b07 100%);
}

/* (Moon glow removed — was a distracting bright circle over the warp starfield.) */
.night-section::before { display: none; }


.night-section .prose { padding-top: 8rem; position: relative; z-index: 2; }
.night-section .prose p { color: #e8e2c8; opacity: 0.92; }
.night-section .prose em { color: #c8c0a8; }

.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 3s var(--ease-soft);
}

.night-section.is-visible .stars { opacity: 1; }

.star {
  position: absolute;
  border-radius: 50%;
  background: #f4ecd8;                 /* warm white — size/glow set per-star in JS */
  animation: twinkle var(--tw, 5s) infinite ease-in-out;
  animation-delay: var(--td, 0s);
  will-change: opacity;
}
.star--warm { background: #ffe9c2; }   /* a few warmer */
.star--cool { background: #dfe7f2; }   /* a few cooler — subtle temperature variety */

/* Brightness-led twinkle + a subtle size pulse so each star visibly "breathes",
   not just dims. Each animates between its OWN --bmin/--bmax → organic shimmer. */
@keyframes twinkle {
  0%, 100% { opacity: var(--bmin, 0.3); transform: scale(0.78); }
  50%      { opacity: var(--bmax, 0.85); transform: scale(1.32); }
}

/* ===== Constellations — faint gold lines that find shapes among the bright
   stars, drawn slowly when the night arrives (echoes «тени в форме змей,
   птиц, кошек»). Jake-Archibald stroke-dashoffset reveal. ===== */
/* The wolf lives in its own in-flow block after the last text block (no overlap). */
.wolf-constellation {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 60vh;                 /* claim the dark band below the text… */
  display: flex;
  align-items: center;              /* …and centre the wolf vertically within it */
  justify-content: center;
}
.constellation {
  display: block;
  width: min(320px, 82%);
  aspect-ratio: 205 / 180;          /* derive height from width — Safari collapses height:auto on a viewBox-only SVG to 0 */
  height: auto;
  margin: 0 auto;
  overflow: visible;
  pointer-events: none;
}
.constellation polyline {
  fill: none;
  stroke: rgba(217, 184, 120, 0.32);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;        /* hairline stays crisp at any display size */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;                       /* pathLength=1 → one dash covers the whole line */
  stroke-dashoffset: 1;                      /* hidden until the night section is visible */
  transition: stroke-dashoffset 4.5s var(--ease-soft);   /* slow draw of the wolf */
}
.wolf-constellation.is-drawn .constellation polyline { stroke-dashoffset: 0; }

/* glowing node-stars at the wolf's joints — fade in as the line finishes drawing */
.constellation__node {
  fill: #f7eed6;
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft) 2.4s;   /* appear partway through the draw */
  filter: drop-shadow(0 0 3px rgba(247, 238, 214, 0.8));
}
.wolf-constellation.is-drawn .constellation__node { opacity: 0.92; }

/* =========================================================
   fx.js effect blocks — inserted from the editor as
   <div class="fx" data-fx="…"></div>, brought to life by name.
   ========================================================= */
.fx { position: relative; }
.fx[data-fx="starfield"] {
  background: #050402;
  min-height: 70vh;
  margin: 2rem 0;
  overflow: hidden;
}
/* Fade the starfield's top + bottom edges into the page bg so it blends in flow */
.fx[data-fx="starfield"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  pointer-events: none; z-index: 1;
  background: linear-gradient(to bottom, rgba(14,11,7,0), #0e0b07);
}

.fx[data-fx="wolf"] {
  display: flex; align-items: center; justify-content: center;
  min-height: 52vh; padding: 0 1.5rem;
}
.fx-constellation {
  display: block; width: min(320px, 82%);
  aspect-ratio: 205 / 180; height: auto; overflow: visible; pointer-events: none;
}
.fx-constellation polyline {
  fill: none; stroke: rgba(217, 184, 120, 0.32); stroke-width: 1.1;
  vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 4.5s var(--ease-soft);
}
.fx[data-fx="wolf"].is-drawn .fx-constellation polyline { stroke-dashoffset: 0; }
.fx-constellation__node {
  fill: #f7eed6; opacity: 0;
  transition: opacity 1.2s var(--ease-soft) 2.4s;
  filter: drop-shadow(0 0 3px rgba(247, 238, 214, 0.8));
}
.fx[data-fx="wolf"].is-drawn .fx-constellation__node { opacity: 0.92; }

@media (prefers-reduced-motion: reduce) {
  .fx[data-fx="wolf"].is-drawn .fx-constellation polyline { transition: none; }
}

.wolf-trace {
  position: relative;
  height: 120px;
  margin: 3rem auto 0;
  max-width: var(--measure);
  overflow: hidden;
}

.wolf-trace svg {
  position: absolute;
  bottom: 10px;
  left: -100px;
  width: 80px;
  height: 80px;
  color: #050402;
  opacity: 0;
  transition: opacity 1s, transform 3s var(--ease-soft);
}

.wolf-trace.is-visible svg {
  opacity: 0.9;
  transform: translateX(calc(100vw + 200px));
}

/* End mark */
.endmark {
  display: block;
  width: 100%;
  text-align: center;
  margin: 3.5rem auto 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: #e8e2c8;
  opacity: 0.55;
  letter-spacing: 0.05em;
  user-select: none;
}

/* Story footer */
.story-footer {
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  font-style: italic;
  font-family: var(--sans);
}

.story-footer p {
  max-width: var(--measure);
  margin: 0 auto 0.8rem;
}

/* «Другие тексты» cards at the end of a story */
.more { max-width: var(--measure); margin: 0 auto 2.4rem; text-align: left; }
.more__h { font-style: normal; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.more__list { list-style: none; padding: 0; margin: 0; }
.more__list li + li, .more__list li { border-top: 1px solid var(--rule); }
.more__list a { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 1rem 0.25rem; border: none; transition: padding 0.3s var(--ease-soft, ease); }
.more__list a:hover { padding-left: 0.6rem; }
.more__t { font-style: normal; font-family: var(--sans); font-weight: 600; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.01em; }
.more__list a:hover .more__t { color: var(--accent); }
.more__m { font-style: normal; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.story-footer__links { font-style: normal; letter-spacing: 0.04em; }

.story-footer a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.story-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Reveal on scroll */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft);
}
.fade-up.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up { opacity: 1; transform: none; }
  .serpent path { stroke-dashoffset: 0; }
  .figure--cell .figure__frame img { animation: none; }
}

/* =========================================================
   Share — sticky pill + popover (dark version)
   ========================================================= */

.share {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  font-family: var(--sans);
}

.share__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(28, 24, 16, 0.85);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s var(--ease-soft);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.share__btn:hover,
.share__btn[aria-expanded="true"] {
  background: rgba(40, 35, 23, 0.95);
  color: var(--ink);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.share__pop {
  position: absolute;
  bottom: calc(100% + 0.6rem);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 0.35rem 0;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s var(--ease-soft);
}

.share__pop.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.share__item {
  display: block;
  width: 100%;
  padding: 0.78rem 1.15rem;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.share__item:hover,
.share__item:focus-visible {
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
}

.share__item + .share__item { border-top: 1px solid var(--rule); }
.share__item.is-copied { color: var(--accent); font-style: italic; }

@media (max-width: 560px) {
  .share { bottom: 1rem; right: 1rem; }
  .share__btn { padding: 0.5rem 0.85rem; font-size: 0.66rem; }
  .share__pop { min-width: min(280px, calc(100vw - 2rem)); }
}

/* =========================================================
   One-page home — smooth scroll, sticky nav, section flow
   ========================================================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Nav stays reachable while scrolling the one-pager */
body.home .site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}

/* Hero leaves a peek of «Тексты» below the fold (desktop) */
@media (min-width: 801px) {
  body.home .hero {
    height: clamp(480px, 80svh, 760px);
    max-height: none;
  }
}

/* Anchored sections clear the sticky header */
.home-sec { scroll-margin-top: 4.5rem; }
.home-sec.page { padding-top: clamp(2.5rem, 5vw, 4rem); }
