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

:root {
  --blue:  #3643BA;
  --dark:  #111;
  --muted: #888;
  --paper: #faf9f7;
  --alt:   #f4f5fb;
  --white: #fff;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--paper); color: var(--dark); }

/* ━━━ NAV ━━━ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 3rem;
  background: rgba(250,249,247,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-bar { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.nav-name { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.nav-chapters { display: flex; gap: 0.15rem; }
.nav-ch {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em;
  color: var(--muted); padding: 0.25rem 0.55rem; border-radius: 4px;
  text-decoration: none; transition: color 0.15s;
}
.nav-ch:hover { color: var(--dark); }
.lang-btn {
  background: var(--blue); color: var(--white); border: none;
  border-radius: 4px; padding: 0.28rem 0.75rem;
  font-family: 'Inter', sans-serif; font-size: 0.7rem;
  font-weight: 700; cursor: pointer; letter-spacing: 0.08em;
}

/* ━━━ SHARED INNER WIDTH ━━━ */
.inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* ━━━ HERO SPLIT ━━━ */
.hero-journey { height: 250vh; }
.hero-sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  z-index: 2;
}

.hero-panel {
  position: absolute; top: 0; width: 50%; height: 100%;
  will-change: transform;
}
.hero-panel--left {
  left: 0;
  background: var(--dark);
  display: flex; align-items: center;
  padding: 6rem 3.5rem 5rem;
}
.hero-panel--right {
  right: 0;
  background: var(--alt);
}
.hero-panel--right img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}

.hero-panel__inner { width: 100%; }

.hero-roles { margin-bottom: 1rem; }
.hero-role-line {
  font-size: 0.78rem; font-weight: 600;
  color: rgba(255,255,255,0.55); line-height: 1.85;
}
.hero-divider {
  width: 24px; height: 1px;
  background: rgba(255,255,255,0.18);
  margin: 1rem 0;
}
.hero-meta-line {
  font-size: 0.7rem; font-weight: 400;
  color: rgba(255,255,255,0.32); line-height: 1.9;
}
.hero-name {
  font-size: clamp(3.2rem, 6.5vw, 5.2rem);
  font-weight: 900; line-height: 0.88;
  letter-spacing: -0.04em; color: var(--white);
  margin-bottom: 1.6rem;
}

.hero-contacts { display: flex; flex-direction: column; gap: 0.55rem; }
.hero-contacts a {
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-size: 0.8rem; display: flex; align-items: center; gap: 0.6rem;
  transition: color 0.2s;
}
.hero-contacts a:hover { color: var(--white); }
.hero-contacts i { width: 16px; text-align: center; color: var(--blue); font-size: 0.8rem; }

/* ━━━ CHAPTER DIVIDER ━━━ */
.ch-divider {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 900px; margin: 0 auto;
  padding: 5rem 3rem 0;
  opacity: 0.28;
}
.ch-divider-line { flex: 1; height: 1px; background: var(--dark); }
.ch-divider-label {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 0.85rem; font-weight: 400;
  letter-spacing: 0.03em; white-space: nowrap;
}

/* ━━━ CHAPTER SECTION ━━━ */
.ch-section--alt { background: var(--alt); }


/* ━━━ CHAPTER INNER ━━━ */
.chapter {
  max-width: 900px; margin: 0 auto;
  padding: 3.5rem 3rem 5rem;
}

/* ━━━ CHAPTER HEADER GRID ━━━ */
.ch-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 3rem;
}
.ch-header--flip { grid-template-columns: auto 1fr; }
.ch-header--flip .ch-artifact { order: -1; }

/* ━━━ CHAPTER TITLE + META ━━━ */
.ch-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 900; line-height: 0.91;
  letter-spacing: -0.03em; color: var(--dark);
  margin-bottom: 1.25rem;
}

