/* ===========================================================
   Психологическая практика — Design System
   =========================================================== */

:root {
  /* Palette — deep ocean blue + teal, mint as accent */
  --bg: #E5EEF5;
  --bg-soft: #CFDDEA;
  --surface: #FFFFFF;
  --surface-warm: #F2F6FA;
  --ink: #0E1F35;
  --ink-soft: #2A4361;
  --ink-muted: #6E7E94;
  --line: #BFCDDB;
  --line-soft: #D8E2EC;

  /* "sage" var name kept — actual hue is deep ocean blue */
  --sage: #2C5F8D;
  --sage-deep: #143F61;
  --sage-soft: #6E9BC4;
  --sage-tint: #C8DAEB;

  /* "terra" var name kept — actual hue is teal (still cool) */
  --terra: #1F8FA8;
  --terra-soft: #4FB5C8;
  --terra-tint: #BFE0E8;

  --gold: #C99B36;
  --rose: #B97993;

  /* Bright sea-foam accent for special highlights */
  --aqua: #06D5E0;
  --aqua-soft: #5FE6ED;
  --aqua-deep: #048A91;
  --aqua-grad: linear-gradient(135deg, #1F8FA8 0%, #2C5F8D 55%, #143F61 100%);

  /* Result severity */
  --sev-min: #6B9B7A;
  --sev-mild: #C9A961;
  --sev-mod: #D88B5C;
  --sev-sev: #B85A4C;

  /* Type */
  --serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Geometry */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(45, 42, 38, .04), 0 2px 4px rgba(45, 42, 38, .04);
  --shadow: 0 4px 12px rgba(45, 42, 38, .06), 0 12px 32px rgba(45, 42, 38, .06);
  --shadow-lg: 0 8px 24px rgba(45, 42, 38, .08), 0 24px 64px rgba(45, 42, 38, .08);

  /* Container */
  --container: 1200px;
  --container-narrow: 880px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
  overflow-x: hidden;
}

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

a { color: var(--sage-deep); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--terra); }

button { font-family: inherit; cursor: pointer; border: 0; background: none; }

/* ============ Typography ============ */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 300; letter-spacing: -.02em; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.8rem); font-weight: 300; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: -.005em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terra);
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--terra);
}

.lead { font-size: 1.15rem; color: var(--ink-soft); line-height: 1.65; }

em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

/* In large headings — keep the italic teal accent (нежно-голубой курсив) */
h1 em, h2 em, .hero h1 .accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--terra);
}

