/* PLANKA — interactive prototype layer on top of the narrative
   Floating chrome: progress bar, section nav, tweaks. */

/* =================================================================
   PINNED CHAPTERS  (gentlerain-style scroll-driven transitions)
   The narrative becomes a tight stack: each multi-stage section
   collapses into a single sticky frame; scroll progress (0..1) drives
   a horizontal carousel of stages. No empty scrolling.
   ================================================================= */

html { scroll-behavior: smooth; }

/* Soft chapter intro spacer — big editorial number + title before each pinned chapter */
/* Chapter wrap — sticky boundary for the intro */
.planka-chapter-wrap {
  position: relative;
}
.planka-chapter-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}

/* Chapter intro — large by default, morphs to pin-bar driven by --pin-t (0→1) */
.planka-chapter-intro {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 24vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-top: 1px solid var(--line);
  transition: background 200ms linear, border-color 200ms linear;
  pointer-events: none;
}
/* Bar background — opacity driven by JS via --pin-t */
.planka-chapter-intro::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(248, 251, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 12px rgba(30, 42, 56, 0.06);
  opacity: var(--pin-t, 0);
  pointer-events: none;
}
/* is-pinned: only background/border chrome — geometry handled by JS */
.planka-chapter-intro.is-pinned {
  background: transparent;
  border-color: transparent;
}

.planka-chapter-intro__inner {
  position: absolute;
  top: 0.6vw;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: auto;
  width: min(100%, 1200px);
  margin-inline: auto;
  padding: 0 clamp(20px, 4vw, 56px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  /* gap animated by JS */
}

.planka-chapter-intro__num {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(80px, 14vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--fg);
  font-weight: 300;
  font-feature-settings: "lnum";
  font-variant-numeric: lining-nums;
  opacity: 0.92;
  font-style: italic;
  /* font-size animated by JS */
}

.planka-chapter-intro__meta {
  display: grid;
  gap: 8px;
}
.planka-chapter-intro__kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  max-height: 24px;
  margin-top: 1rem;
  margin-bottom: -.5rem;
  /* max-height/opacity/margins animated by JS */
}
.planka-chapter-intro__title {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-weight: 500;
  text-wrap: balance;
  /* font-size animated by JS */
}
.planka-chapter-intro__rule {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin-top: 14px;
  overflow: hidden;
  max-height: 1px;
  /* max-height/opacity/margin animated by JS */
}

/* Hide the original sticky title chrome when chapter is pinned */
.planka-pinned .req-sticky,
.planka-pinned .section-sticky { display: none !important; }

/* All chaptered sections (single + pinned) get a global 
   appended to body — hide their inline section-sticky / req-sticky titles. */
#designing .section-sticky,
#gesture .section-sticky,
#principles .section-sticky,
#object .section-sticky,
#layers .section-sticky,
#growth .section-sticky,
#requirements .req-sticky { display: none !important; }

/* Mobile: compact end-values (read by JS as lerp targets) */
@media (max-width: 768px) {
  .planka-chapter-intro__num  { --pin-num-end:   22; }
  .planka-chapter-intro__title { --pin-title-end: 14; }
}

