/* ===========================
   SKIP LINK
=========================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #151515;
  color: #fff;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* ===========================
   VISUALLY HIDDEN (screen-reader only)
=========================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* h3 reset inside timeline-date-inner */
.timeline-date-inner h3 {
  margin: 0;
  font: inherit;
  color: inherit;
}

/* ===========================
   SCROLL REVEAL
=========================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: var(--font-sans);
  background: #FAFAFA;
  color: var(--color-text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 40px; /* місце для фіксованого marquee */
}

/* ===========================
   ENTRANCE / STORY STATES
=========================== */
#entrance-state {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

#story-state[hidden] {
  display: none !important;
}

/* ===========================
   SITE HEADER
=========================== */
.site-header {
  width: 100%;
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transform: translateY(-100%);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
}

/* Лого — зліва */
.site-logo {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
  text-decoration: none;
  transition: color 0.2s ease;
  justify-self: start;
}

.site-logo:hover {
  color: rgba(0, 0, 0, 0.85);
}

.site-logo img {
  height: 54px;
  width: auto;
  display: block;
}

/* Навігація — по центру */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  justify-self: center;
}

.site-nav__link {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.25s ease;
}

.site-nav__link:hover {
  color: rgba(0, 0, 0, 0.85);
}

.site-nav__link:hover::after {
  width: 100%;
}

.site-nav__link.active {
  color: #000;
}

.site-nav__link.active::after {
  width: 100%;
}

/* Контроли — справа */
.site-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-self: end;
  grid-column: 3;
}

@media (max-width: 768px) {
  .site-header__inner {
    height: 48px;
    grid-template-columns: 1fr auto 1fr;
  }

  .site-nav {
    gap: var(--space-3);
  }

  #waveform {
    display: none;
  }
}

@media (max-width: 390px) {
  .site-logo {
    display: none;
  }

  .site-header__inner {
    grid-template-columns: 1fr auto;
  }

  .site-controls {
    gap: var(--space-2);
  }
}

/* ===========================
   HERO
=========================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  background: #FAFAFA;
}

/* ===========================
   ILLUSTRATIONS — full bleed
=========================== */
.hero-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: cloud-drift 33s ease-in-out infinite;
}

/* ===========================
   CLOUD LIGHT
   Brightness ±2–3%, contrast ±1%
   Відчуття: проходять хмари
=========================== */
@keyframes cloud-drift {
  0%   { filter: brightness(1.000) contrast(1.000); }
  11%  { filter: brightness(0.979) contrast(0.991); }
  24%  { filter: brightness(0.972) contrast(0.989); }
  36%  { filter: brightness(0.981) contrast(0.993); }
  49%  { filter: brightness(1.002) contrast(1.001); }
  61%  { filter: brightness(1.024) contrast(1.008); }
  73%  { filter: brightness(1.028) contrast(1.009); }
  84%  { filter: brightness(1.014) contrast(1.005); }
  93%  { filter: brightness(1.003) contrast(1.001); }
  100% { filter: brightness(1.000) contrast(1.000); }
}

/* Graphite pencil canvas — весь сайт */
#pencil-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9997;
  pointer-events: none;
}

/* Кастомний курсор */
.pencil-cursor {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #2a2a2a;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: multiply;
}

body {
  cursor: none;
}

/* Drawing reveal container */
.drawing-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* All stages — stacked */
.drawing-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  opacity: 0;
  mix-blend-mode: normal;
}

.girl-img {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  height: 80%;
  width: auto;
  object-fit: contain;
  object-position: bottom;
  opacity: 0;
  z-index: 15;
}

/* Кадри анімації виходу — стекаються поверх girl-img */
.girl-frame {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 80%;
  width: auto;
  object-fit: contain;
  object-position: bottom;
  opacity: 0;
  z-index: 16;
}

/* ===========================
   HERO LANG — перемикач мов поверх hero
=========================== */
.hero-lang {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
}