.ch-meta {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; color: var(--muted);
}
.ch-meta-org { font-weight: 600; color: var(--dark); }
.ch-meta-dot { color: #ccc; }

/* ━━━ ARTIFACT PHOTO ━━━ */
.ch-artifact {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.55rem;
  margin-top: 0.5rem;
}
.ch-artifact img {
  width: 190px; height: 245px;
  object-fit: cover; object-position: center top;
  box-shadow: 0 3px 8px rgba(0,0,0,0.09), 0 10px 28px rgba(0,0,0,0.13), 0 22px 50px rgba(0,0,0,0.08);
  display: block;
}
.ch-artifact--neg img { transform: rotate(-2.2deg); }
.ch-artifact--pos img { transform: rotate(1.8deg); }
.ch-artifact figcaption {
  font-size: 0.58rem; color: var(--muted); font-style: italic;
  text-align: center; line-height: 1.4; max-width: 180px;
}
.ch-artifact--neg figcaption { transform: rotate(-2.2deg); }
.ch-artifact--pos figcaption { transform: rotate(1.8deg); }

/* ━━━ LAPTOP PEEK ━━━ */
.laptop-peek {
  position: relative;
  width: 220px;
  flex-shrink: 0;
  align-self: start;
  margin-top: 4.5rem;
}
.laptop-peek__laptop {
  position: relative; z-index: 2;
  width: 100%; display: block;
  transform: rotate(1.2deg);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2)) drop-shadow(0 12px 32px rgba(0,0,0,0.16));
}
.laptop-peek__head {
  position: absolute;
  top: -4rem;
  left: 12.5%; width: 75%;
  z-index: 1;
  transform: translateY(0%);
  will-change: transform;
}

/* ━━━ PHOTO LIFT ANIMATION ━━━ */
.ch-artifact--lift { position: relative; }
.ch-artifact--lift img {
  transform-origin: bottom center;
  transform: perspective(900px) rotateX(74deg) rotateZ(-2.2deg);
  will-change: transform;
  width: auto;
  height: 370px;
  object-fit: unset;
  object-position: unset;
  box-shadow: none;
  filter:
    drop-shadow(2px 6px 12px rgba(0,0,0,0.22))
    drop-shadow(0 22px 48px rgba(0,0,0,0.14));
}
.lift-shadow {
  position: absolute;
  bottom: 42px; left: 8%;
  width: 84%; height: 18px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: opacity 0.08s linear;
}

/* ━━━ BODY TEXT ━━━ */
.ch-body {
  max-width: 640px;
  font-size: 1rem; line-height: 1.85;
  color: #2e2e2e; margin-bottom: 2.5rem;
}
.ch-body--wide { max-width: none; }

/* ━━━ FLOAT LAYOUT (Ch03, Ch04) ━━━ */
.ch-float-right {
  float: right;
  margin: 0 0 1.5rem 2.5rem;
}
.ch-float-left {
  float: left;
  margin: 0 2.5rem 1.5rem 0;
}
.ch-float-left.laptop-peek { margin-top: 0; }
.ch-float-wrap { display: flow-root; }
.ch-float-wrap .ch-title { margin-bottom: 1.25rem; }
.ch-float-wrap .ch-meta { margin-bottom: 1.75rem; }
.ch-body p + p { margin-top: 1.2rem; }
.ch-body strong { font-weight: 700; color: var(--dark); }

/* ━━━ PULL QUOTE ━━━ */
.pull-section {
  background: var(--dark); color: var(--white);
  padding: 5.5rem 3rem;
}
.pull-inner { max-width: 1100px; margin: 0 auto; }
.pull-mark {
  font-size: 0.55rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin-bottom: 1.5rem;
}
.pull-quote {
  font-family: 'Lora', serif;
  font-style: italic; font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.3; color: var(--white);
}

/* ━━━ RESULTS TABLE ━━━ */
.results-table {
  width: 100%; border-collapse: collapse;
  margin-top: 0.75rem; font-size: 0.82rem;
}
.results-table thead th {
  text-align: left; padding: 0.5rem 0.75rem;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 2px solid #eee;
}
.results-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.results-table tbody tr:last-child { border-bottom: none; }
.results-table td { padding: 0.65rem 0.75rem; vertical-align: top; }
.results-table .col-metric { font-weight: 600; color: var(--dark); width: 22%; position: relative; cursor: help; }
.results-table .col-metric[data-def] {
  text-decoration: underline dotted rgba(54,67,186,0.45);
  text-underline-offset: 3px;
}
.results-table .col-before { color: var(--muted); width: 12%; text-align: center; }
.results-table .col-arrow  { color: #ccc; width: 4%; text-align: center; }
.results-table .col-after  { font-weight: 700; color: #16a34a; width: 14%; text-align: center; }
.results-table .col-how    { color: var(--muted); width: 48%; font-size: 0.78rem; line-height: 1.5; }

/* ── Metric definition tooltip (desktop hover / mobile tap) ── */
.metric-tooltip {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 30;
  background: var(--dark);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  width: 210px;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  pointer-events: none;
}

/* ── Mobile row detail (tap to expand) ── */
.metric-row { cursor: pointer; }
.metric-row.expanded { background: rgba(54,67,186,0.04); }
.metric-detail-cell {
  font-size: 0.76rem;
  color: var(--muted);
  padding: 0.6rem 0.75rem 0.8rem;
  background: var(--alt);
  line-height: 1.55;
  border-bottom: 1px solid #f0f0f0;
}

/* ━━━ METRICS TOGGLE ━━━ */
.metrics-toggle { margin-top: 0.5rem; }
.metrics-toggle summary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue); cursor: pointer;
  padding: 0.5rem 0; list-style: none; user-select: none;
}
.metrics-toggle summary::-webkit-details-marker { display: none; }
.metrics-toggle summary::after { content: '↓'; font-size: 0.7rem; transition: transform 0.2s; }
.metrics-toggle[open] summary::after { transform: rotate(180deg); }

