:root {
  --ink: #18363a;
  --ink-soft: #486065;
  --paper: #f2f0ea;
  --paper-deep: #e8ebe7;
  --aqua: #9abfba;
  --peach: #d29d83;
  --line: rgba(24, 54, 58, 0.18);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.is-loading {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 1.1rem;
  min-height: 100svh;
  color: var(--ink);
  background: var(--paper);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__brand {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.loader__track {
  width: min(16rem, 62vw);
  height: 1px;
  overflow: hidden;
  background: rgba(24, 54, 58, 0.15);
}

.loader__track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--peach);
  transform: scaleX(0.03);
  transform-origin: left;
  transition: transform 160ms linear;
}

.loader p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: max(1.3rem, env(safe-area-inset-top)) clamp(1.2rem, 4vw, 4rem) 1rem;
  pointer-events: none;
}

.brand,
.header-link {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.045em;
}

.brand__descriptor {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0 1.1rem;
  border: 1px solid rgba(24, 54, 58, 0.2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(244, 242, 236, 0.56);
  backdrop-filter: blur(14px);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 200ms ease, border-color 200ms ease;
}

.header-link:hover {
  border-color: rgba(24, 54, 58, 0.4);
  background: rgba(244, 242, 236, 0.8);
}

.journey {
  position: relative;
  height: 720vh;
  background: #dfe6e3;
}

.stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  min-height: 36rem;
  overflow: hidden;
  background-color: #dfe6e3;
  background-position: var(--focus-x, 50%) center;
  background-size: cover;
}

.journey-video,
.still-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.journey-video {
  z-index: 1;
  object-fit: cover;
  object-position: var(--focus-x, 50%) center;
  filter: saturate(0.88) contrast(0.98);
  opacity: 0;
  transition: opacity 550ms ease, object-position 800ms ease;
}

.journey-video.is-ready {
  opacity: 1;
}

.still-fallback {
  z-index: 0;
  background-image: url("./assets/poster.jpg");
  background-position: var(--focus-x, 50%) center;
  background-size: cover;
  transition: background-image 250ms ease, background-position 800ms ease;
}

.image-wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(239, 241, 237, 0.92) 0%, rgba(239, 241, 237, 0.53) 30%, transparent 58%),
    linear-gradient(180deg, rgba(239, 241, 237, 0.28) 0%, transparent 25%, rgba(14, 36, 39, 0.11) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.27'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.chapters {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.chapter {
  --chapter-opacity: 0;
  --chapter-shift: 22px;
  position: absolute;
  left: clamp(1.4rem, 7vw, 7.5rem);
  bottom: clamp(6.5rem, 17vh, 11rem);
  width: min(38rem, calc(100vw - 8rem));
  opacity: var(--chapter-opacity);
  transform: translate3d(0, var(--chapter-shift), 0);
  transition: opacity 160ms linear, transform 220ms ease-out;
  will-change: opacity, transform;
}

.chapter.is-interactive {
  pointer-events: auto;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.chapter .eyebrow {
  color: var(--ink-soft);
}

.chapter h1,
.chapter h2,
.contact h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.055em;
}

.chapter h1,
.chapter h2 {
  max-width: 11ch;
  font-size: clamp(3rem, 6.8vw, 7.1rem);
  line-height: 0.9;
  text-wrap: balance;
}

.chapter__body {
  max-width: 29rem;
  margin: 1.35rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.25vw, 1.14rem);
  line-height: 1.6;
}