.hero-lang .lang-divider,
.hero-lang__btn {
  color: rgba(0, 0, 0, 0.4) !important;
  text-shadow: 0 0 6px rgba(255,255,255,0.8);
}
.hero-lang__btn:hover  { color: rgba(0, 0, 0, 0.75) !important; }
.hero-lang__btn.active { color: #000 !important; }

/* ===========================
   HERO CONTENT (text — bottom)
=========================== */
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding-bottom: var(--space-8);
}

.hero-grid {
  align-items: end;
  row-gap: 4px;
}

.hero-text {
  grid-column: 1 / -1;
  background: #000;
  padding: 8px 20px;
  opacity: 0;
  transform: translateY(16px);
  display: inline-block;
  width: fit-content;
  align-self: end;
}

.hero-desc {
  grid-column: 1 / 7;
}

.hero-btn {
  grid-column: 1 / 4;
}

.hero-title {
  font-family: var(--font-sans);
  color: var(--color-text-light);
  margin-bottom: 0;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  visibility: hidden;
}

/* Blinking cursor during typewriter */
.hero-title.typing::after {
  content: '|';
  display: inline-block;
  color: var(--color-accent);
  animation: blink 0.7s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-desc {
  grid-column: 1 / 7;
  color: rgba(255, 255, 255, 0.85);
  max-width: none;
  background: #000;
  padding: 8px 20px;
  display: inline-block;
  width: fit-content;
  opacity: 0;
  transform: translateY(8px);
}

.hero-btn {
  display: block;
  opacity: 0;
  transform: translateY(8px);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.1vw, 19px);
  font-weight: 700;
  line-height: 1.8;
  text-decoration: none;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  padding: 13px 44px;
  position: relative;
  transition: background 0.2s ease, transform 0.15s ease;
}

.hero-btn:hover {
  background: #a01a0d;
  transform: translateY(-1px);
}

/* Вуха — decorative ear bars */
.hero-btn::before,
.hero-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.hero-btn::before { left: 16px; }
.hero-btn::after  { right: 16px; }

/* ===========================
   AUDIO PLAYER
=========================== */
.audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.1);
}

#waveform {
  display: block;
  width: 120px;
  height: 24px;
}

/* ===========================
   LANG SWITCHER
=========================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.35);
  padding: 2px 0;
  transition: color 0.2s ease;
  min-width: 32px;
  min-height: 32px;
}

.lang-btn:hover  { color: rgba(0, 0, 0, 0.85); }
.lang-btn.active { color: #000; }

.lang-divider {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.2);
}

/* Audio toggle button */
.audio-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.35);
  transition: color 0.2s ease;
  min-width: 32px;
  min-height: 32px;
  margin-right: 8px;
}
.audio-toggle-btn:hover { color: rgba(0, 0, 0, 0.85); }

/* ===========================
   MARQUEE
=========================== */
.marquee-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9996;
  background: #000;
  overflow: hidden;
  height: 40px;
  display: flex;
  align-items: center;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 140s linear infinite;
}

.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  align-items: center;
  padding-right: 48px;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding-right: 48px;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1;
}

.marquee-time {
  font-family: var(--font-mono);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.marquee-text {
  font-weight: 500;
  color: #fff;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===========================
   SECTION 01 — LABEL
=========================== */
.s01-label {
  margin-bottom: var(--space-10);
}

.s01-label-tag {
  display: inline-block;
  background: #151515;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 20px;
  margin: 0;
}

/* ===========================
   TIMELINE
=========================== */
.timeline {
  margin-top: var(--space-15);
}

/* Секції закінчуються галереєю — без нижнього відступу */
#section-01,
#section-02 {
  padding-bottom: 0;
}

/* Секція форми — окремий екран */
#section-05 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Відступ між датами у тайм-лайні = 64px
   (48px margin + 16px bottom-padding попереднього row = 64px) */
.timeline > * + .timeline-date {
  margin-top: 48px;
}

/* Скорочуємо відстань від чорного лейблу до тексту = 64px
   (24px margin-bottom + 24px margin-top + 16px row padding-top)
   Стосується секцій 02/03/04, де timeline іде одразу після лейблу */
.s01-label + .timeline {
  margin-top: 24px;
}

#section-02 .s01-label,
#section-03 .s01-label,
#section-04 .s01-label {
  margin-bottom: 24px;
}

