:root {
  color-scheme: dark;
  --ink-950: #0d171c;
  --ink-900: #172934;
  --ink-800: #233844;
  --graphite: #3d4b50;
  --slate: #87959b;
  --bone: #f7f0e4;
  --mineral: #e8ddc9;
  --current: #b9ecf3;
  --gold: #c59536;
  --coral: #ff6b70;
  --moss: #71836b;
  --clay: #c27e56;
  --violet: #8094ca;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --interface: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink-950);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--interface);
  color: var(--bone);
  background:
    radial-gradient(circle at 18% 4%, rgba(185, 236, 243, 0.1), transparent 32rem),
    radial-gradient(circle at 82% 86%, rgba(197, 149, 54, 0.08), transparent 29rem),
    linear-gradient(145deg, #0a1419 0%, var(--ink-950) 42%, #13232b 100%);
}

button,
summary {
  font: inherit;
}

button,
summary,
a {
  touch-action: manipulation;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3 {
  scroll-margin-top: 96px;
  text-wrap: balance;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink-950);
  background: var(--current);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.ambient-map {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(27deg, transparent 45%, rgba(185, 236, 243, 0.18) 46%, transparent 47%),
    linear-gradient(113deg, transparent 48%, rgba(232, 221, 201, 0.11) 49%, transparent 50%),
    radial-gradient(circle at 40% 35%, transparent 0 64px, rgba(185, 236, 243, 0.12) 65px 66px, transparent 67px),
    radial-gradient(circle at 72% 66%, transparent 0 112px, rgba(232, 221, 201, 0.09) 113px 114px, transparent 115px);
  background-size: 250px 180px, 290px 220px, 410px 410px, 520px 520px;
  mix-blend-mode: screen;
}

.ambient-current {
  position: fixed;
  pointer-events: none;
  width: 720px;
  height: 150px;
  border-top: 2px solid rgba(185, 236, 243, 0.22);
  border-radius: 50%;
  filter: blur(0.2px) drop-shadow(0 0 13px rgba(185, 236, 243, 0.28));
}

.ambient-current--one {
  top: 17%;
  left: -260px;
  transform: rotate(22deg);
}

.ambient-current--two {
  right: -260px;
  bottom: 12%;
  transform: rotate(-19deg);
}

.pilot-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 11rem),
    rgba(13, 23, 28, 0.9);
  border-inline: 1px solid rgba(185, 236, 243, 0.08);
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.38);
}

.pilot-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 18px 10px;
  background: linear-gradient(180deg, rgba(13, 23, 28, 0.98), rgba(13, 23, 28, 0.86));
  border-bottom: 1px solid rgba(185, 236, 243, 0.09);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.brand-spark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--gold);
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(197, 149, 54, 0.34));
}

.brand-name,
.brand-current {
  display: block;
}

