:root {
  --cream: #fff6df;
  --soft: rgba(255, 246, 223, 0.78);
  --gold: #d6f05f;
  --gold-warm: #ffd27c;
  --green: #7da540;
  --deep: #07110b;
  --panel: rgba(5, 12, 8, 0.72);
  --line: rgba(255, 246, 223, 0.18);
  --progress: 0;
  --camera-x: 0%;
  --camera-y: 0%;
  --camera-scale: 1;
  --camera-origin: 50% 50%;
  --gate-scale: 1;
  --gate-opacity: 1;
  --gate-copy-opacity: 1;
  --gate-blur: 0px;
  --map-opacity: 0;
  --grass-x: 0px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06100b;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(circle at 50% 45%, transparent 0 42%, rgba(3, 8, 5, 0.36) 76%, rgba(2, 5, 3, 0.9) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 24% 76%, rgba(0, 0, 0, 0.5));
}

body::after {
  opacity: 0.11;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 100% 3px;
  mix-blend-mode: overlay;
}

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

#atmosphere {
  position: fixed;
  inset: 0;
  z-index: 18;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(16px, 2.8vw, 34px) clamp(18px, 4.8vw, 72px);
  color: rgba(255, 246, 223, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.08rem, 2vw, 1.72rem);
  font-weight: 300;
  letter-spacing: 0.05em;
}

.brand span span {
  color: var(--green);
  font-weight: 800;
}

.brand-leaf {
  width: 30px;
  aspect-ratio: 1;
  border: 2px solid var(--green);
  border-radius: 80% 10% 80% 10%;
  transform: rotate(-45deg);
  box-shadow: 0 0 26px rgba(157, 202, 79, 0.42);
}

.journey-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(8px, 1.35vw, 20px);
  max-width: 820px;
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.journey-nav a {
  opacity: 0.62;
  transition: color 240ms ease, opacity 240ms ease;
}

.journey-nav a:hover,
.journey-nav a.is-active {
  color: var(--gold);
  opacity: 1;
}

.journey {
  position: relative;
  z-index: 2;
}

.map-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 205, 125, 0.2), transparent 28%),
    #07110b;
}

.gateway-stage {
  position: absolute;
  inset: 0;
  z-index: 22;
  overflow: hidden;
  opacity: var(--gate-opacity);
  pointer-events: none;
  transition: opacity 180ms linear;
}

.gateway-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(1.06) contrast(1.03) brightness(0.9) blur(var(--gate-blur));
  transform: scale(var(--gate-scale));
  transform-origin: 50% 51%;
  will-change: transform, filter;
}

.gateway-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 49%, transparent 0 20%, rgba(3, 7, 4, 0.2) 48%, rgba(2, 5, 3, 0.78) 100%),
    linear-gradient(90deg, rgba(2, 5, 3, 0.64), transparent 28% 72%, rgba(2, 5, 3, 0.5)),
    linear-gradient(180deg, rgba(2, 5, 3, 0.18), transparent 48%, rgba(2, 5, 3, 0.62));
}

.gateway-intro {
  position: absolute;
  left: clamp(22px, 5vw, 76px);
  bottom: clamp(38px, 8vh, 92px);
  z-index: 2;
  width: min(690px, calc(100vw - 44px));
  opacity: var(--gate-copy-opacity);
  transform: translateY(calc((1 - var(--gate-copy-opacity)) * 28px));
}

.gateway-intro h1 {
  font-size: clamp(4.2rem, 9vw, 9.8rem);
}

.gateway-intro p:not(.kicker) {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 246, 223, 0.82);
  font-size: clamp(1rem, 1.3vw, 1.28rem);
  line-height: 1.65;
}

.scroll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scroll-indicator span {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 42px;
  border: 1px solid rgba(214, 240, 95, 0.62);
  border-radius: 999px;
}

.scroll-indicator span::after {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: var(--gold);
  transform: translateX(-50%);
  animation: scroll-dot 1.4s ease-in-out infinite;
}

