/* Layout and motion corrections shared by both language routes. */
.constellation .node.core-legal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 24px 18px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.core-legal > span { display: block; max-width: 100%; }
.core-legal > small { font: 10px/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: #aabbd1; }
@media (max-width: 800px) {
  .constellation .node.core-legal { width: 184px; height: 184px; font-size: 17px; gap: 10px; }
}
html { scroll-padding-top: 100px; }
:where(h1, h2, h3, p, strong) { overflow-wrap: break-word; }
:where(.shell, .split-copy, .system-grid, .result-grid, .project-shell) > * { min-width: 0; }
.hero h1, .inner-hero h1, .inner-hero h1 em,
.chapter-title, .big-question, .inner-cta h2,
.manifesto h2, .work-heading h2, .services-head h2, .worlds-head h2,
.project-copy h3, .mobile-project-heading h3, .home-notes-head h2,
.method-chapter h2, .gravity-step h1, .gravity-step h2,
.principle h3, .lab-card h2, .note-card h2 { line-height: 1; }
.inner-hero h1 em { margin-top: .16em; }
.hero h1 { font-size: clamp(3.4rem, 7.1vw, 7.4rem); }
.inner-hero h1 { font-size: clamp(3.5rem, 8vw, 9rem); }
.hero h1 em { line-height: 1; }
.ai-hero-copy h1, .ai-section-intro h2, .ai-connected-copy h2,
.ai-boundary-copy h2, .lab-preview-copy h2, .transformation-head h2 { line-height: 1; }
.phone-content strong { font-size: clamp(.65rem, 1.35vw, 1.2rem); line-height: 1.12; }

/* The original wordmark write / dissolve / return cycle lives in styles.css. */
.site-header.scrolled, .inner-header { background: rgba(7,8,13,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.scroll-progress span { width: 100%; transform: scaleX(0); transform-origin: left; }
.page-noise { mix-blend-mode: normal; opacity: .025; }

/* Content stays readable even when an observer or optional script is unavailable. */
.reveal, .reveal-text { opacity: 1; transform: none; }
[data-motion-paused] *, [data-motion-paused]::before, [data-motion-paused]::after,
[data-motion-paused] *::before, [data-motion-paused] *::after { animation-play-state: paused !important; }

/* Fit copy and visuals inside the pinned sector stage without clipping words. */
@media (min-width: 801px) {
  .hero h1 { font-size: clamp(3.4rem, 6vw, 6.5rem); }
  .hero h1 em { margin-left: clamp(12px, 2vw, 32px); }
  .ai-hero-copy h1 { font-size: clamp(3.2rem, 5.3vw, 6.2rem); }
  .world-scroll-track { height: 520vh; height: 520svh; }
  .world-stage {
    position: sticky;
    min-height: 0;
    top: 96px;
    height: calc(100svh - 116px);
  }
  .world-scroll-meter span { transition: none; }
  .inner-section { padding: clamp(72px, 7vw, 112px) 0; }
  .inner-hero { min-height: 0; padding: 152px 0 80px; }
  .inner-cta { padding: clamp(80px, 8vw, 128px) 0; }
  .result-grid article { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 210px; padding: 28px 24px; }
  .result-grid strong { margin-top: 0; font-size: clamp(1.5rem, 3.8vw, 3.5rem); line-height: 1.1; overflow-wrap: anywhere; }
  .xray-shell { gap: clamp(28px, 4vw, 64px); padding-bottom: 0; }
  .xray-stack-project, .xray-stack-capabilities { min-height: clamp(480px, 50vw, 680px); }
  .xray-stack.scroll-driven:is(.active, :not(.active)) .xray-layer:nth-child(n) {
    top: 50%;
    max-width: 680px;
    transform: translate(-50%, calc(var(--closed-y) + var(--spread-y) * var(--xray-spread, 0))) rotateX(30deg) rotateZ(-5deg);
    transition: border-color .2s ease;
    filter: none;
    will-change: auto;
    box-shadow: 0 16px 30px rgba(0,0,0,.25);
  }
  .xray-stack.scroll-driven .xray-layer:nth-child(1) { --closed-y: -56%; --spread-y: -56%; }
  .xray-stack.scroll-driven .xray-layer:nth-child(2) { --closed-y: -51%; --spread-y: -31%; }
  .xray-stack.scroll-driven .xray-layer:nth-child(3) { --closed-y: -46%; --spread-y: -6%; }
  .xray-stack.scroll-driven .xray-layer:nth-child(4) { --closed-y: -41%; --spread-y: 19%; }
  .xray-stack.scroll-driven .xray-layer:nth-child(5) { --closed-y: -36%; --spread-y: 44%; }
  .xray-stack.scroll-driven .xray-layer > span { backdrop-filter: none; -webkit-backdrop-filter: none; background: #0b0e16; }
}
@media (min-width: 801px) and (max-width: 980px) {
  .xray-stack-project, .xray-stack-capabilities { min-height: 680px; }
}
@media (max-width: 800px) {
  html { scroll-padding-top: 84px; }
  .hero h1 { font-size: clamp(2.65rem, 11.8vw, 5.5rem); }
  .inner-hero h1 { font-size: clamp(3rem, 14vw, 6rem); }
  .world-scroll-track { height: 500vh; height: 500svh; }
  .phone-content strong { font-size: clamp(.65rem, 2.5vw, 1rem); }
  .result-grid strong { font-size: clamp(1.65rem, 8vw, 3rem); overflow-wrap: anywhere; }
  .xray-shell { padding-bottom: 0; }
  .xray-stack .xray-layer { will-change: auto; }
}
@media (max-width: 680px) {
  /* Preserve content immediately while the view-toggle media listener catches up. */
  .work-grid-v2.hidden { display: grid; }
}
/* Reduced motion keeps every world available through its tab. */
@media (prefers-reduced-motion: reduce) {
  .world-scroll-track { height: auto; }
  .world-stage { position: relative; top: auto; height: auto; min-height: 0; }
  .world-copy { overflow: visible; }
  .world-stage::after, .world-scroll-meter { display: none; }
}
@media (max-width: 932px) and (max-height: 520px) {
  .world-scroll-track { height: auto; }
  .world-stage { position: relative; top: auto; height: auto; }
  .world-stage { grid-template-columns: 1fr; grid-template-rows: 48px auto auto; grid-auto-rows: auto; }
  .world-tabs { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; height: 48px; }
  .world-tabs button { flex: 1 0 auto; min-height: 48px; padding: 0 14px; }
  .world-copy { grid-row: 2; padding: 24px; }
  .world-copy h3 { max-width: none; }
  .world-copy p { max-width: 65ch; }
  .world-preview { grid-row: 3; padding: 24px; }
  .world-browser { width: min(100%, 560px); }
}
@media (min-width: 933px) and (max-height: 600px) and (prefers-reduced-motion: no-preference) {
  .world-stage { top: 82px; height: calc(100svh - 96px); }
  .world-copy { padding: 18px; }
  .world-copy h3 { margin-top: 12px; font-size: 1.75rem; }
  .world-copy p { margin-top: 12px; font-size: .8rem; line-height: 1.5; }
  .world-open { margin-top: 14px; padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html, .world-tabs { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cursor-glow { display: none; }
}

/* Case-study continuation: keep the label, project name, and arrow together. */
.next-world { justify-content: flex-start; }
.next-world > .next-world-link {
  display: inline-flex;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  flex-direction: column;
  align-items: flex-start;
  color: inherit;
  border: 0;
  border-radius: 0;
}
.next-world-link > span {
  display: inline-flex;
  align-items: baseline;
  gap: clamp(18px, 2.4vw, 38px);
}
.next-world-link b {
  flex: 0 0 auto;
  transition: transform .3s var(--ease);
}
.next-world-link:hover b,
.next-world-link:focus-visible b { transform: translate(5px, -5px); }
.next-world-link:focus-visible { outline: 2px solid currentColor; outline-offset: 10px; }
