/* ============================================================
   site.css — глобальні стилі сайту humandesign.com.ua.
   Джерело правди по вигляду: static/landing-v5.html (перенесено
   клас-в-клас), поведінкові стилі потоку і мультикарт —
   static/hero-chart-flow.html. Tailwind сюди не мігруємо.
   ============================================================ */

:root {
  --paper: #f4f1e8;
  --paper-deep: #ece7d9;
  --ink: #24211b;
  --muted: #7c7365;
  --line: #e3dccb;
  --red: #be3d2a;
  --red-deep: #8e2f1f;
  --amber: #e3b34c;
  --amber-soft: #f2e3be;
  --sage: #6fa377;
  --white: #fffdf8;
  --night: #221e18;
  --night-deep: #1b1813;
  --chalk: #efe9dc;
  --chalk-dim: #b9ac93;
  --line-dark: #3a332b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Golos Text", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--amber-soft);
}
.serif {
  font-family: "Cormorant Garamond", Georgia, serif;
}
.mono {
  font-family: "IBM Plex Mono", monospace;
}
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

/* ---------- header ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark {
  width: 26px;
  height: 26px;
  flex: none;
}
.logo-text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}
.logo-text b {
  font-weight: 500;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 6px 2px;
  cursor: pointer;
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}
/* «Мої карти (N)» — і в рядку, і в мобільному меню (.js-mycharts):
   невидимі, поки скрипт не підтвердить, що є збережені карти */
.js-mycharts {
  display: none;
  color: var(--ink);
}
#nav-mycharts.show {
  display: inline;
}
.js-mycharts .cnt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--red);
}
.nav-cta {
  background: var(--ink);
  color: var(--white) !important;
  padding: 10px 18px;
  border-radius: 7px;
  font-size: 14px;
  white-space: nowrap;
}
.nav-cta:hover {
  background: #3a332b;
}

/* бургер (видимий лише на мобільному) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 40px;
  padding: 0 11px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.nav-burger.on span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-burger.on span:nth-child(2) {
  opacity: 0;
}
.nav-burger.on span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav-burger:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* мобільне меню під хедером */
.mobile-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  z-index: 49;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 6px 24px 14px;
  box-shadow: 0 14px 28px rgba(36, 33, 27, 0.09);
}
.mobile-menu a {
  display: block;
  padding: 13px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child {
  border-bottom: none;
}
.mobile-menu .js-mycharts.show {
  display: block;
}

@media (max-width: 860px) {
  /* у рядку лишаються лого + CTA + бургер; решта — в мобільному меню */
  .nav-links a:not(.nav-cta) {
    display: none;
  }
  #nav-mycharts.show {
    display: none; /* на мобільному «Мої карти» живуть у меню бургера */
  }
  .nav-links {
    gap: 10px;
  }
  .nav-cta {
    padding: 9px 14px;
    font-size: 13px;
  }
  .nav-burger {
    display: flex;
  }
  .mobile-menu.on {
    display: block;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 96px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 720px 520px at 76% 32%,
      rgba(227, 179, 76, 0.15),
      transparent 64%
    ),
    radial-gradient(
    ellipse 520px 420px at 8% 96%,
    rgba(111, 163, 119, 0.08),
    transparent 60%
  );
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero {
    padding: 52px 0 68px;
  }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--red);
}
h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(40px, 5.6vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.018em;
  margin-bottom: 22px;
}
h1 .accent {
  font-style: italic;
  color: var(--red);
}
.hero-sub {
  font-size: 17.5px;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 34px;
}
.hero-sub b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- калькулятор (спільні стилі форми: hero і панель) ---------- */
.calc {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 26px 22px;
  max-width: 480px;
  box-shadow: 0 2px 8px rgba(36, 33, 27, 0.04);
  transition: opacity 0.3s;
}
.calc-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.jpl {
  position: relative;
}
.jpl-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--red);
  letter-spacing: 0.04em;
  background: none;
  border: none;
  cursor: help;
  padding: 2px 0;
  border-bottom: 1px dotted var(--red);
}
.jpl-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}
.jpl-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(340px, 80vw);
  z-index: 20;
  background: var(--ink);
  color: #efe9dc;
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 8px 26px rgba(36, 33, 27, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    visibility 0.2s;
}
.jpl-pop::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 26px;
  width: 12px;
  height: 12px;
  background: var(--ink);
  transform: rotate(45deg);
}
.jpl-pop .src {
  display: block;
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: #b9ac93;
}
.jpl:hover .jpl-pop, .jpl:focus-within .jpl-pop, .jpl.open .jpl-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.calc-field.full {
  grid-column: 1/-1;
}
.calc-field label {
  font-size: 13px;
  font-weight: 500;
}
.calc-field input {
  font-family: "Golos Text", sans-serif;
  font-size: 15px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
.calc-field input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--white);
}
.calc-btn {
  width: 100%;
  margin-top: 6px;
  background: var(--ink);
  color: var(--white);
  font-family: "Golos Text", sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  padding: 15px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  min-height: 48px;
}
.calc-btn:hover {
  background: #3a332b;
}
.calc-btn:active {
  transform: scale(0.985);
}
.calc-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.calc-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 520px) {
  .calc-row {
    grid-template-columns: 1fr;
  }
}