.map-camera {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, 177.78vh);
  aspect-ratio: 16 / 9;
  transform:
    translate(-50%, -50%)
    translate3d(var(--camera-x), var(--camera-y), 0)
    scale(var(--camera-scale));
  transform-origin: var(--camera-origin);
  opacity: var(--map-opacity);
  transition: filter 400ms ease;
  will-change: transform, opacity;
}

.farm-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.08) contrast(1.05) brightness(0.84);
}

.map-camera::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(5, 15, 13, 0.22), transparent 26%, rgba(6, 12, 7, 0.24) 100%),
    radial-gradient(circle at 78% 14%, rgba(255, 211, 130, 0.26), transparent 20%),
    linear-gradient(90deg, rgba(4, 9, 5, 0.36), transparent 30% 72%, rgba(4, 9, 5, 0.22));
  mix-blend-mode: soft-light;
}

.sun-wash,
.lens-flare,
.depth-vignette,
.foreground-grass {
  position: absolute;
  pointer-events: none;
}

.sun-wash {
  top: -16%;
  right: -8%;
  z-index: 10;
  width: 58vw;
  height: 52vh;
  background:
    radial-gradient(circle at 62% 40%, rgba(255, 243, 193, 0.52), rgba(255, 189, 91, 0.18) 30%, transparent 56%),
    conic-gradient(from 210deg at 62% 40%, transparent 0 15deg, rgba(255, 233, 174, 0.18) 16deg 24deg, transparent 25deg 360deg);
  filter: blur(10px);
  opacity: calc(0.54 + var(--progress) * 0.22);
  animation: sun-breathe 8s ease-in-out infinite alternate;
}

.lens-flare {
  top: 24%;
  left: 15%;
  z-index: 11;
  width: 72vw;
  height: 16vh;
  opacity: 0.34;
  background: linear-gradient(90deg, transparent, rgba(255, 237, 188, 0.28), transparent);
  filter: blur(14px);
  transform: translateX(calc(var(--progress) * 18vw));
}

.depth-vignette {
  inset: 0;
  z-index: 17;
  background:
    radial-gradient(circle at 50% 48%, transparent 0 35%, rgba(3, 7, 4, 0.2) 68%, rgba(2, 4, 2, 0.88) 100%),
    linear-gradient(180deg, rgba(5, 12, 8, 0.02), rgba(4, 8, 5, 0.76));
}

.foreground-grass {
  left: -4%;
  right: -4%;
  bottom: -7%;
  z-index: 16;
  height: 28vh;
  opacity: 0.62;
  background:
    repeating-linear-gradient(102deg, transparent 0 18px, rgba(199, 173, 86, 0.34) 19px 22px, transparent 23px 42px),
    repeating-linear-gradient(78deg, transparent 0 20px, rgba(62, 121, 53, 0.52) 21px 26px, transparent 27px 44px),
    linear-gradient(180deg, transparent, rgba(4, 9, 5, 0.86) 62%, #020403 100%);
  transform: translateX(var(--grass-x));
  animation: grass 2.7s ease-in-out infinite alternate;
}

.map-pin {
  position: absolute;
  z-index: 5;
  display: none;
  grid-template-columns: 34px max-content;
  grid-template-areas:
    "icon title"
    "icon meta";
  column-gap: 10px;
  min-width: 175px;
  padding: 10px 13px 10px 10px;
  border: 1px solid rgba(255, 246, 223, 0.28);
  border-radius: 8px;
  color: white;
  background: rgba(3, 9, 6, 0.78);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  transform: translate(-50%, -50%) scale(calc(0.86 + var(--pin-focus, 0) * 0.13));
  opacity: calc(0.48 + var(--pin-focus, 0) * 0.52);
  transition: opacity 500ms ease, transform 500ms ease, border-color 500ms ease;
}

.map-pin::after {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 56px;
  content: "";
  background: linear-gradient(rgba(255, 246, 223, 0.72), transparent);
}

.map-pin::before {
  position: absolute;
  left: calc(50% - 4px);
  top: calc(100% + 52px);
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: var(--cream);
  box-shadow: 0 0 16px rgba(255, 246, 223, 0.85);
}

.pin-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid rgba(214, 240, 95, 0.45);
  border-radius: 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
}

