:root {
  --bg: #f4f3ef;
  --text: #171717;
  --muted: #77756f;
  --line: #d8d6d0;
  --accent: #b8893d;
  --dark: #191a19;
  --border-dark: #383936;
  --thread: #f4f3ef;
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191a19;
    --text: #f4f3ef;
    --muted: #8b8a84;
    --line: #383936;
    --accent: #b8893d;
    --dark: #111211;
  }
}

/* ─────────────────────────
   RESET / BASE
   ───────────────────────── */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  line-height: 1.55;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.container {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

/* ─────────────────────────
   HEADER
   ───────────────────────── */

header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;

  .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.04em;
  }

  .status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
  }

  .status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2.5s infinite;
  }
}

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

  50% {
    opacity: 0.3;
  }
}

/* ─────────────────────────
   HERO
   ───────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  align-items: start;
  padding: 100px 0 70px;
  border-bottom: 1px solid var(--line);

  h1 {
    max-width: 850px;
    font-size: clamp(58px, 9vw, 130px);
    line-height: 0.88;
    letter-spacing: -0.075em;
    font-weight: 500;

    span {
      color: var(--muted);
    }
  }

  .hero-side {
    align-self: center;
    padding-bottom: 8px;
    max-width: 300px;

    p {
      margin-top: 5px;
      font-size: 15px;
      color: var(--muted);
    }
  }

  .scroll {
    margin-top: 42px;
    color: var(--text);
    display: block;

    &::before {
      content: "↓";
      display: inline-block;
      margin-right: 10px;
      font-size: 15px;
    }
  }
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 25px;
}

/* ─────────────────────────
   INTRO
   ───────────────────────── */

.intro {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding: 140px 0;
  border-bottom: 1px solid var(--line);
}

.section-label {
  color: var(--muted);
}

.intro-text {
  max-width: 760px;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

/* ─────────────────────────
   TIMELINE
   ───────────────────────── */

.story {
  padding: 120px 0;

  .story-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 35px;
    border-bottom: 1px solid var(--line);

    h2 {
      font-size: 42px;
      letter-spacing: -0.05em;
      font-weight: 500;
    }
  }
}

#chapters {
  scroll-margin-top: 40px;
}

.chapter {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  padding: 75px 0;
  border-bottom: 1px solid var(--line);
}

.chapter-meta {
  color: var(--muted);
}

.chapter-number {
  font-size: 12px;
  margin-bottom: 12px;
}

.chapter-title {
  font-size: 14px;
  color: var(--text);
}

.chapter-location {
  color: var(--accent);
  margin-bottom: 18px;
}

.chapter-content {
  max-width: 700px;

  h3 {
    font-size: clamp(32px, 4vw, 55px);
    line-height: 1;
    letter-spacing: -0.055em;
    font-weight: 500;
    margin-bottom: 30px;
  }

  p {
    font-size: 18px;
    color: var(--text);
    max-width: 650px;
  }
}

/* ─────────────────────────
   THREAD
   ───────────────────────── */

.thread {
  padding: 130px 0;
  background: var(--dark);
  color: var(--thread);

  .section-label {
    color: var(--muted);
  }

  .thread-content {
    max-width: 780px;

    h2 {
      font-size: clamp(42px, 6vw, 78px);
      line-height: 0.95;
      letter-spacing: -0.065em;
      font-weight: 500;
      margin-bottom: 70px;
    }
  }
}

.thread-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
}

.connections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-dark);
}

.connection {
  padding: 25px 0;
  border-bottom: 1px solid var(--border-dark);

  &:nth-child(odd) {
    margin-right: 30px;
  }

  span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
  }

  strong {
    font-size: 21px;
    font-weight: 400;
  }
}

/* ─────────────────────────
   CLOSING
   ───────────────────────── */

.closing {
  padding: 160px 0;

  .closing-inner {
    max-width: 1000px;
  }

  .closing-label {
    margin-bottom: 35px;
  }

  h2 {
    font-size: clamp(52px, 8vw, 110px);
    line-height: 0.9;
    letter-spacing: -0.075em;
    font-weight: 500;

    span {
      color: var(--muted);
    }
  }

  p {
    margin-top: 55px;
    max-width: 500px;
    font-size: 18px;
    color: var(--muted);
  }
}

/* ─────────────────────────
   FOOTER
   ───────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;

  .container {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
  }

  .mono {
    text-transform: initial;
  }

  .status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.25;
    animation: dot-blink 1.4s infinite ease-in-out;

    &:nth-child(2) {
      animation-delay: 0.2s;
    }

    &:nth-child(3) {
      animation-delay: 0.4s;
    }
  }
}

.status-dots {
  display: inline-flex;
  gap: 5px;
  margin-left: 5px;
  margin-bottom: 2px;
  vertical-align: text-bottom;
}

@keyframes dot-blink {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }

  30% {
    opacity: 1;
  }
}

/* ─────────────────────────
   REVEAL
   ───────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;

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

/* ─────────────────────────
   MOBILE
   ───────────────────────── */

@media (max-width: 1280px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 32px), var(--max));
  }

  .hero {
    grid-template-columns: 1fr 1fr;
  }

  .intro,
  .chapter,
  .thread-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .intro {
    padding: 90px 0;
  }

  .story {
    padding: 80px 0;
  }

  .chapter {
    padding: 55px 0;
  }

  .connections {
    grid-template-columns: 1fr;
  }

  .connection {
    &:nth-child(odd) {
      margin-right: 0;
    }
  }

  .thread {
    padding: 90px 0;
  }

  .closing {
    padding: 100px 0;
  }

  footer {
    .container {
      flex-direction: column;
      gap: 10px;
    }
  }
}

@media (max-width: 580px) {
  .container {
    width: min(calc(100% - 32px), var(--max));
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 80px 0 50px;

    .hero-side {
      margin-top: 70px;
    }
  }
}