/* автопідказки місця + валідація (еталон: /calculator) */
.calc-err {
  font-size: 12.5px;
  color: var(--red);
}
.calc-ok {
  font-size: 12.5px;
  color: #5a7a4a;
}
.calc-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(36, 33, 27, 0.10);
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.calc-suggest li {
  padding: 9px 11px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
}
.calc-suggest li.active {
  background: var(--amber-soft);
}

/* ритуал розрахунку */
.computing input {
  opacity: 0.45;
  pointer-events: none;
}
.computing .calc-btn {
  background: #3a332b;
  pointer-events: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}
.hero.computing .graph-holder {
  animation: breathe 1.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.graph-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (min-width: 921px) {
  .hero .graph-holder {
    transform: translateY(-22px);
  }
}
#hero-bodygraph {
  width: min(100%, 430px);
}
#hero-bodygraph svg {
  width: 100%;
  height: auto;
  display: block;
}
.graph-caption {
  margin-top: 16px;
  display: flex;
  gap: 22px;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: -1px;
}
.dot.red {
  background: var(--red);
}
.dot.black {
  background: var(--ink);
}
.dot.gold {
  background: var(--amber);
}

/* демо-граф hero (рендерить static/scripts/hero-graph.js) */
.bgc-center {
  stroke: #5a5348;
  stroke-width: 2;
  fill: var(--white);
  opacity: 0;
  animation: bgcIn 0.7s var(--ease) forwards;
}
.bgc-center.defined {
  stroke: none;
}
.bgc-pipe-border {
  stroke: #c6bda9;
  fill: none;
  stroke-linecap: round;
}
.bgc-pipe-base {
  stroke: var(--white);
  fill: none;
  stroke-linecap: round;
}
.bgc-fill {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: bgcDraw 1s var(--ease) forwards;
}
.bgc-fill.design {
  stroke: var(--red);
}
.bgc-fill.personality {
  stroke: var(--ink);
}
.bgc-fill.both {
  stroke: url(#bgc-zebra);
}
.bgc-gate circle {
  opacity: 0;
  transition: opacity 0.3s;
}
.bgc-gate.on circle {
  opacity: 1;
}
.bgc-gate text {
  font-family: "Golos Text", sans-serif;
  font-size: 12px;
  fill: #6f675a;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.bgc-gate.on text {
  fill: #fffdf8;
  font-weight: 700;
}
g.cw-defined .bgc-gate:not(.on) text {
  fill: rgba(255, 252, 245, 0.8);
}
@keyframes bgcDraw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes bgcIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* промальовування карти hd-chart на /chart:
   island ChartView ставить pathLength=1 на .hdc-fill і клас .chart-draw
   на обгортку — публічний API бібліотеки не змінюється.
   Швидше, ніж на головній (там демо-краса, тут — результат):
   порядок появи — сонце→плутон, спершу дизайн, потім особистість
   (затримки виставляє ChartView за колонками планет). */
.chart-draw .hdc-fill {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: bgcDraw 0.45s var(--ease) forwards;
}
.chart-draw .hdc-cwrap {
  opacity: 0;
  animation: bgcIn 0.35s var(--ease) forwards;
}

/* ---------- strip ---------- */
.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 22px 0;
}
.strip-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.strip-item {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.strip-item b {
  font-family: "Cormorant Garamond", serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 700px) {
  .strip-inner {
    justify-content: flex-start;
    column-gap: 32px;
    row-gap: 10px;
  }
}

/* ---------- sections ---------- */
section {
  padding: 96px 0;
}
@media (max-width: 700px) {
  section {
    padding: 64px 0;
  }
}
.sec-head {
  max-width: 680px;
  margin-bottom: 54px;
}
.sec-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  display: block;
}
h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(32px, 3.9vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin-bottom: 16px;
}
.sec-head p {
  color: var(--muted);
  font-size: 16.5px;
}