/* Дата-рядок — вирівняний по колонці 6 */
.timeline-date {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  margin-bottom: 0; /* перший .timeline-row вже має padding-top: 32px */
}

.timeline-date-inner {
  grid-column: 6 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-primary);
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

/* Рядок: 1–5 порожньо | 6 час | 7–12 текст */
.timeline-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  padding-block: 16px;
}

.timeline-time {
  grid-column: 6 / 7;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  color: rgba(0,0,0,0.3);
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.timeline-content {
  grid-column: 8 / -1;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #151515;
  text-align: justify;
}

.timeline-content p + p {
  margin-top: 1em;
}

.timeline-content strong {
  font-weight: 600;
}

.timeline-caption {
  font-size: 12px;
  color: rgba(0,0,0,0.35);
  letter-spacing: 0.03em;
  margin-top: var(--space-3);
}

.tg-caption-right {
  text-align: right;
}

/* ===========================
   DEFINITION CARD — словникова картка
=========================== */
.definition-card {
  background: transparent;
  padding: 28px 0 0;
}

.definition-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.08em;
  color: rgba(21,21,21,0.45);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 0;
}

.definition-card__term {
  font-family: var(--font-sans);
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #151515;
  margin-bottom: 8px;
}

.definition-card__phonetics {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: italic;
  color: rgba(21,21,21,0.5);
  margin-bottom: 20px;
}

.definition-card__text {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: #151515;
}

/* Текст и подпись перед чатом — слева */
.tg-intro {
  text-align: left;
}

/* Контейнер чата — колонка с gap 8px */
.tg-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.tg-chat + p {
  margin-top: 16px;
}

/* Telegram bubble — базовый (исходящий, мой, справа) */
.tg-bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  background: #C21F10;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 16px 16px 4px 16px;
  max-width: 340px;
  align-self: flex-end;
}

.tg-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: -18px;
  align-self: flex-end;
}

/* Telegram voice message bubble */
.tg-bubble--voice {
  padding: 10px 14px 10px;
}

.tg-bubble--voice.tg-bubble--incoming {
  border-radius: 16px !important;
}

/* Входящее (его) — светлое, прижато влево */
.tg-bubble--incoming {
  background: #F0F0F0;
  border-radius: 16px !important;
  align-self: flex-start;
  color: #151515;
}

/* Текстові вхідні бульбашки — та сама максимальна ширина, що й вихідні */
.tg-bubble--incoming:not(.tg-bubble--voice) {
  max-width: 340px;
}

.tg-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 240px;
}

.tg-voice__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #353846;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.tg-bubble--incoming .tg-voice__btn {
  background: #353846;
}

.tg-bubble--incoming .tg-voice__btn:hover {
  background: #2a2b38;
}

/* Исходящее (моё) — біла кнопка з червоним плеєм */
.tg-bubble:not(.tg-bubble--incoming) .tg-voice__btn {
  background: #fff;
  border: none;
}

.tg-bubble:not(.tg-bubble--incoming) .tg-voice__btn:hover {
  background: rgba(255, 255, 255, 0.88);
}

.tg-bubble:not(.tg-bubble--incoming) .tg-voice__play path,
.tg-bubble:not(.tg-bubble--incoming) .tg-voice__pause rect {
  fill: var(--color-accent);
}

.tg-voice__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.tg-read-icon {
  width: 14px;
  height: auto;
  vertical-align: middle;
  opacity: 0.85;
}

.tg-voice__play {
  margin-left: 2px;
}