.brand-name {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-current {
  margin-top: 4px;
  color: var(--current);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.pilot-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pilot-badge {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.pilot-menu {
  position: relative;
}

.pilot-menu summary {
  display: grid;
  width: 44px;
  height: 44px;
  list-style: none;
  place-items: center;
  color: var(--mineral);
  background: rgba(23, 41, 52, 0.84);
  border: 1px solid rgba(185, 236, 243, 0.14);
  border-radius: 50%;
  cursor: pointer;
}

.pilot-menu summary::-webkit-details-marker {
  display: none;
}

.pilot-menu__surface {
  position: absolute;
  top: 52px;
  right: 0;
  width: 220px;
  padding: 14px;
  color: var(--mineral);
  background: #162932;
  border: 1px solid rgba(185, 236, 243, 0.2);
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
}

.pilot-menu__surface p {
  margin: 0 0 12px;
  color: var(--slate);
  font-size: 12px;
  line-height: 1.45;
}

.pilot-menu__surface button {
  width: 100%;
  min-height: 44px;
  color: var(--coral);
  background: rgba(255, 107, 112, 0.08);
  border: 1px solid rgba(255, 107, 112, 0.28);
  border-radius: 12px;
  cursor: pointer;
}

.hatch-rail {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 8px 20px;
  color: var(--slate);
  background: rgba(10, 20, 25, 0.58);
  border-bottom: 1px solid rgba(185, 236, 243, 0.06);
}

.hatch-rail__label,
.hatch-rail__count {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hatch-rail__count {
  color: var(--current);
  font-variant-numeric: tabular-nums;
}

.hatch-rail__track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.hatch-rail__segment {
  height: 3px;
  overflow: hidden;
  background: var(--ink-800);
  border-radius: 999px;
}

.hatch-rail__segment::after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, var(--current), var(--gold));
  box-shadow: 0 0 9px rgba(185, 236, 243, 0.72);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-settle);
}

.hatch-rail__segment.is-complete::after {
  transform: scaleX(1);
}

.pilot-screen {
  min-height: calc(100svh - 158px);
}

.screen {
  display: flex;
  min-height: calc(100svh - 158px);
  flex-direction: column;
  padding: 30px 22px calc(34px + var(--safe-bottom));
  animation: screen-enter 420ms var(--ease-settle) both;
}

.screen--center {
  justify-content: center;
  text-align: center;
}

.screen--active {
  padding-bottom: calc(110px + var(--safe-bottom));
}

@keyframes screen-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.display-title {
  max-width: 440px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(39px, 11vw, 58px);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.display-title--small {
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1;
}

.lead {
  max-width: 440px;
  margin: 18px 0 0;
  color: var(--mineral);
  font-size: 17px;
  line-height: 1.55;
}

.body-copy {
  color: var(--mineral);
  font-size: 15px;
  line-height: 1.55;
}

.muted {
  color: var(--slate);
}

.centered {
  margin-inline: auto;
  text-align: center;
}

.pulse-stage {
  position: relative;
  display: grid;
  width: 218px;
  height: 218px;
  margin: 32px auto 26px;
  place-items: center;
}

.pulse-stage::before,
.pulse-stage::after {
  position: absolute;
  border: 1px solid rgba(185, 236, 243, 0.18);
  border-radius: 50%;
  content: "";
}

.pulse-stage::before {
  inset: 8px;
}

.pulse-stage::after {
  inset: 38px;
}

.pulse-core {
  position: relative;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  background:
    radial-gradient(circle, var(--bone) 0 4px, var(--gold) 5px 10px, transparent 11px),
    radial-gradient(circle, rgba(185, 236, 243, 0.34), var(--ink-900) 55%);
  border: 2px solid var(--current);
  border-radius: 50%;
  box-shadow:
    0 0 0 10px rgba(185, 236, 243, 0.05),
    0 0 28px rgba(185, 236, 243, 0.45),
    inset 0 0 22px rgba(185, 236, 243, 0.2);
}

.pulse-core::before,
.pulse-core::after {
  position: absolute;
  width: 8px;
  height: 17px;
  background: var(--bone);
  border-radius: 50%;
  box-shadow: 0 0 9px var(--current);
  content: "";
}

.pulse-core::before {
  left: 27px;
  transform: rotate(-10deg);
}

.pulse-core::after {
  right: 27px;
  transform: rotate(10deg);
}

.pulse-core--rewarding {
  border-color: var(--gold);
  box-shadow:
    0 0 0 10px rgba(197, 149, 54, 0.06),
    0 0 32px rgba(197, 149, 54, 0.52),
    inset 0 0 22px rgba(185, 236, 243, 0.22);
}

.beacon {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  margin: 10px 0 24px;
  padding: 16px 0;
  text-align: left;
  border-top: 1px solid rgba(232, 221, 201, 0.14);
  border-bottom: 1px solid rgba(232, 221, 201, 0.14);
}

.beacon__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--current);
  background: rgba(185, 236, 243, 0.08);
  border: 1px solid rgba(185, 236, 243, 0.16);
  border-radius: 50%;
}

.beacon__eyebrow {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.beacon h2,
.beacon p {
  margin: 0;
}

.beacon h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
}

.beacon p:last-child {
  margin-top: 4px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.45;
}

.action-stack {
  display: grid;
  gap: 11px;
  margin-top: auto;
}

.signal-button {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  color: var(--ink-950);
  font-weight: 800;
  background: var(--mineral);
  border: 1px solid rgba(247, 240, 228, 0.72);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: transform 130ms ease, background 180ms ease, box-shadow 180ms ease;
}

.signal-button:hover {
  background: var(--bone);
  box-shadow: 0 13px 32px rgba(0, 0, 0, 0.28);
}

