/* Universe scene: the solar system canvas (js/systems/solar.js), its core panel, the plain
   project list and the hollow inert objects, all in the site's light paper palette. */
.universe {
  position: fixed;
  inset: 0;
  z-index: var(--z-scene);
}

/* Inert objects: hollow outlines with presence only (never projects, never interactive) */
.inert {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms ease-out;
}

.inert.is-shown {
  opacity: 1;
}

.inert-object {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  fill: none;
  stroke: var(--inert-stroke);
  stroke-width: var(--inert-stroke-width);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.inert-object * {
  vector-effect: non-scaling-stroke;
}

/* Core ---------------------------------------------------------------- */
.core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 0;
  height: 0;
}

.core__button {
  position: absolute;
  left: -100px;
  top: -100px;
  display: block;
  width: 200px;
  height: 200px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}

.core__button:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 2px;
}

/* Core panel: Factory concepts and the live Virtual Office */
.core__panel {
  position: absolute;
  left: 130px;
  top: 0;
  width: 300px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border-radius: 22px;
  background: var(--surface-white);
  border: 1px solid color-mix(in srgb, var(--space-orbit) 14%, transparent);
  box-shadow: 0 10px 30px rgb(17 17 17 / 0.06);
  opacity: 0;
  visibility: hidden;
  translate: 8px -50%;
  transition: opacity 200ms ease-out, translate 200ms ease-out, visibility 0s 200ms;
}

.core.is-open {
  z-index: 5;
}

.core.is-open .core__panel {
  opacity: 1;
  visibility: visible;
  translate: 0 -50%;
  transition: opacity 200ms ease-out, translate 200ms ease-out, visibility 0s;
}

.core__kicker {
  font-size: 1.05rem;
  font-weight: 700;
}

.core__summary {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.core__concepts {
  display: grid;
  gap: 4px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgb(17 17 17 / 0.08);
}

.core__concept {
  font-size: 0.85rem;
  font-weight: 600;
}

.core__concept-text {
  margin: 0 0 8px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.core__label {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.office {
  position: relative;
  margin-top: 8px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg);
}

.office__map {
  display: block;
  width: 100%;
  height: auto;
}

.office__links line {
  stroke: var(--ink);
  stroke-opacity: 0.14;
  stroke-width: 1;
}

.office__packets circle {
  fill: var(--accent);
}

.office__desk {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.18;
}

.office__agent {
  fill: var(--ink);
}

.office__agent--accent {
  fill: var(--accent);
}

.office__status {
  min-height: 1.2em;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Core panel, richer (brief Task 3.6) --------------------------------------------- */
.core__line {
  min-height: 1.3em;
  margin-top: 2px;
  font-size: 0.85rem;
  font-weight: 500;
}

.core__services,
.core__roster {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

/* A service row expands to show its one-line detail on hover or keyboard focus. */
.core__service {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 10px;
  outline: none;
}

.core__service:hover,
.core__service:focus-visible {
  background: var(--bg);
}

.core__service:focus-visible {
  box-shadow: 0 0 0 2px var(--ink);
}

.core__service svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.core__service-body {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 200ms ease-out;
}

.core__service:hover .core__service-body,
.core__service:focus-visible .core__service-body {
  grid-template-rows: auto 1fr;
}

.core__service-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.core__service-detail {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

/* Roster: each agent with its role and a live status dot */
.core__roster-item {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.core__roster-name {
  font-weight: 600;
}

.core__roster-role {
  color: var(--ink-muted);
}

.core__status {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  animation: core-working 1.6s ease-in-out infinite alternate;
}

.core__status--accent {
  background: var(--accent);
}

/* Sending work: the dot lights up with the accent for a moment */
.core__status.is-sending {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

@keyframes core-working {
  from { scale: 0.8; }
  to   { scale: 1.15; }
}

.core__cta {
  width: 100%;
  margin-top: 14px;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
}

.core__cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .core__status {
    animation: none;
  }

  .core__service-body {
    transition: none;
  }
}

/* Preview tags: the technologies behind a project */
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 0 4px;
}

.project__tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 500;
}

/* Close the core panel */
.core__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.core__close svg,
.project-list__close svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---- Solar system (js/systems/solar.js) -------------------------------------------------- */
.solar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--space-bg);
}

/* Where you are, and the way back out of a planet */
.solar-bar {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  translate: -50% 0;
}

.solar-bar__crumb {
  color: color-mix(in srgb, var(--space-label) 70%, transparent);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.solar-bar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-nav-raised);
}

.solar-bar__back svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solar-bar__back:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Planets and moons as real buttons and links: invisible, but reachable by keyboard and screen
   readers. Focusing one shows the same ring and preview as hovering it on the canvas. */
.solar-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The project preview window, shared by moons and the project list */
.solar-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 6;
  width: 220px;
  padding: 8px 8px 10px;
  border-radius: 16px;
  background: var(--surface-white);
  box-shadow: 0 10px 30px rgb(17 17 17 / 0.1);
  opacity: 0;
  scale: 0.94;
  pointer-events: none;
  transition: opacity 160ms ease-out, scale 160ms ease-out;
}