/* ---------- лекторій: серії ---------- */
.series {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}
.series:last-of-type {
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) {
  .series {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 0;
  }
}
.series-meta .s-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}
.series-meta h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 10px;
}
.series-meta p {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 34ch;
}
.series-meta .count {
  display: inline-block;
  margin-top: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 12px;
  background: var(--white);
}
.ep-list {
  display: flex;
  flex-direction: column;
}
.ep {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.ep:hover {
  background: rgba(255, 253, 248, 0.85);
}
.ep .n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}
.ep .t {
  font-size: 15px;
  font-weight: 500;
}
.ep .t small {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.ep .st {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.ep .st.live {
  color: var(--red);
}
.ep-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
}
@media (max-width: 700px) {
  .ep-cols {
    grid-template-columns: 1fr;
  }
}
.series.author .series-meta h3 {
  color: var(--red-deep);
}
.series.author .series-meta::before {
  content: "авторська позиція";
  display: inline-block;
  margin-bottom: 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  padding: 4px 10px;
  border-radius: 4px;
}
.series.author .series-meta .s-num {
  display: none;
}

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 820px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
.step {
  border-top: 2px solid var(--ink);
  padding-top: 22px;
}
.step .mono {
  font-size: 11.5px;
  color: var(--red);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 12px;
}
.step h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.step p {
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- події ---------- */
.events {
  border-top: 1px solid var(--line);
}
.ev-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ev-chip {
  font-family: "Golos Text", sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}
.ev-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.ev-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.ev-chip:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.ev-legend {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ev-legend .lvl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ev-legend .lvl::after {
  content: "→";
  color: var(--line);
}
.ev-legend .lvl:last-child::after {
  content: "";
}
.ev-featured {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 700px) {
  .ev-featured {
    grid-template-columns: 1fr;
  }
}
.ev-featured .lvl-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 8px;
}
.ev-featured h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ev-featured p {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 52ch;
}
.ev-featured .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 99px;
  padding: 6px 14px;
  white-space: nowrap;
}
.ev-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 14px 18px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  margin-bottom: 8px;
  background: rgba(255, 253, 248, 0.5);
  font-size: 14px;
}
.ev-row .lvl-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.ev-row .what {
  font-weight: 500;
  color: var(--muted);
}
.ev-row .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.ev-row.hide, .ev-featured.hide {
  display: none;
}
@media (max-width: 640px) {
  .ev-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.events-cta {
  margin-top: 24px;
  font-size: 14.5px;
  color: var(--muted);
}
.events-cta a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
}
.events-cta a:hover {
  border-color: var(--red);
}

/* ---------- API ---------- */
.api {
  padding-top: 0;
}
.api-panel {
  background: var(--ink);
  color: #efe9dc;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  padding: 56px 52px;
  align-items: center;
}
@media (max-width: 860px) {
  .api-panel {
    grid-template-columns: 1fr;
    padding: 40px 28px;
  }
}
.api-panel h2 {
  color: #fbf8f0;
  margin-bottom: 14px;
}
.api-panel p {
  font-size: 15.5px;
  color: #c9c0ae;
  max-width: 46ch;
}
.api-panel p + p {
  margin-top: 10px;
}
.api-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(227, 179, 76, 0.4);
  border-radius: 99px;
  padding: 5px 12px;
  margin-bottom: 20px;
}
.api-code {
  background: #1b1813;
  border: 1px solid #3a332b;
  border-radius: 10px;
  padding: 24px 26px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #d8cdb8;
  overflow-x: auto;
}
.api-code .c-method {
  color: var(--amber);
}
.api-code .c-path {
  color: #fbf8f0;
}
.api-code .c-key {
  color: #9fb8a4;
}
.api-code .c-val {
  color: #e0a090;
}
.api-code .c-dim {
  color: #7c7365;
}

/* ---------- джерела ---------- */
.sources {
  border-top: 1px solid var(--line);
}
.source-list {
  border-top: 1px solid var(--line);
}
.source-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.source-row:hover {
  background: rgba(255, 253, 248, 0.7);
}
.source-row .name {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 600;
}
.source-row .desc {
  font-size: 14.5px;
  color: var(--muted);
}
.source-row .arr {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .source-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .source-row .arr {
    display: none;
  }
}

