/* khôra continuum — homepage. Visual-led: full-bleed images, small type, one pinned
   scroll story (GSAP). Without GSAP or with reduced motion the story is a stack of
   full-screen panels, each with its own image and caption. */

.home-page .nav:not(.is-stuck):not(.is-open) { background: linear-gradient(rgba(0, 0, 0, .55), transparent); }

/* ---------- cover ---------- */
.cover { position: relative; height: 100svh; min-height: 38.75rem; overflow: hidden; isolation: isolate; }
.cover__media, .cover__drift { position: absolute; inset: 0; }
.cover__media { z-index: -2; transform-origin: 70% 60%; }
.cover__drift { transform-origin: 66% 58%; }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
.cover__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .15) 55%, transparent), linear-gradient(transparent 55%, #000); }
.cover__in { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: clamp(2rem, 6vh, 4rem); }
.cover__copy { max-width: 35rem; }
.cover__copy .label { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.375rem; }
.cover__copy .label::before { content: ""; width: 0.4375rem; height: 0.4375rem; background: var(--fox); }
.cover__title { font: 500 clamp(1.875rem, 3.3vw, 3.125rem)/1.08 var(--sans); letter-spacing: -.045em; color: var(--ink); }
.cover__title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; font-size: 1.08em; }
.cover__lede { margin-top: 1.125rem; max-width: 40ch; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.cover__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-top: clamp(2.25rem, 7vh, 4.5rem); padding-top: 1rem; border-top: 1px solid var(--line); }
.cover__cue { display: inline-flex; align-items: center; gap: 0.75rem; }
.cover__cue i { position: relative; width: 1px; height: 1.75rem; background: var(--line-2); overflow: hidden; }
.cover__cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .cover__cue i::after { animation: none; } }

/* ---------- story: static stack (default) ---------- */
.story { position: relative; background: #000; }
.story__head { position: absolute; z-index: 3; top: calc(var(--nav-h) + 1.125rem); left: 0; right: 0; }
.story__head .wrap { display: flex; justify-content: space-between; gap: 1rem; }
.story__head .dir { color: var(--fox); }
.story__step { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.story__img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% 50%; }
.story__step::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .1) 60%), linear-gradient(transparent 50%, rgba(0, 0, 0, .85)); }
.story__cap { position: relative; z-index: 2; width: 100%; max-width: var(--max); margin-inline: auto; padding: 0 var(--pad) clamp(6rem, 14vh, 8.75rem); }
.story__cap > div { max-width: 28.75rem; }
.story__tag { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.story__tag i { width: 1.5rem; height: 1px; background: var(--accent); }
.story__tag.is-end { color: var(--fox); }
.story__tag.is-end i { background: var(--fox); }
.story__line { font: 500 clamp(1.5rem, 2.4vw, 2.25rem)/1.12 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.story__line em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; font-size: 1.08em; }
.story__sub { margin-top: 0.875rem; font: 500 0.6875rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.story__close { position: relative; z-index: 2; padding: 0 var(--pad) 7.5rem; max-width: var(--max); margin: -3.75rem auto 0; font: italic 400 clamp(1.375rem, 2.2vw, 2rem)/1.25 var(--serif); color: var(--ink); }
.story__river, .story__index { display: none; }

/* ---------- story: pinned scene (GSAP) ---------- */
html.story-on .story__pin { position: relative; height: 100svh; overflow: hidden; }
html.story-on .story__step { position: absolute; inset: 0; min-height: 0; }
html.story-on .story__step::after { display: none; }
html.story-on .story__shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .12) 58%, rgba(0, 0, 0, .25)), linear-gradient(rgba(0, 0, 0, .6), transparent 22%, transparent 60%, rgba(0, 0, 0, .9)); }
html.story-on .story__img { z-index: 0; will-change: transform, opacity; }
html.story-on .story__cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; will-change: transform, opacity, filter; }
html.story-on .story__river { display: block; position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
html.story-on .story__step { pointer-events: none; }
html.story-on .story__pin { background: #000; cursor: crosshair; }
html.story-on .story__close { position: absolute; z-index: 4; left: 0; right: 0; top: 50%; margin: 0 auto; padding: 0 var(--pad); transform: translateY(-50%); text-align: center; opacity: 0; visibility: hidden; font-size: clamp(1.625rem, 3vw, 2.875rem); }
html.story-on .story__close { width: fit-content; max-width: min(92vw, 56.25rem); padding: 1.625rem 2.5rem; color: #fff; text-shadow: 0 1px 2px #000, 0 0 1.5rem rgba(0, 0, 0, .9);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .82), rgba(0, 0, 0, .55) 70%, transparent); }
html.story-on .story__index { display: flex; position: absolute; z-index: 4; right: 0; left: 0; bottom: clamp(1.75rem, 5vh, 3rem); pointer-events: none; }
.story__index .wrap { display: flex; justify-content: flex-end; }
.story__index ol { display: flex; gap: 0.25rem; pointer-events: auto; }
.story__index button { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; width: clamp(4rem, 7vw, 6.5rem); padding-top: 0.625rem; font: 500 0.625rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-4); text-align: left; transition: color .3s; }
.story__index button::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-2); }
.story__index button::after { content: ""; position: absolute; top: 0; left: 0; height: 1px; width: calc(var(--p, 0) * 100%); background: var(--ink); }
.story__index button.is-active { color: var(--ink); }
.story__index button.is-done { color: var(--ink-3); }
.story__index button b { font-weight: 500; color: var(--accent-2); }
@media (max-width: 760px) {
  .story__cap { padding-bottom: 7.5rem; }
  html.story-on .story__index { bottom: 1.5rem; }
  .story__index .wrap { justify-content: flex-start; }
  .story__index button { width: calc((100vw - 2 * var(--pad) - 1rem) / 5); font-size: 0.5625rem; letter-spacing: .04em; }
  .story__index button span { display: none; }
  .story__img { object-position: 70% 50%; }
}