/* Pinned section becomes a tall scroll-track; inner is sticky */
.planka-pinned {
  position: relative;
  min-height: auto;
}
.planka-pinned__track {
  position: relative;
}
.planka-pinned__viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--bg);
}
.planka-pinned__inner {
  position: relative;
  width: min(100%, 1280px);
  height: 100%;
  padding: clamp(72px, 10vh, 120px) clamp(20px, 4vw, 56px) clamp(40px, 8vh, 96px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(12px, 2vh, 20px);
}

/* Single sections: same DOM structure, no scroll animation */
.planka-pinned--single .planka-pinned__viewport {
  position: static;
  height: auto;
  overflow: visible;
}
.planka-pinned--single .planka-pinned__inner {
  height: auto;
  grid-template-rows: auto auto auto;
}
.planka-pinned--single .planka-pinned__stages {
  position: static;
  height: auto;
}


/* Header inside pinned: chapter label + tiny progress dots */
.planka-pinned__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.planka-pinned__chapter {
  display: none; /* replaced by global  */
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.planka-pinned__dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.planka-pinned__dot {
  width: 28px;
  height: 2px;
  background: var(--line);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 220ms ease, transform 220ms ease;
}
.planka-pinned__dot.is-active {
  background: var(--fg);
  transform: scaleY(2.2);
}

/* Stages stack — only one is visible based on data-active */
.planka-pinned__stages {
  position: relative;
  width: 100%;
  height: 100%;
}
.planka-pinned .stage,
.planka-pinned .object-pair,
.planka-pinned .layer-stage {
  position: absolute !important;
  inset: 0;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: 1fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms cubic-bezier(.22,.7,.2,1), transform 700ms cubic-bezier(.22,.7,.2,1);
  pointer-events: none;
  will-change: opacity, transform;
}
.planka-pinned .stage.is-active,
.planka-pinned .object-pair.is-active,
.planka-pinned .layer-stage.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.planka-pinned .stage.is-leaving,
.planka-pinned .object-pair.is-leaving,
.planka-pinned .layer-stage.is-leaving {
  opacity: 0;
  transform: translateY(-28px);
}

/* Stage alternation in pinned */
.planka-pinned .stage.is-reverse .stage-media,
.planka-pinned .stage.is-reverse .gesture-visual { order: 2; }
.planka-pinned .stage.is-reverse .stage-copy,
.planka-pinned .stage.is-reverse .gesture-copy { order: 1; }
/* object-pair and layer-stage handled by #object/#layers ID rules */
.planka-pinned .object-pair.is-reverse .object-media,
.planka-pinned .object-pair.is-reverse .object-copy,
.planka-pinned .layer-stage.is-reverse .layer-media,
.planka-pinned .layer-stage.is-reverse .layer-copy { order: initial; }

.planka-pinned .stage-grid,
.planka-pinned .layer-stage-grid {
  display: contents !important;
}

/* Visual side */
.planka-pinned .stage-media,
.planka-pinned .object-media,
.planka-pinned .layer-media,
.planka-pinned .gesture-visual {
  margin: 0;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-height: min(72vh, 640px);
}
.planka-pinned .stage-media .media-image,
.planka-pinned .object-media .media-image,
.planka-pinned .layer-media .media-image,
.planka-pinned .gesture-visual .media-image {
  width: 100%;
  height: 100%;
  max-height: min(72vh, 640px);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 28, 38, 0.08);
  aspect-ratio: auto;
}

/* Copy side — editorial, restrained */
.planka-pinned .stage-copy,
.planka-pinned .object-copy,
.planka-pinned .layer-copy,
.planka-pinned .gesture-copy {
  display: grid;
  gap: 18px;
  align-content: center;
  max-width: 48ch;
}
.planka-pinned .stage-name,
.planka-pinned .layer-name {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-transform: none;
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}
.planka-pinned .stage-strong,
.planka-pinned .stage-but,
.planka-pinned .stage-need,
.planka-pinned .layer-note,
.planka-pinned .object-text,
.planka-pinned .gesture-copy p {
  margin: 0;
  font-size: clamp(15px, 1.18vw, 17px);
  line-height: 1.55;
  color: var(--fg);
  max-width: 46ch;
  text-wrap: pretty;
}
.planka-pinned .stage-strong span,
.planka-pinned .stage-but span,
.planka-pinned .stage-need span {
  display: inline-block;
  margin-right: 6px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.planka-pinned .stage-need {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.planka-pinned .stage-need strong {
  font-weight: 500;
  color: var(--fg);
}

/* Slide-point becomes a quiet footer line under the active stage */
.planka-pinned__foot {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 1.4vw, 20px);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  min-height: 32px;
}
.planka-pinned__foot-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: .55;
  white-space: nowrap;
  flex: 0 0 auto;
}
.planka-pinned__foot-text {
  font-family: ui-serif, Georgia, serif;
  font-size: clamp(15px, 1.4vw, 19px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  text-wrap: balance;
  flex: 1 1 0;
  min-width: 0;
}

/* Hide original slide-points inside pinned (we surface them in __foot) */
.planka-pinned .slide-point { display: none !important; }
.planka-pinned .stage-print-header,
.planka-pinned .stage-print-secondary { display: none !important; }
.planka-pinned .requirements-intro { display: none; }

/* Gesture-specific: keep before/after, but tighter */
.planka-pinned #gesture-stages .stage-title {
  display: none;
}
.planka-pinned #gesture-stages .gesture-visual { position: relative; }
.planka-pinned #gesture-stages .before-after {
  width: 100%;
  height: min(50vh, 640px);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 28, 38, 0.08);
  overflow: hidden;
}
.planka-pinned #gesture-stages .before-after__image--base,
.planka-pinned #gesture-stages .before-after__image--after {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.planka-pinned #gesture-stages .before-after__overlay {
  inset: 0;
}
#gesture.planka-pinned .gesture-reaction--overlay { right: 16px; bottom: 16px; }
#gesture.planka-pinned .media-row { display: contents; }
#gesture.planka-pinned .alt.only-print { display: none !important; }
#gesture.planka-pinned .stage { display: grid !important; }