/* ---------- про гіда: нічний ---------- */
.about {
  background: linear-gradient(var(--night), var(--night-deep));
  color: var(--chalk);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
.about h2 {
  color: #f4f2ea;
}
.about .sec-eyebrow {
  color: var(--chalk-dim);
}
.about-facts {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-dark);
}
.fact {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line-dark);
}
.fact .k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--chalk-dim);
  letter-spacing: 0.04em;
}
.fact .v {
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  color: var(--chalk);
}
.about-text p {
  color: var(--chalk);
  font-size: 16px;
  margin-bottom: 16px;
  max-width: 58ch;
}
.about-text p.dim {
  color: var(--chalk-dim);
  font-size: 15px;
}

footer.site {
  padding: 40px 0 48px;
  background: var(--night-deep);
  color: var(--chalk-dim);
  border-top: 1px solid var(--line-dark);
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13.5px;
}
.foot a {
  color: var(--chalk-dim);
  text-decoration: none;
}
.foot a:hover {
  color: var(--chalk);
}
.foot .mono {
  font-size: 12px;
}

/* появу секцій вмикає static/scripts/landing.js (додає html.js);
   без JS увесь контент видимий одразу */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Сторінка /chart (джерело поведінки: hero-chart-flow.html)
   ============================================================ */
.result {
  padding: 44px 0 80px;
  position: relative;
}
.result-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back-link::before {
  content: "←";
  transition: transform 0.2s;
}
.back-link:hover::before {
  transform: translateX(-3px);
}
.result h1 {
  font-size: clamp(30px, 3.6vw, 42px);
  margin-bottom: 6px;
}
.result-params {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 22px;
}
.result .graph-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 18px 0 10px;
}
.chart-holder {
  max-width: 700px;
  margin: 0 auto;
}
/* до монтування карти island-ом резервуємо її приблизну висоту —
   контент нижче (розшифровка) не стрибає вгору-вниз */
.chart-mount:empty {
  aspect-ratio: 6 / 7;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.4);
}

/* бодіграф не виділяється при тапі/довгому натисканні (мобільні) */
.chart-mount,
#hero-bodygraph {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* мобільний вʼюпорт: граф більший, колонки планет вужчі */
@media (max-width: 640px) {
  .result .wrap {
    padding: 0 12px;
  }
  .chart-holder .hdc-cols {
    gap: 2px;
  }
  .chart-holder .hdc-panel {
    width: 42px;
    font-size: 10px;
    line-height: 1.8;
  }
  .chart-holder .hdc-panel-title {
    font-size: 8.5px;
    letter-spacing: 0.03em;
  }
  .chart-holder .hdc-glyph {
    width: 9px;
    font-size: 9px;
  }
}

/* помилка розрахунку */
.chart-error {
  max-width: 560px;
  margin: 60px auto;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 40px 28px;
  background: rgba(255, 253, 248, 0.6);
}
.chart-error h1 {
  font-size: clamp(26px, 3vw, 34px);
  margin-bottom: 12px;
}
.chart-error p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}
.chart-error .calc-btn {
  max-width: 280px;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  width: auto;
  padding: 13px 26px;
}

/* ---------- поличка карт ---------- */
.shelf {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  position: relative;
}
.shelf.hidden {
  display: none;
}
.shelf-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s;
  user-select: none;
}
.chip:hover {
  border-color: var(--ink);
}
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.chip .menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 99px;
  opacity: 0.55;
}
.chip .menu-btn:hover {
  opacity: 1;
}
.chip-add {
  padding: 7px 14px;
  border-style: dashed;
  color: var(--muted);
  font-weight: 500;
}
.chip-add:hover {
  color: var(--ink);
}
.chip-all {
  padding: 7px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

/* меню чіпса */
.chip-menu {
  position: fixed;
  z-index: 30;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(36, 33, 27, 0.14);
}
.chip-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: "Golos Text", sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.chip-menu button:hover {
  background: var(--paper);
}
.chip-menu button.danger {
  color: var(--red);
}

/* випадайка «Усі карти» */
.all-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  width: min(320px, 90vw);
  box-shadow: 0 10px 30px rgba(36, 33, 27, 0.16);
}
.all-panel input {
  width: 100%;
  font-family: "Golos Text", sans-serif;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  margin-bottom: 8px;
}
.all-panel input:focus {
  outline: none;
  border-color: var(--ink);
}
.all-list {
  max-height: 240px;
  overflow-y: auto;
}
.all-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: "Golos Text", sans-serif;
  font-size: 14px;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.all-list button:hover {
  background: var(--paper);
}
.all-list button .d {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

/* рядок збереження */
/* поле імені В ПОЗИЦІЇ ЗАГОЛОВКА: карта без імені сама просить його */
.save-title {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.save-title input {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.1;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--muted);
  outline: none;
  padding: 0 2px 4px;
  flex: 1;
  min-width: 240px;
  max-width: 460px;
}
.save-title input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
.save-title input:focus {
  border-bottom-color: var(--ink);
}
.save-btn {
  font-family: "Golos Text", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.save-btn:hover {
  background: var(--ink);
  color: var(--white);
}
/* inline-перейменування прямо в чіпі (без prompt) */
.chip input.nm-edit {
  font-family: "Golos Text", sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: inherit;
  background: transparent;
  border: none;
  border-bottom: 1px dashed currentColor;
  outline: none;
  padding: 0;
  min-width: 6ch;
  max-width: 18ch;
}

/* ---------- панель «+ нова карта» ---------- */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 33, 27, 0.35);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
}
.panel-backdrop.on {
  opacity: 1;
  visibility: visible;
}
/* панель виїжджає ЛІВОРУЧ — там само, де форма в hero при першому візиті */
.panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(440px, 94vw);
  z-index: 61;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 28px 26px;
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 0.3s var(--ease);
}
.panel.on {
  transform: none;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.panel-head h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
}
.panel-close {
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  width: 36px;
  height: 36px;
  font-size: 17px;
  cursor: pointer;
  color: var(--muted);
  transition: 0.2s;
}
.panel-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.panel .calc {
  max-width: none;
  box-shadow: none;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 10px);
  z-index: 90;
  background: var(--ink);
  color: #fbf8f0;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
}
.toast.on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ============================================================
   Розшифровка карти на /chart (серверний компонент ChartReading)
   ============================================================ */