.chapter--final .button {
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.35rem;
  padding: 0 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--glass {
  border-color: rgba(24, 54, 58, 0.25);
  color: var(--ink);
  background: rgba(246, 244, 238, 0.68);
  backdrop-filter: blur(16px);
}

.route-rail {
  position: absolute;
  right: clamp(1.4rem, 3.5vw, 3.5rem);
  top: 50%;
  z-index: 8;
  display: grid;
  gap: 0.75rem;
  transform: translateY(-50%);
}

.route-rail button {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.route-rail button::before,
.route-rail button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  content: "";
  transform: translate(-50%, -50%);
}

.route-rail button::before {
  width: 4px;
  height: 4px;
  background: rgba(24, 54, 58, 0.42);
}

.route-rail button::after {
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid transparent;
  transition: border-color 200ms ease, transform 200ms ease;
}

.route-rail button[aria-current="step"]::before {
  background: var(--ink);
}

.route-rail button[aria-current="step"]::after {
  border-color: rgba(24, 54, 58, 0.48);
  transform: translate(-50%, -50%) scale(1.12);
}

.scroll-cue {
  position: absolute;
  left: clamp(1.4rem, 4vw, 4rem);
  bottom: max(1.4rem, env(safe-area-inset-bottom));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(24, 54, 58, 0.7);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  transition: opacity 250ms ease;
}

.scroll-cue i {
  position: relative;
  display: block;
  width: 3rem;
  height: 1px;
  overflow: hidden;
  background: rgba(24, 54, 58, 0.25);
}

.scroll-cue i::after {
  position: absolute;
  inset: 0;
  background: var(--ink);
  content: "";
  animation: cue 1.9s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes cue {
  55%, 100% { transform: translateX(100%); }
}

.journey-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  height: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.journey-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--peach), var(--aqua));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.contact {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(7rem, 14vw, 13rem) clamp(1.4rem, 8vw, 8rem);
  background:
    radial-gradient(circle at 78% 24%, rgba(154, 191, 186, 0.36), transparent 25rem),
    linear-gradient(135deg, #f3f0e9, #e8ece8);
}

.contact::before {
  position: absolute;
  top: -18vw;
  right: -8vw;
  width: 58vw;
  aspect-ratio: 1;
  border: 1px solid rgba(24, 54, 58, 0.11);
  border-radius: 50%;
  content: "";
}

.contact__inner {
  position: relative;
  z-index: 1;
  max-width: 62rem;
}

.contact h2 {
  max-width: 12ch;
  font-size: clamp(3.8rem, 9vw, 9.5rem);
  line-height: 0.87;
}

.contact__lead {
  max-width: 36rem;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.7;
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.2rem;
}

.button--primary {
  color: #f7f4ed;
  background: var(--ink);
}

.button--primary:hover {
  background: #275359;
}

.button--quiet {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.34);
}

.email-link {
  display: inline-block;
  margin-top: 1.6rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-underline-offset: 0.3em;
}

.contact__signature {
  position: absolute;
  right: clamp(1.4rem, 4vw, 4rem);
  bottom: 2rem;
  left: clamp(1.4rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(24, 54, 58, 0.56);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.contact__signature i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem clamp(1.4rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

footer a {
  text-decoration: none;
}

.noscript-note {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  background: var(--ink);
}

@media (max-width: 760px) {
  .site-header {
    padding-inline: 1.1rem;
  }

  .brand__descriptor {
    display: none;
  }

  .brand__name {
    text-shadow:
      0 1px 12px rgba(244, 242, 236, 0.94),
      0 0 24px rgba(244, 242, 236, 0.7);
  }

  .header-link {
    min-height: 2.2rem;
    padding-inline: 0.9rem;
  }

  .journey {
    height: 660vh;
  }

  .stage {
    min-height: 32rem;
  }

  .image-wash {
    background:
      linear-gradient(180deg, rgba(238, 241, 237, 0.08) 28%, rgba(238, 241, 237, 0.78) 71%, rgba(238, 241, 237, 0.94) 100%);
  }

  .chapter {
    right: 1.2rem;
    bottom: calc(5.3rem + env(safe-area-inset-bottom));
    left: 1.2rem;
    width: auto;
  }

  .chapter h1,
  .chapter h2 {
    max-width: 10ch;
    font-size: clamp(3rem, 15vw, 5.2rem);
  }

  .chapter__body {
    max-width: 28rem;
    font-size: 0.93rem;
  }

  .route-rail {
    top: auto;
    right: 1.1rem;
    bottom: calc(1.2rem + env(safe-area-inset-bottom));
    left: auto;
    grid-auto-flow: column;
    transform: none;
  }

  .scroll-cue {
    left: 1.2rem;
    bottom: calc(1.4rem + env(safe-area-inset-bottom));
  }

  .scroll-cue span {
    display: none;
  }

  .scroll-cue i {
    width: 2rem;
  }

  .contact {
    padding: 8rem 1.4rem 7rem;
  }

  .contact h2 {
    font-size: clamp(3.7rem, 17vw, 6.3rem);
  }

  .contact__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .contact__actions .button {
    width: 100%;
  }

  .contact__signature {
    gap: 0.55rem;
    font-size: 0.5rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }
}

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

  .journey-video,
  .grain {
    display: none;
  }

  .loader,
  .chapter,
  .still-fallback {
    transition: none;
  }

  .scroll-cue i::after {
    animation: none;
  }
}