/* ============ Layout ============ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 32px; }

section { padding: clamp(64px, 9vw, 128px) 0; }

/* ============ Header / Nav ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(229, 238, 245, .85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.logo {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 400;
  color: var(--ink); display: inline-flex; align-items: center; gap: 10px;
  letter-spacing: -.01em;
}
.logo-mark {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), var(--sage-deep));
  color: #fff;
  font-family: var(--serif); font-style: italic; font-size: 1.05rem;
  position: relative;
  overflow: hidden;
}
.logo-mark img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.logo-mark.has-img > span,
.logo-mark.has-img::before { display: none; }
.nav-links {
  display: flex; gap: 4px; align-items: center; list-style: none;
}
.nav-links a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  transition: all .25s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--sage-deep); background: var(--sage-tint); }
.nav-cta {
  padding: 10px 22px !important;
  background: var(--aqua-grad) !important;
  background-size: 180% 180% !important;
  background-position: 0% 50% !important;
  color: #fff !important;
  font-weight: 500 !important;
  transition: background-position .5s var(--ease) !important;
}
.nav-cta:hover { background-position: 100% 50% !important; color: #fff !important; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  align-items: center; justify-content: center;
  position: relative;
  z-index: 110;        /* above the slide-in panel */
  cursor: pointer;
  transition: background .2s var(--ease);
}
.menu-toggle:hover { background: var(--bg-soft); }
.menu-toggle span {
  position: relative; display: block;
  width: 20px; height: 2px;
  background: var(--sage-deep);
  border-radius: 2px;
  transition: background .2s var(--ease);
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: ''; position: absolute; left: 0;
  width: 20px; height: 2px;
  background: var(--sage-deep);
  border-radius: 2px;
  transition: transform .3s var(--ease), background .2s var(--ease);
}
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }
.menu-toggle.open span { background: transparent; }
.menu-toggle.open span::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span::after  { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; top: 76px; left: 0; right: 0;
    height: calc(100vh - 76px);
    flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
    padding: 32px 24px 24px;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform .35s var(--ease-out);
    overflow-y: auto;
    z-index: 105;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { width: 100%; max-width: 320px; text-align: center; }
  .nav-links a { display: block; padding: 14px 18px; font-size: 1.15rem; border-radius: 14px; text-align: center; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  font-size: .95rem; font-weight: 500; letter-spacing: .005em;
  transition: all .3s var(--ease);
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary {
  background: var(--aqua-grad);
  background-size: 180% 180%;
  background-position: 0% 50%;
  color: #fff;
  transition: all .35s var(--ease), background-position .6s var(--ease);
}
.btn-primary:hover {
  background-position: 100% 50%;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(20, 63, 97, .28);
}
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { color: var(--ink); background: var(--bg-soft); }
.btn-ghost:hover { background: var(--sage-tint); color: var(--sage-deep); }
.btn-terra { background: var(--terra); color: #fff; }
.btn-terra:hover { background: #2A8FB8; color: #fff; transform: translateY(-1px); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: clamp(48px, 8vw, 96px) 0 clamp(80px, 10vw, 140px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  grid-template-areas:
    "text photo"
    "meta meta";
  gap: 48px 64px;
  align-items: center;
}
.hero-text   { grid-area: text; }
.hero-visual { grid-area: photo; }
.hero-meta   { grid-area: meta; }
@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "photo"
      "meta";
    gap: 32px;
  }
}
.hero h1 { margin: 24px 0 24px; }
/* (.hero h1 .accent style is in the h1-em rule above) */
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }
.hero-meta {
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-meta.hero-meta-2 { grid-template-columns: repeat(2, 1fr); }
.hero-meta .item {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 14px;
  min-width: 0;
}
.hero-meta .num {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 400;
  color: var(--ink); display: block; line-height: 1.15;
  white-space: nowrap;
}
.hero-meta .lbl {
  font-size: .82rem; color: var(--ink-muted); margin-top: 6px;
  display: block; line-height: 1.35;
}
@media (max-width: 720px) {
  /* Drop to one column earlier — labels like "очно — редко, можно попробовать
     чередовать" don't fit in half-width tiles on tablets/phones. */
  .hero-meta, .hero-meta.hero-meta-2 { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .hero-meta .item {
    /* Keep column layout (num above, label below) — better readability than row */
    flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 12px 14px;
  }
  .hero-meta .num { font-size: 1.15rem; white-space: normal; }
  .hero-meta .lbl { margin-top: 0; }
}

.hero-visual {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--sage-tint), var(--terra-tint));
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-visual::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(31, 143, 168, .25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(20, 63, 97, .25), transparent 40%);
}
.hero-visual .photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-visual.has-photo::before {
  background: linear-gradient(to top, rgba(8, 16, 28, .35) 0%, rgba(8, 16, 28, 0) 50%);
  z-index: 1;
}
.hero-visual .card {
  position: absolute;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  font-size: .9rem;
}
.hero-visual .card.c1 { top: 8%; left: 6%; animation: float 8s ease-in-out infinite; }
.hero-visual .card.c2 { bottom: 10%; right: 6%; animation: float 8s ease-in-out infinite -4s; }
.hero-visual .card.c3 { top: 48%; left: 12%; animation: float 7s ease-in-out infinite -2s; }
@media (max-width: 880px) {
  .hero-visual .card { max-width: 84%; }
  .hero-visual .card.c3 { left: 8%; }
}
.hero-visual .card .dot {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), var(--sage-deep));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--serif); font-style: italic;
  flex-shrink: 0;
}
.hero-visual .card.c2 .dot { background: linear-gradient(135deg, var(--terra), #B26B55); }
.hero-visual .card.c3 .dot { background: linear-gradient(135deg, var(--gold), #A88A47); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Decorative blobs */
.blob {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(80px); opacity: .55;
}
.blob-1 { top: -100px; left: -120px; width: 380px; height: 380px; background: var(--sage-tint); }
.blob-2 { bottom: -80px; right: -100px; width: 320px; height: 320px; background: var(--terra-tint); }

/* ============ Sections ============ */
.section-head { max-width: 720px; margin: 0 auto 72px; text-align: center; }
.section-head .eyebrow { margin-bottom: 18px; justify-content: center; }
.section-head .eyebrow::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--terra);
}
.section-head h2 { margin-bottom: 18px; }

/* ============ Pain cards (С чем приходят) ============ */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.pain-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: all .35s var(--ease);
  display: flex; flex-direction: column;
  --card-grad: linear-gradient(135deg, #1F8FA8 0%, #143F61 100%);
  --card-accent: #1F8FA8;
}
.pain-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(20, 63, 97, .15), 0 4px 12px rgba(20, 63, 97, .08);
  border-color: transparent;
}

/* Slim colored strip at the top of each pain card */
.pain-cover {
  height: 54px;
  background: var(--card-grad);
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.pain-cover .pain-tag {
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,.98);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}
/* Hide the editorial composition completely */
.pain-cover .pain-art,
.pain-cover .pain-number { display: none; }

/* Per-theme colors — bright (for pain-cards + case-cards). Soft tints separately. */
[data-pain="1"] { --card-grad: linear-gradient(135deg, #E63946 0%, #8A1A2C 100%); --card-accent: #C9202E; --card-tint-bg: #FFD7DA; --card-tint-fg: #B5505B; } /* отношения — crimson */
[data-pain="2"] { --card-grad: linear-gradient(135deg, #FFD23F 0%, #E08F00 100%); --card-accent: #C9810F; --card-tint-bg: #FFF1C7; --card-tint-fg: #A88333; } /* самооценка — amber */
[data-pain="3"] { --card-grad: linear-gradient(135deg, #3676BC 0%, #1B3A6B 100%); --card-accent: #2C5F94; --card-tint-bg: #D8E4F0; --card-tint-fg: #2C5F94; } /* смысл — deep navy / morskaya volna */
[data-pain="4"] { --card-grad: linear-gradient(135deg, #A8E061 0%, #5B8F1A 100%); --card-accent: #7CB342; --card-tint-bg: #E5F2C7; --card-tint-fg: #6F9446; } /* эмоции — lime */
[data-pain="5"] { --card-grad: linear-gradient(135deg, #06AED5 0%, #1F4F8C 100%); --card-accent: #0E8FB8; --card-tint-bg: #D6ECF4; --card-tint-fg: #4E83A0; } /* вн. ребёнок — ocean */
[data-pain="6"] { --card-grad: linear-gradient(135deg, #FF6B5B 0%, #C9382E 100%); --card-accent: #E54B30; --card-tint-bg: #FFE2D5; --card-tint-fg: #B5694F; } /* границы — coral */
[data-pain="7"] { --card-grad: linear-gradient(135deg, #F25CA2 0%, #9C2B6E 100%); --card-accent: #D43A85; --card-tint-bg: #FAE0EC; --card-tint-fg: #A86386; } /* сексология — fuchsia */
[data-pain="8"] { --card-grad: linear-gradient(135deg, #00C896 0%, #006B5C 100%); --card-accent: #00A075; --card-tint-bg: #D9F0E5; --card-tint-fg: #5C9377; } /* тревога — emerald */

.pain-content {
  padding: 28px 32px 28px;
  display: flex; flex-direction: column; flex-grow: 1;
}

.pain-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--card-accent);
  position: relative;
  padding: 14px 16px 14px 24px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--bg-soft) 100%);
  border-radius: 10px;
  border-left: 3px solid var(--card-accent);
}
.pain-quote::before {
  content: '“';
  position: absolute;
  top: -8px; left: 8px;
  font-size: 2.6rem;
  color: var(--card-accent);
  opacity: .35;
  line-height: 1;
  font-family: var(--serif);
}

.pain-card h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--ink);
}
.pain-card p.pain-body {
  color: var(--ink-soft);
  font-size: .95rem;
  margin-bottom: 18px;
  line-height: 1.6;
}

.pain-signs {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}
.pain-signs li {
  padding: 7px 0 7px 24px;
  position: relative;
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.pain-signs li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 12px; height: 2px;
  background: var(--card-accent);
  border-radius: 2px;
}

.pain-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: .85rem;
  color: var(--ink-muted);
  font-style: italic;
}
.pain-foot strong { color: var(--card-accent); font-style: normal; font-weight: 600; }

/* Cases CTA strip */
.cases-cta {
  margin-top: 56px;
  padding: 40px 48px;
  background:
    radial-gradient(circle at 100% 0%, rgba(31, 143, 168, .08), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(20, 63, 97, .06), transparent 50%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  gap: 32px; flex-wrap: wrap;
}
.cases-cta h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem;
  margin-bottom: 6px;
}
.cases-cta p { color: var(--ink-soft); margin: 0; max-width: 540px; font-size: .95rem; }

/* ============ Cases page ============ */
.case-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
/* Default accent only when no data-pain assigned */
.case-card:not([data-pain]) {
  --card-grad: var(--aqua-grad);
  --card-accent: #0E8FB8;
}
/* Thin colored strip at top, like pain-cover but very thin */
.case-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: var(--card-grad);
}
.case-card[data-pain] { padding-top: 42px; }

.case-head {
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.case-ava {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--card-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.4rem; font-weight: 500;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.case-meta-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--card-grad);
  color: #fff;
}
.case-meta-name {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.2;
  color: var(--ink);
}
.case-meta-tag {
  font-size: .82rem; color: var(--ink-muted);
  margin-top: 4px;
}

.case-steps {
  display: grid; grid-template-columns: 1fr;
  gap: 18px;
}
.case-step {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 18px; align-items: baseline;
}
@media (max-width: 600px) { .case-step { grid-template-columns: 1fr; gap: 6px; } }
.case-step-label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--card-accent);
  font-weight: 600;
  padding-top: 4px;
}
.case-step-body p {
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.65;
  font-size: .98rem;
}
.case-step-body p:last-child { margin-bottom: 0; }

.cases-disclaimer {
  background: var(--bg-soft);
  border-left: 3px solid var(--terra);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.6;
}
.cases-disclaimer strong { color: var(--ink); }

/* ============ Cases sticky theme bar ============ */
.cases-themes {
  position: sticky;
  top: 76px;                    /* clears the fixed header */
  z-index: 30;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px;
  margin: 0 -10px 36px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 24px -10px rgba(20, 63, 97, .12);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cases-themes::-webkit-scrollbar { display: none; }

.case-theme {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color .25s ease, color .25s ease, transform .15s ease;
  cursor: pointer;
}
.case-theme .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--card-accent, var(--ink-muted));
  flex-shrink: 0;
  transition: transform .25s ease, box-shadow .25s ease;
}
.case-theme:hover {
  color: var(--ink);
  background: var(--bg-soft);
}
.case-theme.active {
  background: var(--card-tint-bg, var(--bg-soft));
  color: var(--card-tint-fg, var(--ink));
  font-weight: 600;
}
.case-theme.active .dot {
  background: var(--card-accent);
  transform: scale(1.4);
  box-shadow: 0 0 0 4px var(--card-tint-bg, transparent);
}

/* Make the body have a smooth offset for jump-to-anchor (so card isn't behind sticky bar) */
.case-card { scroll-margin-top: 160px; }

@media (max-width: 720px) {
  .cases-themes {
    /* Sit directly under the 76px header — covers less viewport, less content
       hides behind the sticky bar while scrolling. */
    top: 76px;
    padding: 6px;
    margin: 0 -16px 24px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .case-theme { padding: 6px 10px; font-size: .78rem; }
  .case-theme .dot { width: 7px; height: 7px; }
  /* Reduce scroll-margin too, since the sticky bar is shorter now */
  .case-card { scroll-margin-top: 130px; }
}

/* ============ Cards / Approaches ============ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.cards-grid.two-col { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) {
  .cards-grid.two-col { grid-template-columns: 1fr; }
}

/* Пакет сессий — две цены в одной плашке.
   Desktop: обе в один ряд с вертикальным разделителем.
   Mobile:  две строки друг под другом, разделитель — тонкая горизонтальная линия. */
.format-price.format-price-pair { gap: 16px; }
.format-price-pair .fpp-item {
  display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap;
}
.format-price-pair .fpp-sep {
  width: 1px; align-self: stretch;
  background: var(--line); opacity: .6;
  margin: 0 4px;
}
@media (max-width: 540px) {
  .format-price.format-price-pair {
    flex-direction: column; align-items: center; gap: 10px;
  }
  .format-price-pair .fpp-sep {
    width: 40%; height: 1px; align-self: center; margin: 0;
  }
}
.card-feat {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  border: 1px solid var(--line);
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* Education card head row: year pill on the LEFT, hours label on the RIGHT.
   `align-items: baseline` aligns by the text line — the words inside the year
   pill and the words of the hours sit on the SAME baseline, like one row.
   Children get !important margin-reset so nothing inherited can offset them. */
.card-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.card-head-row > * {
  margin: 0 !important;
  align-self: baseline !important;
}
.card-hours {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: #B5BFCB;          /* light gray — sits quietly next to the year pill */
  white-space: nowrap;
  line-height: 1;
}
.card-feat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--sage-soft);
}
.card-feat .icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--sage-tint);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  color: var(--sage-deep);
}
/* 4-color cycle for methods/formats — same palette as tests */
.card-feat:nth-child(4n+1) .icon { background: var(--sage-tint); color: var(--sage-deep); }
.card-feat:nth-child(4n+2) .icon { background: var(--terra-tint); color: var(--terra); }
.card-feat:nth-child(4n+3) .icon { background: #FAEEC9; color: #8C6F2A; }
.card-feat:nth-child(4n+4) .icon { background: #F5DCDC; color: #B85A5A; }
/* card-feat with data-pain — soft tint pill (like test tags) */
.card-feat[data-pain] .icon {
  background: var(--card-tint-bg);
  color: var(--card-tint-fg);
}
.card-feat[data-pain] .icon-year {
  background: var(--card-tint-bg);
  color: var(--card-tint-fg);
  font-weight: 600;
  font-size: .75rem;
  padding: 5px 12px;
}
.card-feat .icon-year {
  width: auto; height: auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  font-family: var(--sans);
  white-space: nowrap;
  align-self: flex-start;       /* hug the content, no full-width stretch */
  display: inline-flex;
  align-items: center; justify-content: center;
}

/* Education sections — grouped */
.edu-group { margin-bottom: 64px; }
.edu-group:last-child { margin-bottom: 0; }
/* Rose group (Высшее / Магистратура) — single full-width card with rose accent.
   IMPORTANT: must override `.card-feat:nth-child(4n+1) .icon` rule above —
   adding `.edu-group-rose` class wins on specificity. */
.edu-group-rose .cards-grid {
  grid-template-columns: 1fr;
}
.edu-group-rose .card-feat .icon,
.edu-group-rose .card-feat:nth-child(4n+1) .icon,
.edu-group-rose .card-feat .icon-year {
  background: #F5DCDC !important;
  color: #B85A5A !important;
}
.edu-group-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;       /* allow stacking on narrow screens so count isn't cut */
}
.edu-group-head .badge {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  background: var(--aqua-grad);
  color: #fff;
  border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.edu-group-head h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.4rem;
  margin: 0;
  flex: 1 1 auto;        /* take available space, allow shrinking */
  min-width: 0;
}
.edu-group-head .count {
  margin-left: auto;
  font-size: .85rem;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .edu-group-head { gap: 10px; }
  .edu-group-head h3 { font-size: 1.2rem; width: 100%; flex-basis: 100%; }
  .edu-group-head .count { margin-left: 0; }
}
.card-feat p .why {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--terra);
  font-style: italic;
  font-size: .9rem;
}

.format-price {
  margin-top: auto;
  margin-bottom: 0;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-radius: 12px;
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  width: 100%;                  /* full width of the card */
  align-self: stretch;
  flex-wrap: wrap;
}
/* Add breathing room before the price box while preserving margin-top:auto
   (which keeps prices bottom-aligned across cards with different text lengths).
   :has() lets us target the last text block that sits directly above the price. */
.card-feat > *:has(+ .format-price) {
  margin-bottom: 28px;
}
.format-price .price-meta {
  white-space: nowrap;
}
.format-price .price-num {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  background: var(--aqua-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.format-price .price-meta {
  font-size: .82rem;
  color: var(--ink-muted);
}

/* Section anchors — compact dot column (no labels) */
.section-spy {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
  gap: 4px;
  z-index: 60;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 6px;
  box-shadow: var(--shadow-sm);
}
.section-spy a {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  position: relative;
  transition: all .2s var(--ease);
}
.section-spy a span {
  /* tooltip-style label on hover */
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  background: var(--ink);
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.section-spy a:hover span {
  opacity: 1; transform: translateY(-50%) translateX(0);
}
.section-spy a::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  opacity: .45;
  transition: all .2s var(--ease);
}
.section-spy a:hover::before { opacity: 1; transform: scale(1.3); }
.section-spy a.active::before {
  background: var(--aqua-grad), var(--ink);
  background: var(--terra);
  opacity: 1;
  transform: scale(1.6);
  box-shadow: 0 0 0 4px rgba(31, 143, 168, .15);
}
@media (max-width: 700px) {
  .section-spy { display: none; }
}

/* FAQ mini cards on tests.html */
.faq-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  transition: all .3s var(--ease);
}
.faq-mini:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.faq-mini h4 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--ink);
  letter-spacing: -.005em;
}
.faq-mini p { color: var(--ink-soft); font-size: .95rem; line-height: 1.6; margin: 0; }

/* Long-form FAQ on the contact page — keep question and answer in the same
   sans-serif family, so they read as a single typographic unit. */
.contact-faq details { transition: background .2s var(--ease); }
.contact-faq details[open] summary { color: var(--sage-deep); }
.contact-faq details p {
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.65;
  margin: 14px 0 0;
}
.contact-faq details p + p { margin-top: 10px; }
.contact-faq details p strong { color: var(--ink); font-weight: 600; }
.card-feat h3 { margin-bottom: 12px; }
.card-feat p { color: var(--ink-soft); font-size: .95rem; }

/* ============ Quote ============ */
.quote {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}
.quote .mark {
  font-size: 4rem; color: var(--terra); display: block; line-height: .5; margin-bottom: 20px;
}
.quote .author { display: block; margin-top: 28px; font-family: var(--sans); font-size: .9rem; color: var(--ink-muted); letter-spacing: .04em; }

/* ============ Approach detail rows ============ */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-bottom: 96px;
}
.row:last-child { margin-bottom: 0; }
.row.reverse { direction: rtl; }
.row.reverse > * { direction: ltr; }
@media (max-width: 880px) {
  .row, .row.reverse { grid-template-columns: 1fr; gap: 36px; direction: ltr; }
}
.row-img {
  aspect-ratio: 5/4;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--sage-tint), var(--terra-tint));
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.row-img::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.25), transparent 55%);
  pointer-events: none;
}
.row-img img.photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.row-img.has-photo::after { background: transparent; }