.signal-button:active {
  transform: scale(0.975);
}

.signal-button--secondary {
  color: var(--bone);
  background: rgba(23, 41, 52, 0.78);
  border-color: rgba(185, 236, 243, 0.24);
  box-shadow: none;
}

.signal-button--secondary:hover {
  background: var(--ink-800);
}

.signal-button--danger {
  color: var(--coral);
  background: rgba(255, 107, 112, 0.06);
  border-color: rgba(255, 107, 112, 0.32);
  box-shadow: none;
}

.button-icon {
  font-size: 18px;
}

.safety-list {
  display: grid;
  gap: 4px;
  margin: 26px 0;
}

.safety-rule {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid rgba(232, 221, 201, 0.13);
}

.safety-rule__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--current);
  background: rgba(185, 236, 243, 0.08);
  border-radius: 14px;
  font-size: 21px;
}

.safety-rule h3,
.safety-rule p {
  margin: 0;
}

.safety-rule h3 {
  font-size: 15px;
}

.safety-rule p {
  margin-top: 4px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.45;
}

.mission-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.mission-count {
  color: var(--current);
  font-size: 27px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.core-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 28px 0;
}

.core-step {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 8px;
}

.core-step__orb {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--graphite);
  background: var(--ink-900);
  border: 1px solid rgba(185, 236, 243, 0.12);
  border-radius: 50%;
  transition: color 300ms var(--ease-settle), background 300ms var(--ease-settle), border-color 300ms var(--ease-settle), box-shadow 300ms var(--ease-settle);
}

.core-step.is-complete .core-step__orb {
  color: var(--ink-950);
  background: var(--gold);
  border-color: var(--mineral);
  box-shadow: 0 0 20px rgba(197, 149, 54, 0.35);
}

.core-step span:last-child {
  color: var(--slate);
  font-size: 10px;
  font-weight: 800;
}

.mission-slab {
  position: relative;
  overflow: hidden;
  margin: 4px 0 20px;
  padding: 22px;
  color: var(--ink-950);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent 48%),
    var(--mineral);
  border-radius: 23px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.26);
}

.mission-slab::after {
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 170px;
  height: 120px;
  border: 1px solid rgba(13, 23, 28, 0.13);
  border-radius: 50%;
  content: "";
  transform: rotate(-14deg);
}

.mission-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 13px;
  color: var(--mineral);
  background: var(--ink-900);
  border: 1px solid rgba(197, 149, 54, 0.38);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mission-slab h2 {
  max-width: 330px;
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: 31px;
  font-weight: 500;
  line-height: 1;
}

.mission-slab p {
  max-width: 350px;
  margin: 0;
  color: var(--ink-800);
  line-height: 1.45;
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 750;
}

.active-chip-row {
  display: flex;
  justify-content: center;
}

.route-stage {
  position: relative;
  height: 305px;
  margin: 10px 0 4px;
  overflow: hidden;
  background:
    radial-gradient(circle at 53% 67%, rgba(185, 236, 243, 0.08), transparent 34%),
    linear-gradient(27deg, transparent 48%, rgba(232, 221, 201, 0.035) 49%, transparent 50%);
  border-block: 1px solid rgba(185, 236, 243, 0.08);
}

.route-stage svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.route-base,
.route-progress {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-base {
  stroke: rgba(185, 236, 243, 0.12);
  stroke-width: 13;
}

.route-progress {
  stroke: url(#routeGradient);
  stroke-width: 7;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--route-progress, 0));
  filter: drop-shadow(0 0 9px rgba(185, 236, 243, 0.75));
  transition: stroke-dashoffset 480ms var(--ease-settle);
}

.route-orb {
  position: absolute;
  left: var(--route-x, 23%);
  top: var(--route-y, 76%);
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--ink-950);
  background: var(--current);
  border: 5px solid rgba(13, 23, 28, 0.86);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--current), 0 0 24px rgba(185, 236, 243, 0.7);
  transform: translate(-50%, -50%);
  transition: left 480ms var(--ease-settle), top 480ms var(--ease-settle);
}

.mission-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 14px 0 20px;
}

.mission-metric {
  padding: 12px 8px;
  text-align: center;
  background: rgba(23, 41, 52, 0.62);
  border: 1px solid rgba(185, 236, 243, 0.07);
  border-radius: 13px;
}

