:root {
  color-scheme: dark;
  --bg: #03050a;
  --bg-2: #07101b;
  --ink: #f6fbff;
  --muted: #b6c6d5;
  --soft: #86a0b4;
  --line: rgba(199, 232, 255, 0.22);
  --line-strong: rgba(229, 246, 255, 0.46);
  --panel: rgba(8, 18, 32, 0.74);
  --panel-strong: rgba(16, 31, 50, 0.9);
  --shadow: rgba(0, 0, 0, 0.52);
  --lens-a: #74f7ff;
  --lens-b: #a88cff;
  --lens-c: #fff36d;
  --lens-rgb: 116 247 255;
  --focus: #ffffff;
  --danger: #ff6e9d;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --content: 1180px;
  --pad: clamp(1rem, 2.7vw, 2rem);
  --display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-lens="orient"] {
  --lens-a: #74f7ff;
  --lens-b: #a88cff;
  --lens-c: #fff36d;
  --lens-rgb: 116 247 255;
}

html[data-lens="weigh"] {
  --lens-a: #fff36d;
  --lens-b: #74f7ff;
  --lens-c: #ff8cbd;
  --lens-rgb: 255 243 109;
}

html[data-lens="compose"] {
  --lens-a: #ff8cbd;
  --lens-b: #a88cff;
  --lens-c: #74f7ff;
  --lens-rgb: 255 140 189;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--display);
  background:
    radial-gradient(circle at 12% 8%, rgba(var(--lens-rgb), 0.22), transparent 31rem),
    radial-gradient(circle at 88% 10%, rgba(168, 140, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 50% 82%, rgba(255, 243, 109, 0.1), transparent 29rem),
    linear-gradient(145deg, #020309 0%, #07101b 48%, #02050c 100%);
  font-size: 16px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 22%, black 0 45%, transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 8px);
  mix-blend-mode: screen;
  opacity: 0.4;
}

::selection {
  background: rgba(var(--lens-rgb), 0.34);
  color: var(--ink);
}

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

:where(a, button, summary) {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  transform: translateY(-160%);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: #031016;
  background: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px var(--shadow);
  transition: transform 180ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header,
.portrait-shell,
.site-footer,
.not-found {
  width: min(var(--content), calc(100% - (var(--pad) * 2)));
  margin-inline: auto;
}

.site-header {
  padding: clamp(2rem, 5vw, 4.8rem) 0 clamp(1rem, 2.5vw, 2rem);
}

.kicker,
.section-tag {
  margin: 0 0 0.8rem;
  color: var(--lens-a);
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(4.4rem, 17vw, 14.5rem);
  line-height: 0.76;
  letter-spacing: -0.095em;
  text-transform: uppercase;
  text-wrap: balance;
  background:
    linear-gradient(95deg, var(--ink), var(--lens-a) 34%, var(--lens-c) 62%, var(--ink)),
    linear-gradient(#fff, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(var(--lens-rgb), 0.18));
}

.lede {
  max-width: 70ch;
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.38rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 1.08fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1rem, 2vw, 2rem) 0 clamp(2rem, 5vw, 5rem);
}

.hero-copy {
  min-width: 0;
}

.hero-copy h2,
.control-deck h2,
.lens-intro h2,
.boundary-card h2,
.not-found h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.2rem, 6vw, 5.35rem);
  line-height: 0.93;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.hero-copy p:not(.section-tag),
.control-deck p,
.boundary-card p,
.lens-panel p,
.not-found p {
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: clamp(1.4rem, 2.8vw, 2rem);
}

.signature-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sig-num,
.panel-index {
  display: block;
  color: var(--lens-a);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.signature-grid strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.05rem;
}

.signature-grid p {
  margin: 0.45rem 0 0;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.portrait-frame {
  min-width: 0;
  margin: 0;
}

.portrait-plate {
  position: relative;
  width: min(100%, 44rem);
  margin-inline: auto;
  border: 1px solid var(--line-strong);
  border-radius: clamp(1.5rem, 5vw, 3.2rem);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 46%, rgba(var(--lens-rgb), 0.22), transparent 38%),
    rgba(5, 12, 22, 0.82);
  box-shadow:
    0 2rem 6rem rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 5rem rgba(var(--lens-rgb), 0.1);
  isolation: isolate;
}

.portrait-plate::before {
  content: "";
  position: absolute;
  inset: 1.2rem;
  border: 1px solid rgba(var(--lens-rgb), 0.22);
  border-radius: clamp(1rem, 4vw, 2.4rem);
  pointer-events: none;
}

.portrait-plate::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  background: conic-gradient(from 120deg, transparent, rgba(var(--lens-rgb), 0.22), transparent, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0.7;
  animation: field-turn 18s linear infinite;
  mix-blend-mode: screen;
}