.reading {
  max-width: 860px;
  margin: 72px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 52px;
}
.reading h2 {
  margin-bottom: 12px;
}
.reading-lead {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 36px;
}
.reading-lead b {
  color: var(--ink);
  font-weight: 600;
}

/* самарі: тип · стратегія · авторитет · профіль · визначення.
   Картки з описами (тексти — static/content/summary.json), довжина
   тексту будь-яка; long-тексти і підпункти — в акордеоні «докладніше» */
.reading-sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 52px;
}
.reading-sum .item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.reading-sum .k {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.reading-sum .v {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}
.reading-sum .item p {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* акордеон «докладніше» (нативний details, без JS) */
.reading details.more {
  margin-top: 10px;
}
.reading details.more summary {
  cursor: pointer;
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  border-bottom: 1px dashed var(--amber);
  padding-bottom: 1px;
  list-style: none;
}
.reading details.more summary::-webkit-details-marker {
  display: none;
}
.reading details.more summary::after {
  content: " ↓";
  color: var(--muted);
}
.reading details.more[open] summary::after {
  content: " ↑";
}
.reading details.more summary:hover {
  border-color: var(--red);
}
.reading details.more p {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
.reading details.more p b {
  color: var(--ink);
}

.reading-block {
  margin-bottom: 52px;
}
.reading-block h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.reading-block h3 .mono {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.reading-block .hint {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 20px;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.reading-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.reading-card b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 5px;
}
.reading-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
.reading-card.defined {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  box-shadow: inset 3px 0 0 var(--amber);
}
.reading-card.open {
  background: rgba(255, 253, 248, 0.55);
}

/* канали: рядки як у лекторії */
.reading-ch {
  border-top: 1px solid var(--line);
}
.reading-ch .row {
  display: grid;
  grid-template-columns: 84px 200px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) {
  .reading-ch .row {
    grid-template-columns: 64px 1fr;
  }
  .reading-ch .row .desc {
    grid-column: 2;
  }
}
.reading-ch .key {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--red);
  white-space: nowrap;
}
.reading-ch .nm {
  font-size: 14.5px;
  font-weight: 600;
}
.reading-ch .desc {
  font-size: 14px;
  color: var(--muted);
}

.reading-cta {
  font-size: 14.5px;
  color: var(--muted);
}
.reading-cta a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
}
.reading-cta a:hover {
  border-color: var(--red);
}

/* плавне перемикання між картами (повне перезавантаження сторінки):
   cross-document view transitions прибирають «блимання»; хедер і футер
   позначені стабільними, тож не миготять узагалі. Прогресивно:
   браузери без підтримки просто ігнорують. */
@view-transition {
  navigation: auto;
}
header.site {
  view-transition-name: site-header;
}
footer.site {
  view-transition-name: site-footer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .bgc-fill, .chart-draw .hdc-fill {
    stroke-dashoffset: 0;
    animation: none;
  }
  .bgc-center {
    opacity: 1;
  }
  .chart-draw .hdc-cwrap {
    opacity: 1;
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
