/* Sunlit sand, then the cool underside of an open desert shelter.
   Only the decorative scene uses perspective. Text and controls stay in 2D. */
.desert-journey { position: relative; height: auto; background: #263c32; }
.desert-journey[data-desert-active="true"] { height: 300svh; }
.desert-journey[data-desert-hidden="true"] { display: none; }
.desert-journey > .hero {
  position: relative;
  width: 100%;
  min-height: min(720px,100svh);
  height: 100svh;
  max-height: none;
  background: #e8e0d0;
  overflow: clip;
  isolation: isolate;
}
.desert-journey[data-desert-active="true"] > .hero { position: sticky; top: 0; }
.hero .hero-world { background: #e8e0d0; }
.hero .hero-world img { width: 100%; margin-left: 0; opacity: 1; filter: none; animation: none; transform: none; object-position: center; }
.hero .hero-world:after { background: linear-gradient(180deg,#f1ecdf12,transparent 70%,#c7ba9f33); }
.desert-journey[data-desert-active="true"] .hero-world { opacity: 0; }
.cinematic-host { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.cinematic-host canvas { display: block; width: 100%; height: 100%; }
.desert-scene[data-renderer="webgl"] > :not(.cinematic-host) { visibility: hidden; }
.desert-scene[data-renderer="webgl"] > .cinematic-host { opacity: 1; }
.desert-scene,.desert-scene * { pointer-events: none; user-select: none; -webkit-user-select: none; }
.desert-scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; contain: strict; background: #ece4d5; }
/* The light source stays outdoors. Shade comes from the actual roof and floor. */
.desert-sky { position: absolute; inset: -8% -8% -10%; background: radial-gradient(ellipse 61% 61% at 84% 28%,#fff8df 0,#f6e9ce 40%,transparent 79%),linear-gradient(180deg,#bdc7c0 0,#e3dfcd 40%,#f6e8c9 68%,#e8cea1); transform: translate3d(0,var(--desert-sky-y,0px),0); }
.desert-sun { position: absolute; width: clamp(84px,9.5vw,154px); aspect-ratio: 1; border-radius: 50%; top: 19%; right: 16%; background: #fffbed; box-shadow: 0 0 65px 31px #fff9df52,0 0 190px 90px #fff1c73d; transform: translate3d(0,var(--desert-sun-y,0px),0); opacity: var(--desert-sun-opacity,1); }
.desert-terrain { position: absolute; inset: 0; }
.desert-terrain svg { display: block; width: 100%; height: 100%; }
.desert-haze { position: absolute; inset: 0; background: radial-gradient(ellipse 54% 54% at 86% 29%,#fff9df30,transparent 75%),linear-gradient(180deg,transparent 41%,#fff7df20 57%,transparent 72%); opacity: var(--desert-glare,calc(1 - var(--desert-arrival,0))); }
.desert-refuge { position: absolute; inset: 0; opacity: 1; transform: translate3d(0,0,0); }
.desert-refuge svg { display: block; width: 100%; height: 100%; }
.desert-grain { position: absolute; inset: 0; opacity: .095; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%235a4931' filter='url(%23g)' opacity='.45' d='M0 0h160v160H0z'/%3E%3C/svg%3E"); background-size: 160px 160px; mix-blend-mode: soft-light; }

/* The contrast change is discrete at the luminance crossover: neither a
   gray-on-gray text tween nor a decorative overlay can obscure the copy. */
.hero #hero-title,.hero .hero-bottom h2,.hero .hero-bottom p,.hero .hero-kicker,.hero .hero-foot,.hero .hero-foot .scroll-cue span { color: #302f2b; text-shadow: none; }
.hero .hero-content { position: relative; z-index: 3; transform: translate3d(0,var(--desert-copy-y,0px),0); }
.hero #hero-title { text-shadow: 0 1px 20px #fff8e033; }
.hero #hero-title,.hero #hero-title span,.hero .hero-bottom,.hero .hero-kicker,.hero .hero-foot,.hero .scroll-cue span { animation: none; }
.hero .hero-bottom h2,.hero .hero-bottom p { color: #263024; }
.hero[data-desert-light="shade"] .hero-bottom h2,
.hero[data-desert-light="shade"] .hero-bottom p,
.hero[data-desert-foot="shade"] .hero-foot,
.hero[data-desert-foot="shade"] .hero-foot .scroll-cue span { color: #f5f1e6; text-shadow: 0 1px 7px #172e2260; }
.hero .hero-bottom { position: relative; max-width: 640px; margin-inline: auto; isolation: isolate; opacity: var(--desert-caption-opacity,1); }
.hero .hero-bottom:before { content: ""; position: absolute; z-index: -1; inset: -10px -25px; background: none; }
.hero[data-desert-light="shade"] .hero-bottom:before { background: none; }
.hero[data-desert-custom="true"] .hero-bottom:before { background: radial-gradient(ellipse farthest-side,#08090bcc 5%,#08090b88 60%,transparent 100%); }
.hero .hero-bottom p { font-size: clamp(13px,1.05vw,17px); }
.hero .hero-bottom h2 { font-size: clamp(18px,1.65vw,26px); }
.hero .hero-foot { z-index: 4; }
.hero .hero-foot .scroll-cue { border-radius: 100%; }
.hero .hero-foot .scroll-cue:focus-visible { outline-color: currentColor; background: #fff2; }
.hero:after { display: none; }
/* The wordmark sits in the luminous opening; the caption sits on the slab. */
.hero.desert-hero:not([data-desert-custom="true"]) .hero-content { position: absolute; inset: 0; padding: 0; margin: 0; }
.hero.desert-hero:not([data-desert-custom="true"]) #hero-title { position: absolute; top: 52%; left: 5.2%; margin: 0; width: auto; justify-content: flex-start; font-size: calc(min(clamp(112px,22vw,320px),31svh) * var(--title-scale,1)); font-weight: 900; line-height: .92; letter-spacing: -.07em; color: #243429; text-shadow: 0 1px 24px #fff5d529; opacity: var(--desert-title-opacity,1); transform: translate3d(0,calc(var(--desert-intro-exit,0) * -36px),0); }
.hero.desert-hero:not([data-desert-custom="true"]) #hero-title span { width: .55em; transform: translate3d(0,calc(var(--desert-intro-exit,0) * var(--letter-lift,-12px)),0) scaleX(.78); transform-origin: left center; }
.hero #hero-title span:nth-child(2) { --letter-lift: -26px; }
.hero #hero-title span:nth-child(3) { --letter-lift: -42px; }
.hero #hero-title span:nth-child(4) { --letter-lift: -60px; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom { position: absolute; top: 80%; left: 5.5%; right: 5.5%; max-width: none; padding: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; text-align: left; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom h2 { font-size: clamp(20px,2.15vw,34px); font-weight: 500; line-height: 1.4; letter-spacing: -.06em; max-width: 570px; margin: 0; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom p { font-size: clamp(13px,1.05vw,16px); line-height: 1.8; max-width: 335px; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom h2 { margin-top: 0; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-foot { margin-top: auto; }
.hero.desert-hero:not([data-desert-custom="true"]) .hero-kicker { color: #2e352c; }


/* The supplied custom cover is preserved exactly; it is not a new desert. */
.hero[data-desert-custom="true"] { background: var(--site-background,#08090b); }
.hero[data-desert-custom="true"] .hero-world { background: var(--site-background,#08090b); }
.hero[data-desert-custom="true"] .hero-world:after { background: linear-gradient(180deg,#08090b70,transparent 28%,#08090b30 55%,#08090be0); }
.hero[data-desert-custom="true"] #hero-title,.hero[data-desert-custom="true"] .hero-bottom h2,.hero[data-desert-custom="true"] .hero-kicker { color: var(--site-text,#f5f1e6); text-shadow: 0 2px 25px #0007; }
.hero[data-desert-custom="true"] .hero-bottom p,.hero[data-desert-custom="true"] .hero-foot,.hero[data-desert-custom="true"] .hero-foot .scroll-cue span { color: var(--site-muted,#d5d3cc); text-shadow: 0 2px 14px #0008; }

/* The header stays above the landscape and keeps the existing menu theme. */
body:not(.menu-open) .header:not(.scrolled),
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="sun"] .header { color: #302f2b; background: linear-gradient(180deg,#eee9dcf2,#eee9dce6 70%,#eee9dc00); border-color: transparent; }
body:not(.menu-open) .header:not(.scrolled) :is(.brand,.brand-ko,.mobile-menu),
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="sun"] .header :is(.brand,.brand-ko,.mobile-menu) { color: #302f2b; }
body:not(.menu-open) .header:not(.scrolled) .brand-mark,
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="sun"] .header .brand-mark { background: linear-gradient(130deg,transparent 28%,#302f2b 29% 62%,transparent 63%); border-color: #302f2b; }
body:not(.menu-open)[data-desert-header="shade"] .header:not(.scrolled),
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="shade"] .header { color: #f5f1e6; background: linear-gradient(180deg,#263b30ed,#263b30dd 70%,transparent); }
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="shade"] .header :is(.brand,.brand-ko,.mobile-menu) { color: #f5f1e6; }
body:not(.menu-open)[data-desert-visible="true"][data-desert-header="shade"] .header .brand-mark { background: linear-gradient(130deg,transparent 28%,#f5f1e6 29% 62%,transparent 63%); border-color: #f5f1e6; }
body.menu-open .header :is(.brand,.brand-ko,.mobile-menu) { color: var(--site-text,#f5f1e6); }
body.menu-open .header .brand-mark { background: linear-gradient(130deg,transparent 28%,#f5f1e6 29% 62%,transparent 63%); border-color: #f5f1e6; }

@media(max-width:760px) {
  .desert-journey[data-desert-active="true"] { height: 260svh; }
  .desert-journey > .hero { min-height: 100svh; padding-top: 108px; }
  .desert-sun { top: 19%; right: 10%; width: 88px; }
  .hero.desert-hero:not([data-desert-custom="true"]) #hero-title { top: 52%; left: 5.5%; font-size: calc(min(clamp(104px,31vw,230px),28svh) * var(--title-scale,1)); }
  .hero.desert-hero:not([data-desert-custom="true"]) #hero-title span { width: .52em; }
  .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom { top: 75%; display: block; }
  .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom h2 { font-size: 21px; line-height: 1.5; max-width: 340px; }
  .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom p { margin-top: 12px; max-width: 310px; }
  .desert-grain { opacity: .07; }
  .hero .hero-bottom { max-width: 330px; margin-inline: auto; }
  .hero .hero-bottom h2 { font-size: 18px; line-height: 1.6; }
  .hero .hero-bottom p { font-size: 13px; line-height: 1.9; }
}
@media(prefers-reduced-motion:reduce), (max-height:540px), (max-width:359px) {
  .desert-journey[data-desert-active] { height: auto; }
  .desert-journey[data-desert-active] > .hero { position: relative; height: auto; min-height: 100svh; }
  .desert-scene { display: none!important; }
  .desert-journey[data-desert-active] .hero-world { opacity: 1; }
  .hero .hero-content { transform: none; }
  .hero.desert-hero:not([data-desert-custom="true"]) .hero-content { position: absolute; }
}
body:is([data-motion="off"],[data-effects="off"],[data-fx-motion="off"]) .desert-journey { height: auto; }
body:is([data-motion="off"],[data-effects="off"],[data-fx-motion="off"]) .desert-journey > .hero { position: relative; }
body:is([data-motion="off"],[data-effects="off"],[data-fx-motion="off"]) .desert-scene { display: none!important; }
body:is([data-motion="off"],[data-effects="off"],[data-fx-motion="off"]) .hero-world { opacity: 1; }
@media(forced-colors:active) {
  .desert-journey[data-desert-active] { height: auto; }
  .desert-journey[data-desert-active] > .hero { position: relative; background: Canvas; }
  .desert-scene,.hero-world { display: none!important; }
  .hero.desert-hero:not([data-desert-custom="true"]) #hero-title,.hero #hero-title,.hero .hero-bottom h2,.hero .hero-bottom p,.hero .hero-foot,.hero .hero-foot .scroll-cue span { color: CanvasText; text-shadow: none; }
}

/* Respect the existing grain preference; it never changes scene lighting. */
body[data-grain="off"] .desert-grain { display: none; }
body[data-effects="subtle"] .desert-grain { opacity: .055; }

@media(max-height:540px) {
 .hero.desert-hero:not([data-desert-custom="true"]) #hero-title { top: 31%; font-size: calc(min(22vw,28svh) * var(--title-scale,1)); }
 .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom { top: 67%; display: block; }
 .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom h2 { font-size: 18px; }
 .hero.desert-hero:not([data-desert-custom="true"]) .hero-bottom p { font-size: 12px; margin-top: 6px; }
}