.map-pin strong {
  grid-area: title;
  font-size: clamp(0.66rem, 0.9vw, 0.92rem);
  line-height: 1.15;
}

.map-pin small {
  grid-area: meta;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.56rem, 0.76vw, 0.76rem);
}

.pin-gateway {
  left: 11%;
  top: 80%;
}

.pin-forge {
  left: 18.7%;
  top: 24%;
}

.pin-tower {
  left: 53.4%;
  top: 16.5%;
}

.pin-barn {
  left: 74%;
  top: 16%;
}

.pin-greenhouse {
  left: 91%;
  top: 30%;
}

.pin-fields {
  left: 49.7%;
  top: 40.6%;
}

.pin-stables {
  left: 76%;
  top: 70%;
}

.pin-orchard {
  left: 84%;
  top: 58%;
}

.pin-house {
  left: 34%;
  top: 58%;
}

body[data-scene="forge"] .pin-forge,
body[data-scene="tower"] .pin-tower,
body[data-scene="barn"] .pin-barn,
body[data-scene="greenhouse"] .pin-greenhouse,
body[data-scene="fields"] .pin-fields,
body[data-scene="stables"] .pin-stables,
body[data-scene="orchard"] .pin-orchard,
body[data-scene="house"] .pin-house {
  --pin-focus: 1;
  border-color: rgba(214, 240, 95, 0.72);
}

.chapter {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(420px, 0.72fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: 122vh;
  padding: 18vh clamp(20px, 5.2vw, 86px);
}

.chapter::before {
  justify-self: start;
  width: clamp(96px, 16vw, 220px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(214, 240, 95, 0.76), rgba(255, 246, 223, 0.18));
  box-shadow: 0 0 22px rgba(214, 240, 95, 0.24);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 780ms ease, transform 980ms cubic-bezier(0.19, 1, 0.22, 1);
}

.chapter::after {
  position: absolute;
  left: clamp(18px, 5.2vw, 86px);
  top: 50%;
  width: 12px;
  aspect-ratio: 1;
  border: 1px solid rgba(214, 240, 95, 0.8);
  border-radius: 50%;
  content: "";
  background: rgba(214, 240, 95, 0.24);
  box-shadow: 0 0 28px rgba(214, 240, 95, 0.48);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 780ms ease, transform 980ms cubic-bezier(0.19, 1, 0.22, 1);
}

.chapter.is-active::before {
  opacity: 1;
  transform: translateX(0);
}

.chapter.is-active::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.chapter.align-right {
  grid-template-columns: minmax(220px, 0.9fr) minmax(420px, 0.72fr);
}

.chapter .story,
.chapter.align-right .story {
  grid-column: 2;
}

.chapter .portfolio,
.chapter.align-right .portfolio {
  grid-column: 2;
  grid-row: auto;
}

.chapter.content-left::before {
  justify-self: end;
  background: linear-gradient(90deg, rgba(255, 246, 223, 0.18), rgba(214, 240, 95, 0.76), transparent);
  transform: translateX(16px);
}

.chapter.content-left {
  grid-template-columns: minmax(420px, 0.72fr) minmax(220px, 0.9fr);
}

.chapter.content-left::after {
  left: auto;
  right: clamp(18px, 5.2vw, 86px);
  transform: translate(50%, -50%) scale(0.7);
}

.chapter.content-left.is-active::after {
  transform: translate(50%, -50%) scale(1);
}

.chapter.content-left .story,
.chapter.content-left .portfolio {
  grid-column: 1;
  justify-self: end;
}

.chapter.content-left .portfolio {
  width: min(650px, 100%);
}

.portal-runway {
  position: relative;
  z-index: 4;
  min-height: 132vh;
}

.story,
.portfolio,
.finale-copy {
  position: relative;
  z-index: 31;
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(0.98);
  transition: opacity 780ms ease, transform 980ms cubic-bezier(0.19, 1, 0.22, 1);
}

.chapter.is-active .story,
.chapter.is-active .portfolio,
.chapter.is-active .finale-copy {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.story {
  align-self: end;
  width: min(650px, 100%);
  max-width: 650px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kicker::before {
  display: block;
  width: 42px;
  height: 1px;
  content: "";
  background: currentColor;
}

h1,
h2 {
  margin: 0;
  max-width: 780px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.6rem, 7.1vw, 7.8rem);
}

h2 {
  font-size: clamp(2.9rem, 5.35vw, 5.9rem);
}

.story p:not(.kicker),
.finale-copy p:not(.kicker) {
  max-width: 570px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: clamp(1rem, 1.25vw, 1.24rem);
  line-height: 1.68;
}

.service-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 28px;
  padding: 0 14px;
  border: 1px solid rgba(214, 240, 95, 0.3);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(4, 11, 7, 0.54);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  backdrop-filter: blur(18px);
}

.portfolio {
  align-self: start;
  width: min(480px, 100%);
  max-width: 480px;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(6, 14, 9, 0.7), rgba(6, 14, 9, 0.34));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
}