/* Sticky photo variant: photo stays in view while reading long text next to it.
   Use on rows where the text block is taller than the photo. */
.row.row-photo-sticky {
  align-items: start;
  gap: 48px;                  /* tighter than default 80px — photo closer to text */
  grid-template-columns: 0.85fr 1.15fr;   /* slight bias toward text column */
}
.row.row-photo-sticky .row-img {
  position: sticky;
  top: 100px;                 /* clears the fixed header */
  aspect-ratio: 4/5;          /* taller than wide — portrait */
  max-height: calc(100vh - 140px);
}
@media (max-width: 1080px) {
  .row.row-photo-sticky {
    gap: 36px;
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 880px) {
  .row.row-photo-sticky {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .row.row-photo-sticky .row-img {
    position: relative;
    top: auto;
    aspect-ratio: 4/3;
    max-height: 280px;
    width: 100%;
    margin-bottom: 0;
  }
  .row.row-photo-sticky .row-img img.photo {
    object-position: center 25%;
  }
  /* Photo first, then text. */
  .row.row-photo-sticky > .row-img { order: 1; }
  .row.row-photo-sticky > div:not(.row-img) { order: 2; }
}

.row h2 { margin-bottom: 20px; }
.row p { color: var(--ink-soft); margin-bottom: 16px; }
/* Lists inside content rows: styled like paragraphs (same color, same size, same line-height) */
.row ul {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
  color: var(--ink-soft);
}
.row ul li {
  position: relative;
  padding: 4px 0 4px 20px;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}
.row ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  top: 4px;
  color: var(--terra);
  font-size: 1rem;
  line-height: 1.65;
}

/* ============ Stats / Highlights ============ */
.stats {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 48px;
}
.stats .num {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.8rem, 5vw, 4rem); line-height: 1;
  background: linear-gradient(135deg, var(--sage-soft), var(--terra-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: block; margin-bottom: 12px;
}
.stats .lbl { color: rgba(255,255,255,.7); font-size: .9rem; }

/* ============ CTA ============ */
.cta-band {
  background:
    radial-gradient(circle at 80% 20%, var(--terra-tint), transparent 50%),
    radial-gradient(circle at 20% 80%, var(--sage-tint), transparent 50%),
    var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 80px 48px;
  text-align: center;
}
.cta-band h2 { margin-bottom: 18px; }
.cta-band p { color: var(--ink-soft); max-width: 560px; margin: 0 auto 32px; }

/* ============ Footer ============ */
.site-footer {
  background: linear-gradient(180deg, #0C1A2A 0%, #081424 100%);
  color: rgba(255,255,255,.72);
  padding: 72px 0 32px;
  margin-top: 96px;
  border-top: 1px solid rgba(31, 143, 168, .25);
}
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px; font-weight: 500; }
.footer-grid ul { list-style: none; }
.footer-grid li { padding: 6px 0; font-size: .92rem; }
.footer-grid .logo { color: #fff; }
.footer-grid p { font-size: .92rem; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: .85rem;
}

/* ============ Tests page — group cards (top navigator) ============ */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  margin-top: 32px;
}
.group-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  overflow: hidden;
}
.group-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--gc, var(--terra));
  opacity: .85;
}
.group-card::after {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--gc-bg, var(--terra-tint)), transparent 65%);
  opacity: .55;
  pointer-events: none;
}
.group-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--gc, var(--terra));
}
.group-card .group-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--gc, var(--terra));
  line-height: 1;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.group-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 14px;
}
.group-card .group-tags {
  font-size: .85rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin: 0 0 22px;
  flex-grow: 1;
}
.group-card .group-count {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--gc, var(--terra));
  background: var(--gc-bg, var(--sage-tint));
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.group-card .group-count .arrow {
  transition: transform .2s var(--ease);
}
.group-card:hover .group-count .arrow {
  transform: translateX(4px);
}