.portrait-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.stop-core-a { stop-color: #ffffff; }
.stop-core-b { stop-color: var(--lens-a); }
.stop-core-c { stop-color: rgba(3, 7, 16, 0.35); }
.stop-rim-a { stop-color: var(--lens-a); }
.stop-rim-b { stop-color: var(--lens-b); }
.stop-rim-c { stop-color: var(--lens-c); }

.svg-well {
  fill: rgba(2, 5, 12, 0.18);
}

.axis-grid path,
.axis-grid circle {
  fill: none;
  stroke: rgba(218, 242, 255, 0.13);
  stroke-width: 1.2;
  stroke-dasharray: 5 14;
}

.orbit,
.calibration,
.marker-link {
  fill: none;
  stroke: var(--lens-a);
  stroke-linecap: round;
}

.orbit {
  stroke-width: 1.6;
  stroke-opacity: 0.58;
  transform-origin: 360px 360px;
  animation: orbit-breathe 5.6s ease-in-out infinite;
}

.orbit-two {
  --orbit-rotate: 60deg;
  transform: rotate(60deg);
  stroke: var(--lens-b);
  animation-delay: -1.6s;
}

.orbit-three {
  --orbit-rotate: -60deg;
  transform: rotate(-60deg);
  stroke: var(--lens-c);
  animation-delay: -3s;
}

.calibration {
  stroke-width: 1.8;
  stroke-opacity: 0.34;
  stroke-dasharray: 2 12;
}

.spine {
  fill: rgba(var(--lens-rgb), 0.28);
  stroke: rgba(255, 255, 255, 0.48);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: spine-pulse 4.8s ease-in-out infinite;
}

.body-shadow {
  fill: rgba(0, 0, 0, 0.38);
  transform: translate(18px, 22px);
}

.body-shell {
  fill: url(#rim-gradient);
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 2.4;
}

.body-glass {
  fill: rgba(255, 255, 255, 0.18);
}

.core {
  fill: url(#core-gradient);
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1.5;
  transform-origin: 360px 360px;
  animation: core-pulse 4.4s ease-in-out infinite;
}

.core-inner {
  fill: rgba(2, 7, 14, 0.74);
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 1.3;
}

.eye {
  fill: rgba(2, 7, 14, 0.88);
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.6;
}

.mouth-line,
.measure {
  fill: none;
  stroke: rgba(2, 7, 14, 0.76);
  stroke-width: 6;
  stroke-linecap: round;
}

.measure {
  stroke-width: 3;
  stroke-opacity: 0.54;
}

.marker {
  fill: var(--lens-a);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms ease, fill 220ms ease;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
  filter: drop-shadow(0 0 18px rgba(var(--lens-rgb), 0.9));
}

.marker-weigh { fill: var(--lens-c); }
.marker-compose { fill: var(--lens-b); }
.marker-link {
  stroke-width: 1.3;
  stroke-opacity: 0.32;
  stroke-dasharray: 6 12;
}

.svg-labels text {
  fill: rgba(246, 251, 255, 0.74);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-anchor: middle;
}

.detail-high,
.detail-mid {
  transition: opacity 260ms ease, transform 260ms ease;
}

html[data-intensity="1"] .detail-mid,
html[data-intensity="1"] .detail-high {
  opacity: 0;
}

html[data-intensity="2"] .detail-high {
  opacity: 0;
}

html[data-intensity="2"] .detail-mid,
html[data-intensity="3"] .detail-mid,
html[data-intensity="3"] .detail-high {
  opacity: 1;
}

html[data-lens="orient"] .marker-orient,
html[data-lens="weigh"] .marker-weigh,
html[data-lens="compose"] .marker-compose {
  transform: scale(1.5);
}

.portrait-hotspots {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(2, 8, 16, 0.62);
  box-shadow: 0 0 0 0.45rem rgba(var(--lens-rgb), 0.08), 0 0 2rem rgba(var(--lens-rgb), 0.24);
  pointer-events: auto;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hotspot span {
  position: absolute;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  color: #031016;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hotspot::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--lens-a);
  box-shadow: 0 0 1rem rgba(var(--lens-rgb), 0.95);
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-active {
  transform: scale(1.08);
  border-color: var(--ink);
  background: rgba(var(--lens-rgb), 0.22);
}

.hotspot:hover span,
.hotspot:focus-visible span,
.hotspot.is-active span {
  opacity: 1;
  transform: translateY(2.05rem);
}

.hotspot-orient { left: calc(50% - 1.375rem); top: 12%; }
.hotspot-weigh { right: 14%; top: 62%; }
.hotspot-compose { left: 14%; top: 62%; }

.portrait-frame figcaption {
  margin-top: 0.8rem;
  color: var(--soft);
  font-size: 0.94rem;
}

.control-deck,
.boundary-card,
.lens-panel,
.not-found-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: 0 1.6rem 5rem rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(18rem, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.control-deck h2,
.lens-intro h2,
.boundary-card h2 {
  font-size: clamp(2rem, 4.5vw, 4rem);
}

.controls {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.lens-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.lens-tab {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.85rem 0.8rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 900;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.lens-tab span {
  display: block;
  color: var(--lens-a);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.lens-tab:hover,
.lens-tab:focus-visible,
.lens-tab[aria-current="page"] {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(var(--lens-rgb), 0.19);
}

.detail-control {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.045);
}

.detail-label {
  color: var(--ink);
  font-weight: 900;
}

.detail-control input[type="range"] {
  width: 100%;
  accent-color: var(--lens-a);
}

.detail-output,
.control-help,
.noscript-note {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.control-help,
.noscript-note {
  margin: 0;
}

.noscript-note {
  border: 1px solid rgba(var(--lens-rgb), 0.34);
  border-radius: 1rem;
  padding: 0.85rem;
  background: rgba(var(--lens-rgb), 0.08);
}

.path-button,
.home-link {
  border: 0;
  border-radius: 999px;
  padding: 0.92rem 1.15rem;
  color: #021018;
  background: linear-gradient(90deg, var(--lens-a), var(--lens-c));
  box-shadow: 0 1rem 2.4rem rgba(var(--lens-rgb), 0.22);
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.path-button:hover,
.home-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.lens-deck {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.25rem);
  padding: clamp(2rem, 5vw, 5rem) 0;
}

.lens-intro {
  min-width: 0;
}

.lens-panel {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: clamp(1.15rem, 3vw, 2rem);
}

.js .lens-panel:not(.is-active) {
  display: none;
}

.lens-panel h3 {
  margin: 0.4rem 0 0.85rem;
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lens-panel ul {
  display: grid;
  gap: 0.75rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.lens-panel li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
}

.lens-panel li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--lens-a);
  box-shadow: 0 0 1rem rgba(var(--lens-rgb), 0.7);
}

.boundary-card {
  border-radius: var(--radius-lg);
  margin-bottom: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2.2rem);
}

.boundary-card h2 {
  max-width: 16ch;
}

.boundary-card details {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.boundary-card summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.site-footer {
  padding: 0 0 2.5rem;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.status-region {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.not-found {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding-block: clamp(2rem, 8vw, 6rem);
}

.not-found-card {
  width: min(100%, 52rem);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 5vw, 3rem);
}

.not-found-card h1 {
  max-width: 12ch;
}

.not-found-card .home-link {
  display: inline-block;
  margin-top: 1rem;
}

@keyframes field-turn {
  to { transform: rotate(1turn); }
}

@keyframes orbit-breathe {
  0%, 100% { stroke-opacity: 0.34; transform: rotate(var(--orbit-rotate, 0deg)) scale(0.985); }
  50% { stroke-opacity: 0.82; transform: rotate(var(--orbit-rotate, 0deg)) scale(1.015); }
}

@keyframes spine-pulse {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 1; }
}

@keyframes core-pulse {
  0%, 100% { transform: scale(0.97); filter: drop-shadow(0 0 18px rgba(var(--lens-rgb), 0.32)); }
  50% { transform: scale(1.035); filter: drop-shadow(0 0 34px rgba(var(--lens-rgb), 0.62)); }
}

@media (max-width: 920px) {
  .hero,
  .control-deck,
  .lens-deck {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    order: -1;
  }

  .hero-copy h2,
  .control-deck h2,
  .lens-intro h2,
  .boundary-card h2 {
    max-width: 18ch;
  }
}

@media (max-width: 660px) {
  :root {
    --pad: 1rem;
  }

  body {
    overflow-x: hidden;
  }

  .site-header {
    padding-top: 2.2rem;
  }

  h1 {
    font-size: clamp(4rem, 22vw, 6.5rem);
  }

  .signature-grid,
  .lens-tabs {
    grid-template-columns: 1fr;
  }

  .portrait-plate::before {
    inset: 0.65rem;
  }

  .hotspot {
    min-width: 2.25rem;
    min-height: 2.25rem;
  }

  .hotspot::before {
    width: 0.6rem;
    height: 0.6rem;
  }

  .hotspot span {
    font-size: 0.56rem;
  }

  .hotspot-orient { top: 11%; }
  .hotspot-weigh { right: 10%; top: 62%; }
  .hotspot-compose { left: 10%; top: 62%; }
}

@media (max-width: 420px) {
  .kicker,
  .section-tag {
    letter-spacing: 0.12em;
  }

  .hero-copy h2,
  .control-deck h2,
  .lens-intro h2,
  .boundary-card h2,
  .not-found h1 {
    font-size: clamp(2rem, 14vw, 3.45rem);
  }

  .control-deck,
  .boundary-card,
  .lens-panel,
  .not-found-card {
    border-radius: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .portrait-plate::after {
    opacity: 0.18;
  }
}

@media (forced-colors: active) {
  body,
  .control-deck,
  .boundary-card,
  .lens-panel,
  .not-found-card,
  .portrait-plate {
    background: Canvas;
    color: CanvasText;
  }

  .lens-tab,
  .detail-control,
  .hotspot,
  .path-button,
  .home-link {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .status-region {
    forced-color-adjust: none;
  }
}