.tg-voice__wave {
  display: block;
  width: 100%;
  cursor: pointer;
}

.tg-voice__time {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* В покое: duration слева, sent справа */
.tg-voice__duration { order: 1; }
.tg-voice__current  { order: 0; }
.tg-voice__sent     { order: 2; }

/* При воспроизведении: current слева, duration справа */
.tg-voice__time--playing .tg-voice__current  { order: 0; }
.tg-voice__time--playing .tg-voice__duration { order: 2; }
.tg-voice__time--playing .tg-voice__sent     { order: 1; display: none !important; }

.tg-voice__sent {
  opacity: 0.6;
}

/* ── Transcript toggle badge ── */
.tg-voice__transcript-btn {
  flex-shrink: 0;
  margin-left: 6px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}
.tg-bubble--incoming .tg-voice__transcript-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}
.tg-voice__transcript-btn:hover,
.tg-voice__transcript-btn--active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.28);
}
.tg-bubble--incoming .tg-voice__transcript-btn:hover,
.tg-bubble--incoming .tg-voice__transcript-btn--active {
  background: rgba(0, 0, 0, 0.18);
}

/* ── Transcript panel ── */
.tg-transcript {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  width: 100%;
  box-sizing: border-box;
}
.tg-bubble--incoming .tg-transcript {
  border-top-color: rgba(0, 0, 0, 0.1);
  color: #151515;
}
.tg-transcript[hidden] {
  display: none;
}

/* Цвета времени — для входящих тёмные */
.tg-bubble--incoming .tg-voice__time {
  color: rgba(0, 0, 0, 0.4);
}

/* Цвета времени — для исходящих светлые */
.tg-bubble:not(.tg-bubble--incoming) .tg-voice__time {
  color: rgba(255, 255, 255, 0.7);
}

/* Цвет tg-time для входящих */
.tg-bubble--incoming .tg-time {
  color: rgba(0, 0, 0, 0.4);
}

@media (max-width: 1024px) {
  .timeline-date-inner { grid-column: 2 / -1; }
  .timeline-time       { grid-column: 2 / 4; }
  .timeline-content    { grid-column: 4 / -1; }
}

@media (max-width: 768px) {
  .timeline-date  { grid-template-columns: 1fr; }
  .timeline-date-inner { grid-column: 1 / -1; }
  .timeline-row   { grid-template-columns: 56px 1fr; gap: var(--space-3); }
  .timeline-time  { grid-column: 1 / 2; font-size: 12px; }
  .timeline-content { grid-column: 2 / -1; }

  .tg-bubble {
    max-width: 100%;
    margin-left: 0;
  }
}

/* ===========================
   TABLET
=========================== */
@media (max-width: 1024px) {
  .hero-text {
    grid-column: 1 / -1;
  }

  .girl-img,
  .girl-frame {
    height: 85%;
  }
}

/* ===========================
   MOBILE
=========================== */
@media (max-width: 768px) {
  .hero {
    min-height: 100svh;
  }

  .hero-text {
    grid-column: 1 / -1;
    padding: var(--space-3) var(--space-3) var(--space-5);
  }

  .hero-title {
    font-size: 20px;
    white-space: normal;
  }

  .hero-desc {
    font-size: 13px;
    max-width: 100%;
  }

  .hero-btn {
    font-size: 11px;
    padding: 11px 36px;
  }

  .girl-img,
  .girl-frame {
    height: 72%;
  }
}

/* ===========================
   SECTION 01 — INTRO
=========================== */
.s01-empty {
  grid-column: 1 / 6;
}

/* Scroll intro image (left 5 columns) */
.s01-intro__media {
  grid-column: 1 / 6;
  position: relative;
}

.s01-intro__media-sticky {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  height: 600px;
}

.s01-intro__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.s01-intro__img.is-active {
  opacity: 1;
}

.s01-text {
  grid-column: 6 / -1;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-primary);
  text-align: justify;
}