/* ---------- company ---------- */
.company > .wrap { padding-block: clamp(6rem, 14vw, 12.5rem); }
.company__statement { max-width: 22ch; font: 500 clamp(1.75rem, 3.4vw, 3.25rem)/1.1 var(--sans); letter-spacing: -.045em; color: var(--ink); }
.company__statement em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; font-size: 1.06em; }
.company__grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(3.5rem, 8vw, 7rem); border-top: 1px solid var(--line); }
.company__grid > div { padding: 1.375rem 1.5rem 0 0; display: flex; flex-direction: column; gap: 0.75rem; }
.company__grid p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); max-width: 32ch; }
.company__grid a { color: var(--ink); border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.company__grid a:hover { color: var(--accent); border-color: var(--accent); }
/* wide screens: the statement and its picture side by side; phones keep the text alone */
.company__art { display: none; }
@media (min-width: 901px) {
  .company > .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: clamp(2rem, 4vw, 5rem); align-items: center; }
  .company__grid { grid-column: 1 / -1; }
  .company__art { display: block; position: relative; height: clamp(20rem, 27vw, 28rem); }
  .company__net { position: absolute; inset: 0; width: 100%; height: 100%; }
}
@media (max-width: 800px) { .company__grid { grid-template-columns: 1fr; } .company__grid > div { padding: 1.375rem 0; border-bottom: 1px solid var(--line); } }