.portfolio-title {
  margin: 0 0 14px;
  color: rgba(255, 246, 223, 0.76);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.portfolio-grid figure {
  position: relative;
  min-height: clamp(116px, 12vw, 170px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 246, 223, 0.16);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(214, 240, 95, 0.16), transparent 42%),
    radial-gradient(circle at 72% 20%, rgba(255, 210, 124, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(255, 246, 223, 0.12), rgba(255, 246, 223, 0.03));
}

.portfolio-grid figure::before {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(255, 246, 223, 0.23);
  border-radius: 5px;
  content: "";
}

.portfolio-grid figure::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  animation: portfolio-sheen 5s ease-in-out infinite;
}

.portfolio-grid span {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  color: rgba(255, 246, 223, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.finale {
  display: flex;
  justify-content: center;
  min-height: 132vh;
  text-align: center;
}

.finale::before,
.finale::after {
  display: none;
}

.finale-copy {
  width: min(1050px, 100%);
}

.finale h2 {
  margin-inline: auto;
  font-size: clamp(3.2rem, 6.2vw, 7rem);
}

@keyframes sun-breathe {
  from {
    opacity: 0.46;
    transform: translate3d(-2%, 1%, 0) rotate(-4deg);
  }

  to {
    opacity: 0.72;
    transform: translate3d(2%, -1%, 0) rotate(3deg);
  }
}

@keyframes grass {
  from {
    filter: brightness(0.88);
  }

  to {
    filter: brightness(1.12);
  }
}

@keyframes portfolio-sheen {
  0%,
  58%,
  100% {
    transform: translateX(-120%);
  }

  76% {
    transform: translateX(120%);
  }
}

@keyframes scroll-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: translate(-50%, 0);
  }

  45% {
    opacity: 1;
    transform: translate(-50%, 13px);
  }
}

@media (max-width: 760px) {
  .journey-nav {
    display: none;
  }

  .chapter,
  .chapter.align-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    min-height: 132vh;
    padding: 18vh 20px 12vh;
  }

  .chapter::before,
  .chapter::after {
    display: none;
  }

  .chapter.align-right .story,
  .chapter.align-right .portfolio {
    grid-column: auto;
    grid-row: auto;
  }

  .portfolio {
    max-width: none;
  }

  .map-camera {
    width: max(155vw, 177.78vh);
  }

  .map-pin {
    display: none;
  }

  h1 {
    font-size: clamp(3.3rem, 16vw, 6.3rem);
  }

  .gateway-intro h1 {
    font-size: clamp(3.5rem, 17vw, 6.8rem);
  }

  h2 {
    font-size: clamp(2.8rem, 12.8vw, 5.2rem);
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 1rem;
  }

  .brand-leaf {
    width: 24px;
  }

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

  .portfolio-grid figure {
    min-height: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
