html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: "JetBrains Mono", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", monospace; }
button, input { font: inherit; }
.field-photo { display: block; background: none !important; object-fit: cover; object-position: center; }
.field-photo::after { display: none !important; }
.creature-distortion { position: absolute; inset: 0; z-index: 22; width: 100%; height: 100%; pointer-events: none; }
.creature-intro-more { max-width: 500px; margin-top: 22px; }
.creature-intro-more p { margin: 0 0 15px; font-size: clamp(13px,1.05vw,16px); line-height: 1.55; }
.menu-tools summary { display: none; }
.device-test-link { color: var(--pink); text-decoration: none; }
.device-test-link:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.menu-meta-line { display: flex; align-items: baseline; gap: 5px; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 7px !important; letter-spacing: .025em !important; }
.menu-meta-line::-webkit-scrollbar { display: none; }
.menu-meta-line a { flex: 0 0 auto; }
.context-page { --context-gutter: clamp(22px,5vw,76px); overflow-x: hidden; }
.context-intro { box-sizing: border-box; width: 100%; grid-template-columns: minmax(0,1fr); padding-inline: var(--context-gutter); align-content: start; }
.context-intro > * { min-width: 0; max-width: 100%; }
.context-intro h1 { width: min(100%,950px); font-size: clamp(36px,6.2vw,78px); line-height: .98; letter-spacing: -.035em; overflow-wrap: anywhere; }
.context-intro-copy { width: min(100%,780px); }
.context-intro-copy p { overflow-wrap: break-word; }
.context-copy { box-sizing: border-box; padding-inline: var(--context-gutter); grid-template-columns: minmax(0,1fr) minmax(330px,1fr); gap: clamp(22px,4vw,64px); align-items: start; }
.context-copy article { min-width: 0; }
.context-main-column { min-width: 0; }
.context-main-column article { padding: 0 0 clamp(32px,5vw,66px); border: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.context-main-column article + article { padding-top: clamp(20px,3vw,38px); border-top: 1px solid #fe74a075; }
.context-side-column { display: grid; gap: 12px; min-width: 0; align-content: start; }
.context-side-column > article,
.context-media-gallery { min-width: 0; padding: clamp(18px,2.2vw,30px); background: #00180eea; border: 1px solid #ffffff28; border-radius: 2px 22px 2px 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.diagram-labels strong { font-weight: 600; }
.context-copy .warning-label p { overflow-wrap: anywhere; }
.palette-switch { display: none !important; }
.pole-colors { border: 1px solid #ffffff45; margin: 15px 0 5px; padding: 10px; min-width: 0; }
.pole-colors legend { color: var(--pink); font-size: 11px; letter-spacing: .07em; padding: 0 4px; }
.pole-color-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pole-color-options button { color: #fff; background: #0006; border: 1px solid #ffffff58; padding: 9px 5px; min-height: 40px; cursor: pointer; font-size: 11px; letter-spacing: .02em; }
.pole-color-options button[aria-pressed="true"] { color: #101010; background: var(--pink); border-color: var(--pink); }
.pole-color-options button:focus-visible, .language-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pole-note { font-size: 9px; line-height: 1.3; color: #e6e6e6; margin: 9px 0 0; }
.pole-tracking-tools { border: 1px solid #ffffff45; margin: 10px 0 5px; padding: 10px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pole-tracking-tools legend { color: var(--pink); font-size: 11px; letter-spacing: .07em; padding: 0 4px; }
.pole-tracking-tools button { border: 1px solid #ffffff75; color: #fff; background: #0006; min-height: 39px; font-size: 9px; cursor: pointer; }
.pole-tracking-tools #pole-preview { grid-column: 1 / -1; color: var(--pink); }
.pole-tracking-tools #pole-preview[aria-pressed="true"] { color: #101010; background: var(--pink); }
.pole-tracking-tools button:focus-visible { outline: 2px solid var(--pink); }
.pole-tracking-tools p { grid-column: 1 / -1; font-size: 9px; color: var(--pink); line-height: 1.3; margin: 2px 0 0; }
.pole-tracking-tools p:empty { display: none; }

.protocol-irl-gallery,
.protocol-video-gallery { z-index: 8; width: min(58vw,840px); margin: 28px 3vw 28px auto; position: relative; color: #0f6; }
.protocol-video-gallery { margin-bottom: 70px; }
.protocol-page { overflow-y: auto; overflow-x: hidden; }
.protocol-irl-gallery label,
.protocol-video-gallery label { display: block; color: var(--pink); margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; }
.protocol-irl-gallery select,
.protocol-video-gallery select { width: 100%; min-height: 52px; appearance: auto; color: #0f6; background: #000c06e8; border: 1px solid #0f6; border-radius: 0; padding: 8px 12px; font-size: clamp(16px,2vw,28px); font-weight: 400; cursor: pointer; }
.protocol-irl-gallery figure,
.protocol-video-gallery figure { margin: 10px 0 0; padding: 10px; background: #000c06cc; border: 1px solid #0f6; }
.protocol-irl-gallery picture { display: block; overflow: hidden; background: #001008; }
.protocol-irl-gallery img { display: block; width: 100%; height: min(48vw,560px); object-fit: contain; object-position: center; }
.protocol-video-gallery video { display: block; width: 100%; max-height: min(48vw,560px); background: #001008; }
.protocol-irl-gallery figcaption,
.protocol-video-gallery figcaption { color: #0f6; margin-top: 8px; font-size: 10px; letter-spacing: .055em; }
.context-media-gallery label { display: block; color: var(--pink); margin-bottom: 8px; font-size: 10px; letter-spacing: .06em; }
.context-media-gallery select { width: 100%; min-height: 48px; color: #fff; background: #0009; border: 1px solid var(--pink); border-radius: 0; padding: 7px 9px; font-size: clamp(12px,1.1vw,16px); }
.context-media-gallery figure { margin: 10px 0 0; }
.context-media-gallery picture { display: block; }
.context-media-gallery img,
.context-media-gallery video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #001008; }
.context-media-gallery [hidden] { display: none; }
.context-media-gallery figcaption { margin-top: 8px; color: var(--pink); font-size: 9px; letter-spacing: .045em; }
.pole-calibration { position: absolute; inset: 0; z-index: 75; pointer-events: none; display: none; }
.pole-calibration.active { display: block; pointer-events: auto; touch-action: manipulation; cursor: crosshair; }
.pole-calibration > p { position: absolute; left: 50%; bottom: max(102px,calc(env(safe-area-inset-bottom) + 95px)); transform: translateX(-50%); width: min(90vw,590px); text-align: center; color: #fff; background: #001a14bf; border: 1px solid var(--pink); padding: 12px; font-size: clamp(11px,2.5vw,15px); }
.pole-calibration-markers, #pole-calibration-markers { position: absolute; inset: 0; pointer-events: none; }
.pole-calibration-marker { position: absolute; width: 24px; height: 24px; border: 2px solid var(--pink); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 5px #fe74a049; }
.pole-calibration-marker:after { content: attr(data-number); color: #fff; font-size: 10px; position: absolute; left: 28px; top: 0; }
.pole-debug-overlay { position: absolute; inset: 0; z-index: 62; display: none; pointer-events: none; }
.pole-debug-overlay.active { display: block; }
.pole-debug-overlay:before { content: "TRACKING VIEW"; position: absolute; top: 72px; right: 18px; color: var(--pink); background: #00180fc9; border: 1px solid var(--pink); padding: 6px 8px; font-size: 9px; letter-spacing: .06em; }
html[lang="zh-CN"] .pole-debug-overlay:before { content: "追踪视图"; }
.pole-debug-line { position: absolute; left: 0; top: 0; height: 1px; transform-origin: 0 50%; background: linear-gradient(90deg,#fe74a0,#fe74a018); filter: drop-shadow(0 0 3px #fe74a0); }
.pole-debug-marker { position: absolute; width: 24px; height: 24px; border: 2px solid var(--pink); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 5px #fe74a030,0 0 15px #fe74a0; }
.pole-debug-marker:before, .pole-debug-marker:after { content: ""; position: absolute; background: var(--pink); }
.pole-debug-marker:before { left: 10px; top: -8px; width: 1px; height: 36px; }
.pole-debug-marker:after { left: -8px; top: 10px; width: 36px; height: 1px; }
.pole-debug-marker b { position: absolute; left: 27px; top: -3px; color: #fff; background: #00180fcf; padding: 2px 4px; font-size: 9px; font-weight: 400; white-space: nowrap; }
.field-actions { position: fixed; top: max(13px,env(safe-area-inset-top)); right: max(17px,env(safe-area-inset-right)); z-index: 110; display: flex; align-items: center; justify-content: flex-end; gap: clamp(4px,1vw,13px); }
.field-actions .run-button, .field-actions .animal-mode-button, .field-actions .language-button { position: static; inset: auto; min-height: 44px; margin: 0; padding: 6px 7px; display: inline-flex; align-items: center; justify-content: center; line-height: 1.1; background: #06080845; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid #fe74a080; color: var(--pink); font-size: clamp(10px,1vw,12px); letter-spacing: .03em; white-space: nowrap; cursor: pointer; }
.field-actions .run-button:after { display: none; }
.field-actions .language-button { border-color: #ffffffa0; color: #fff; min-width: 48px; }
.site-menu.is-open { z-index: 200; }
.context-palette { position: relative; z-index: 20; pointer-events: auto; touch-action: manipulation; min-height: 48px; font-size: 12px; }
body:not(.route-field) .field-actions #run, body:not(.route-field) .field-actions #animal-time { display: none; }
.artist-page { min-height: 100svh; overflow: auto; color: #fff; background: linear-gradient(110deg,#001d15e9,#001507f2),url("./visuals/subpage-pattern.webp") center/430px repeat; padding: clamp(105px,13vh,145px) clamp(18px,5vw,90px) 50px; }
.artist-page.active { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(220px,.85fr); gap: clamp(24px,6vw,100px); align-items: start; }
.artist-copy { max-width: 820px; }
.artist-copy h1 { color: var(--pink); font-size: clamp(36px,7vw,100px); line-height: .9; font-weight: 400; margin: 14px 0 33px; overflow-wrap: anywhere; }
.artist-copy > h2, .credit-grid h2 { color: var(--pink); font-size: clamp(15px,1.35vw,20px); line-height: 1.2; font-weight: 400; letter-spacing: .06em; margin: 34px 0 15px; }
.artist-copy > h3 { color: #fff; font-size: clamp(25px,3vw,46px); line-height: 1; font-weight: 400; margin: 0 0 22px; }
.artist-copy p { font-size: clamp(15px,1.2vw,20px); line-height: 1.52; margin: 0 0 19px; }
.artist-copy .commission { border: 0; padding: 0; margin-top: calc(2 * 1.52em + 38px); margin-bottom: 46px; color: #fff; }
.credit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 0; }
.credit-grid > section { min-width: 0; border-top: 1px solid #fe74a099; }
.credit-grid .credit-commission { grid-column: 1 / -1; }
.credit-grid .credit-wide { grid-column: 1 / -1; }
.credit-grid dl { margin: 0; }
.credit-grid dl > div { display: grid; grid-template-columns: minmax(120px,.72fr) minmax(0,1.28fr); gap: 16px; padding: 11px 0; border-top: 1px solid #ffffff28; }
.credit-grid dt, .credit-grid dd { margin: 0; overflow-wrap: anywhere; }
.credit-grid dt { color: var(--pink); font-size: 10px; line-height: 1.45; letter-spacing: .055em; }
.credit-grid dd { color: #fff; font-size: 12px; line-height: 1.5; }
.artist-copy .page-number { color: var(--pink); font-size: 12px; }
.artist-copy a { color: var(--pink); text-underline-offset: 4px; }
.artist-image { margin: 0; position: sticky; top: 95px; }
.artist-image img { display: block; width: 100%; max-height: 70svh; object-fit: contain; filter: grayscale(.08) contrast(1.07); }
.artist-image figcaption { margin-top: 8px; font-size: 10px; color: var(--pink); }
.creature-list article p { line-height: 1.48; }
.context-copy article p, .context-intro-copy p { line-height: 1.58; }
html[lang="zh-CN"] .creature-list article p, html[lang="zh-CN"] .context-copy p, html[lang="zh-CN"] .context-intro-copy p { letter-spacing: .02em; }

@media (max-width: 760px), (max-width: 900px) and (orientation: landscape) {
  .site-menu { width: fit-content; max-width: calc(100vw - 190px); }
  .site-menu.is-open { width: min(360px,calc(100vw - 20px)); max-width: none; }
  .site-menu:not(.is-open) .menu-panel { display: none; }
  .menu-trigger { min-height: 44px; border: 1px solid #ffffff8c; border-radius: 3px 12px 3px 12px; background: #00180fb8; font-size: 11px; padding: 8px 10px; }
  .menu-panel { max-height: calc(100vh - 65px); max-height: calc(100svh - 65px); overflow-y: auto; overscroll-behavior: contain; border-radius: 0 0 14px 4px; }
  .menu-panel nav { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
  .menu-panel nav a { box-sizing: border-box; min-width: 0; min-height: 46px; align-items: center; grid-template-columns: 25px minmax(0,1fr); padding: 8px 6px; font-size: 11px; line-height: 1.2; border: 1px solid #ffffff34; background: #001c1170; overflow-wrap: anywhere; }
  .menu-panel nav a:last-child { grid-column: 1 / -1; }
  .menu-panel > p { margin: 10px 0 2px; font-size: 10px; }
  .menu-tools { margin-top: 8px; border-top: 1px solid #ffffff6a; }
  .menu-tools summary { display: flex; align-items: center; justify-content: space-between; min-height: 42px; list-style: none; color: var(--pink); font-size: 11px; letter-spacing: .04em; cursor: pointer; }
  .menu-tools summary::-webkit-details-marker { display: none; }
  .menu-tools summary::after { content: "+"; font-size: 20px; font-weight: 400; }
  .menu-tools[open] summary::after { content: "−"; }
  .menu-tools .pole-colors { margin-top: 2px; }
  .context-page { --context-gutter: clamp(18px,4.5vw,29px); }
  .context-intro { min-height: 0; padding: 92px var(--context-gutter) 28px; }
  .context-intro h1 { font-size: clamp(33px,8vw,54px); line-height: 1; }
  .context-intro-copy p { font-size: 16px; line-height: 1.56; }
  .context-copy { grid-template-columns: minmax(0,1fr); gap: 18px; padding: 0 var(--context-gutter) 54px; }
  .context-main-column article { padding: 0 0 32px; }
  .context-side-column > article, .context-media-gallery { padding: 20px; }
  .creature-intro-more { margin-top: 20px; }
  .creature-intro-more p { font-size: 15px; }
  .field-actions { right: max(10px,env(safe-area-inset-right)); top: max(9px,env(safe-area-inset-top)); gap: 3px; }
  .field-actions .run-button, .field-actions .animal-mode-button, .field-actions .language-button { min-height: 44px; font-size: 10px; padding-inline: 6px; }
  .site-menu { width: fit-content; max-width: calc(100vw - 190px); }
  .menu-trigger { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-menu.is-open { width: min(360px,calc(100vw - 20px)); }
  .artist-page.active { grid-template-columns: 1fr; padding-top: 90px; }
  .artist-image { position: static; }
  .artist-copy p { font-size: 16px; }
  .credit-grid { grid-template-columns: 1fr; gap: 10px; }
  .credit-grid .credit-wide { grid-column: auto; }
  .credit-grid dl > div { grid-template-columns: minmax(105px,.7fr) minmax(0,1.3fr); gap: 12px; }
  .credit-grid dt { font-size: 11px; }
  .credit-grid dd { font-size: 14px; }
  .creature-list article p, .context-copy article p, .context-intro-copy p { font-size: 16px; line-height: 1.55; }
  .field-controls label { min-width: 0; }
}

/* V12: larger protocol micro-type while preserving its hierarchy. */
.protocol-mast > p { font-size: 11px; }
.protocol-mast button { font-size: 12px; }
.protocol-manifesto p { font-size: 14px; }
.protocol-equation { font-size: 11px !important; }
.protocol-constellation button { font-size: 12px; line-height: 1.15; }
.protocol-constellation button span,
.protocol-constellation button small { font-size: 9px; }
.protocol-specimen { bottom: max(86px,12vh); }
.protocol-specimen > span { font-size: 10px; }
.protocol-specimen p { font-size: 12px; }
.protocol-specimen a { font-size: 9px; }

/* Stable viewport sizing for older WeChat, UC, QQ and manufacturer WebViews. */
.home-screen { height: 100vh; height: calc(var(--pure-vh, 1vh) * 100); }
.protocol-page,
.pattern-page,
.artist-page { min-height: 100vh; min-height: calc(var(--pure-vh, 1vh) * 100); }

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .protocol-specimen { bottom: auto; }
  .protocol-mast button { font-size: 13px; }
  .protocol-manifesto p { font-size: 15px; }
  .protocol-equation { font-size: 12px !important; }
  .protocol-constellation button { font-size: 13px; }
  .protocol-constellation button span,
  .protocol-constellation button small { font-size: 10px; }
  .protocol-specimen > span { font-size: 11px; }
  .protocol-specimen p { font-size: 14px; }
  .protocol-specimen a { font-size: 11px; }
  .protocol-irl-gallery, .protocol-video-gallery { width: auto; margin: 24px 12px; }
  .protocol-irl-gallery label, .protocol-video-gallery label { font-size: 12px; }
  .protocol-irl-gallery select, .protocol-video-gallery select { font-size: 16px; }
  .protocol-irl-gallery img { height: min(115vw,620px); }
  .protocol-video-gallery video { max-height: min(115vw,620px); }
}

@media (max-width: 900px) and (orientation: landscape) {
  .site-menu.is-open .menu-panel { box-sizing: border-box; max-height: calc(100vh - 48px); max-height: calc(100svh - 48px); display: grid; grid-template-columns: minmax(205px,.78fr) minmax(270px,1.22fr); grid-template-rows: auto auto; gap: 7px 10px; overflow: auto; padding: 8px; }
  .site-menu.is-open .menu-panel nav { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: 1fr; align-content: start; gap: 3px; }
  .site-menu.is-open .menu-panel nav a,
  .site-menu.is-open .menu-panel nav a:last-child { grid-column: auto; min-height: 34px; padding: 5px 7px; font-size: 9px; }
  .site-menu.is-open .menu-tools { grid-column: 2; grid-row: 1; margin: 0; border: 0; }
  .site-menu.is-open .menu-tools summary { display: none; }
  .site-menu.is-open .pole-colors,
  .site-menu.is-open .pole-tracking-tools { margin: 0 0 6px; padding: 6px; }
  .site-menu.is-open .pole-colors legend,
  .site-menu.is-open .pole-tracking-tools legend { font-size: 8px; letter-spacing: .045em; }
  .site-menu.is-open .pole-color-options { gap: 3px; }
  .site-menu.is-open .pole-color-options button,
  .site-menu.is-open .pole-tracking-tools button { min-height: 28px; padding: 3px; font-size: 8px; }
  .site-menu.is-open .pole-tracking-tools p { font-size: 7px; }
  .site-menu.is-open .menu-meta-line { grid-column: 1 / -1; grid-row: 2; margin: 0; }
  .field-actions { top: max(5px,env(safe-area-inset-top)); right: max(8px,env(safe-area-inset-right)); }
  .field-actions .run-button, .field-actions .animal-mode-button, .field-actions .language-button { min-height: 36px; font-size: 10px; }
  .site-menu { top: max(5px,env(safe-area-inset-top)); left: max(8px,env(safe-area-inset-left)); width: fit-content; }
  .site-menu.is-open { width: min(650px,calc(100vw - 24px)); }
  .field-controls .camera-button { bottom: max(8px,env(safe-area-inset-bottom)); left: max(8px,env(safe-area-inset-left)); }
  .sound-toggle { bottom: max(8px,env(safe-area-inset-bottom)); left: calc(max(8px,env(safe-area-inset-left)) + 115px); }
  .field-controls label { right: max(12px,env(safe-area-inset-right)); bottom: max(8px,env(safe-area-inset-bottom)); width: min(42vw,360px); grid-template-columns: auto minmax(45px,1fr) auto; gap: 6px; font-size: 10px; padding: 5px 2px; }
  .field-controls label span { white-space: nowrap; }
  .artist-page.active { grid-template-columns: 1fr 260px; }
}

@media (max-width: 650px) and (orientation: landscape) {
  .field-controls label { width: 35vw; }
  .field-controls label span { font-size: 0; }
  .field-controls label span:before { content: "ROOT"; font-size: 10px; }
}

@media (max-width: 480px) and (orientation: portrait) {
  .field-actions .run-button { padding-inline: 5px; }
  .field-actions .animal-mode-button { font-size: 9px; }
  .site-menu { width: fit-content; max-width: calc(100vw - 205px); }
  .site-menu.is-open { width: min(340px,calc(100vw - 20px)); }
}

/* V16: clearer structure, fully opaque underground signal, archive and compact controls. */
.data-root-horizon,
.data-root-horizon svg,
.data-root-horizon .root-lines,
.data-root-horizon .root-technical,
.data-root-horizon .diagram-labels { opacity: 1 !important; }
.data-root-horizon path,
.data-root-horizon circle { stroke: #fe74a0 !important; stroke-opacity: 1 !important; }
.data-root-horizon text { fill: #fe74a0 !important; fill-opacity: 1 !important; }

.context-copy { grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); }
.context-main-column { display: grid; gap: clamp(18px,2.5vw,34px); }
.context-main-column article,
.context-side-column > article {
  padding: clamp(22px,3vw,42px);
  border: 1px solid #fe74a080;
  border-radius: 2px 26px 2px 26px;
  background: linear-gradient(135deg,#00351fd6,#002216e8),url("./visuals/subpage-pattern.webp") center/340px repeat;
  box-shadow: 0 20px 60px #00110938;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.context-main-column article + article { padding-top: clamp(22px,3vw,42px); border-top: 1px solid #fe74a080; }
.context-intro-copy { background: transparent; border: 0; }
.context-side-column { position: sticky; top: 105px; }

.pole-picker { position: relative; }
.pole-picker > summary {
  list-style: none; min-height: 44px; padding: 6px 7px; display: inline-flex; align-items: center;
  color: var(--pink); background: #06080845; border: 1px solid #fe74a080; cursor: pointer; white-space: nowrap;
  justify-content: center; line-height: 1.1; font-size: clamp(10px,1vw,12px); font-weight: 400; letter-spacing: .03em;
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.pole-picker > summary::-webkit-details-marker { display: none; }
.pole-picker[open] > summary { color: #101010; background: var(--pink); }
.pole-picker .pole-colors {
  position: absolute; right: 0; top: calc(100% + 18px); width: min(320px,82vw); margin: 0;
  min-height: 184px; padding: 43px 10px 14px; overflow: visible;
  background: #001b14ee; border-color: var(--pink); box-shadow: 0 14px 46px #0009;
}
.pole-picker .pole-colors legend { position: absolute; top: 13px; left: 10px; line-height: 1.25; padding: 0; max-width: calc(100% - 20px); white-space: normal; }

.protocol-page { padding-bottom: 40px; }
.protocol-irl-gallery.compact-gallery {
  width: min(42vw,610px); margin: max(42px,7vh) auto 160px 3vw;
}
.protocol-irl-gallery.compact-gallery img { height: auto; }
.protocol-specimen {
  position: fixed !important; left: auto !important; right: clamp(14px,3vw,44px) !important;
  bottom: max(74px,10vh) !important; max-height: min(48vh,430px); overflow: auto;
  width: min(390px,calc(100vw - 28px)); z-index: 30;
}
.protocol-specimen #protocol-deep-link { display: block; margin-top: 12px; padding: 9px 10px; color: #00170e; background: #00ff66; text-decoration: none; }
.protocol-specimen.is-revealed { animation: protocol-reveal .72s steps(4,end); }
@keyframes protocol-reveal { 0%{transform:translate(12px,-8px);filter:brightness(2)} 40%{transform:translate(-7px,3px)} 100%{transform:none;filter:none} }

.exhibition-page {
  min-height: 100vh; min-height: 100svh; overflow: auto; color: #fff;
  padding: clamp(110px,15vh,160px) clamp(18px,5vw,82px) 80px;
  background-color: #2b0d26;
  background-image: url("./media/exhibition/exhibition-hero-ai.png");
  background-position: center 24%; background-size: cover; background-attachment: fixed; background-blend-mode: multiply;
}
.exhibition-page.active { display: block; }
.exhibition-intro { max-width: 950px; margin: 0 0 clamp(38px,6vw,78px); }
.exhibition-intro h1 { margin: 0 0 26px; color: var(--pink); font-size: clamp(36px,6.2vw,78px); line-height: .98; font-weight: 400; letter-spacing: -.035em; }
.exhibition-intro p { max-width: 810px; font-size: clamp(14px,1.18vw,18px); line-height: 1.58; }
.exhibition-intro a { color: #fff; text-underline-offset: 4px; }
.exhibition-intro .commission { margin-top: 30px; padding-top: 18px; border-top: 1px solid #ffffff80; }
.exhibition-galleries { display: grid; grid-template-columns: minmax(0,1fr); gap: clamp(18px,3vw,42px); align-items: start; }
.exhibition-lower-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(18px,3vw,42px); align-items: start; margin-top: clamp(18px,3vw,42px); }
.exhibition-right-stack { display: grid; gap: clamp(18px,3vw,42px); min-width: 0; }
.media-box,
.exhibition-credits {
  min-width: 0; padding: clamp(16px,2.2vw,30px); border: 1px solid #ffffff9c; border-radius: 2px 24px 2px 24px;
  background: #190817e8; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.media-box > label { display: block; margin-bottom: 9px; color: #fff; font-size: 11px; letter-spacing: .1em; }
.media-box select,
.compact-gallery select { width: 100%; min-height: 50px; padding: 8px 11px; color: #fff; background: #250018cc; border: 1px solid #fff; border-radius: 0; font: inherit; }
.media-box figure { margin: 12px 0 0; }
.media-box picture { display: block; overflow: hidden; }
.media-box img,
.media-box video { display: block; width: 100%; height: auto; object-fit: contain; background: transparent; }
.media-box-screens picture { aspect-ratio: 16 / 9; }
.media-box-screens img { width: 100%; height: 100%; object-fit: cover; }
.media-box figcaption { margin-top: 8px; font-size: 9px; letter-spacing: .055em; color: #fff; }
.exhibition-credits { margin-top: 0; }
.exhibition-credits > h2 { color: var(--pink); font-size: clamp(19px,2.2vw,32px); font-weight: 400; margin: 0 0 25px; }
.exhibition-credits .credit-grid { grid-template-columns: 1fr; gap: 10px; }
.exhibition-credits .credit-grid .credit-wide { grid-column: auto; }
.exhibition-credits .credit-grid h2,
.exhibition-credits .credit-grid dt { color: #fff; }
.exhibition-credits .credit-grid > section { border-top-color: #ffffff88; }
.exhibition-credits .credit-grid dl > div { border-top-color: #ffffff42; }

.artist-copy .commission,
.artist-copy .credit-grid { display: none; }

@media (max-width: 760px), (max-width: 900px) and (orientation: landscape) {
  .context-copy { grid-template-columns: 1fr; }
  .context-side-column { position: static; }
  .pole-picker > summary { min-height: 44px; font-size: 10px; padding-inline: 6px; }
  .protocol-irl-gallery.compact-gallery { width: auto; margin: 28px 12px 180px; }
  .protocol-irl-gallery.compact-gallery img { height: auto; }
  .protocol-specimen { position: relative !important; right: auto !important; left: auto !important; bottom: auto !important; margin: 22px 12px 70px !important; width: auto; max-height: none; }
  .exhibition-page { background-attachment: scroll; padding-top: 94px; }
  .exhibition-galleries,.exhibition-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .field-actions { max-width: calc(100vw - 150px); }
  .field-actions .animal-mode-button { max-width: 86px; white-space: normal; }
  .pole-picker > summary { font-size: 10px; }
}

/* V17: gallery media follows the selected file instead of sitting in a fixed black viewport. */
.context-media-gallery figure { margin: 10px 0 0; }
.context-media-gallery picture { display: block; overflow: hidden; }
.context-media-gallery img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; background: transparent; }
.context-media-gallery figcaption { margin-top: 8px; }

/* V17.3 release layout */
body:not(.route-field) .field-actions .pole-picker { display: none; }

.context-page,
.artist-page,
.exhibition-page {
  background-repeat: repeat;
  background-size: 430px 430px;
  background-attachment: scroll;
}
.context-page {
  background-color: #0b2b20;
  background-image: url("./visuals/subpage-pattern.webp");
  background-blend-mode: multiply;
}
.context-page.active { animation: context-pattern-drift 72s linear infinite; }
.artist-page {
  background-color: #071f16;
  background-image: url("./visuals/subpage-pattern.webp");
  background-blend-mode: multiply;
}
.artist-page.active { animation: artist-pattern-drift 78s linear infinite; }
.exhibition-page {
  background-color: #351027;
  background-image: url("./visuals/subpage-pattern.webp");
  background-blend-mode: multiply;
}
.exhibition-page.active { animation: exhibition-pattern-drift 75s linear infinite; }
@keyframes context-pattern-drift {
  from { background-position: 100% 0; }
  to { background-position: 0 100%; }
}
@keyframes artist-pattern-drift {
  from { background-position: 100% 100%; }
  to { background-position: 0 0; }
}
@keyframes exhibition-pattern-drift {
  from { background-position: 0 100%; }
  to { background-position: 100% 0; }
}

/* Context A: Editorial Ledger */
.context-intro,
.context-copy { width: min(100%,1540px); margin-inline: auto; }
.context-intro { padding-bottom: clamp(34px,5vw,72px); }
.context-intro-copy { width: min(100%,860px); }
.context-copy {
  grid-template-columns: minmax(0,1.55fr) minmax(270px,.65fr);
  gap: clamp(30px,5vw,78px);
}
.context-main-column { gap: 0; }
.context-main-column article,
.context-main-column article + article {
  padding: clamp(23px,3vw,42px) 0 clamp(36px,5vw,70px);
  border: 0;
  border-top: 1px solid #fe74a0a6;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.context-main-column h2,
.context-side-column h2 { margin-top: 0; letter-spacing: .08em; }
.context-main-column p { max-width: 820px; }
.context-side-column {
  gap: 0;
  padding-left: clamp(18px,2.4vw,36px);
  border-left: 1px solid #fe74a0a6;
}
.context-side-column > article,
.context-media-gallery {
  padding: 19px 0 28px;
  border: 0;
  border-top: 1px solid #ffffff38;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.context-side-column > article:first-child { border-top-color: #fe74a0a6; }
.diagram-labels ul { columns: 2; column-gap: 22px; }
.diagram-labels li { break-inside: avoid; margin-bottom: 5px; }
.context-media-gallery select { background: #071f16d9; }

/* Credits/videos lead the Exhibition archive; large galleries follow. */
.exhibition-lower-grid { margin-top: 0; margin-bottom: clamp(18px,3vw,42px); }
.exhibition-galleries { margin-top: 0; }
.exhibition-lower-grid,
.exhibition-galleries { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.media-box,
.exhibition-credits { background: #220918e8; background-image: none; }

/* True-3D model windows: compact glass cases for the field's own creature meshes. */
.creature-model-viewer {
  grid-column: 2; position: relative; min-height: clamp(150px,15vw,220px); margin: 8px 0 14px;
  overflow: hidden; touch-action: none; cursor: grab; outline: none;
  background: #00190f82; border: 1px solid #ffffff4d; border-radius: 3px 19px 3px 16px;
  backdrop-filter: blur(14px) saturate(1.08); -webkit-backdrop-filter: blur(14px) saturate(1.08); perspective: 720px;
}
.creature-model-viewer.is-grabbed { cursor: grabbing; border-color: var(--pink); }
.creature-model-viewer:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.creature-model-viewer canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.creature-model-viewer span { position: absolute; z-index: 3; left: 10px; bottom: 7px; color: var(--pink); font-size: 8px; letter-spacing: .08em; }

/* Tracking geometry: pole anchors, secondary nodes and local orbit fields. */
.pole-debug-line.is-mesh { opacity: .42; height: 1px; background: #fe74a0; }
.pole-debug-line.is-spine { opacity: .9; }
.pole-field-node {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--pink);
  transform: translate(-50%,-50%) rotate(45deg);
  box-shadow: 0 0 12px #fe74a0b8;
}
.pole-field-node::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid #fe74a040;
  border-radius: 50%;
  animation: tracking-node-pulse 2.8s ease-in-out infinite;
}
.pole-orbit-ring {
  position: absolute;
  width: var(--ring-size,76px);
  height: calc(var(--ring-size,76px) * .42);
  border: 1px solid #fe74a068;
  border-radius: 50%;
  transform: translate(-50%,-58%) rotate(var(--ring-angle,0deg));
  box-shadow: inset 0 0 14px #fe74a021;
}
.pole-debug-marker b { min-width: 84px; }
@keyframes tracking-node-pulse { 0%,100%{opacity:.25;transform:scale(.75)} 50%{opacity:.9;transform:scale(1.3)} }

.pure-easter-egg {
  position: fixed;
  left: 50%;
  bottom: max(72px,calc(env(safe-area-inset-bottom) + 62px));
  z-index: 500;
  width: min(680px,calc(100vw - 30px));
  transform: translate(-50%,18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  color: #07120d;
  background: var(--pink);
  border: 1px solid #fff;
  text-align: center;
  font-size: clamp(11px,1.2vw,15px);
  letter-spacing: .045em;
  transition: opacity .24s,transform .24s;
}
.pure-easter-egg.is-visible { opacity: 1; transform: translate(-50%,0); }
.pixel-title { pointer-events: auto; touch-action: manipulation; }
.warning-label { touch-action: manipulation; }

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .menu-panel { background: #02120bf2; }
  .field-actions button,
  .field-actions summary { background: #07120ddd; }
}
.client-low-power .diamond-glass,
.client-data-saver .diamond-glass { display: none; }
.client-low-power .context-page,
.client-low-power .artist-page,
.client-low-power .exhibition-page,
.client-data-saver .context-page,
.client-data-saver .artist-page,
.client-data-saver .exhibition-page { animation: none; }

@media (max-width: 760px), (max-width: 900px) and (orientation: landscape) {
  .context-copy { grid-template-columns: 1fr; gap: 26px; }
  .context-side-column { padding-left: 0; border-left: 0; }
  .context-side-column > article:first-child { border-top-color: #fe74a0a6; }
  .diagram-labels ul { columns: 1; }
  .exhibition-right-stack { gap: 18px; }
  .creature-model-viewer { min-height: 175px; }
}

@media (prefers-reduced-motion: reduce) {
  .context-page.active,
  .artist-page.active,
  .exhibition-page.active,
  .pattern-page,
  .pole-field-node::after { animation: none !important; }
  .pure-easter-egg { transition: none; }
}
