:root {
  --color-bg: #f8f1e4;
  --color-text: #3d2b1f;
  --color-accent: #c1622d;
  --color-accent-dark: #8a4620;
  --color-sage: #7a8b5c;
  --color-sky: #6e9c97;
  --color-egg: #efb238;
  --color-panel: #fffdf8;
  --color-line: #dfceac;
  --shadow-soft: 0 8px 24px rgba(61, 43, 31, 0.12);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
}

.header-inner,
main,
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

/* Header */

.site-header {
  padding-top: var(--space-4);
  padding-bottom: var(--space-3);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pigeon-mark {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  margin: 0;
  line-height: 1.1;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--color-accent-dark);
  font-size: 1rem;
}

/* Stream section */

.stream-section {
  padding-bottom: var(--space-4);
}

.stream-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.video-wrapper {
  position: relative;
  flex: 1 1 auto;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-soft);
}

.video-wrapper .yt-target,
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.state-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3);
  background: var(--color-panel);
}

.status-loading,
.status-offline {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
}

.stream-layout[data-state="loading"] .yt-target {
  visibility: hidden;
}
.stream-layout[data-state="loading"] .state-overlay,
.stream-layout[data-state="loading"] .status-loading {
  display: flex;
}

.stream-layout[data-state="offline"] .yt-target {
  display: none;
}
.stream-layout[data-state="offline"] .state-overlay,
.stream-layout[data-state="offline"] .status-offline {
  display: flex;
}

.loading-egg {
  width: 28px;
  height: 34px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--color-egg);
  animation: egg-pulse 1.8s ease-in-out infinite;
}

.pigeon-illustration {
  width: min(240px, 60%);
  height: auto;
}

.chat-icon {
  width: 64px;
  height: auto;
}

.pigeon-bob {
  animation: pigeon-bob 3s ease-in-out infinite;
}

@keyframes egg-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes pigeon-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-egg,
  .pigeon-bob {
    animation: none;
  }
}

.chat-wrapper {
  position: relative;
  flex: 0 0 auto;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-panel);
}

.chat-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (min-width: 900px) {
  .stream-layout {
    flex-direction: row;
    align-items: stretch;
  }
  .video-wrapper {
    flex: 1 1 auto;
  }
  .chat-wrapper {
    flex: 0 0 320px;
    height: auto;
  }
}

/* Timeline */

.timeline-section {
  padding-bottom: var(--space-5);
}

.timeline-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  margin-bottom: var(--space-3);
}

.timeline-scroll {
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.timeline-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding-left: 2rem;
  max-width: 640px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--color-line);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-3);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--color-egg);
}

.timeline-date {
  display: block;
  font-weight: 800;
  color: var(--color-accent-dark);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-text {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-top: 0.15rem;
}

/* Above the breakpoint, the timeline runs left-to-right instead of
   top-to-bottom. It scrolls horizontally once entries outgrow the
   available width, rather than squeezing items down over time. */
@media (min-width: 900px) {
  .timeline-list {
    display: inline-flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-4);
    padding-left: 0;
    max-width: none;
  }

  .timeline-list::before {
    left: 0;
    right: 0;
    top: 0.5rem;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .timeline-item {
    flex: 0 0 200px;
    padding-top: 1.75rem;
    padding-bottom: 0;
  }

  .timeline-item::before {
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
  }
}

/* Footer */

.site-footer {
  padding: var(--space-3) 0 var(--space-4);
  text-align: center;
  color: var(--color-accent-dark);
  font-size: 0.95rem;
}