/* Group color palette */
.group-card[data-group="1"] { --gc: #C9484E; --gc-bg: #F5DCDC; }   /* anxiety — coral */
.group-card[data-group="2"] { --gc: #2C5F8D; --gc-bg: #D8E4F0; }   /* depression — navy */
.group-card[data-group="3"] { --gc: #B97993; --gc-bg: #F5E0E8; }   /* relationships — rose */
.group-card[data-group="4"] { --gc: #C99B36; --gc-bg: #F0E6D5; }   /* emotions — gold */
.group-card[data-group="5"] { --gc: #143F61; --gc-bg: #C8DAEB; }   /* identity — deep navy */
.group-card[data-group="6"] { --gc: #348562; --gc-bg: #D6EBDF; }   /* body — mint */
.group-card[data-group="7"] { --gc: #A83B4F; --gc-bg: #F4D6DC; }   /* sexuality — deep red / passion */
.group-card[data-group="8"] { --gc: #6B4D8F; --gc-bg: #E4DCEF; }   /* trauma — muted violet */

/* ============ Group sections (per-theme test listings) ============ */
.group-section {
  padding: 64px 0 32px;
  scroll-margin-top: 96px;
  position: relative;
}
.group-section + .group-section { padding-top: 32px; }
.group-section::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 64px; height: 3px;
  background: var(--gs, var(--terra));
  border-radius: 999px;
  opacity: .5;
}
.group-section[data-group="1"] { --gs: #C9484E; }
.group-section[data-group="2"] { --gs: #2C5F8D; }
.group-section[data-group="3"] { --gs: #B97993; }
.group-section[data-group="4"] { --gs: #C99B36; }
.group-section[data-group="5"] { --gs: #143F61; }
.group-section[data-group="6"] { --gs: #348562; }
.group-section[data-group="7"] { --gs: #A83B4F; }
.group-section[data-group="8"] { --gs: #6B4D8F; }
.group-section-head {
  max-width: 760px;
  margin-bottom: 36px;
}
.group-section-head .eyebrow {
  background: var(--gs, var(--terra));
  color: #fff;
}
.group-section-head h2 {
  margin: 14px 0 16px;
}

.back-to-groups {
  display: inline-block;
  margin-top: 32px;
  font-size: .85rem;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.back-to-groups:hover {
  color: var(--gs, var(--terra));
  background: var(--surface);
}

/* Empty-group placeholder (group 6 — no tests yet) */
.empty-group {
  background:
    radial-gradient(circle at 20% 0%, rgba(52, 133, 98, .08), transparent 50%),
    var(--surface);
  border: 1px dashed var(--gs, var(--terra));
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  max-width: 720px;
  margin: 0 auto;
}
.empty-group h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--gs, var(--terra));
  margin: 0 0 14px;
}
.empty-group p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 14px;
}
.empty-group-actions {
  margin-top: 22px;
  display: flex; gap: 12px; flex-wrap: wrap;
}

@media (max-width: 640px) {
  .group-card { padding: 22px 22px 18px; }
  .group-card .group-num { font-size: 1.8rem; margin-bottom: 10px; }
  .group-card h3 { font-size: 1.1rem; }
  .group-section { padding: 48px 0 24px; }
  .empty-group { padding: 28px 24px; }
}

/* ============ Tests grid (catalog) ============ */
.tests-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.test-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex; flex-direction: column;
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.test-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--sage); opacity: 0; transition: opacity .3s var(--ease);
}
.test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage-soft); }
.test-card:hover::before { opacity: 1; }
.test-card[data-color="terra"]::before { background: var(--terra); }
.test-card[data-color="gold"]::before { background: var(--gold); }
.test-card[data-color="rose"]::before { background: var(--rose); }
.test-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sage-deep); padding: 5px 10px;
  background: var(--sage-tint); border-radius: 999px;
  align-self: flex-start; margin-bottom: 20px;
}
.test-card[data-color="terra"] .test-tag { background: var(--terra-tint); color: var(--terra); }
.test-card[data-color="gold"] .test-tag { background: #FAEEC9; color: #8C6F2A; }
.test-card[data-color="rose"] .test-tag { background: #F5DCDC; color: #B85A5A; }
.test-card h3 { margin-bottom: 12px; font-family: var(--serif); }
.test-card p { color: var(--ink-soft); font-size: .95rem; flex-grow: 1; margin-bottom: 24px; }
.test-card .meta { display: flex; gap: 18px; font-size: .82rem; color: var(--ink-muted); margin-bottom: 24px; }
.test-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.test-card .go {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sage-deep);
  background: var(--sage-tint);
  padding: 6px 14px;
  border-radius: 999px;
  align-self: flex-start;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.test-card[data-color="terra"] .go { background: var(--terra-tint); color: var(--terra); }
.test-card[data-color="gold"]  .go { background: #FAEEC9; color: #8C6F2A; }
.test-card[data-color="rose"]  .go { background: #F5DCDC; color: #B85A5A; }

.test-card .go .arrow { transition: transform .25s var(--ease); }
.test-card:hover .go {
  transform: translateX(6px);
}
.test-card:hover .go .arrow { transform: translateX(2px); }

/* ============ Test Page (taking the test) ============ */
.test-hero {
  background:
    radial-gradient(circle at 100% 0%, var(--sage-tint), transparent 40%),
    radial-gradient(circle at 0% 100%, var(--terra-tint), transparent 40%),
    var(--bg);
  padding: 64px 0;
}
.test-hero .breadcrumbs {
  font-size: .85rem; color: var(--ink-muted); margin-bottom: 24px;
}
.test-hero .breadcrumbs a { color: var(--ink-muted); }
.test-hero h1 { margin-bottom: 20px; }
.test-meta-bar {
  display: flex; gap: 28px; flex-wrap: wrap; margin-top: 32px;
  padding: 20px 28px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line);
}
.test-meta-bar .item { display: flex; flex-direction: column; gap: 2px; }
.test-meta-bar .lbl { font-size: .75rem; color: var(--ink-muted); letter-spacing: .08em; text-transform: uppercase; }
.test-meta-bar .val { font-weight: 500; }

.progress {
  position: sticky; top: 76px; z-index: 50;
  background: var(--aqua-grad);             /* site-wide blue gradient */
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 4px 18px -8px rgba(20, 63, 97, .35);
}
.progress-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: .88rem;
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
  letter-spacing: .02em;
}
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, .18);     /* translucent track over the blue */
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFFFFF 0%, #EAF7FB 100%);   /* bright white fill */
  width: 0%;
  transition: width .4s var(--ease);
  border-radius: 999px;
  box-shadow:
    0 0 10px rgba(255, 255, 255, .85),
    0 0 22px rgba(143, 220, 235, .55);       /* soft cyan glow */
}
/* Disclaimer above the questions — ensure scrollIntoView clears the
   fixed header (~76px) + sticky progress bar (~64px) + a bit of air. */
.disclaimer {
  scroll-margin-top: 170px;
}

.test-form { padding: 56px 0 96px; }
.question {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 44px;
  margin-bottom: 20px;
  scroll-margin-top: 180px;
  transition: all .3s var(--ease);
  /* One-at-a-time wizard mode */
  display: none;
}
.question.active { display: block; animation: q-fade-in .35s var(--ease-out); }
.question.answered { border-color: var(--sage-soft); }
@keyframes q-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 28px;
  flex-wrap: wrap;
}
.wizard-nav .btn-back {
  background: transparent; color: var(--ink-soft); padding: 10px 18px;
  border-radius: 999px; font-size: .92rem; font-weight: 500;
  transition: all .2s var(--ease); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.wizard-nav .btn-back:hover:not(:disabled) { background: var(--bg-soft); color: var(--ink); }
.wizard-nav .btn-back:disabled { opacity: .35; cursor: not-allowed; }
.wizard-nav .step-info {
  font-size: .85rem; color: var(--ink-muted); letter-spacing: .04em;
}
.q-nav {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.q-hint { font-size: .82rem; color: var(--ink-muted); }
.btn-back { padding: 8px 16px; font-size: .85rem; }

.question .q-num {
  font-size: .82rem; color: var(--ink-muted); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 12px;
}
.question .q-text {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 400; line-height: 1.4;
  color: var(--ink); margin-bottom: 24px;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s var(--ease);
  font-size: .98rem;
  background: var(--bg);
}
.option:hover { background: var(--surface-warm); border-color: var(--sage-soft); }
.option input { display: none; }
.option .radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
  flex-shrink: 0;
}
.option:hover .radio { border-color: var(--sage); }
.option input:checked + .radio {
  border-color: var(--sage-deep);
  background: var(--sage-deep);
}
.option input:checked + .radio::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff;
}
.option:has(input:checked) {
  background: var(--sage-tint);
  border-color: var(--sage);
}

.form-actions {
  margin-top: 40px; display: flex; gap: 12px; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
}
.form-actions .note {
  font-size: .85rem; color: var(--ink-muted); flex-grow: 1; min-width: 200px;
}

.disclaimer {
  background: var(--bg-soft);
  border-left: 3px solid var(--terra);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  color: var(--ink-soft);
  font-size: .92rem;
}
.disclaimer strong { color: var(--ink); }

/* ============ Result page ============ */
.result {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 56px 56px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: none;
}
.result.show { display: block; animation: fadeUp .6s var(--ease-out); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
/* When there is no gauge (only one child column), give the text full width.
   Works in all modern browsers (Chrome 105+, Safari 15.4+, Firefox 121+). */
.result-grid:not(:has(.gauge-wrap)) {
  grid-template-columns: 1fr;
  max-width: none;
}
.result-grid:not(:has(.gauge-wrap)) .result-summary {
  max-width: none;
}
@media (max-width: 760px) {
  .result-grid { grid-template-columns: 1fr; gap: 40px; }
  .result { padding: 36px 28px; }
}
.result-label {
  display: inline-block;
  padding: 8px 16px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.sev-min { background: var(--sage-tint); color: var(--sage-deep); }
.sev-mild { background: #FFF4D2; color: #8E6920; }
.sev-mod { background: #FFE2D2; color: #B55524; }
.sev-sev { background: #FFD3D8; color: #B0202C; }

.result h2 { margin: 16px 0 12px; }
.result-summary { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; margin-bottom: 24px; }
/* result-summary now is a <div> wrapper — supports paragraphs and lists from interp() */
.result-summary p { margin: 0 0 .9em; }
.result-summary p:last-child { margin-bottom: 0; }
.result-summary ul,
.result-summary ol {
  margin: .6em 0 1em;
  padding-left: 1.4em;
  list-style-position: outside;
}
.result-summary ul { list-style: disc; }
.result-summary ol { list-style: decimal; }
.result-summary li { margin-bottom: .35em; padding-left: .2em; }
.result-summary li::marker { color: var(--terra); }
.result-summary strong { color: var(--ink); font-weight: 600; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.gauge-wrap { position: relative; }
.gauge-wrap .gauge-num {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -10%);
  font-family: var(--serif); font-size: 4rem; font-weight: 300; color: var(--ink);
  line-height: 1;
}
.gauge-wrap .gauge-of {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, 95%);
  font-size: .85rem; color: var(--ink-muted); letter-spacing: .04em;
}

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 48px;
}
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-block {
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.detail-block h4 { margin-bottom: 12px; }
.detail-block p { color: var(--ink-soft); font-size: .95rem; }

/* Inline links to related tests (auto-generated from <strong>TEST-NAME</strong>) */
.test-link {
  color: var(--terra);
  font-weight: 600;
  border-bottom: 1px dashed currentColor;
  transition: color .2s var(--ease);
}
.test-link:hover { color: var(--sage-deep); }

.chart-card {
  margin-top: 32px;
  padding: 32px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.chart-card h4 { margin-bottom: 20px; }
.chart-card .chart-wrap {
  position: relative; width: 100%; height: 280px;
}
.chart-card-polar {
  background:
    radial-gradient(circle at center, rgba(31, 143, 168, .06) 0%, transparent 65%),
    var(--bg);
  padding: 40px 32px 48px;
}
.chart-card-polar .chart-wrap {
  max-width: 460px;          /* compact circle — about 2× smaller than before */
  margin: 0 auto;
}

/* Custom percentage cards under the polar chart (replacing built-in legend) */
.polar-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 40px;
}
.polar-legend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform .15s ease, box-shadow .2s ease;
  min-width: 0;                          /* allow children to shrink */
  overflow: hidden;                      /* hard guard against overflow */
}
.polar-legend-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(20, 63, 97, .22);
}
.polar-legend-item .swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 0 0 3px var(--swatch-c, transparent);
  background: var(--swatch-c);
}
.polar-legend-item .name {
  flex: 1 1 auto;
  min-width: 0;                          /* let the flex item shrink below content size */
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  word-break: break-word;                /* wrap long labels onto multiple lines */
  hyphens: auto;
}
.polar-legend-item .pct {
  flex-shrink: 0;                        /* keep the % from ever being squashed */
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--swatch-c);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.polar-legend-item .pct .pct-num {
  font-feature-settings: 'tnum';      /* tabular numbers — aligned */
}
.polar-legend-item .pct .pct-sym {
  font-size: 1rem;
  color: var(--ink-muted);
  margin-left: 2px;
}
.chart-note {
  margin-top: 16px;
  font-size: .85rem;
  color: var(--ink-muted);
  line-height: 1.6;
  text-align: center;
}

/* Long extended description on result */
.result-long {
  margin-top: 40px;
  padding: 32px 36px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--terra);
  font-size: 1rem; line-height: 1.7; color: var(--ink);
}
.result-long h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem;
  margin-bottom: 16px;
}
.result-long p { margin-bottom: 1em; color: var(--ink-soft); }
.result-long p:last-child { margin-bottom: 0; }
/* Use padding-left (not margin) so list markers stay INSIDE the box */
.result-long ul,
.result-long ol {
  margin: 1em 0;
  padding-left: 1.4em;
  color: var(--ink-soft);
  list-style-position: outside;
}
.result-long ul { list-style: disc; }
.result-long ol { list-style: decimal; }
.result-long li { margin-bottom: .4em; padding-left: .2em; }
.result-long li::marker { color: var(--terra); }
.result-long strong { color: var(--ink); font-weight: 600; }

/* Result split into thematic sections */
.result-sections {
  margin-top: 32px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.result-section {
  padding: 28px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.result-section h4 {
  font-family: var(--serif); font-weight: 400; font-size: 1.15rem;
  margin-bottom: 12px; color: var(--terra);
}
.result-section p { color: var(--ink-soft); font-size: .95rem; line-height: 1.65; margin: 0 0 .8em; }
.result-section p:last-child { margin-bottom: 0; }
.result-section ul,
.result-section ol {
  margin: 0 0 .8em 0;            /* no left margin — bullets sit inside padding */
  padding-left: 1.4em;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.65;
  list-style-position: outside;
}
.result-section ul:last-child,
.result-section ol:last-child { margin-bottom: 0; }
.result-section ol { list-style: decimal; }
.result-section ul { list-style: disc; }
.result-section li {
  margin-bottom: .55em;
  line-height: 1.65;
  padding-left: .2em;
}
.result-section li::marker {
  color: var(--terra);
  font-weight: 600;
}
.result-section li:last-child { margin-bottom: 0; }

/* Per-scale cards in multiscale result */
.scale-cards {
  margin-top: 32px;
  display: grid; grid-template-columns: 1fr;
  gap: 14px;
}
.scale-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  border-left: 3px solid var(--sage);
}
.scale-card.above {
  border-left-color: var(--terra);
  background: var(--surface-warm);
}
.scale-card-head {
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start;
  margin-bottom: 12px;
}
.scale-card h4 {
  font-family: var(--serif); font-weight: 400; font-size: 1.2rem;
  margin: 0; line-height: 1.3;
}
.scale-card-num {
  text-align: right; min-width: 110px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.scale-card-num .big {
  font-family: var(--serif); font-size: 1.6rem; color: var(--ink); line-height: 1;
}
.scale-card-num .of { font-size: .78rem; color: var(--ink-muted); }
.scale-desc { color: var(--ink-soft); font-size: .95rem; margin: 0 0 .8em; line-height: 1.6; }
.scale-full { color: var(--ink-soft); font-size: .92rem; line-height: 1.65; }
.scale-full p { margin-bottom: .8em; }
.scale-full p:last-child { margin-bottom: 0; }
.scale-full strong { color: var(--ink); }
.scale-full ul,
.scale-full ol {
  margin: .6em 0;
  padding-left: 1.4em;
  list-style-position: outside;
}
.scale-full ul { list-style: disc; }
.scale-full ol { list-style: decimal; }
.scale-full li { margin-bottom: .35em; padding-left: .2em; }
.scale-full li::marker { color: var(--terra); }

/* ============ Articles ============ */
.articles-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .35s var(--ease);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.article-card .img {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--sage-tint), var(--terra-tint));
}
.article-card[data-c="2"] .img { background: linear-gradient(135deg, #F8EDC8, var(--terra-tint)); }
.article-card[data-c="3"] .img { background: linear-gradient(135deg, var(--terra-tint), #F5DCDC); }
.article-card[data-c="4"] .img { background: linear-gradient(135deg, var(--sage-tint), #DCE6F0); }
.article-card[data-c="5"] .img { background: linear-gradient(135deg, #F5DCDC, var(--sage-tint)); }
.article-card[data-c="6"] .img { background: linear-gradient(135deg, #FAEEC9, var(--sage-tint)); }
.article-card .body { padding: 28px; }
.article-card .meta-row { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-muted); margin-bottom: 12px; }
.article-card h3 { font-size: 1.25rem; margin-bottom: 12px; line-height: 1.3; }
.article-card p { color: var(--ink-soft); font-size: .92rem; margin-bottom: 18px; }

/* ============ Contact ============ */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
.contact-info ul { list-style: none; margin-top: 32px; }
.contact-info li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  display: flex; gap: 18px; align-items: flex-start;
}
.contact-info li:first-child { border-top: 0; }
.contact-info .icon-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--sage-tint); color: var(--sage-deep);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-info .lbl { font-size: .78rem; color: var(--ink-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.contact-info .val { color: var(--ink); font-weight: 500; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  font-family: inherit; font-size: 1rem;
  transition: all .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--sage); background: var(--surface);
  box-shadow: 0 0 0 4px var(--sage-tint);
}
.field textarea { min-height: 120px; resize: vertical; }

/* ============ Reveal animation ============ */
/* Reveal-on-scroll — «магически» появляется при попадании в видимую область:
   плавная композиция fade + slight blur + translate-up. Длительность 1s,
   ease-cubic с лёгким overshoot — ощущается как «выплывает». */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(6px);
  transition:
    opacity 1s cubic-bezier(.22,.61,.36,1),
    transform 1s cubic-bezier(.22,.61,.36,1),
    filter .9s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform, filter;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  transition:
    opacity .85s cubic-bezier(.22,.61,.36,1),
    transform .85s cubic-bezier(.22,.61,.36,1),
    filter .8s cubic-bezier(.22,.61,.36,1);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); filter: blur(0); }
.reveal-stagger.in > *:nth-child(2) { transition-delay: .12s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: .24s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: .36s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: .48s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: .6s; }

/* Уважение к reduced-motion — если пользователь просит «без движения», ставим всё мгновенно. */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * {
    opacity: 1; transform: none; filter: none; transition: none;
  }
}

/* ============ Page header (sub-pages) ============ */
.page-hero {
  padding: 64px 0 56px;
  position: relative;
}
.page-hero h1 { margin-bottom: 18px; }
.page-hero .lead { max-width: 720px; }

/* ============ Misc utility ============ */
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft);
  font-size: .78rem; font-weight: 500;
}

hr.soft { border: 0; height: 1px; background: var(--line); margin: 64px 0; }

/* Print friendly */
@media print {
  .site-header, .site-footer, .progress, .form-actions, .nav { display: none !important; }
  body { background: #fff; }
  .question { break-inside: avoid; }
}

/* ============ Nav dropdown ============ */
.nav-links li.has-dropdown { position: relative; }
/* Invisible bridge to prevent dropdown from closing when moving cursor down */
.nav-links li.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 14px;
  z-index: 1;
}
.nav-links .dropdown {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 220px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  list-style: none;
  z-index: 2;
}
.nav-links .dropdown::before {
  content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
.nav-links li.has-dropdown:hover > .dropdown,
.nav-links li.has-dropdown:focus-within > .dropdown {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-links .dropdown li { display: block; }
.nav-links .dropdown a {
  display: block; padding: 10px 14px; border-radius: 10px;
  color: var(--ink); font-weight: 500;
}
.nav-links .dropdown a small {
  display: block; font-weight: 400; font-size: .78rem; color: var(--ink-muted); margin-top: 2px;
}
.nav-links .dropdown a:hover { background: var(--bg-soft); }

@media (max-width: 880px) {
  .nav-links .dropdown {
    position: static; transform: none; opacity: 1; pointer-events: auto;
    box-shadow: none; border: 0; padding: 0 0 8px 16px;
    min-width: 0; background: transparent;
  }
  .nav-links .dropdown::before { display: none; }
}

/* ============ Tabs ============ */
.tabs {
  display: inline-flex; gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 32px;
}
.tabs a {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .9rem; font-weight: 500;
  color: var(--ink-soft);
  transition: all .25s var(--ease);
}
.tabs a:hover { color: var(--ink); }
.tabs a.active {
  background: var(--ink); color: #fff;
}
.tabs a .count {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: rgba(0,0,0,.08); border-radius: 999px;
  font-size: .72rem; font-weight: 500;
}
.tabs a.active .count { background: rgba(255,255,255,.2); }

/* ============ Material cards (videos / lectures / articles unified) ============ */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.material-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all .35s var(--ease);
  position: relative;
}
.material-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--sage-soft);
}
.material-card .cover {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--sage-tint), var(--terra-tint));
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.material-card[data-type="video"] .cover { aspect-ratio: 4/5; }
.material-card[data-type="lecture"] .cover { aspect-ratio: 16/9; }
.material-card[data-type="article"] .cover { aspect-ratio: 16/9; }
.material-card .cover::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(8,16,28,.92) 0%, rgba(8,16,28,.65) 40%, rgba(8,16,28,0) 100%);
  pointer-events: none;
}
.material-card .cover-title {
  position: absolute; left: 18px; right: 18px; bottom: 16px;
  z-index: 1;
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
.material-card .cover-summary {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: .82rem;
  color: rgba(255,255,255,.85);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.material-card .cover .play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(45,42,38,.25);
  transition: all .3s var(--ease);
}
.material-card:hover .cover .play { transform: translate(-50%, -50%) scale(1.1); }
.material-card .cover .play svg {
  width: 22px; height: 22px; color: var(--ink);
  margin-left: 3px;
}
.material-card .cover .duration {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0, 0, 0, .55);
  color: #F5F1E5;
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
}
/* Спрячем пустой бейдж длительности (новые лекции без указания времени) */
.material-card .cover .duration:empty { display: none; }
.material-card .cover .topic-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92);
  color: #1B2028;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.material-card .body { padding: 16px 20px; display: flex; flex-direction: column; }
.material-card h3 {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 400;
  margin-bottom: 10px; line-height: 1.3;
}
.material-card .desc {
  color: var(--ink-soft); font-size: .92rem;
  margin-bottom: 18px;
}
.material-card .footer {
  display: flex; justify-content: space-between; align-items: center;
}
.material-card .meta-tags { display: flex; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-muted); }
.material-card .actions { display: flex; gap: 14px; align-items: center; }

/* ============ Like button ============ */
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: .85rem; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s var(--ease);
  user-select: none;
}
.like-btn:hover { background: var(--sage-tint); color: var(--sage-deep); }
.like-btn.liked {
  background: var(--terra-tint);
  color: var(--terra);
  border-color: var(--terra-soft);
}
.like-btn .heart {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  transition: all .25s var(--ease);
}
.like-btn.liked .heart {
  fill: var(--terra); stroke: var(--terra);
  animation: heartBeat .45s var(--ease-out);
}
@keyframes heartBeat {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(.9); }
  100% { transform: scale(1); }
}
.comment-count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: .85rem; color: var(--ink-soft);
}
.comment-count-pill svg { width: 14px; height: 14px; }