.solar-preview.is-shown {
  opacity: 1;
  scale: 1;
}

.solar-preview__shot {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  aspect-ratio: 16 / 10;
  padding: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--shot-a) 22%, var(--surface-white));
  background-size: cover;
  background-position: center;
}

.solar-preview__shot.has-image > * {
  display: none;
}

.solar-preview__bar {
  height: 7px;
  border-radius: 4px;
  background: rgb(17 17 17 / 0.1);
}

.solar-preview__hero {
  border-radius: 7px;
  background: var(--shot-a);
}

.solar-preview__lines {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.solar-preview__lines i {
  height: 7px;
  border-radius: 4px;
  background: rgb(17 17 17 / 0.12);
}

.solar-preview__name {
  display: block;
  margin-top: 8px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.solar-preview__meta {
  display: block;
  padding: 0 4px;
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.solar-preview__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 0 4px;
}

/* ---- The plain project list (js/systems/project-list.js) --------------------------------- */
.project-list {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* A small card that floats like the Factory cards */
.project-list__toggle {
  display: grid;
  place-items: center;
  gap: 3px;
  width: 64px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface-white);
  box-shadow: var(--card-edge), var(--shadow-card-raised);
  color: var(--ink);
}

.project-list__toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-top: 8px;
}

.project-list__toggle-label {
  margin-bottom: 8px;
  font-size: 0.66rem;
  font-weight: 600;
}

.project-list__toggle.is-open {
  background: var(--ink);
  color: var(--bg);
}

.project-list__toggle:focus-visible,
.project-list__category:focus-visible,
.project-list__project:focus-visible,
.project-list__close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.project-list__panel {
  position: relative;
  width: 300px;
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 12px;
  border-radius: 20px;
  background: var(--surface-white);
  box-shadow: var(--card-edge), var(--shadow-card-raised);
}

.project-list__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink);
}

.project-list__title {
  font-size: 1rem;
  font-weight: 700;
}

.project-list__intro {
  margin: 2px 0 10px;
  color: var(--ink-muted);
  font-size: 0.76rem;
  text-wrap: pretty;
}

.project-list__category {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: none;
  color: var(--ink);
  text-align: left;
}

.project-list__dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--category);
}

.project-list__name {
  font-size: 0.86rem;
  font-weight: 600;
}

.project-list__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.project-list__projects {
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
  padding: 0 0 0 20px;
  list-style: none;
}

.project-list__project {
  display: grid;
  padding: 6px 8px;
  border-radius: 10px;
}

.project-list__project:hover,
.project-list__project:focus-visible {
  background: var(--bg);
}

.project-list__project-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.project-list__project-meta {
  color: var(--ink-muted);
  font-size: 0.72rem;
}