.mission-metric strong,
.mission-metric span {
  display: block;
}

.mission-metric strong {
  color: var(--bone);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.mission-metric span {
  margin-top: 4px;
  color: var(--slate);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.simulation-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: var(--slate);
  background: rgba(185, 236, 243, 0.05);
  border-left: 2px solid rgba(185, 236, 243, 0.36);
  font-size: 12px;
  line-height: 1.45;
}

.mission-dock {
  position: fixed;
  z-index: 15;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 12px 18px calc(12px + var(--safe-bottom));
  background: rgba(13, 23, 28, 0.96);
  border-top: 1px solid rgba(185, 236, 243, 0.13);
  backdrop-filter: blur(16px);
}

.dock-button {
  min-height: 58px;
  color: var(--mineral);
  background: var(--ink-900);
  border: 1px solid rgba(185, 236, 243, 0.16);
  border-radius: 17px;
  cursor: pointer;
  transition: transform 130ms ease, border-color 160ms ease;
}

.dock-button:active {
  transform: scale(0.965);
}

.dock-button--primary {
  color: var(--ink-950);
  font-weight: 850;
  background: var(--gold);
  border-color: var(--mineral);
  box-shadow: 0 0 21px rgba(197, 149, 54, 0.28);
}

.pause-symbol {
  display: block;
  margin-bottom: 2px;
  font-size: 20px;
}

.dock-label {
  display: block;
  font-size: 10px;
  font-weight: 760;
}

.pause-emblem {
  display: grid;
  width: 124px;
  height: 124px;
  margin: 0 auto 24px;
  place-items: center;
  color: var(--current);
  border: 10px solid rgba(185, 236, 243, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(185, 236, 243, 0.2);
  font-size: 42px;
}

.saved-note {
  margin: 18px auto 28px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
}

.recap-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 26px 0;
  overflow: hidden;
  color: var(--ink-950);
  background: rgba(13, 23, 28, 0.1);
  border-radius: 18px;
}

.recap-stat {
  padding: 18px 9px;
  background: var(--mineral);
  text-align: center;
}

.recap-stat strong,
.recap-stat span {
  display: block;
}

.recap-stat strong {
  font-size: 18px;
}

.recap-stat span {
  margin-top: 4px;
  color: var(--graphite);
  font-size: 10px;
}

.candidate-list {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.candidate-card {
  overflow: hidden;
  background: rgba(23, 41, 52, 0.82);
  border: 1px solid rgba(232, 221, 201, 0.15);
  border-radius: 25px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
}

.candidate-card__body {
  padding: 18px;
}

.candidate-card__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
}

.candidate-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
}

.family-tag {
  color: var(--current);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.candidate-card p {
  margin: 8px 0 16px;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.5;
}

.companion-portrait {
  position: relative;
  min-height: var(--portrait-height, 265px);
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 48%),
    #13232b;
}

.companion-portrait::after {
  position: absolute;
  z-index: 10;
  inset: auto 0 0;
  height: 28%;
  pointer-events: none;
  content: "";
  background: linear-gradient(transparent, rgba(13, 23, 28, 0.7));
}

.companion-art {
  position: absolute;
  z-index: 1;
  inset: -4% -2%;
  transition: transform 360ms var(--ease-settle), filter 240ms ease;
}

.companion-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(1.04);
}

.companion-portrait[data-proportion*="shallow"] .companion-art,
.companion-portrait[data-proportion*="trim"] .companion-art,
.companion-portrait[data-proportion*="lowset"] .companion-art {
  transform: scaleX(1.055) scaleY(0.96);
}

.companion-portrait[data-proportion*="raised"] .companion-art,
.companion-portrait[data-proportion*="longline"] .companion-art,
.companion-portrait[data-proportion*="block"] .companion-art {
  transform: scaleX(0.97) scaleY(1.06);
}