/* Principles — keep but reflow as a quieter editorial column */
#principles {
  background: var(--bg);
}
#principles .section-sticky {
  position: static;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0 0 clamp(24px, 4vh, 48px);
  min-height: 0;
}
#principles .title {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-transform: none;
  color: var(--fg);
  margin: 0;
}
#principles .principles {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  margin-top: clamp(32px, 5vh, 64px);
}
#principles .pill {
  grid-column: span 12;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: clamp(20px, 3.2vh, 32px) 0 !important;
  padding-left: clamp(56px, 8vw, 120px) !important;
  display: grid !important;
  grid-template-columns: minmax(40px, 80px) 1fr;
  gap: clamp(18px, 3vw, 36px);
  align-items: baseline;
  font-size: clamp(18px, 1.7vw, 24px) !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: var(--fg) !important;
  position: relative;
  min-height: 0 !important;
  counter-increment: principle;
}
#principles .pill::before {
  content: counter(principle, decimal-leading-zero);
  position: static !important;
  width: auto !important; height: auto !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
  font-size: clamp(14px, 1.1vw, 17px);
  color: var(--muted);
  letter-spacing: 0.04em;
  align-self: baseline;
}
#principles .principles { counter-reset: principle; }
#principles .pill--caps {
  display: block !important;
  padding-left: clamp(56px, 8vw, 120px) !important;
}
#principles .pill--caps::before {
  position: absolute !important;
  left: clamp(20px, 4vw, 56px);
  top: 50%;
  transform: translateY(-50%);
}
#principles .pill--caps .pill__caps {
  display: inline !important;
  font-style: inherit;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: inherit;
}
/* Word field — tighter, restrained */
#growth { background: var(--bg); }
#growth .section-sticky {
  position: static;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0 0 clamp(24px, 4vh, 48px);
  min-height: 0;
}
#growth .title {
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-transform: none;
}
#growth .word-field {
  min-height: 70vh;
}

/* Final A — quieter, editorial */
#final-a .lead {
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
#final-a .final-message {
  font-family: ui-serif, Georgia, serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* Scroll progress per pinned section — leave room on left for the global counter chip */