/* ============ Material detail page ============ */
.material-detail-hero {
  padding: 56px 0 32px;
}
.material-detail-hero .breadcrumbs { font-size: .85rem; color: var(--ink-muted); margin-bottom: 24px; }
.material-detail-hero .breadcrumbs a { color: var(--ink-muted); }
.material-detail-hero .topic { color: var(--terra); margin-bottom: 14px; }
.material-detail-hero h1 { margin-bottom: 18px; max-width: 880px; }
.material-detail-hero .subtitle {
  font-family: var(--serif); font-size: 1.3rem;
  color: var(--ink-soft); max-width: 760px; line-height: 1.5;
  font-weight: 300; font-style: italic;
}
.material-detail-hero .meta-row {
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--ink-muted);
}
.material-detail-hero .meta-row strong { color: var(--ink); font-weight: 500; }

.player-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1F1D1A;
  margin-bottom: 48px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.player-wrap[data-aspect="vertical"] {
  max-width: 420px; margin-left: auto; margin-right: auto;
}
.player-wrap iframe, .player-wrap video {
  width: 100%; aspect-ratio: 16/9;
  display: block; border: 0;
}
.player-wrap[data-aspect="vertical"] iframe,
.player-wrap[data-aspect="vertical"] video { aspect-ratio: 9/16; }