.surface-pattern,
.secondary-markings {
  position: absolute;
  z-index: 3;
  inset: 13% 16%;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: screen;
  mask-image: radial-gradient(ellipse, #000 20%, transparent 73%);
}

.companion-portrait[data-surface*="grid"] .surface-pattern,
.companion-portrait[data-surface*="block_weave"] .surface-pattern {
  background-image:
    linear-gradient(var(--accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 23px 23px;
}

.companion-portrait[data-surface*="topographic"] .surface-pattern,
.companion-portrait[data-markings*="topographic"] .secondary-markings {
  background: repeating-radial-gradient(ellipse at center, transparent 0 15px, var(--accent) 16px 17px, transparent 18px 26px);
}

.companion-portrait[data-surface*="ripple"] .surface-pattern,
.companion-portrait[data-markings*="ripple"] .secondary-markings {
  background: repeating-radial-gradient(circle at 52% 54%, transparent 0 17px, var(--accent) 18px 20px, transparent 21px 31px);
}

.companion-portrait[data-surface*="branch"] .surface-pattern,
.companion-portrait[data-markings*="branch"] .secondary-markings {
  background-image:
    linear-gradient(63deg, transparent 46%, var(--accent) 47% 49%, transparent 50%),
    linear-gradient(116deg, transparent 47%, var(--accent) 48% 50%, transparent 51%);
  background-size: 46px 54px;
}

.companion-portrait[data-markings*="crosswalk"] .secondary-markings,
.companion-portrait[data-markings*="block_loop"] .secondary-markings {
  background: repeating-linear-gradient(90deg, transparent 0 18px, var(--accent) 19px 25px, transparent 26px 39px);
}

.current-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent));
}

.current-overlay path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.3;
  stroke-linecap: round;
  opacity: 0.72;
}

.companion-portrait[data-trail*="topographic"] .current-overlay path {
  stroke-dasharray: 16 5 3 5;
}

.companion-portrait[data-trail*="ripple"] .current-overlay path {
  stroke-dasharray: 2 6;
}

.companion-portrait[data-trail*="branch"] .current-overlay path {
  stroke-dasharray: 10 4;
}

.companion-portrait[data-trail*="block"] .current-overlay path {
  stroke-dasharray: 4 8;
}

.companion-portrait[data-trail*="horizon"] .current-overlay path {
  stroke-dasharray: 28 7;
}

.current-overlay .extra-current {
  display: none;
}

.companion-portrait[data-ribbon*="double"],
.companion-portrait[data-ribbon*="twin"],
.companion-portrait[data-ribbon*="staggered"] {
  --show-extra: 1;
}

.companion-portrait[data-ribbon*="double"] .extra-current,
.companion-portrait[data-ribbon*="twin"] .extra-current,
.companion-portrait[data-ribbon*="staggered"] .extra-current,
.companion-portrait[data-ribbon*="orbit"] .extra-current,
.companion-portrait[data-ribbon*="side_loops"] .extra-current {
  display: block;
}

.crest-mark {
  position: absolute;
  z-index: 7;
  top: 16%;
  left: 50%;
  width: 82px;
  height: 38px;
  pointer-events: none;
  border-top: 3px solid var(--accent);
  border-radius: 50% 50% 0 0;
  filter: drop-shadow(0 0 5px var(--accent));
  transform: translateX(-50%);
}

.companion-portrait[data-crest*="split"] .crest-mark,
.companion-portrait[data-crest*="double"] .crest-mark {
  border-top: 0;
  border-right: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
  border-radius: 50% 50% 0 0;
}

.companion-portrait[data-crest*="hook"] .crest-mark,
.companion-portrait[data-crest*="upswept"] .crest-mark {
  width: 65px;
  border-right: 3px solid var(--accent);
  transform: translateX(-50%) rotate(-13deg);
}

.companion-portrait[data-crest*="loop"] .crest-mark {
  width: 62px;
  height: 48px;
  border: 3px solid var(--accent);
  border-radius: 50%;
}

.face-mark {
  position: absolute;
  z-index: 8;
  top: 31%;
  left: 50%;
  min-width: 46px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 4px;
  text-align: center;
  text-shadow: 0 0 6px var(--accent);
  transform: translateX(-50%);
}

.core-assembly {
  position: absolute;
  z-index: 8;
  top: 49%;
  left: 50%;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.core-halo,
.core-housing,
.core-light {
  position: absolute;
}

.core-housing {
  width: 42px;
  height: 42px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 65%, transparent);
}

.companion-portrait[data-core*="faceted_capsule"] .core-housing {
  width: 37px;
  height: 49px;
  border-radius: 12px;
}

