/* Enchi home: two scroll-driven parts (the pieces, then Origin) with an ordinary
   Selected works section between them. */
:root {
  --cream: #F7F4EF;
  --ink: #1E1E1B;
  --night: #11110F;
  --bronze: #B8966E;
  --bronze-ink: #85653F;
  --stone: #6B665F;
  --pale: #EFE8DC;
  --font: 'Hanken Grotesk', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: 48px;
}
@media (max-width: 760px) { :root { --gutter: 22px; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--cream); }
body {
  font-family: var(--font);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }
::selection { background: rgba(184, 150, 110, 0.4); }

.skip {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 10px 14px; font-size: 13px;
}
.skip:focus { top: 16px; }

/* ── CHROME ── */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 70;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 26px var(--gutter);
  color: var(--chrome);
  transition: color 0.8s var(--ease);
}
body[data-tone="dark"] { --chrome: var(--ink); --chrome-soft: rgba(30, 30, 27, 0.35); }
body[data-tone="light"] { --chrome: var(--pale); --chrome-soft: rgba(239, 232, 220, 0.35); }
/* The Enchi wordmark: lowercase, Hanken Grotesk 800, -0.02em. Never restyled. */
.mark, .wordmark, .end-mark { font-family: var(--font); font-weight: 800; letter-spacing: -0.02em; text-transform: none; }
.mark { font-size: 26px; line-height: 1; justify-self: start; }
.bar-nav { display: flex; gap: 40px; }
.bar-nav a {
  position: relative; font-size: 11px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase;
  padding: 6px 0; opacity: 0.8; transition: opacity 0.3s;
}
.bar-nav a:hover { opacity: 1; }
.bar-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease);
}
.bar-nav a:hover::after, .bar-nav a.is-current::after { transform: scaleX(1); }
.bar-nav a.is-current { opacity: 1; }
.bar-cta {
  justify-self: end; font-size: 11px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase;
  padding: 11px 20px; border: 1px solid var(--chrome-soft); border-radius: 999px;
  transition: border-color 0.8s var(--ease), background 0.3s;
}
.bar-cta:hover { border-color: var(--chrome); }
body.bar-solid .bar { background: rgba(247, 244, 239, 0.97); transition: background 0.4s, color 0.8s var(--ease); }
.bar-menu {
  display: none; justify-self: end; margin-left: 10px; font-size: 11px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase;
  padding: 11px 16px; color: var(--chrome);
}
.menu {
  position: fixed; inset: 0; z-index: 65; background: rgba(17, 17, 15, 0.97);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 0 var(--gutter);
}
.menu[hidden] { display: none; }
.menu a { color: var(--pale); font-size: 30px; font-weight: 300; letter-spacing: 0.08em; text-transform: uppercase; }
.menu a[aria-current="page"] { color: #E3CFAE; }
.nojs { display: none; max-width: 720px; margin: 0 auto; padding: 22vh var(--gutter) 10vh; color: var(--ink); }
.nojs h2 { font-size: 28px; font-weight: 400; margin: 32px 0 12px; }
.nojs p { font-size: 17px; line-height: 1.7; margin-bottom: 12px; }
.nojs a { text-decoration: underline; }

.rail {
  --chrome: var(--pale);
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  color: var(--chrome); transition: color 0.8s var(--ease);
}
.rail button {
  position: relative; display: flex; align-items: center; gap: 12px;
  font-size: 10px; font-weight: 400; letter-spacing: 0.28em; text-transform: uppercase;
  height: 16px; color: inherit;
}
.rail button::after {
  content: ""; width: 14px; height: 1px; background: currentColor; opacity: 0.45;
  transition: width 0.5s var(--ease), opacity 0.5s;
}
/* over the cream sections the bar is solid, so the rail steps aside (keyboard focus still shows it) */
.rail { transition: color 0.8s var(--ease), opacity 0.4s; }
.rail.on-light { --chrome: var(--ink); opacity: 0; pointer-events: none; }
.rail.on-light:focus-within { opacity: 1; pointer-events: auto; }
.rail button { color: transparent; }
.rail button::after { background: var(--chrome); }
.rail button:hover, .rail button.is-on { color: var(--chrome); }
.rail button.is-on::after { width: 36px; opacity: 1; }
.rail button:hover::after { opacity: 1; }

.hint {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--pale);
  opacity: var(--hint, 1); pointer-events: none;
}
.hint i { display: block; width: 1px; height: 44px; background: rgba(239, 232, 220, 0.3); position: relative; overflow: hidden; }
.hint i::after {
  content: ""; position: absolute; left: 0; top: -44px; width: 1px; height: 44px; background: var(--pale);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip { to { top: 44px; } }

/* ── STAGE ── */
.scroller { position: relative; background: #15140f; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage { background: #15140f; }
/* Off-screen layers are hidden so the phone does not keep compositing them */
.scene, .species, .scene-globe { opacity: 0; visibility: hidden; }
.scene.on, .species.on, .scene-globe.on { visibility: visible; }
.scene { background: #15140f; overflow: hidden; }
.scene picture { display: contents; }
.scene img, .scene video { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; }
.scene.on > img:not(.backdrop), .scene.on > video, .scene.on .frame img, .scene.on .frame video { will-change: transform; }
.shade { position: absolute; inset: 0; pointer-events: none; }
/* curtain scenes rise over the one before, with a soft shadow on their top edge */
.scene[data-enter="curtain"] { box-shadow: 0 -30px 70px rgba(0, 0, 0, 0.45); }
.scene.on[data-enter="curtain"] { will-change: transform; }
/* darkens the studio as Selected works rises over it */
.cover-dim { background: #0b0a08; opacity: 0; pointer-events: none; z-index: 25; }
.stage { transform-origin: 50% 40%; }

/* Shade keeps light text readable on any frame */
.scene .shade {
  background:
    linear-gradient(180deg, rgba(14, 12, 9, 0.5) 0%, rgba(14, 12, 9, 0.12) 28%, rgba(14, 12, 9, 0.12) 55%, rgba(14, 12, 9, 0.72) 100%),
    linear-gradient(90deg, rgba(14, 12, 9, 0.55) 0%, rgba(14, 12, 9, 0) 55%);
}
.scene .shade-forest {
  background:
    radial-gradient(70% 60% at 50% 46%, rgba(14, 12, 9, 0.5), rgba(14, 12, 9, 0.15) 70%),
    linear-gradient(180deg, rgba(14, 12, 9, 0.45) 0%, rgba(14, 12, 9, 0.1) 30%, rgba(14, 12, 9, 0.55) 100%);
}
.scene-dim .shade { background: rgba(10, 8, 6, 0.62); }
.scene-dim-soft .shade { background: radial-gradient(90% 80% at 50% 50%, rgba(10, 8, 6, 0.35), rgba(10, 8, 6, 0.7)); }
.scene .shade-hero {
  background:
    linear-gradient(180deg, rgba(14, 12, 9, 0.45) 0%, rgba(14, 12, 9, 0.1) 35%, rgba(14, 12, 9, 0.2) 60%, rgba(14, 12, 9, 0.6) 100%),
    radial-gradient(50% 45% at 50% 46%, rgba(14, 12, 9, 0.35), rgba(14, 12, 9, 0) 100%);
}

/* Origin: field photos in a frame, over a blurred copy of themselves */
.framed { background: #1a1813; }
.framed .backdrop {
  position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; transform-origin: 50% 0;
  /* a tiny pre-blurred image, stretched: no live blur */
}
.framed .shade { background: linear-gradient(90deg, rgba(14, 12, 9, 0.55) 0%, rgba(14, 12, 9, 0.15) 60%); }
.frame {
  position: absolute; right: 9vw; top: 50%; transform: translateY(-50%); margin: 0;
  height: 74vh; aspect-ratio: 3 / 4; overflow: hidden; background: #222;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  outline: 1px solid rgba(239, 232, 220, 0.22); outline-offset: 12px;
}
.frame-wide { height: auto; width: 38vw; aspect-ratio: 4 / 3; }
.frame-video { height: auto; width: 40vw; aspect-ratio: 16 / 9; }
.copy-left { max-width: 46vw; }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame figcaption {
  position: absolute; left: 14px; bottom: 12px; font-size: 10px; font-weight: 500; letter-spacing: 0.3em;
  text-transform: uppercase; color: rgba(239, 232, 220, 0.85); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Origin title card, the opening frame of part two */
.copy.copy-origin { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.copy.copy-origin .display { font-size: clamp(30px, 4.4vw, 72px); }

/* The seven hardwoods, appearing one after another */
.species { display: flex; align-items: center; justify-content: center; pointer-events: none; padding-bottom: 8vh; }
.sp-list { list-style: none; text-align: center; }
.sp {
  font-size: clamp(22px, 3.2vw, 46px); font-weight: 300; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pale); line-height: 1.55; white-space: nowrap; opacity: 0;
}
.sp small { font-size: 0.32em; font-weight: 500; letter-spacing: 0.34em; color: #E3CFAE; vertical-align: middle; margin-left: 0.4em; }

.scene-globe { background: radial-gradient(90% 80% at 60% 55%, #1b201c 0%, #0d0f0d 70%); }
.scene-globe canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin {
  position: absolute; left: 0; top: 0; font-size: 10px; font-weight: 400; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--pale); white-space: nowrap; opacity: 0; padding-left: 16px;
}
.pin-b { color: var(--bronze); transition: color 0.8s var(--ease); }
.pin-b.lit { color: #E9D2AE; }
.pin-b::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  border: 1px solid #E9D2AE; border-radius: 50%; opacity: 0; pointer-events: none;
}
.pin-b.lit::before { animation: arrive 1.8s var(--ease) 1; }
@keyframes arrive { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin-b.lit::before { animation: none; } }
.km { font-variant-numeric: tabular-nums; }


/* ── SELECTED WORKS: an ordinary section between the two parts ── */
.works { position: relative; z-index: 2; background: var(--cream); padding: 16vh var(--gutter) 14vh; box-shadow: 0 -40px 90px rgba(0, 0, 0, 0.35); }
.works-head, .works-grid { max-width: 1320px; margin: 0 auto; }
.works-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-left: 6vw; margin-bottom: 56px; }
.works .eyebrow { color: var(--bronze-ink); }
.works-title { font-size: clamp(30px, 4vw, 60px); font-weight: 300; letter-spacing: 0.12em; line-height: 1.15; text-transform: uppercase; }
.works .text-link { margin-top: 0; }
.works-grid { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 28px; padding-left: 6vw; }
.card { display: block; color: var(--ink); }
.card-img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #E6DFD3; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* second photo on hover (mouse only) */
.card-img .card-alt { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s var(--ease); }
.card:hover .card-alt { opacity: 1; }
/* cards rise into place once, a few at a time */
.works-grid > li { opacity: 0; transform: translate3d(0, 34px, 0); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s); }
.works-grid > li.in { opacity: 1; transform: none; }
.works-grid > li .card-img > img:first-child { transform: scale(1.08); transition: transform 1.6s var(--ease) var(--d, 0s); }
.works-grid > li.in .card-img > img:first-child { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .works-grid > li, .works-grid > li .card-img > img:first-child { transform: none; transition: opacity 0.6s; }
}
.card-name { margin-top: 18px; font-size: 12px; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; line-height: 1.6; }
.card-meta { margin-top: 4px; font-size: 13px; letter-spacing: 0.02em; color: var(--stone); line-height: 1.5; }
.card:hover .card-name, .card:focus-visible .card-name { color: var(--bronze-ink); }
.works-all { display: table; margin: 72px auto 0; }

/* ── COPY: each line fades up into place ── */
.copy {
  position: absolute; z-index: 20; pointer-events: none;
  --in: 0; --out: 0;
  opacity: calc(min(1, var(--in) * 1.4) * (1 - var(--out)));
  color: var(--pale);
}
.copy.light { color: var(--pale); }
.copy.is-live { pointer-events: auto; }
/* A soft shade behind every text block keeps it readable on the brightest frame */
.copy::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -45% -30% -45% -30%;
  background: radial-gradient(closest-side, rgba(12, 10, 8, 0.7), rgba(12, 10, 8, 0.45) 55%, rgba(12, 10, 8, 0) 100%);
}
.copy.copy-intro::before { inset: 22% 18%; background: radial-gradient(closest-side, rgba(12, 10, 8, 0.6), rgba(12, 10, 8, 0.3) 60%, rgba(12, 10, 8, 0) 100%); }
.copy.copy-origin::before { content: none; }
/* each line rises from behind its own edge, one after another */
.copy .line {
  --t: clamp(0, calc(var(--in) * 1.7 - var(--i) * 0.22), 1);
  display: block; position: relative; overflow: hidden;
  padding-bottom: 0.12em; margin-bottom: -0.12em; /* room for descenders inside the mask */
}
.copy .line-in {
  display: block;
  transform: translate3d(0, calc((1 - var(--t)) * 112% - var(--out) * 35%), 0);
}
@media (prefers-reduced-motion: reduce) {
  .copy .line-in { transform: none; }
  .copy .line { opacity: var(--t); }
}

.display {
  font-size: clamp(26px, 3.6vw, 58px); font-weight: 300; letter-spacing: 0.12em; line-height: 1.22;
  text-transform: uppercase;
}
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.34em; text-transform: uppercase; color: #F2E6D2; margin-bottom: 22px; }
.lede { margin-top: 26px; max-width: 36ch; font-size: 16px; line-height: 1.65; letter-spacing: 0.01em; }
.text-link { display: inline-block; margin-top: 30px; font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 6px; }

.copy-intro { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-bottom: 6vh; }
.wordmark { font-size: clamp(64px, 12vw, 176px); line-height: 1; }
.tagline { margin-top: 26px; font-size: 11px; font-weight: 400; letter-spacing: 0.4em; text-transform: uppercase; color: var(--pale); opacity: 0.9; margin-right: -0.4em; }
.copy-right { right: 12vw; top: 22vh; text-align: left; }
.copy-left { left: var(--gutter); top: 50%; transform: translateY(-50%); padding-left: 6vw; }
.copy-bottom { left: var(--gutter); bottom: 12vh; padding-left: 6vw; }
.copy-species { left: 50%; bottom: 9vh; transform: translateX(-50%); text-align: center; }
.copy-species .eyebrow { margin-bottom: 0; }
.copy-species .lede { margin: 10px auto 0; font-size: 13px; color: #A9A196; }

.room-tools {
  position: absolute; right: calc(var(--gutter) + 80px); bottom: 34px; z-index: 21; display: flex; gap: 22px; align-items: center;
  font-size: 10px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase; color: var(--pale);
  opacity: 0; pointer-events: none;
}
.room-tools.is-live { pointer-events: auto; }
.room-tools a { border-bottom: 1px solid rgba(239, 232, 220, 0.4); padding-bottom: 3px; }

/* ── END ── */
.end { position: relative; z-index: 2; background: var(--cream); padding: 14vh var(--gutter) 40px; }
.end-cta { max-width: 1320px; margin: 0 auto; padding-left: 6vw; }
.end-title { font-size: clamp(34px, 5vw, 76px); font-weight: 300; letter-spacing: 0.04em; line-height: 1.08; margin-bottom: 40px; }
.btn {
  display: inline-block; font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 18px 34px; background: var(--ink); color: var(--cream); border-radius: 999px; transition: background 0.3s;
}
.btn:hover { background: var(--bronze-ink); }
.end-grid {
  max-width: 1320px; margin: 16vh auto 0; padding: 48px 0 0 6vw;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  border-top: 1px solid rgba(30, 30, 27, 0.12);
}
.end-grid h3 { font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bronze-ink); margin-bottom: 16px; }
.end-grid p, .end-grid a { display: block; font-size: 14px; line-height: 1.9; color: var(--ink); overflow-wrap: anywhere; }
.end-grid a:hover { color: var(--bronze-ink); }
.end-mark {
  max-width: 1320px; margin: 12vh auto 0; text-align: center;
  font-size: clamp(72px, 22vw, 320px);
  line-height: 0.9; color: var(--ink); opacity: 0.92;
}
.end-legal {
  max-width: 1320px; margin: 6vh auto 0; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 12px; color: var(--stone); letter-spacing: 0.04em;
}
.end-legal ul { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; }
.end-legal a:hover { color: var(--ink); }

/* ── SMALL SCREENS ── */
@media (max-width: 900px) {
  .bar { grid-template-columns: 1fr auto; padding: 20px var(--gutter); }
  .bar-nav { display: none; }
  .bar-menu { display: inline-block; }
  .bar { grid-template-columns: 1fr auto auto; }
  .rail { right: 14px; gap: 10px; }
  .rail button { font-size: 0; gap: 0; }
  .rail button::after { width: 10px; }
  .rail button.is-on::after { width: 22px; }
  .copy-right { right: auto; left: var(--gutter); top: 16vh; padding-right: var(--gutter); }
  .copy-left, .copy-bottom { padding-left: 0; padding-right: var(--gutter); }
  .copy-left { top: auto; bottom: 14vh; transform: none; }
  .copy-bottom { bottom: 14vh; }
  .lede { font-size: 15px; }
  .works { padding: 12vh var(--gutter) 10vh; }
  .works-head { padding-left: 0; margin-bottom: 36px; flex-wrap: wrap; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 14px; padding-left: 0; }
  .card-name { margin-top: 12px; font-size: 11px; letter-spacing: 0.16em; }
  .card-meta { font-size: 12px; }
  .works-all { margin-top: 48px; }
  .room-tools { right: auto; left: var(--gutter); bottom: 24px; }
  .copy-left { max-width: none; }
  .copy.copy-intro::before { inset: 30% -10%; background: radial-gradient(closest-side, rgba(12, 10, 8, 0.72), rgba(12, 10, 8, 0.4) 60%, rgba(12, 10, 8, 0) 100%); }
  .frame { right: auto; left: 50%; top: 11vh; transform: translateX(-50%); height: 46vh; }
  .frame-wide { height: auto; width: 84vw; }
  .frame-video { height: auto; width: 88vw; }
  .framed .shade { background: linear-gradient(180deg, rgba(14, 12, 9, 0.2) 40%, rgba(14, 12, 9, 0.7) 100%); }
  .end-cta, .end-grid { padding-left: 0; }
  .end-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .end-legal { flex-direction: column; }
}

/* Visually hidden, still read by screen readers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Labels on the cream footer use the darker bronze */
.end .eyebrow { color: var(--bronze-ink); }

.room-tools button {
  padding: 9px 16px; border-radius: 999px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  background: rgba(17, 17, 15, 0.72); border: 1px solid rgba(239, 232, 220, 0.4); color: var(--pale);
}
.room-tools button:hover { border-color: var(--pale); }

/* Quiet disclosure on staged scenes, linking to the imagery note */
.staged-note {
  position: fixed; left: var(--gutter); bottom: 38px; z-index: 60;
  font-size: 10px; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--pale); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
  padding-bottom: 3px; border-bottom: 1px solid rgba(239, 232, 220, 0.3);
  opacity: 0; pointer-events: none; transition: border-color 0.3s;
}
.staged-note.is-live { pointer-events: auto; }
.staged-note:hover { border-color: var(--pale); }
@media (max-width: 900px) {
  .staged-note { left: auto; right: 42px; bottom: 34px; }
}