/* Подсказка под плеером — на случай Error 153 внутри iframe. */
.watch-on-yt-hint {
  margin: -36px 0 36px;
  font-size: .82rem;
  color: var(--ink-muted);
  text-align: center;
}
.watch-on-yt-hint a {
  color: #1F6FEB;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.watch-on-yt-hint a:hover { color: #0B57D0; }

.player-placeholder {
  aspect-ratio: 16/9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  background:
    radial-gradient(circle at 30% 30%, var(--sage), transparent 60%),
    radial-gradient(circle at 70% 70%, var(--terra), transparent 60%),
    #1F1D1A;
  color: #fff;
  text-align: center;
  padding: 40px;
}
.player-placeholder[data-aspect="vertical"] { aspect-ratio: 9/16; }
.player-placeholder .play-big {
  width: 84px; height: 84px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.4);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.player-placeholder .play-big:hover { background: rgba(255,255,255,.25); transform: scale(1.05); }
.player-placeholder .play-big svg { width: 28px; height: 28px; margin-left: 4px; fill: #fff; }
.player-placeholder .hint { font-size: .9rem; opacity: .8; max-width: 420px; }

.article-body {
  font-size: 1.05rem; line-height: 1.75; color: var(--ink);
}
.article-body p { margin-bottom: 1.2em; }
.article-body h2, .article-body h3 { margin: 2em 0 .8em; }
.article-body h2 { font-size: 1.6rem; }
.article-body h3 { font-size: 1.3rem; }
.article-body blockquote {
  border-left: 3px solid var(--terra);
  padding: 8px 0 8px 24px;
  margin: 2em 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-soft);
}
.article-body ul, .article-body ol { margin: 1em 0 1em 1.5em; }
.article-body li { margin-bottom: .5em; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body em { font-family: var(--serif); color: inherit; font-style: italic; }
.article-body a { color: var(--terra); border-bottom: 1px solid currentColor; }

.engagement-bar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin: 48px 0 32px;
  padding: 20px 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.engagement-bar .like-btn { padding: 10px 18px; font-size: .95rem; }
.engagement-bar .like-btn .heart { width: 18px; height: 18px; }
.engagement-bar .telegram-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem; font-weight: 500;
  border: 1px solid var(--line);
  transition: all .2s var(--ease);
}
.engagement-bar .telegram-btn:hover {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.engagement-bar .telegram-btn svg { width: 16px; height: 16px; }
.engagement-bar .spacer { flex: 1; }
.engagement-bar .views {
  font-size: .85rem; color: var(--ink-muted);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ============ Comments ============ */
.comments {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.comments h3 {
  font-family: var(--serif); font-size: 1.5rem;
  margin-bottom: 24px;
  display: flex; align-items: baseline; gap: 12px;
}
.comments h3 .num {
  font-size: 1rem; color: var(--ink-muted);
  font-family: var(--sans);
}
.comment-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 600px) { .comment-form .row { grid-template-columns: 1fr; } }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .95rem;
  background: var(--bg);
  color: var(--ink);
  transition: all .2s var(--ease);
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: none; border-color: var(--sage); background: var(--surface);
  box-shadow: 0 0 0 3px var(--sage-tint);
}
.comment-form textarea { min-height: 90px; resize: vertical; margin-bottom: 14px; }
.comment-form .form-foot {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}
.comment-form .form-foot small { color: var(--ink-muted); font-size: .8rem; }

.comments-list { display: flex; flex-direction: column; gap: 16px; }

.comment {
  display: flex; gap: 14px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.comment.local-mark {
  border-color: var(--sage-soft);
  background: var(--surface-warm);
}
.comment .ava {
  flex: 0 0 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), var(--sage-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 500;
  font-size: 1.1rem;
}
.comment .body { flex: 1; min-width: 0; }
.comment .head {
  display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px;
  flex-wrap: wrap;
}
.comment .head strong { color: var(--ink); }
.comment .head small { color: var(--ink-muted); font-size: .8rem; }
.comment .head .you {
  font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sage-tint); color: var(--sage-deep);
  padding: 2px 8px; border-radius: 999px;
}
.comment .text { color: var(--ink); line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.comment .text-actions {
  margin-top: 10px; display: flex; gap: 12px; align-items: center;
  font-size: .82rem;
}
.comment .text-actions button {
  color: var(--ink-muted); padding: 2px 6px; border-radius: 6px;
  font-size: inherit; transition: color .2s var(--ease);
}
.comment .text-actions button:hover { color: var(--terra); }

.empty-comments {
  text-align: center; padding: 40px 24px;
  color: var(--ink-muted);
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: .95rem;
}

/* ============ Modal video ============ */
.modal {
  position: fixed; inset: 0;
  background: rgba(31, 29, 26, .85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal .frame {
  position: relative;
  width: 100%; max-width: 900px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.98);
  transition: transform .35s var(--ease-out);
}
.modal.show .frame { transform: translateY(0) scale(1); }
.modal .frame[data-aspect="vertical"] { max-width: 420px; }
.modal iframe, .modal video {
  width: 100%; aspect-ratio: 16/9;
  display: block; border: 0;
}
.modal .frame[data-aspect="vertical"] iframe,
.modal .frame[data-aspect="vertical"] video { aspect-ratio: 9/16; }
.modal .close {
  position: absolute; top: -44px; right: 0;
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.modal .close:hover { background: rgba(255,255,255,.3); }
.modal .close svg { width: 16px; height: 16px; }