.companion-portrait[data-core*="split_oval"] .core-housing {
  width: 47px;
  height: 31px;
  border-right-width: 7px;
  border-left-width: 7px;
  border-radius: 50%;
}

.companion-portrait[data-core*="mineral_ring"] .core-housing {
  border-style: dashed;
  border-width: 4px;
}

.core-light {
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px 3px var(--accent);
}

.core-halo {
  display: none;
  width: 54px;
  height: 54px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.65;
}

.companion-portrait:not([data-halo*="clear"]) .core-halo {
  display: block;
}

.companion-portrait[data-halo*="double"] .core-halo {
  box-shadow: 0 0 0 4px rgba(13, 23, 28, 0.8), 0 0 0 5px var(--accent);
}

.companion-portrait[data-halo*="offset"] .core-halo {
  width: 57px;
  height: 47px;
  transform: translate(4px, -3px);
}

.companion-portrait[data-halo*="pulsed"] .core-halo {
  border-style: dashed;
  border-width: 2px;
}

.band-mark {
  position: absolute;
  z-index: 8;
  display: none;
  width: 35px;
  height: 7px;
  pointer-events: none;
  background: var(--accent);
  border-radius: 99px;
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent) 60%, transparent);
}

.band-mark--left {
  top: 64%;
  left: 23%;
}

.band-mark--right {
  top: 64%;
  right: 23%;
}

.companion-portrait[data-bands*="wrist"] .band-mark,
.companion-portrait[data-bands*="mixed"] .band-mark,
.companion-portrait[data-bands*="ankle"] .band-mark {
  display: block;
}

.companion-portrait[data-bands*="ankle"] .band-mark {
  top: 82%;
}

.companion-portrait[data-bands*="shoulder"] .band-mark--left {
  top: 46%;
  left: 35%;
  display: block;
  width: 52px;
  transform: rotate(-18deg);
}

.charm-mark {
  position: absolute;
  z-index: 9;
  right: 19%;
  bottom: 19%;
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent);
  background: rgba(13, 23, 28, 0.82);
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 9px color-mix(in srgb, var(--accent) 55%, transparent);
  font-weight: 900;
}

.companion-portrait:not([data-charm*="none"]) .charm-mark {
  display: grid;
}

.ribbon-tip {
  position: absolute;
  z-index: 9;
  top: 31%;
  right: 13%;
  display: none;
  width: 13px;
  height: 13px;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}

.companion-portrait[data-edge*="luminous"] .ribbon-tip,
.companion-portrait[data-edge*="split"] .ribbon-tip,
.companion-portrait[data-edge*="mineral"] .ribbon-tip {
  display: block;
}

.companion-portrait[data-edge*="luminous"] .ribbon-tip {
  width: 44px;
  height: 4px;
  border-radius: 99px;
}

.companion-portrait[data-edge*="split"] .ribbon-tip {
  width: 18px;
  height: 8px;
  background: radial-gradient(circle at 3px 4px, var(--accent) 0 3px, transparent 4px), radial-gradient(circle at 15px 4px, var(--accent) 0 3px, transparent 4px);
  box-shadow: none;
}

.companion-portrait[data-edge*="mineral"] .ribbon-tip {
  transform: rotate(45deg);
}

.trait-panel {
  margin: 22px 0;
}

.trait-panel__label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.trait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.trait-button {
  min-height: 76px;
  padding: 11px;
  color: var(--bone);
  text-align: left;
  background: rgba(23, 41, 52, 0.78);
  border: 1px solid rgba(185, 236, 243, 0.12);
  border-radius: 15px;
  cursor: pointer;
  transition: transform 130ms ease, border-color 160ms ease, background 160ms ease;
}

.trait-button:hover,
.trait-button.is-active {
  background: var(--ink-800);
  border-color: rgba(185, 236, 243, 0.5);
}

.trait-button:active {
  transform: scale(0.975);
}

.trait-button strong,
.trait-button span {
  display: block;
}

.trait-button strong {
  font-size: 12px;
}

.trait-button span {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--current);
  font-size: 10px;
  line-height: 1.25;
}

.preview-status {
  margin: 14px 0;
  padding: 13px;
  color: var(--mineral);
  text-align: center;
  background: rgba(197, 149, 54, 0.07);
  border: 1px solid rgba(197, 149, 54, 0.22);
  border-radius: 14px;
  font-size: 12px;
}

