:root {
  --paper: #eee8dc;
  --paper-2: #e2dacb;
  --ink: #161511;
  --muted: #706a5f;
  --line: rgba(22, 21, 17, .2);
  --red: #b84935;
  --blue: #2f6172;
  --green: #778d77;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Noto Sans TC", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.nav-open {
  overflow: hidden;
}

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

button {
  border: 0;
  color: inherit;
  font: inherit;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  background: var(--paper);
}

.film-grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .2;
  background-image:
    linear-gradient(90deg, rgba(22, 21, 17, .04) 1px, transparent 1px),
    linear-gradient(rgba(22, 21, 17, .035) 1px, transparent 1px);
  background-size: 22px 22px;
  mix-blend-mode: multiply;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 34px 42px;
  pointer-events: none;
}

.brand,
.nav,
.menu {
  pointer-events: auto;
}

.brand {
  display: grid;
  gap: 13px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.brand span:last-child {
  max-width: 118px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.nav {
  display: flex;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
}

.nav a {
  position: relative;
}

.nav a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
  content: "";
}

.nav a:hover::after {
  transform: scaleX(1);
}

.menu {
  display: none;
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: 86px 26px;
  background: rgba(238, 232, 220, .96);
  transform: translateY(-100%);
  transition: transform .7s cubic-bezier(.77, 0, .18, 1);
}

.mobile-nav a {
  width: fit-content;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: clamp(42px, 15vw, 86px);
  line-height: .92;
}

body.nav-open .mobile-nav {
  transform: translateY(0);
}

main {
  position: relative;
  z-index: 5;
}

.scroll-film {
  position: relative;
  height: 1120vh;
}

.fixed-stage {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow: hidden;
}

.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(880px, calc(100vw - 44px));
  padding-left: clamp(22px, 7vw, 118px);
  opacity: 0;
  transform: translate3d(0, 42px, 0) scale(.985);
  filter: blur(8px);
  transition:
    opacity .45s linear,
    transform .65s cubic-bezier(.22, 1, .36, 1),
    filter .55s linear;
  pointer-events: none;
}

.chapter.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.chapter-hero {
  justify-content: flex-end;
  padding-bottom: 11vh;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 52px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow span {
  display: block;
  width: 84px;
  height: 1px;
  background: currentColor;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-weight: 400;
  line-height: .98;
  letter-spacing: 0;
}

h1 {
  max-width: 1040px;
  font-size: clamp(54px, 8.5vw, 132px);
}

h1 span {
  display: block;
}

h2 {
  max-width: 760px;
  font-size: clamp(42px, 6.8vw, 92px);
}

.lede,
.chapter p:not(.eyebrow) {
  max-width: 610px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.85;
}

.chapter a {
  width: fit-content;
  margin-top: 34px;
  color: var(--red);
  font-size: clamp(18px, 2vw, 25px);
  border-bottom: 1px solid currentColor;
}

.service-notes {
  position: absolute;
  right: clamp(22px, 7vw, 108px);
  bottom: 10vh;
  display: grid;
  gap: 12px;
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition: opacity .45s linear, transform .55s ease;
  color: rgba(22, 21, 17, .62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.service-notes.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.service-notes p {
  margin: 0;
  padding-top: 11px;
  border-top: 1px solid rgba(22, 21, 17, .22);
}

.timeline {
  position: fixed;
  right: 32px;
  bottom: 30px;
  z-index: 20;
  width: 96px;
  height: 1px;
  background: rgba(22, 21, 17, .2);
}

.timeline span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
}

@media (max-width: 820px) {
  .site-header {
    padding: 24px 22px;
  }

  .nav {
    display: none;
  }

  .menu {
    display: block;
  }

  .scroll-film {
    height: 980vh;
  }

  .chapter {
    justify-content: flex-end;
    padding: 0 22px 12vh;
    width: 100vw;
  }

  .eyebrow {
    margin-bottom: 34px;
  }

  .eyebrow span {
    width: 42px;
  }

  .service-notes {
    right: auto;
    left: 22px;
    bottom: 3vh;
    grid-template-columns: repeat(2, max-content);
    column-gap: 18px;
    row-gap: 8px;
  }

  .timeline {
    right: 22px;
    bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .chapter,
  .mobile-nav,
  .service-notes,
  .nav a::after {
    transition: none;
  }
}