.s01-text p + p {
  margin-top: 1.35em;
}

.s01-list {
  margin-top: 0.75em;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.s01-list li {
  display: flex;
  align-items: flex-start;
}

.s01-list li::before {
  content: '–';
  margin-right: 0.5em;
  color: var(--color-accent);
  flex-shrink: 0;
  line-height: 1.5;
}

/* Абзац перед списком — жирний */
.s01-text p:has(+ .s01-list) {
  font-weight: 600;
}

@media (max-width: 1024px) {
  .s01-empty        { display: none; }
  .s01-intro__media { display: none; }
  .s01-text         { grid-column: 1 / -1; }
}

/* ===========================
   SMALL MOBILE
=========================== */
@media (max-width: 390px) {
  .girl-img,
  .girl-frame {
    height: 60%;
  }

  .hero-title {
    font-size: 18px;
  }
}

/* ===========================
   PHOTO BUBBLE
=========================== */
.tg-bubble--photo {
  padding: 0;
  max-width: 280px;
  overflow: hidden;
}

.tg-photo {
  display: block;
  width: 100%;
  height: auto;
}

.tg-photo-footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 10px 8px;
  width: 100%;
  box-sizing: border-box;
}

.tg-photo-caption {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
  flex: 1;
}

.tg-photo-footer .tg-time {
  margin-top: 0;
  flex-shrink: 0;
}

/* ===========================
   VIDEO CIRCLE BUBBLE
=========================== */
.tg-bubble--videocircle {
  background: transparent;
  padding: 0;
  border-radius: 0;
  gap: 4px;
  align-items: flex-end;
}

.tg-videocircle {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #111;
  cursor: pointer;
  flex-shrink: 0;
}

.tg-videocircle__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-videocircle__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.tg-videocircle__play.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Bottom gradient for readability inside the circle */
.tg-videocircle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38%;
  background: linear-gradient(to top, rgba(0,0,0,0.50) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 0 0 50% 50%;
}

/* Time + checkmarks — aligned to bottom of circle */
.tg-bubble--videocircle .tg-time {
  margin-top: -10px;
  opacity: 1;
  color: rgba(0,0,0,0.35);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}

/* Checkmarks dark */
.tg-bubble--videocircle .tg-read-icon {
  opacity: 0.6;
  filter: brightness(0);
}

/* ===========================
   DEFINITION CARD — grid position (story layout)
=========================== */
.definition-card {
  grid-column: 1 / 6;
  background: transparent;
  padding: 0;
  align-self: start;
}

.timeline-row--def .timeline-content {
  grid-column: 7 / -1;
}

@media (max-width: 1024px) {
  .definition-card {
    grid-column: 1 / -1;
    margin-bottom: 32px;
  }
  .timeline-row--def .timeline-content {
    grid-column: 1 / -1;
  }
}

/* ===========================
   HORIZONTAL GALLERY
=========================== */
.h-gallery {
  height: 550px;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  margin-top: 32px;
  /* коли горизонтальний скрол закінчився — не блокуємо вертикальний скрол сторінки */
  overscroll-behavior-x: contain;
  /* приховуємо системний скролбар */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.h-gallery::-webkit-scrollbar {
  display: none;
}

.h-gallery__track {
  display: flex;
  height: 100%;
  gap: 24px;
  /* Лівий відступ = відступ контейнера */
  padding-left: calc(var(--margin) + max(0px, (100vw - (var(--max-width) + var(--margin) * 2)) / 2));
}

/* Правий padding через ::after — padding-right у flex scroll-контейнері ігнорується браузерами */
.h-gallery__track::after {
  content: '';
  flex-shrink: 0;
  width: calc(var(--margin) + max(0px, (100vw - (var(--max-width) + var(--margin) * 2)) / 2));
}

.h-gallery__item {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 64px;
  box-sizing: border-box;
}

.h-gallery__img-wrap {
  flex-shrink: 0;
}

.h-gallery__img {
  display: block;
}

.h-gallery__text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: #151515;
  max-width: 100%;
}