.text-button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--current);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.birth-card {
  margin: 22px 0 26px;
  overflow: hidden;
  color: var(--ink-950);
  background: var(--mineral);
  border: 2px solid rgba(197, 149, 54, 0.68);
  border-radius: 28px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.32);
}

.birth-card__caption {
  padding: 21px;
  text-align: center;
}

.birth-card__caption h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 42px;
  font-weight: 500;
}

.birth-card__caption p {
  margin: 5px 0 0;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 720;
}

.birth-card__caption small {
  display: block;
  margin-top: 7px;
  color: rgba(61, 75, 80, 0.78);
}

.home-companion {
  margin: 22px 0;
  overflow: hidden;
  background: var(--ink-900);
  border: 1px solid rgba(185, 236, 243, 0.13);
  border-radius: 24px;
}

.home-companion__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px;
}

.home-companion__caption h2,
.home-companion__caption p {
  margin: 0;
}

.home-companion__caption h2 {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
}

.home-companion__caption p {
  margin-top: 3px;
  color: var(--slate);
  font-size: 12px;
}

.mini-core {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  background: radial-gradient(circle, var(--gold) 0 7px, var(--ink-900) 8px 21px, var(--current) 22px 24px, transparent 25px);
  filter: drop-shadow(0 0 8px rgba(185, 236, 243, 0.35));
}

.status-slab {
  margin-top: 18px;
  padding: 18px;
  color: var(--mineral);
  background: rgba(23, 41, 52, 0.64);
  border: 1px solid rgba(185, 236, 243, 0.1);
  border-radius: 19px;
}

.status-slab h3 {
  margin: 0 0 11px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.status-slab ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.status-slab li::before {
  margin-right: 8px;
  color: var(--current);
  content: "✓";
}

.workshop-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.workshop-header h1 {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-align: center;
}

.round-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--mineral);
  background: var(--ink-900);
  border: 1px solid rgba(185, 236, 243, 0.14);
  border-radius: 50%;
  cursor: pointer;
}

.workshop-section {
  margin: 24px 0 4px;
}

.workshop-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.workshop-section__heading h2,
.workshop-section__heading p {
  margin: 0;
}

.workshop-section__heading h2 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
}

.workshop-section__heading p {
  color: var(--slate);
  font-size: 10px;
}

.combination-note {
  margin: 18px 0 24px;
  padding: 14px 0;
  color: var(--slate);
  border-block: 1px solid rgba(232, 221, 201, 0.12);
  font-size: 11px;
  line-height: 1.5;
}

.combination-note strong {
  color: var(--current);
}

.pilot-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 18px calc(12px + var(--safe-bottom));
  color: rgba(135, 149, 155, 0.72);
  background: rgba(8, 15, 18, 0.54);
  border-top: 1px solid rgba(185, 236, 243, 0.06);
  font-size: 9px;
}

.noscript-message {
  position: fixed;
  z-index: 50;
  inset: 20px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--ink-950);
  background: var(--mineral);
  border-radius: 20px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 760px) {
  body {
    padding-block: 28px;
  }

  .pilot-shell {
    min-height: calc(100svh - 56px);
    overflow: hidden;
    border: 1px solid rgba(185, 236, 243, 0.12);
    border-radius: 30px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.58);
  }

  .pilot-header {
    border-radius: 30px 30px 0 0;
  }

  .mission-dock {
    bottom: 28px;
    border: 1px solid rgba(185, 236, 243, 0.13);
    border-radius: 0 0 30px 30px;
  }

  .display-title {
    font-size: 55px;
  }
}

@media (max-width: 374px) {
  .pilot-badge {
    display: none;
  }

  .screen {
    padding-inline: 18px;
  }

  .display-title {
    font-size: 38px;
  }

  .trait-grid {
    grid-template-columns: 1fr;
  }

  .mission-dock {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  .pilot-shell {
    background: var(--ink-950);
  }

  .muted,
  .lead,
  .body-copy,
  .candidate-card p,
  .safety-rule p {
    color: var(--bone);
  }

  .signal-button--secondary,
  .trait-button,
  .candidate-card,
  .status-slab {
    border-color: var(--current);
  }
}