.planka-pinned__progress {
  position: absolute;
  bottom: clamp(20px, 4vh, 40px);
  left: clamp(96px, 12vw, 160px);
  right: clamp(20px, 4vw, 56px);
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.planka-pinned__progress-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.planka-pinned__progress-fill {
  position: absolute;
  inset: 0;
  width: var(--p, 0%);
  background: var(--fg);
  transition: width 120ms linear;
}
.planka-pinned__progress-text {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Mobile: ditch pinning, go back to a clean stack */
@media (max-width: 900px) {
  .planka-pinned__viewport {
    position: relative;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .planka-pinned__track { height: auto !important; }
  .planka-pinned .stage,
  .planka-pinned .object-pair,
  .planka-pinned .layer-stage {
    position: relative !important;
    inset: auto !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    padding: 32px 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .planka-pinned__stages {
    height: auto;
    display: grid;
    gap: 24px;
  }
  .planka-pinned__inner {
    padding: 60px 20px;
    grid-template-rows: auto auto auto;
  }
  .planka-pinned__progress { display: none; }
  .planka-pinned__head .planka-pinned__dots { display: none; }
  .planka-pinned .stage-name,
  .planka-pinned .layer-name { font-size: clamp(28px, 7vw, 40px); }
  /* Mobile: always show image first, text second — reset is-reverse order swap */
  .planka-pinned .stage.is-reverse .stage-media,
  .planka-pinned .stage.is-reverse .gesture-visual { order: 0 !important; }
  .planka-pinned .stage.is-reverse .stage-copy,
  .planka-pinned .stage.is-reverse .gesture-copy  { order: 0 !important; }
  .planka-chapter-intro {
    height: 120px; /* explicit so JS lerp to 52px works correctly (avoids padding-box confusion) */
    padding: 0;
  }
  .planka-chapter-intro__inner {
    /*grid-template-columns: 1fr;*/
    gap: 12px;
  }
  .planka-chapter-intro__num {
    font-size: clamp(64px, 12vw, 120px);
    min-width: 5rem;
  }
  /* Gesture section on mobile: force single-column stack, prevent image overflow */
  #gesture.planka-pinned .media-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  #gesture.planka-pinned .gesture-visual,
  #gesture.planka-pinned .gesture-visual .media-image {
    max-width: 100%;
    width: 100%;
  }
}

/* Reading progress bar */
.planka-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 90;
  pointer-events: none;
}
.planka-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--planka-accent, #2f8d68);
  transition: width 80ms linear;
  box-shadow: 0 0 12px rgba(47, 141, 104, 0.35);
}

/* Section nav — slim vertical rail on the right edge.
   Just dots; labels slide out from each dot on hover. */
.planka-nav {
  position: fixed;
  top: 50%;
  right: clamp(10px, 1.6vw, 20px);
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  padding: 4px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.planka-nav::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--line, #d4deea);
  opacity: 0.6;
  pointer-events: none;
}
.planka-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  border: 0;
  padding: 6px;
  margin: -6px 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.planka-nav__dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b6c2d2;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1), background 200ms;
  flex-shrink: 0;
  z-index: 1;
}
/* Hero: все точки белые */
.planka-nav.is-light .planka-nav__dot { background: rgba(255, 255, 255, 0.7); }
.planka-nav.is-light::before { background: rgba(255, 255, 255, 0.45); }
/* Hover */
.planka-nav__item:hover .planka-nav__dot { background: var(--fg, #1f2b37); transform: scale(1.4); }
.planka-nav.is-light .planka-nav__item:hover .planka-nav__dot { background: rgba(255, 255, 255, 1); }
/* Активная точка: чёрная везде */
.planka-nav__item.is-active .planka-nav__dot {
  background: var(--fg, #1f2b37);
  transform: scale(1.6);
}
/* Герой: активная тоже чёрная (контраст на фото) */
.planka-nav.is-light .planka-nav__item.is-active .planka-nav__dot { background: #1f2b37; }
/* Последний экран: активная светлая (тёмный фон) */
.planka-nav.is-final .planka-nav__item.is-active .planka-nav__dot { background: rgba(255, 255, 255, 0.9); }

/* Label: slides out leftward from the dot on hover */
.planka-nav__label {
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translate(8px, -50%);
  padding: 5px 10px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: #1f2b37;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line, #d4deea);
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(.2,.7,.2,1), transform 220ms cubic-bezier(.2,.7,.2,1);
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px rgba(30, 42, 56, 0.08);
}
.planka-nav.is-dark .planka-nav__label {
  color: #e7ecf4;
  background: rgba(11, 21, 34, 0.78);
  border-color: rgba(159, 174, 195, 0.24);
}
.planka-nav__item:hover .planka-nav__label,
.planka-nav__item:focus-visible .planka-nav__label {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Floating section counter chip — bottom-left, opposite the pinned sub-progress bar */
.planka-counter-chip {
  position: fixed;
  bottom: clamp(16px, 3.2vh, 28px);
  left: clamp(14px, 2.2vw, 26px);
  z-index: 50;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(248, 251, 255, 0.85);
  border: 1px solid rgba(212, 222, 234, 0.7);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(30, 42, 56, 0.08);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-variant-numeric: lining-nums tabular-nums;
  pointer-events: none;
}
.planka-counter-chip.is-dark {
  background: rgba(11, 21, 34, 0.62);
  border-color: rgba(159, 174, 195, 0.22);
}
.planka-counter-chip__num {
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--fg, #1f2b37);
}
.planka-counter-chip__sep {
  font-size: 13px;
  color: var(--muted, #6b7a8c);
  margin: 0 1px;
}
.planka-counter-chip__total {
  font-size: 12px;
  color: var(--muted, #6b7a8c);
  letter-spacing: 0.02em;
}
.planka-counter-chip.is-dark .planka-counter-chip__num { color: #e7ecf4; }
.planka-counter-chip.is-dark .planka-counter-chip__sep,
.planka-counter-chip.is-dark .planka-counter-chip__total { color: #afbccd; }

/* Hero CTA chip */
.planka-hero-cta {
  position: absolute;
  bottom: clamp(28px, 1.5vh, 56px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(31, 42, 51, 0.88);
  color: #f4f8fc;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  box-shadow: 0 12px 28px rgba(31, 42, 51, 0.18);
  animation: plankaCtaBob 3.6s cubic-bezier(.2,.7,.2,1) infinite;
}
.planka-hero-cta:hover {
  background: var(--planka-accent, #2f8d68);
}
.planka-hero-cta__arrow {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
}
.planka-hero-cta__arrow::before,
.planka-hero-cta__arrow::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.planka-hero-cta__arrow::before {
  left: 50%;
  top: 0;
  bottom: 4px;
  width: 1.5px;
  transform: translateX(-50%);
}
.planka-hero-cta__arrow::after {
  bottom: 2px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  background: transparent;
  transform: translate(-50%, 0) rotate(45deg);
}
@keyframes plankaCtaBob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* Tone variants — applied to <html data-planka-tone="..."> */
html[data-planka-tone="warm"] {
  --bg: #faf6f1;
  --bg-2: #f1e9df;
  --fg: #2a2419;
  --muted: #786958;
  --line: #e3d8c8;
}
html[data-planka-tone="warm"] .section { --section-bg: linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%); }
html[data-planka-tone="warm"] #intro.planka-hero,
html[data-planka-tone="warm"] #intro.planka-hero .planka-hero__bg::before {
  /* keep hero white-fade clean */
}

html[data-planka-tone="neutral"] {
  --bg: #f5f5f3;
  --bg-2: #ececea;
  --fg: #1d1d1b;
  --muted: #6a6a66;
  --line: #d8d8d4;
}
html[data-planka-tone="neutral"] .section { --section-bg: linear-gradient(180deg, #f8f8f6 0%, var(--bg) 100%); }

html[data-planka-tone="mono"] {
  --bg: #ffffff;
  --bg-2: #f3f3f3;
  --fg: #0d0d0d;
  --muted: #6b6b6b;
  --line: #e0e0e0;
}
html[data-planka-tone="mono"] .section { --section-bg: #ffffff; }

/* Font stack variants */
html[data-planka-fonts="serif"] body,
html[data-planka-fonts="serif"] .planka-hero__title,
html[data-planka-fonts="serif"] .planka-hero__subtitle,
html[data-planka-fonts="serif"] #intro.planka-hero .planka-hero__title,
html[data-planka-fonts="serif"] #intro.planka-hero .planka-hero__subtitle {
  font-family: ui-serif, Georgia, "New York", "Times New Roman", serif !important;
}
html[data-planka-fonts="mono"] body {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
}
html[data-planka-fonts="mono"] .planka-hero__title,
html[data-planka-fonts="mono"] #intro.planka-hero .planka-hero__title {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace !important;
  letter-spacing: 0 !important;
}

/* Title weight + tracking knobs apply via CSS vars */
html { --planka-title-weight: 800; --planka-title-tracking: 0.02em; }


/* Hide chrome when tweaks request it */
html[data-planka-hide-nav="1"] .planka-nav,
html[data-planka-hide-progress="1"] .planka-progress,
html[data-planka-hide-chapter="1"] .planka-counter-chip { display: none !important; }

@media (max-width: 768px) {
  .planka-nav { display: none; }
  .planka-counter-chip {
    bottom: 10px;
    left: 10px;
    padding: 6px 12px;
  }
  .planka-chapter-intro__title {
    font-size: clamp(18px, 3.4vw, 56px);
  }
}

@media print {
  .planka-progress, .planka-nav, .planka-counter-chip, .planka-hero-cta { display: none !important; }
}
    padding: 6px 12px 6px 8px;
  }
  .planka-chapter__title { font-size: 11px; }
  .planka-chapter__counter { display: none; }
}

@media print {
  .planka-progress, .planka-nav, .planka-counter-chip, .planka-hero-cta { display: none !important; }
}

/* =================================================================
   HERO VIDEO + TITLE — единый источник истины для первого экрана
   ================================================================= */


#intro.planka-hero .planka-hero__title {
  font-size: clamp(34px, 4vw + 1vh, 82px) !important;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-weight: var(--planka-title-weight) !important;
  letter-spacing: var(--planka-title-tracking) !important;
  line-height: .96 !important;
}

#intro.planka-hero .planka-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: 0;
  opacity: 0;
  transition: opacity 600ms ease;
}
#intro.planka-hero .planka-hero__video.is-ready {
  opacity: 1;
}

@media (max-width: 768px) and (orientation: portrait) {
  #intro.planka-hero .planka-hero__video {
    object-position: 70% top;
  }
}
