:root {
  --purple: #392ca6;
  --orange: #ec8541;
  --white: #ffffff;
  --ease: cubic-bezier(0.77, 0, 0.175, 1);
  --slide: 0.9s;
}

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

html, body { margin: 0; height: 100%; }

body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 58fr 42fr;
  background: #fff;
  font-family: "Figtree", system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Colour panels ---------- */
.panel {
  position: relative;
  animation: var(--slide) var(--ease) both;
}

.panel--top {
  background: var(--purple);
  animation-name: from-left;
}

.panel--bottom {
  background: var(--orange);
  animation-name: from-right;
  animation-delay: 0.35s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1rem clamp(4rem, 8vh, 5rem);
}

@keyframes from-left  { from { transform: translateX(-100%); } }
@keyframes from-right { from { transform: translateX(100%); } }

/* ---------- Staggered intro ---------- */
.intro {
  margin: 0;
  padding: clamp(5rem, 13vh, 8.5rem) clamp(1rem, 8vw, 9rem) 0;
  list-style: none;
  color: var(--white);
  font-size: clamp(1.5rem, 2.15vw, 2.15rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}

.intro li {
  margin-bottom: 0.53em;
  white-space: nowrap;
  opacity: 0;
  animation: line-in 0.7s var(--ease) forwards;
}

/* Each line steps further across the page */
.intro li:nth-child(1) { padding-left: 4%;  animation-delay: 1.2s; --dir: -1; }
.intro li:nth-child(2) { padding-left: 26%; animation-delay: 1.45s; --dir: 1; }
.intro li:nth-child(3) { padding-left: 47%; animation-delay: 1.7s; --dir: -1; }
.intro li:nth-child(4) { text-align: right; animation-delay: 1.95s; --dir: 1; }

/* Lines alternate the side they arrive from, echoing the panels */
@keyframes line-in {
  from { opacity: 0; transform: translateX(calc(var(--dir) * 2.5rem)); }
  to   { opacity: 1; transform: none; }
}

.accent { color: var(--orange); }

.intro a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.12em;
  transition: color 0.2s, border-color 0.2s;
}
.intro a:hover,
.intro a:focus-visible { color: var(--orange); }
.intro a:focus-visible { outline: 2px solid var(--orange); outline-offset: 6px; }

/* ---------- Footnote ---------- */
.footnote {
  margin: 0;
  font-family: "Raleway", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--purple);
  text-align: center;
  opacity: 0;
  animation: fade-up 0.7s ease-out 2.3s forwards;
}
.footnote sup { font-size: 0.6em; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Small screens: tighten the stagger ---------- */
@media (max-width: 640px) {
  .intro li:nth-child(1) { padding-left: 0; }
  .intro li:nth-child(2) { padding-left: 12%; }
  .intro li:nth-child(3) { padding-left: 24%; }
  .intro li:nth-child(4) { padding-right: 4%; }
}

@media (max-width: 400px) {
  .intro li:nth-child(3) { padding-left: 14%; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel, .intro li, .footnote {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