@media (max-width: 768px) {
  .h-gallery__track {
    gap: 16px;
  }
  .h-gallery__text {
    font-size: 13px;
  }
}

/* Контент після галереї всередині секції */
.h-gallery + .container {
  margin-top: 64px;
}

/* ===========================
   GALLERY SCROLL ZONE
   Вертикальний скрол → горизонтальна галерея
=========================== */
.gallery-scroll-zone {
  position: relative;
  margin-top: 32px;
}

/* Контент після зони */
.gallery-scroll-zone + .container {
  margin-top: 64px;
}

/* Галерея всередині зони — sticky */
.gallery-scroll-zone > .h-gallery {
  position: sticky;
  top: calc(var(--header-h) + 200px);
  margin-top: 0;
  overflow-x: hidden; /* скрол керується через JS / scrollLeft */
}

/* Мобільний — вимикаємо scroll-jacking, повертаємо нативний скрол */
@media (max-width: 768px) {
  .gallery-scroll-zone {
    height: auto !important;
  }
  .gallery-scroll-zone > .h-gallery {
    position: static;
    margin-top: 32px;
    overflow-x: auto;
  }
}

/* ===========================
   SECTION 04 — ПРО ПРОЄКТ + ФОРМА
   Desktop: 6 / 1 / 5 grid layout
=========================== */
.s04-layout {
  align-items: start;
  margin-top: 24px;
}

.s04-img {
  grid-column: 1 / 7;
  grid-row: 1;
  margin: 0 0 16px 0;
}

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

.s04-form {
  grid-column: 1 / 7;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 0;
  background-image: url('../images/0000.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 40px 48px 56px 78px;
}

.s04-form::before,
.s04-form::after {
  display: none;
}

@media (max-width: 768px) {
  .s04-form {
    background-image: none;
    background: #F7F5F2;
    padding: 24px 20px;
  }
}

.s04-text {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #151515;
  text-align: justify;
}

.s04-text p + p {
  margin-top: 1em;
}

@media (max-width: 1024px) {
  .s04-form { grid-column: 1 / -1; }
  .s04-text { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .s04-form { grid-column: 1 / -1; }
  .s04-text { grid-column: 1 / -1; }
}

/* ===========================
   STORY FORM — section 05
=========================== */
.story-form {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.story-form__inner {
  grid-column: 2 / -1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.form-intro {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #151515;
  text-align: left;
  line-height: 1.6;
  margin-bottom: 28px;
  align-self: start;
  /* вирівняно по лівому краю інпутів (кінець 2-ї колонки сітки) */
  padding-left: calc(78px + 24px);
}

.form-field {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  gap: 24px;
}

.form-field:last-of-type {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.form-label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #151515;
  padding-top: 2px;
}

.form-label .req {
  color: var(--color-accent);
  margin-left: 2px;
}

.form-input,
.form-textarea {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: #151515;
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
}

.form-textarea {
  resize: none;
  min-height: 260px;
  line-height: 1.65;
}

.form-file-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 768px) {
  .form-intro {
    align-self: stretch;
    max-width: none;
    text-align: left;
  }
  .form-field {
    grid-template-columns: 78px 1fr;
    padding: 18px 0 14px;
  }
}

/* File upload */
.form-file {
  display: none;
}

.form-file-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.18);
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  width: fit-content;
}

.form-file-label:hover {
  background: #151515;
  color: #fff;
  border-color: #151515;
}

.form-file-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 6px;
}

/* ===========================
   FILE CARD — паперовий клаптик
=========================== */
.file-card-wrap {
  /* Виходить поверх форми — прив'язаний до .s04-form */
  position: absolute;
  left: 44px;
  top: 380px;
  padding-top: 22px;
  width: 210px;
  z-index: 20;
  transform: rotate(-1.2deg);
}

