/* Pipeline portfolio — shared styles. Dark hub layout, no third-party CSS. */
@font-face {
  font-family: "GeistLocal";
  src: url("fonts/geist-latin.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07080c;
  --bg-elev: #10131a;
  --bg-card: rgba(14, 17, 26, 0.86);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #eceef4;
  --muted: #9aa3b5;
  --dim: #7a8190;
  --good: #3ecf8e;
  --wait: #e7b549;
  --hold: #8b94a7;
  --active: #5b9cff;
  --font: "GeistLocal", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "GeistLocal", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --dock-h: 300px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  max-width: 100%;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: #fff; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 40;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  border-radius: 8px;
}

body.app {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% 28%, rgba(40, 60, 110, 0.16), transparent 60%),
    var(--bg);
}

/* Fixed chrome + scrolling dock on short/mobile screens */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

.chrome {
  flex: 0 0 auto;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 12px 20px 8px;
  max-width: 100%;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.topbar .back {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.topbar .back:hover { border-color: var(--line-strong); color: var(--fg); }
.brand { flex: 1 1 240px; min-width: 0; }
.kicker {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 590;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.topbar .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  text-align: right;
}
.updated, .preview-flag {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.preview-flag { color: var(--wait); }

.inputs { margin-bottom: 8px; }
.inputs-head, .panel-head, .card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.inputs-head { justify-content: flex-start; gap: 12px; margin-bottom: 8px; }
.inputs-head h2,
.panel h2,
.card .name,
.morning h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 580;
}
.inputs-head .note,
.panel .note,
.card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px 7px 7px;
  min-height: 40px;
  color: var(--fg);
}
.chip .ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--chip-color, #5b9cff) 22%, #0e1118);
  color: var(--chip-color, #5b9cff);
}
.chip .ico svg { width: 15px; height: 15px; display: block; }
.chip span { font-size: 13px; font-weight: 520; }

/* Camera viewport — the world pans inside this, dock stays put */
.viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 520px;
  height: clamp(520px, calc(100vh - 220px - var(--dock-h)), 820px);
  overflow: hidden;
  max-width: 100%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(20, 28, 48, 0.35), transparent 60%);
}
.world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.world .hub-box {
  position: absolute;
  overflow: hidden;
  border-radius: 24px;
  pointer-events: none;
}
.world .hub-box canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.hub-labels {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.hub-labels li {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(236, 238, 244, 0.72);
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.85);
}
.hub-labels li.is-lit { color: #fff; }

.paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.paths .flow-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.55;
  stroke-width: 1.6;
}
.paths .flow-line.is-live {
  stroke-opacity: 0.95;
  stroke-width: 2;
}
.packet {
  pointer-events: none;
}

/* Stage cards sit in the world, above the paths */
.card {
  position: absolute;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow);
  z-index: 2;
  min-width: 0;
  backdrop-filter: blur(8px);
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--stage-color, #5b9cff);
}
.card.is-focus {
  border-color: color-mix(in srgb, var(--stage-color) 70%, #fff 10%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--stage-color) 70%, transparent),
    0 0 24px color-mix(in srgb, var(--stage-color) 28%, transparent),
    var(--shadow);
}
.card-head { padding-left: 10px; margin-bottom: 6px; }
.card .name { color: var(--stage-color, #5b9cff); }
.card .state-pill {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--state-color, var(--muted));
  white-space: nowrap;
}
.card .meta { padding-left: 10px; margin-bottom: 8px; }
.tasks {
  list-style: none;
  margin: 0;
  padding: 0 0 0 10px;
}
.tasks li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  margin: 0 -4px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--dim);
  border: 1.5px solid transparent;
}
.tasks li .tlabel { min-width: 0; }
.tasks .tstate {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.8;
  flex: 0 0 auto;
}
.tasks li.is-lit {
  color: #fff;
  border: 1.5px solid transparent;
  border-image: var(--lit-border) 1;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--stage-color) 80%, #fff),
    0 0 16px color-mix(in srgb, var(--stage-color) 35%, transparent);
  background: color-mix(in srgb, var(--stage-color) 12%, transparent);
}
.tasks li.is-lit .tstate { color: #fff; opacity: 1; }

.meter {
  margin: 8px 0 0 10px;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--stage-color, #5b9cff);
  border-radius: inherit;
}
.connector {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stage-color, #5b9cff);
  box-shadow: 0 0 10px var(--stage-color, #5b9cff);
  top: 22px;
}
.card[data-side="left"] .connector { right: -5px; }
.card[data-side="right"] .connector { left: -5px; }
.card[data-side="top"] .connector,
.card[data-side="bottom"] .connector {
  left: 50%;
  transform: translateX(-50%);
}
.card[data-side="top"] .connector { bottom: -5px; top: auto; }
.card[data-side="bottom"] .connector { top: -5px; }

/* Dock stays put — not inside the camera world */
.dock {
  flex: 0 0 auto;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 12px 20px 28px;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0), var(--bg) 12px);
  position: relative;
  z-index: 6;
}
.bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}
.panel, .morning {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}
.panel-head { margin-bottom: 10px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 0;
}
.metric .label {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.metric .value {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.metric .src {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.metric.is-example .src { color: var(--wait); }

.approvals { list-style: none; margin: 0; padding: 0; }
.approvals li {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.approvals li:first-child { border-top: 0; padding-top: 0; }
.approvals h3 {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 580;
}
.approvals p { margin: 0; color: var(--muted); font-size: 12px; }
.approvals .who {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wait);
}

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}
.log-list li:first-child { border-top: 0; padding-top: 0; }
.log-list .ltime {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  padding-top: 2px;
}
.log-list .ltext { color: var(--fg); min-width: 0; }
.log-list .lstate {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--state-color, var(--muted));
  align-self: start;
  padding-top: 2px;
}
.log-list li.is-new { animation: logIn 0.45s ease; }
@keyframes logIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.morning .when {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.morning .lines { margin: 0; padding: 0; list-style: none; }
.morning .lines li {
  padding: 4px 0;
  color: var(--fg);
  font-size: 13px;
}
.morning .files {
  columns: 1;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.morning .files li { padding: 2px 0; overflow-wrap: anywhere; }

footer.site {
  margin-top: 14px;
  color: var(--dim);
  font-size: 12px;
}
footer.site p { margin: 0 0 6px; }

/* Directory index */
.wrap {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px 20px 48px;
  max-width: 100%;
}
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.dir-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 120px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.dir-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.dir-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.02em;
  font-weight: 590;
  text-transform: none;
}
.dir-card p { margin: 0; color: var(--muted); font-size: 13px; }
.dir-card .pct {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

@media (max-width: 1100px) {
  .bottom { grid-template-columns: 1fr 1fr; }
  --dock-h: 420px;
}

@media (max-width: 900px) {
  .chrome, .dock, .wrap { padding-left: 12px; padding-right: 12px; }
  .viewport {
    min-height: 420px;
    height: 460px;
  }
  .bottom { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .meta { align-items: flex-start; text-align: left; margin-left: 0; }
  .card { width: 240px; }
  .hub-labels li { font-size: 10px; letter-spacing: 0.16em; }
}

@media (max-width: 420px) {
  .viewport { min-height: 380px; height: 400px; }
  .chip { padding: 6px 10px 6px 6px; }
  .metric .value { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .world { will-change: auto; }
  .log-list li.is-new { animation: none; }
}