/* ━━━ PROJECTS ━━━ */
.projects-toggle { margin-top: 0.5rem; }
.projects-toggle summary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue); cursor: pointer;
  padding: 0.5rem 0; list-style: none; user-select: none;
}
.projects-toggle summary::-webkit-details-marker { display: none; }
.projects-toggle summary::after { content: '↓'; font-size: 0.7rem; transition: transform 0.2s; }
.projects-toggle[open] summary::after { transform: rotate(180deg); }

.project-links { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; max-width: 520px; }
.project-link {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e8e8e8; border-radius: 8px;
  text-decoration: none; color: var(--dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project-link:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(54,67,186,0.09); }
.project-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.project-name { font-size: 0.85rem; font-weight: 600; color: var(--blue); margin-bottom: 0.18rem; }
.project-desc { font-size: 0.76rem; color: var(--muted); line-height: 1.4; }

/* ━━━ MAP STRIP ━━━ */
.map-section {
  background: #f0ede8;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.map-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
  max-width: 900px; margin: 0 auto;
  padding: 5rem 3rem;
}
.map-tag {
  font-size: 0.56rem; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.1rem;
}
.map-text {
  font-size: 0.95rem; color: #2e2e2e; line-height: 1.8;
}
.map-img {
  width: 100%; border-radius: 6px;
  object-fit: cover; max-height: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ━━━ FOOTER SITTERS ━━━ */
.footer-sitters {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 3;
}
.footer-sitter { position: absolute; top: 0; }
.footer-sitter img {
  width: auto;
  filter:
    drop-shadow(0 -4px 10px rgba(0,0,0,0.18))
    drop-shadow(0 8px 20px rgba(0,0,0,0.22));
}
.footer-sitter--left { left: 10vw; transform: translateY(-68%); }
.footer-sitter--left img { height: 100px; transform: rotate(-2deg); }
.footer-sitter--right { right: 2vw; transform: translateY(-57%); }
.footer-sitter--right img { height: 400px; transform: rotate(2deg); }

/* ━━━ CONTACT FOOTER ━━━ */
.contact {
  background: var(--blue); color: var(--white);
  padding: 8rem 3rem 5rem;
  position: relative; overflow: visible;
  border-top: 3px solid #2733a0;
  box-shadow: 0 -14px 30px -18px rgba(0,0,0,0.25);
}
.contact-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; margin: 0 auto;
  position: relative; z-index: 2;
}
.contact-name {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 0.92;
}
.contact-links { display: flex; flex-direction: column; gap: 0.65rem; align-items: flex-end; }
.contact-links a {
  color: rgba(255,255,255,0.78); text-decoration: none;
  font-size: 0.88rem; display: flex; align-items: center; gap: 0.6rem;
  transition: color 0.2s;
}
.contact-links a:hover { color: var(--white); }
.contact-links i { width: 16px; text-align: center; }

/* ━━━ PETROGLYPHS WATERMARK ━━━ */
.petroglyphs {
  position: absolute;
  inset: 0; pointer-events: none; overflow: hidden;
  z-index: 0;
}
.petroglyphs svg {
  position: absolute;
  stroke: #3643BA; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.10;
}
#ch01 .petroglyphs svg { stroke: #7a5230; opacity: 0.20; }
.ch-section--petro,
.ch-section--sports { position: relative; overflow: hidden; }
.deca-watermark {
  position: absolute; pointer-events: none; z-index: 0;
  width: 55%; max-width: 680px;
  bottom: 6%; right: -4%;
  opacity: 0.06;
  transform: rotate(-6deg);
}
@media (max-width: 767px) {
  .ch-section--petro { background: url('../img/background1.webp') center center / cover no-repeat; }
}
.ch-section--petro .ch-divider,
.ch-section--petro .chapter,
.ch-section--sports .ch-divider,
.ch-section--sports .chapter { position: relative; z-index: 1; }

/* ━━━ PNG-петроглифы Ch01 ━━━ */
.petro-png {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  width: 130px;
  height: auto;
  transition: opacity 0.8s ease;
}
@media (max-width: 767px) {
  .petro-png { width: 18%; max-width: 80px; }
}
@media (max-width: 320px) { .petro-png { display: none; } }

/* ━━━ INTEGRATED LAYOUT ━━━ */
.ch-integrated {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 0;
  align-items: start;
}

.ch-integrated-title {
  grid-column: 1; grid-row: 1;
  position: relative; z-index: 1;
}
.ch-integrated-title .ch-title { margin-bottom: 0; }

.ch-integrated .ch-artifact--lift {
  grid-column: 2; grid-row: 1 / 3;
  margin-left: -2rem;
  position: relative; z-index: 0;
  align-self: start;
}

.ch-integrated--flip { grid-template-columns: auto 1fr; }
.ch-integrated--flip .ch-integrated-title { grid-column: 2; grid-row: 1; }
.ch-integrated--flip .ch-artifact--lift {
  grid-column: 1; grid-row: 1 / 3;
  margin-left: 0; margin-right: -2rem;
}
.ch-integrated--flip .laptop-peek {
  grid-column: 1; grid-row: 1 / 3;
  align-self: start;
}
.ch-integrated--flip .ch-integrated-body { grid-column: 2; grid-row: 2; }

.ch-integrated-body {
  grid-column: 1; grid-row: 2;
  position: relative; z-index: 1;
  padding-top: 1.75rem;
}
.ch-integrated-body .ch-meta { margin-bottom: 1.75rem; }
.ch-integrated-body .ch-body { margin-bottom: 2rem; }

/* ━━━ REVEAL ━━━ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ━━━ AVATARS (mobile only) ━━━ */
.ch-avatar { display: none; }
.hero-avatar { display: none; }

/* ━━━ RESPONSIVE ━━━ */
@media (max-width: 760px) {
  nav { padding: 1rem 1.25rem; }
  .nav-chapters { display: none; }

  .inner,
  .ch-divider,
  .chapter,
  .pull-section { padding-left: 1.5rem; padding-right: 1.5rem; }

  /* ── Hero: disable split animation, static block ── */
  .hero-journey { height: auto; }
  .hero-sticky { position: relative; height: auto; overflow: visible; }
  .hero-panel { position: relative; width: 100%; top: auto; will-change: auto; transform: none !important; }
  .hero-panel--right { display: none; }
  .hero-panel--left { padding: 7rem 1.5rem 3.5rem; min-height: 100svh; }

  /* Ch01 inline margin-top override */
  #ch01 { margin-top: 0 !important; }

  .ch-divider { padding-top: 3.5rem; }
  .chapter { padding: 2.5rem 1.5rem 3.5rem; }

  /* ── Chapter photos: hide big artifacts, show rolling avatar ── */
  .ch-artifact--lift,
  .laptop-peek { display: none; }

  .ch-avatar {
    display: block;
    width: clamp(48px, 15vw, 72px);
    height: clamp(48px, 15vw, 72px);
    border-radius: 50%;
    object-fit: cover;
    float: right;
    margin: 0 0 0.75rem 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  }

  /* Hero name + avatar: scale together with viewport width */
  .hero-name { font-size: clamp(1.5rem, 10vw, 3.2rem); margin-bottom: 1.2rem; }

  /* Hero round photo */
  .hero-avatar {
    display: block;
    width: clamp(52px, 16vw, 80px);
    height: clamp(52px, 16vw, 80px);
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    float: right;
    margin: 0 0 1rem 1.25rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.35);
  }

  /* ── Reset grid/float layouts to block ── */
  .ch-integrated { display: block; }
  .ch-integrated-body { padding-top: 1rem; }
  .ch-float-right, .ch-float-left { float: none; margin: 0; }
  .ch-float-wrap { display: block; }

  .ch-title { font-size: clamp(2rem, 8vw, 2.8rem); }

  .pull-section { padding: 3.5rem 1.5rem; }
  .pull-quote { font-size: 1.4rem; }

  /* ── Table: hide "how" column, fits 3 columns ── */
  .col-how { display: none; }
  .results-table { font-size: 0.78rem; }
  .results-table td, .results-table th { padding: 0.55rem 0.5rem; }

  .map-section { background: #f0ede8; }
  .map-section .map-inner { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 1.5rem; }

  .contact { padding: 4rem 1.5rem 3rem; }
  .footer-sitter--left img  { height: 60px; }
  .footer-sitter--right img { height: 200px; }
  .contact-inner { flex-direction: column; gap: 2rem; }
  .contact-links { align-items: flex-start; }
  .contact-name { font-size: 2.2rem; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE-ONLY / DESKTOP-ONLY TOGGLE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mob-only { display: none; }

@media (max-width: 760px) {
  .desk-only { display: none !important; }
  .mob-only  { display: block; }

  /* ── Nav hamburger ── */
  nav { padding: 0; flex-wrap: wrap; }
  .nav-bar {
    width: 100%; padding: 0.75rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center;
  }
  .mob-nav-right { display: flex; align-items: center; gap: 0.6rem; }
  .mob-lang-btn {
    background: var(--blue); color: var(--white); border: none;
    border-radius: 4px; padding: 0.26rem 0.65rem;
    font-family: 'Inter', sans-serif; font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.05em; cursor: pointer;
  }
  /* ── Mobile metric ? badge — only in header ── */
  thead th.col-metric::after {
    content: '?';
    display: inline-flex; align-items: center; justify-content: center;
    width: 13px; height: 13px;
    background: var(--blue); color: #fff;
    border-radius: 50%; font-size: 0.58rem; font-weight: 700;
    margin-left: 0.3rem; vertical-align: middle; opacity: 0.65;
  }
  .nav-burger {
    background: none; border: none; cursor: pointer;
    padding: 0.2rem; display: flex; flex-direction: column;
    gap: 4px; align-items: flex-end;
  }
  .nav-burger span {
    display: block; height: 2px; background: #111; border-radius: 2px;
    transition: width 0.2s, opacity 0.2s, transform 0.25s;
  }
  .nav-burger span:nth-child(1) { width: 20px; }
  .nav-burger span:nth-child(2) { width: 14px; }
  .nav-burger span:nth-child(3) { width: 20px; }
  .nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); width: 20px; }
  .nav-burger.open span:nth-child(2) { opacity: 0; width: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); width: 20px; }
  .nav-dropdown {
    display: none; flex-direction: column; width: 100%;
    padding: 0.5rem 0 0.75rem; border-top: 1px solid rgba(0,0,0,0.06);
  }
  .nav-dropdown.open { display: flex; }
  .nav-dropdown a {
    padding: 0.75rem 1.25rem; font-size: 0.78rem; font-weight: 600;
    color: #888; text-decoration: none;
    display: flex; align-items: center; gap: 0.75rem;
    transition: color 0.15s, background 0.15s;
    border-radius: 6px; margin: 0 0.5rem;
  }
  .nav-dropdown a:hover { color: #111; background: rgba(0,0,0,0.04); }
  .nav-dropdown .ch-num {
    font-size: 0.52rem; font-weight: 700; letter-spacing: 0.18em;
    text-transform: uppercase; color: #ccc; min-width: 2.5rem;
  }

  /* ── Mobile hero ── */
  .mob-hero {
    background: #111; color: #fff;
    padding: 5.5rem 1.5rem 3.5rem; min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
  }
  .mob-hero-top { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
  .mob-hero-name {
    font-size: clamp(2.4rem, 13vw, 3.8rem);
    font-weight: 900; line-height: 0.88; letter-spacing: -0.04em; color: #fff;
  }
  .mob-hero-avatar {
    width: clamp(60px,18vw,80px); height: clamp(60px,18vw,80px);
    border-radius: 50%; object-fit: cover; object-position: center top;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5); flex-shrink: 0;
  }
  .mob-hero-divider { width: 24px; height: 1px; background: rgba(255,255,255,0.18); margin: 1rem 0; }
  .mob-hero-role { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.75); line-height: 1.8; margin-bottom: 0.4rem; }
  .mob-hero-meta { font-size: 0.68rem; color: rgba(255,255,255,0.55); line-height: 1.9; }
  .mob-hero-contacts { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.2rem; }
  .mob-hero-contacts a { color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.76rem; display: flex; align-items: center; gap: 0.55rem; }
  .mob-hero-contacts i { width: 15px; text-align: center; color: #3643BA; }

  /* ── Ch01: #ch01 fix & sand ── */
  #ch01 { margin-top: 0 !important; }
  .sand-chapter {
    position: relative; overflow: hidden;
    padding: 1.8rem 1.5rem 3rem;
    background-color: #ede8d9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  }
  /* Ch01 mob: показываем background1.webp, убираем пергаментный фон */
  #ch01 .sand-chapter {
    background-color: transparent;
    background-image: none;
  }
  .sand-chapter > *:not(.petroglyphs) { position: relative; z-index: 2; }
  .sand-chapter .petroglyphs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
  .sand-chapter .petroglyphs svg { position: absolute; stroke: #3643BA; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.10; }
  #ch01 .mob-ch-title { color: #2a2318; }
  #ch01 .mob-ch-meta  { color: #7a6e5a; }
  #ch01 .mob-ch-meta-org { color: #2a2318; }

  /* ── Ch02: receipt ── */
  #ch02 { background: #c8bfb0; }
  #ch02 .mob-body-wrap { padding: 1.4rem 1.5rem 2.5rem; }
  .receipt { background: #fdf6e3; box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 10px 28px rgba(0,0,0,0.14); }
  .receipt-perf {
    height: 13px;
    background: radial-gradient(circle at 6.5px 50%, #c8bfb0 5px, #fdf6e3 5px) left center / 13px 13px repeat-x;
  }
  .receipt-inner { padding: 1.3rem 1.5rem 1.7rem; font-family: 'Courier New', monospace; font-size: 0.74rem; line-height: 1.68; color: #1a1206; }
  .receipt-header-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
  .receipt-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
  .receipt-store-name { font-weight: 700; font-size: 0.8rem; line-height: 1.3; }
  .receipt-store-meta { font-size: 0.65rem; color: #8a7a60; }
  .rline { display: block; opacity: 0; animation: rFallback 0s 10s forwards; }
  .rline-gap { display: block; height: 0.6em; }
  .rline-p { display: block; opacity: 0; margin-bottom: 0.85em; line-height: 1.7; font-size: 0.78rem; animation: rFallback 0s 10s forwards; }
  @keyframes rFallback { to { opacity: 1; } }
  .rline-p strong { font-weight: 400; color: #1a1206; font-family: 'Inter', sans-serif; font-size: 0.76rem; }
  .r-center { text-align: center; }
  .r-bold { font-weight: 700; }
  .r-dim { color: #8a7a60; }
  .r-rule { white-space: pre; overflow: hidden; }
  .r-stat { display: flex; align-items: baseline; color: #8a7a60; }
  .r-sl { flex: 1; white-space: nowrap; overflow: hidden; }
  .r-sl::after { content: ' ................................................................'; letter-spacing: 0.05em; }
  .r-sv { flex-shrink: 0; }

  /* ── Ch03: chat ── */
  #ch03 { background: #d0d8d5; }
  #ch03 .mob-body-wrap { padding: 1.4rem 1.5rem 2.5rem; }
  .chat-phone { background: #f0ebe3; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 10px 28px rgba(0,0,0,0.14); position: relative; }
  .chat-header { background: #f7f3ed; padding: 0.85rem 1rem; display: flex; align-items: center; gap: 0.65rem; border-bottom: 1px solid rgba(0,0,0,0.07); }
  .chat-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-left: auto; }
  .chat-name-mob { font-size: 0.76rem; font-weight: 600; line-height: 1.3; }
  .chat-name-mob span { font-size: 0.63rem; font-weight: 400; color: #888; }
  .chat-online { font-size: 0.6rem; color: #4caf50; font-weight: 600; }
  .chat-body { padding: 1rem 0.9rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 60px; }
  .bubble { max-width: 86%; padding: 0.55rem 0.8rem; border-radius: 14px; font-size: 0.78rem; line-height: 1.55; opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 0.25s ease, transform 0.25s ease; }
  .bubble.in { opacity: 1; transform: none; }
  .bubble--in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
  .btime { display: block; font-size: 0.55rem; margin-top: 0.25rem; opacity: 0.4; text-align: right; }
  .typing-mob { display: none; align-self: flex-start; background: #fff; border-radius: 14px; border-bottom-left-radius: 4px; padding: 0.55rem 0.75rem; opacity: 0; transform: translateY(8px); transition: opacity 0.18s ease, transform 0.18s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
  .typing-mob.in { display: flex; opacity: 1; transform: none; }
  .dots { display: flex; gap: 3px; align-items: center; height: 12px; }
  .dots span { width: 5px; height: 5px; border-radius: 50%; background: #aaa; animation: mobdb 1.2s infinite ease-in-out; }
  .dots span:nth-child(2){animation-delay:.2s} .dots span:nth-child(3){animation-delay:.4s}
  @keyframes mobdb { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-4px)} }
  /* ── Chat rating ── */
  .chat-rating {
    align-self: center; text-align: center;
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  .chat-rating.in { opacity: 1; transform: none; pointer-events: auto; }
  .chat-rating-label { font-size: 0.6rem; color: #aaa; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.55rem; }
  .chat-rating-btns { display: flex; gap: 0.6rem; justify-content: center; }
  .r-btn {
    background: #fff; border: 1px solid #e8e4de;
    border-radius: 50%; width: 38px; height: 38px;
    font-size: 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }
  .r-btn:hover { transform: scale(1.15); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
  .r-btn.picked { transform: scale(1.2); box-shadow: 0 3px 12px rgba(0,0,0,0.18); }
  /* ── Chat toast ── */
  .chat-toast {
    position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%) translateY(8px);
    background: rgba(30,30,30,0.88); color: #fff;
    font-size: 0.7rem; line-height: 1.45; text-align: center;
    padding: 0.6rem 1rem; border-radius: 10px;
    max-width: 80%; white-space: normal;
    opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none; backdrop-filter: blur(6px);
  }
  .chat-toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }
  .mob-metrics-wrap { padding: 0 1.5rem 2rem; display: flex; flex-direction: column; align-items: center; }
  .mob-metrics-toggle { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .mob-metrics-toggle summary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: #3643BA; cursor: pointer; list-style: none; user-select: none;
    border: 1.5px solid #3643BA; border-radius: 999px; padding: 0.45rem 1.2rem;
  }
  .mob-metrics-toggle summary::-webkit-details-marker { display: none; }
  .mob-metrics-toggle summary::after { content: '↓'; font-size: 0.7rem; transition: transform 0.2s; }
  .mob-metrics-toggle[open] summary::after { transform: rotate(180deg); }

  /* ── Ch04 ── */
  #ch04 { background: url('../img/back4.webp') center center / cover no-repeat; }
  #ch04 .mob-ch-intro { background: transparent; padding: 1.6rem 1.5rem 1rem; flex-direction: column; align-items: center; text-align: center; }
  #ch04 .mob-ch-intro .mob-ch-title { color: var(--dark); }
  #ch04 .mob-ch-intro .mob-ch-meta { justify-content: center; color: #555; flex-wrap: wrap; }
  #ch04 .mob-ch-intro .ch-meta-org { color: var(--dark); font-weight: 600; }
  #ch04 .mob-ch-intro .ch-meta-dot { color: #888; }
  #ch04 .mob-ch-intro .mob-ch-intro-text { flex: none; width: 100%; }
  #ch04 .mob-body-wrap { background: transparent; padding: 1.8rem 1.5rem 2.5rem; }

  /* ── WinXP taskbar ── */
  .winxp-taskbar {
    display: flex; align-items: stretch;
    position: relative;
    background: linear-gradient(to bottom, #d4d0c8 0%, #b0aca4 100%);
  }
  .winxp-taskbar::after {
    content: '';
    flex: 1;
    background: linear-gradient(to bottom, #d4d0c8 0%, #b0aca4 100%);
  }
  .projects-toggle--winxp {
    margin: 0; padding: 0; border: none; background: none;
  }
  .projects-toggle--winxp summary {
    list-style: none; cursor: pointer;
    background: none; border: none; padding: 0; margin: 0;
    display: block; line-height: 0;
  }
  .projects-toggle--winxp summary::-webkit-details-marker { display: none; }
  .projects-toggle--winxp summary::after { display: none; }
  .start-btn-img { height: 44px; width: auto; display: block; flex-shrink: 0; }
  .winxp-menu {
    position: absolute; bottom: 100%; left: 0; z-index: 20;
    width: 260px;
    background: #fff;
    border: 1px solid #0a246a;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
    font-family: 'Tahoma', sans-serif;
  }
  .winxp-menu-header {
    background: linear-gradient(to right, #1f4ec8 0%, #3a6eea 100%);
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.75rem;
  }
  .winxp-menu-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5); object-fit: cover; flex-shrink: 0;
  }
  .winxp-menu-username {
    color: #fff; font-weight: 700; font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); letter-spacing: 0.05em;
  }
  .winxp-menu-body {
    background: #fff;
    border-top: 2px solid #7a9fd4;
    padding: 0.4rem 0;
  }
  .winxp-menu-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.45rem 0.75rem;
    text-decoration: none; color: #000;
  }
  .winxp-menu-item:hover { background: #316ac5; color: #fff; }
  .winxp-menu-item:hover .winxp-menu-desc { color: #cfe0ff; }
  .winxp-menu-icon { font-size: 1.2rem; flex-shrink: 0; }
  .winxp-menu-name { font-size: 0.78rem; font-weight: 700; }
  .winxp-menu-desc { font-size: 0.65rem; color: #666; margin-top: 0.1rem; }

  .projects-toggle--winxp .project-links {
    margin-top: 0.75rem;
    background: #0a0a0a;
    border: 2px solid #888;
    border-radius: 0;
    padding: 0.75rem 0.85rem;
    font-family: 'Courier New', 'Lucida Console', monospace;
    box-shadow: inset 1px 1px 0 #333, 2px 2px 6px rgba(0,0,0,0.5);
  }
  .projects-toggle--winxp .project-links::before {
    content: 'C:\\Users\\Kiselev> dir /projects';
    display: block;
    color: #c0c0c0; font-size: 0.68rem;
    margin-bottom: 0.75rem;
  }
  .projects-toggle--winxp .project-link {
    background: transparent; border: none; border-radius: 0;
    padding: 0.3rem 0; display: flex; gap: 0.6rem; align-items: flex-start;
    box-shadow: none;
  }
  .projects-toggle--winxp .project-link:hover { background: #003399; border: none; }
  .projects-toggle--winxp .project-icon { font-size: 0.85rem; margin-top: 0.05rem; }
  .projects-toggle--winxp .project-name {
    color: #ffff00; font-size: 0.75rem; font-weight: 400;
    font-family: 'Courier New', monospace;
  }
  .projects-toggle--winxp .project-desc {
    color: #c0c0c0; font-size: 0.67rem;
    font-family: 'Courier New', monospace;
  }
  .mob-editor { background: #1e1e1e; border-radius: 10px; overflow: hidden; }
  .mob-ed-titlebar { background: #2d2d2d; padding: 0.5rem 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
  .mob-traffic { display: flex; gap: 5px; }
  .mob-traffic span { width: 11px; height: 11px; border-radius: 50%; }
  .mob-tr{background:#ff5f57} .mob-ty{background:#ffbd2e} .mob-tg{background:#28c840}
  .mob-ed-filename { margin: 0 auto; font-size: 0.68rem; color: #ccc; font-family: 'Courier New', monospace; }
  .mob-ed-tabs { background: #252526; display: flex; border-bottom: 1px solid #1e1e1e; }
  .mob-ed-tab { padding: 0.38rem 0.85rem; font-size: 0.67rem; font-family: 'Courier New', monospace; color: #777; border-right: 1px solid #1e1e1e; }
  .mob-ed-tab.active { background: #1e1e1e; color: #d4d4d4; border-top: 1px solid #569cd6; }
  .mob-ed-body { display: flex; padding: 0.75rem 0; }
  .mob-lnums { padding: 0 0.55rem; text-align: right; min-width: 2.2rem; flex-shrink: 0; }
  .mob-lnums span { display: block; font-family: 'Courier New', monospace; font-size: 0.68rem; line-height: 1.7; color: #4a4a4a; opacity: 0; transition: opacity 0.08s; }
  .mob-lnums span.v { opacity: 1; }
  .mob-clines { flex: 1; padding-right: 0.85rem; overflow-x: hidden; }
  .mob-cl { display: block; font-family: 'Courier New', monospace; font-size: 0.68rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: #d4d4d4; opacity: 0; transition: opacity 0.08s; min-height: 1.156em; }
  .mob-cl.v { opacity: 1; }
  .mob-kw{color:#569cd6}.mob-cm{color:#6a9955}.mob-fn{color:#dcdcaa}.mob-pk{color:#c586c0}
  .mob-cur { display: inline-block; width: 2px; height: 0.9em; background: #aeafad; vertical-align: text-bottom; margin-left: 1px; animation: mobcblink 1s steps(1) infinite; }
  @keyframes mobcblink { 0%,100%{opacity:1} 50%{opacity:0} }

  /* ── Ch04 projects on dark background ── */

  /* ── Shared mob chapter layout ── */
  .mob-ch-divider {
    display: flex; align-items: center; gap: 1rem;
    padding: 3rem 1.5rem 0; opacity: 0.3;
  }
  .mob-ch-divider-line { flex: 1; height: 1px; background: currentColor; }
  .mob-ch-divider-label { font-family: 'Playfair Display', serif; font-style: italic; font-size: 0.82rem; font-weight: 400; letter-spacing: 0.03em; white-space: nowrap; }
  .mob-ch-intro {
    display: flex; align-items: flex-start;
    gap: 0.85rem; padding: 1.6rem 1.5rem 0; flex-wrap: nowrap;
  }
  .mob-ch-intro-text { flex: 1; min-width: 0; }
  .mob-ch-avatar {
    width: clamp(52px,15vw,72px); height: auto;
    flex-shrink: 0;
  }
  .mob-ch-title { font-size: clamp(1.6rem,7.5vw,2.4rem); font-weight: 900; line-height: 0.92; letter-spacing: -0.03em; color: #111; margin-bottom: 0.75rem; }
  .mob-ch-meta { font-size: 0.68rem; color: #888; display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
  .mob-ch-meta-org { font-weight: 700; color: #111; }
  .mob-ch-body { padding: 1.2rem 1.5rem 2.5rem; font-size: 0.92rem; line-height: 1.82; color: #2e2e2e; }
  .mob-ch-body p + p { margin-top: 1rem; }
  .mob-ch-body strong { font-weight: 700; color: #111; }
}