.file-card__pin {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: auto;
  z-index: 2;
  pointer-events: none;
}

.file-card {
  position: relative;
  background: #EDE8E4;
  clip-path: polygon(
    7px 0%, calc(100% - 7px) 0%,
    100% 7px, 100% calc(100% - 7px),
    calc(100% - 7px) 100%, 7px 100%,
    0% calc(100% - 7px), 0% 7px
  );
  padding: 14px 18px 18px;
}

.file-card__close {
  position: absolute;
  top: 7px;
  right: 9px;
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: rgba(4, 9, 20, 0.35);
  cursor: pointer;
  padding: 2px 3px;
  transition: color 0.15s ease;
}

.file-card__close:hover {
  color: rgba(4, 9, 20, 0.8);
}

.file-card__date {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: rgba(4, 9, 20, 0.72);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
  padding-right: 18px;
}

.file-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-card__list li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: rgba(4, 9, 20, 0.72);
  line-height: 1.4;
  border-bottom: 1px solid rgba(4, 9, 20, 0.12);
  padding-bottom: 4px;
}

.item-remove {
  background: none;
  border: none;
  font-size: 13px;
  line-height: 1;
  color: rgba(4, 9, 20, 0.3);
  cursor: pointer;
  padding: 0 0 0 4px;
  transition: color 0.15s ease;
}

.item-remove:hover {
  color: rgba(4, 9, 20, 0.8);
}

.file-card__list li .item-num {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(4, 9, 20, 0.4);
  padding-top: 1px;
}

.file-card__list li .item-name {
  word-break: break-all;
}

/* Submit */
.form-submit {
  margin-top: 32px;
  width: fit-content;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  padding: 13px 48px;
  position: relative;
  transition: background 0.2s ease, transform 0.15s ease;
}

.form-submit:hover {
  background: #a01a0d;
  transform: translateY(-1px);
}

/* Вуха — decorative ear bars */
.form-submit::before,
.form-submit::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.form-submit::before { left: 18px; }
.form-submit::after  { right: 18px; }

.form-success {
  display: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  padding-top: 8px;
}

@media (max-width: 1024px) {
  .story-form__inner {
    grid-column: 1 / -1;
  }
}

/* ===========================
   TIMELINE 2402 — LAYERED MAP
=========================== */
.timeline-2402 {
  margin-top: var(--space-15);
}

.timeline-2402 .timeline {
  margin-top: 0;
}

/* Timeline-right займає повну ширину — карта overlays зліва через position:fixed */
.timeline-2402 .timeline-right {
  grid-column: 1 / -1;
}

/* === FIXED MAP — scrollytelling === */
.map-fixed {
  position: fixed;
  top: calc(var(--header-h) + 124px);
  left: 0;
  right: 0;
  height: 600px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.map-fixed.is-map-visible {
  opacity: 1;
}

/* Pin-release: відліплюємо від viewport, залишаємо в document flow */
.map-fixed.is-released {
  position: absolute;
}

.map-fixed__inner {
  max-width: calc(var(--max-width) + var(--margin) * 2);
  margin-inline: auto;
  padding-inline: var(--margin);
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--gutter);
  height: 100%;
}

.map-fixed .map-layers {
  grid-column: 1;
  position: relative;
  height: 100%;
}

.map-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.map-layer.is-visible {
  opacity: 1;
}

/* Layer 1 always visible (base map) */
.map-fixed .map-layer:first-child {
  opacity: 1;
}


/* Tablet & mobile: hide fixed map */
@media (max-width: 1024px) {
  .map-fixed {
    display: none;
  }
}

@media (max-width: 768px) {
  .timeline-2402 .timeline-date-inner {
    grid-column: 1 / -1;
  }

  .timeline-2402 .timeline-time {
    grid-column: 1 / 2;
  }

  .timeline-2402 .timeline-content {
    grid-column: 2 / -1;
  }
}