/* ---------- closing ---------- */
.closing { position: relative; height: 92svh; min-height: 35rem; overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); }
.closing__sun { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.closing::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 30% 60%, rgba(0, 0, 0, .7), transparent 70%), linear-gradient(#000, transparent 18%, transparent 90%, #000); }
.closing .wrap { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.closing h2 { font: 500 clamp(2.125rem, 4.6vw, 4.5rem)/1.02 var(--sans); letter-spacing: -.05em; color: var(--ink); }
.closing h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; }
.closing .cta__row { margin-top: 2rem; }
/* phones: one even column of full-width buttons */
@media (max-width: 600px) { .closing .cta__row { display: grid; grid-template-columns: 1fr; gap: 0.625rem; } .closing .cta__row .btn { justify-content: space-between; } }

/* ---------- the library of babel ---------- */
.babel { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); }
.babel__net { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.babel::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 30% 34% at 50% 50%, rgba(0, 0, 0, .62), rgba(0, 0, 0, .38) 60%, transparent), linear-gradient(#000, transparent 12%, transparent 88%, #000); }
@media (max-width: 899px) { .babel::after { background: radial-gradient(ellipse 70% 30% at 50% 50%, rgba(0, 0, 0, .92), rgba(0, 0, 0, .72) 60%, transparent), linear-gradient(#000, transparent 6%, transparent 94%, #000); } }
.babel__q { max-width: min(61.25rem, 54vw); margin: 0 auto; padding-block: clamp(6rem, 14vh, 10rem); text-align: center; }
.babel__q blockquote { font: 500 clamp(1.625rem, 3vw, 2.875rem)/1.2 var(--sans); letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.babel__q blockquote .w { opacity: .14; transition: opacity .4s; }
html:not(.story-on) .babel__q blockquote .w { opacity: 1; }
.babel__q figcaption { display: inline-flex; align-items: center; gap: 0.875rem; margin-top: clamp(2rem, 5vh, 3.5rem); }
.babel__q figcaption i { width: 2.5rem; height: 1px; background: var(--line-2); }
/* phones: a smaller quote between the galleries (above) and the page (below) */
@media (max-width: 899px) {
  .babel__q { max-width: none; padding-block: 12.5rem 13rem; }
  .babel__q blockquote { font-size: clamp(1.25rem, 5.6vw, 1.75rem); line-height: 1.25; }
  .babel__q figcaption { flex-direction: column; gap: 0.875rem; text-align: center; }
}

/* ---------- the atlas: the rooms of the continuum, over the cover ---------- */
.cover .atlas { position: absolute; z-index: 1; inset: var(--nav-h) 0 0; pointer-events: none; }
.atlas__stage { position: absolute; inset: 0; }
.atlas__stage::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(243, 241, 234, .1) 1px, transparent 1.4px); background-size: 1.75rem 1.75rem;
  -webkit-mask-image: radial-gradient(ellipse at 62% 40%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 62% 40%, #000 20%, transparent 70%); }
.atlas__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.atlas__lines line { stroke: rgba(243, 241, 234, .32); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .8s var(--ease); }
.atlas__path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* before the light arrives only the ring is there; the rooms open one by one */
.atlas__card { transition: opacity .6s var(--ease), transform .75s var(--ease); }
.atlas.is-folded .atlas__card:not(.is-in) { opacity: 0; transform: translateY(0.625rem) scale(.94); pointer-events: none; }
.atlas.is-folded .atlas__lines line:not(.is-in) { stroke-dashoffset: 1; }
.atlas__ring { position: absolute; left: 62%; top: 40%; width: clamp(15rem, 21vw, 20.625rem); aspect-ratio: 1; transform: translate(-50%, -50%); }
.atlas__orbit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.atlas__orbit circle { fill: rgba(0, 0, 0, .5); stroke: rgba(243, 241, 234, .42); stroke-width: .6; }
.atlas__chevron { transform-origin: 6.25rem 6.25rem; }
.atlas__tick { fill: rgba(243, 241, 234, .6); stroke: none; }
.atlas__tick.is-active { fill: var(--accent); }
.atlas__chevron path { fill: none; stroke: var(--ink); stroke-width: 1.2; }
@keyframes orbit { to { transform: rotate(360deg); } }
.atlas__node { position: absolute; display: inline-flex; gap: 0.375rem; padding: 2px 0.5rem; background: #000; color: var(--ink); transform: translate(-50%, -50%); white-space: nowrap; font-size: 0.625rem; transition: color .35s; }
.atlas__node b { font-weight: 500; color: var(--ink-3); transition: color .35s; }
.atlas__node.is-active, .atlas__node.is-active b { color: var(--accent); }
.atlas__core { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ink); line-height: 1.7; font-size: 0.625rem; }
.atlas__card { position: absolute; z-index: 1; display: block; width: var(--w); pointer-events: auto; }
.atlas__label { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.4375rem; color: var(--ink); white-space: nowrap; font-size: 0.625rem; }
.atlas__label i { font-style: normal; color: var(--ink-3); transition: color .25s; }
.atlas__frame { position: relative; display: block; aspect-ratio: 16 / 10; background: rgba(0, 0, 0, .82); border: 1px solid var(--line-2); transition: border-color .25s; }
.atlas__frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.atlas__frame i { position: absolute; width: 0.3125rem; height: 0.3125rem; background: var(--ink); }
.atlas__frame i:nth-of-type(1) { left: -0.1875rem; top: -0.1875rem; } .atlas__frame i:nth-of-type(2) { right: -0.1875rem; top: -0.1875rem; }
.atlas__frame i:nth-of-type(3) { left: -0.1875rem; bottom: -0.1875rem; } .atlas__frame i:nth-of-type(4) { right: -0.1875rem; bottom: -0.1875rem; }
.atlas__card:hover .atlas__frame { border-color: var(--accent); }
.atlas__card:hover .atlas__label i { color: var(--accent); }
/* placed around the ring, clear of the headline (bottom left) */
.atlas__card--origin { --w: clamp(11.25rem, 13.5vw, 14.375rem); left: 31%; top: 6%; }
.atlas__card--signal { --w: clamp(10.625rem, 12.5vw, 13.125rem); left: 34%; top: 38%; }
.atlas__card--fields { --w: clamp(10.625rem, 12.5vw, 13.125rem); left: 77%; top: 4%; }
/* clockwise from the top left: 01 origin, 02 fields, 03 artifacts, 04 passages, 05 signal */
.atlas__card--artifacts { --w: clamp(11.25rem, 13.5vw, 14.375rem); left: 81%; top: 37%; }
.atlas__card--passages { --w: clamp(10.625rem, 12.5vw, 13.125rem); left: 50%; top: 66%; }
/* narrow screens: only the ring, centred in the sky above the headline */
@media (max-width: 1100px) {
  .cover .atlas { inset: var(--nav-h) 0 auto; height: calc(100svh - var(--nav-h) - 19rem); min-height: 15rem; }
  .atlas__stage::before, .atlas__lines, .atlas__card { display: none; }
  .atlas__ring { left: 50%; top: 52%; width: auto; height: min(72%, 62vw, 17rem); }
}

/* touch: the story's step buttons get a 44 px hit area without changing how they look */
@media (pointer: coarse) {
  .story__index button { min-height: 2.75rem; }
}
