/* DSO Headquarters — "Console" layout: a symmetrical war-room built around the shield.
   Blue wing on the left, red wing on the right, the shield's radar core in the middle. */

/* ---------- Panel shape variants (outer corners cut like the shield's wings) ---------- */
.panel.wl {
  clip-path: polygon(30px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 30px 100%, 0 calc(100% - 30px), 0 30px);
  --edge: linear-gradient(110deg, var(--blue-2), rgba(9, 146, 249, 0.2) 40%, rgba(220, 203, 208, 0.12));
}
.panel.wl::after { clip-path: polygon(29.6px 0, 100% 0, 100% calc(100% - 9.6px), calc(100% - 9.6px) 100%, 29.6px 100%, 0 calc(100% - 29.6px), 0 29.6px); }
.panel.wr {
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% calc(100% - 30px), calc(100% - 30px) 100%, 10px 100%, 0 calc(100% - 10px));
  --edge: linear-gradient(250deg, var(--red), rgba(239, 14, 13, 0.2) 40%, rgba(220, 203, 208, 0.12));
}
.panel.wr::after { clip-path: polygon(0 0, calc(100% - 29.6px) 0, 100% 29.6px, 100% calc(100% - 29.6px), calc(100% - 29.6px) 100%, 9.6px 100%, 0 calc(100% - 9.6px)); }

/* Corner brackets: little HUD marks on a panel's straight corners */
.brackets { position: absolute; inset: 8px; pointer-events: none; z-index: 0; }
.brackets::before, .brackets::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: rgba(220, 203, 208, 0.45); border-style: solid; }
.wl .brackets::before { right: 0; top: 0; border-width: 1px 1px 0 0; }
.wl .brackets::after { right: 0; bottom: 6px; border-width: 0 1px 1px 0; opacity: 0; }
.wr .brackets::before { left: 0; top: 0; border-width: 1px 0 0 1px; }
.wr .brackets::after { left: 0; bottom: 0; border-width: 0 0 1px 1px; opacity: 0; }

/* Panel title strip with index number */
.ph { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ph .idx { font: 600 10px/1 var(--mono); color: var(--dim); letter-spacing: 0.14em; }
.ph h2 { font-size: 20px; }
.ph .rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.wr .ph { flex-direction: row-reverse; text-align: right; }
.wr .ph .rule { background: linear-gradient(270deg, var(--line-strong), transparent); }
.ph a, .ph .tag2 { font: 600 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Greeting band (centered) ---------- */
.greet { position: relative; text-align: center; margin: 4px auto 26px; max-width: 980px; }
.greet .eyebrow { display: flex; justify-content: center; }
.greet h1.glitch { display: block; width: fit-content; margin-inline: auto; }
.greet .eyebrow::after { content: ""; width: 22px; height: 2px; background: var(--split); }
.greet h1 { margin-top: 12px; font-size: clamp(34px, 5vw, 70px); }
.greet .lede { margin: 12px auto 0; text-align: center; }
.greet .hero-actions { justify-content: center; }

/* ---------- The console grid ---------- */
.console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 500px) minmax(0, 1fr);
  grid-template-areas: "left core right";
  gap: 20px;
  align-items: start;
}
.console > .left { grid-area: left; }
.console > .right { grid-area: right; }
.console > .core-wrap { grid-area: core; position: sticky; top: 112px; }

/* ---------- Radar core ---------- */
.core { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.core .ring { position: absolute; border-radius: 50%; inset: var(--in); border: 1px solid rgba(220, 203, 208, 0.12); }
.core .ring.r1 { --in: 0%; border: 0; background: conic-gradient(from 180deg, var(--blue-2), var(--silver) 25%, var(--red) 50%, var(--silver) 75%, var(--blue-2)); mask: radial-gradient(closest-side, transparent 98.6%, #000 99%); opacity: 0.75; box-shadow: 0 0 40px rgba(9, 146, 249, 0.12); }
.core .ring.r2 { --in: 12%; border-style: dashed; border-color: rgba(220, 203, 208, 0.3); animation: spin 60s linear infinite; }
.core .ring.r3 { --in: 26%; border: 1px solid transparent; background: linear-gradient(90deg, rgba(9, 146, 249, 0.55), rgba(239, 14, 13, 0.55)) border-box; mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); }
.core .ring.r4 { --in: 4%; border: 0; background: conic-gradient(from 0deg, transparent 0 87%, rgba(220, 203, 208, 0.5) 87% 87.4%, transparent 87.4%); mask: radial-gradient(closest-side, transparent 96%, #000 97%); animation: spin 24s linear infinite reverse; }
.core .ticks { position: absolute; inset: 2%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(220, 203, 208, 0.35) 0 0.4deg, transparent 0.4deg 6deg); mask: radial-gradient(closest-side, transparent 94%, #000 95%); }
.core .sweep { position: absolute; inset: 4%; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg 290deg, rgba(90, 202, 248, 0.06) 300deg, rgba(90, 202, 248, 0.22) 355deg, rgba(200, 240, 255, 0.85) 359.5deg, transparent 360deg); mix-blend-mode: screen; mask: radial-gradient(closest-side, #000 99%, transparent 100%); animation: spin 6s linear infinite; }
.core .split-glow { position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(closest-side at 30% 50%, rgba(9, 146, 249, 0.42), transparent), radial-gradient(closest-side at 70% 50%, rgba(239, 14, 13, 0.36), transparent); filter: blur(18px); animation: breathe 6s ease-in-out infinite; }
.core .core-shield { position: relative; width: 52%; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.75)); animation: float 7s ease-in-out infinite; }
.core .crosshair { position: absolute; inset: 0; pointer-events: none; }
.core .crosshair::before, .core .crosshair::after { content: ""; position: absolute; background: linear-gradient(90deg, transparent, rgba(220, 203, 208, 0.18), transparent); }
.core .crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }
.core .crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(180deg, transparent, rgba(220, 203, 208, 0.18), transparent); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Orbit nodes: live counts sitting on the radar */
.node-o {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 4px;
  min-width: 96px;
  padding: 10px 12px 9px;
  color: var(--text);
  text-align: center;
  background: rgba(5, 8, 19, 0.88);
  box-shadow: inset 0 0 0 1px var(--o-c, var(--cyan)), 0 0 24px color-mix(in srgb, var(--o-c, var(--cyan)) 30%, transparent);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  transition: transform var(--med) var(--ease), background var(--fast);
  z-index: 2;
}
.node-o:hover { color: var(--text); transform: translate(-50%, -50%) scale(1.07); background: rgba(10, 16, 40, 0.95); }
.node-o b { font: 700 28px/1 var(--display); }
.node-o span { font: 600 9.5px/1.1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.node-o .blip { position: absolute; top: 6px; right: 14px; width: 6px; height: 6px; background: var(--o-c, var(--cyan)); transform: rotate(45deg); animation: pulse 1.6s infinite; }

.core-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.core-actions .btn { width: 100%; }

/* ---------- Mission rail (horizontal snap) ---------- */
.rail-wrap { margin-top: 34px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rail-btns { display: flex; gap: 6px; }
.rail-btns button { width: 34px; height: 34px; border: 0; color: var(--text); background: rgba(220, 203, 208, 0.06); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: pointer; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.rail-btns button:hover { box-shadow: inset 0 0 0 1px var(--cyan); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior-x: contain; }
.mission { scroll-snap-align: start; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; padding: 16px; color: var(--text); }
.mission:hover { color: var(--text); }
.mission .date { display: grid; justify-items: center; padding: 8px 0; background: linear-gradient(180deg, color-mix(in srgb, var(--m-c) 30%, transparent), transparent); box-shadow: inset 0 2px 0 var(--m-c); }
.mission .date b { font: 700 28px/1 var(--display); }
.mission .date span { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--muted); }
.mission h3 { font-size: 17px; }
.mission p { margin: 4px 0 0; font: 12px/1.4 var(--mono); color: var(--muted); }

/* ---------- Org tree (real diagram, not a list) ---------- */
.tree { display: grid; justify-items: center; gap: 26px; padding: 8px 0 4px; }
.tree .t-node { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 18px; min-width: 150px; text-align: center; background: rgba(5, 8, 19, 0.85); box-shadow: inset 0 0 0 1px var(--t-c, var(--line-strong)); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px); }
.tree .t-node b { font: 700 17px/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; }
.tree .t-node span { font: 10px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tree .t-node.ceo { --t-c: var(--silver); }
.tree .t-node.coo { --t-c: var(--red); }
.tree .tier { position: relative; display: grid; justify-items: center; }
.tree .tier + .tier::before { content: ""; position: absolute; top: -26px; left: 50%; width: 1px; height: 26px; background: linear-gradient(180deg, var(--silver), var(--red)); }
.tree .depts { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; }
.tree .depts::before { content: ""; position: absolute; top: -13px; left: 12.5%; right: 12.5%; height: 1px; background: linear-gradient(90deg, var(--blue-2), var(--red)); }
.tree .depts > .t-node { --t-c: rgba(9, 146, 249, 0.6); min-width: 0; width: 100%; }
.tree .depts > .t-node::before { content: ""; position: absolute; top: -13px; left: 50%; width: 1px; height: 13px; background: var(--blue-2); }
.tree .depts > .t-node { clip-path: none; overflow: visible; }
.tree .t-node .count { margin-top: 6px; font: 700 11px/1 var(--mono); color: var(--cyan); }

/* ---------- Phone dock + bottom sheet ---------- */
.dock { display: none; }
.sheet { display: none; }

@media (max-width: 1240px) {
  .console { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "core core" "left right"; }
  .console > .core-wrap { position: static; max-width: 520px; width: 100%; justify-self: center; }
}
@media (max-width: 860px) {
  .console { grid-template-columns: minmax(0, 1fr); grid-template-areas: "core" "left" "right"; gap: 16px; }
  .tree .depts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  .tree .depts::before { display: none; }
  .tree .depts > .t-node::before { display: none; }
  .panel.wl, .panel.wr { clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
  .panel.wl::after, .panel.wr::after { clip-path: polygon(17.6px 0, 100% 0, 100% calc(100% - 17.6px), calc(100% - 17.6px) 100%, 0 100%, 0 17.6px); }
  .wr .ph { flex-direction: row; text-align: left; }
  .wr .ph .rule { background: linear-gradient(90deg, var(--line-strong), transparent); }

  /* App-style bottom dock with the shield as the centre button */
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .site-foot { padding-bottom: 30px; }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: linear-gradient(180deg, rgba(5, 8, 19, 0.9), rgba(3, 4, 10, 0.98));
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .dock::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, var(--blue-2), var(--silver) 50%, var(--red)); opacity: 0.7; }
  .dock a, .dock button { position: relative; display: grid; justify-items: center; gap: 4px; height: 68px; padding-top: 12px; border: 0; background: none; color: var(--muted); font: 700 10.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .dock svg { width: 22px; height: 22px; }
  .dock [aria-current="page"] { color: #fff; }
  .dock [aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
  .dock .dock-core { padding: 0; }
  .dock .dock-core .plate { position: absolute; bottom: 22px; left: 50%; width: 74px; height: 74px; transform: translateX(-50%); display: grid; place-items: center; background: radial-gradient(circle at 35% 40%, #12204d, #03040a 70%); box-shadow: 0 0 0 1px rgba(220, 203, 208, 0.35), 0 0 26px rgba(9, 146, 249, 0.35), 0 0 26px rgba(239, 14, 13, 0.2); clip-path: polygon(50% 0, 100% 22%, 100% 70%, 50% 100%, 0 70%, 0 22%); transition: transform var(--fast) var(--ease); }
  .dock .dock-core .plate img { width: 56px; }
  .dock .dock-core:active .plate { transform: translateX(-50%) scale(0.94); }
  .dock .dock-core > span:last-child { position: absolute; bottom: 8px; }
  .dock .dot { position: absolute; top: 8px; right: calc(50% - 18px); min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center; font: 700 9px/1 var(--mono); color: #fff; background: var(--red); border-radius: 8px; }

  .sheet { display: block; position: fixed; inset: 0; z-index: 70; pointer-events: none; }
  .sheet .scrim { position: absolute; inset: 0; background: rgba(3, 4, 10, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--med) var(--ease); }
  .sheet .body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto; padding: 10px 18px calc(96px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #0b1230, #05081a); box-shadow: 0 -1px 0 rgba(220, 203, 208, 0.25); clip-path: polygon(0 18px, 18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); transform: translateY(105%); transition: transform 420ms var(--ease); }
  .sheet .grab { width: 44px; height: 4px; margin: 4px auto 16px; background: var(--line-strong); }
  body.sheet-open .sheet { pointer-events: auto; }
  body.sheet-open .sheet .scrim { opacity: 1; }
  body.sheet-open .sheet .body { transform: none; }
  .sheet .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet .sheet-grid a { display: grid; gap: 6px; padding: 16px 14px; color: var(--text); background: rgba(220, 203, 208, 0.04); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
  .sheet .sheet-grid a.b { box-shadow: inset 3px 0 0 var(--blue-2), inset 0 0 0 1px var(--line); }
  .sheet .sheet-grid a.r { box-shadow: inset -3px 0 0 var(--red), inset 0 0 0 1px var(--line); }
  .sheet .sheet-grid b { font: 700 16px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
  .sheet .sheet-grid span { font: 11px/1.3 var(--mono); color: var(--muted); }
  .sheet .who-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .sheet .who-row .who { font: 700 18px/1 var(--display); text-transform: uppercase; }
  .sheet .who-row .role { font: 11px/1.3 var(--mono); color: var(--red-glow); letter-spacing: 0.12em; text-transform: uppercase; }
  .sheet .search-btn { width: 100%; margin-bottom: 14px; justify-content: flex-start; height: 46px; }

  .menu-btn.left { display: none; }
}
@media (max-width: 560px) {
  .node-o { min-width: 76px; padding: 8px 8px 7px; }
  .node-o b { font-size: 22px; }
  .node-o span { font-size: 8.5px; }
  .core-actions { grid-template-columns: 1fr; }
  .greet h1 { font-size: clamp(30px, 9vw, 44px); }
  .greet .lede { font-size: 15px; }
  .rail { grid-auto-columns: 82%; }
  .tree .t-node { padding: 10px 10px; }
  .tree .t-node b { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .core .ring, .core .sweep, .core .core-shield, .core .split-glow { animation: none !important; }
}
@media (max-width: 560px) { .hide-sm { display: none; } .greet .eyebrow::before, .greet .eyebrow::after { width: 14px; } }

/* Live org tree: real people in their seats */
.tree a.t-node, .tree .t-node { color: var(--text); }
.tree .t-node.ceo, .tree .t-node.coo { grid-template-columns: auto; justify-items: center; gap: 6px; padding: 14px 22px 12px; }
.tree a.t-node:hover b { color: var(--cyan); }
.tree .vacant { opacity: .6; }
.tree .vacant .hexav { background: rgba(220,203,208,.12); }
.tree .depts { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.tree .depts::before { left: calc(50% / var(--n, 4)); right: calc(50% / var(--n, 4)); }
.tree .t-node.dept { align-content: start; gap: 8px; padding: 14px 10px; }
.tree .dept-name { font: 600 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan) !important; }
.tree .lead { display: grid; justify-items: center; gap: 4px; color: var(--text); }
.tree .lead b { font: 700 15px/1.1 var(--display); text-transform: uppercase; }
.tree .lead span:not(.hexav):not(.hexav span) { font: 10px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.tree .crew { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }
.tree .crew .more { font-size: 11px; color: var(--muted); align-self: center; }
@media (max-width: 1100px) { .tree .depts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; } .tree .depts::before, .tree .depts > .t-node::before { display: none; } }
@media (max-width: 860px) { .tree .depts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Player home ---------- */
.row.is-me { box-shadow: inset 2px 0 0 var(--cyan); background: linear-gradient(90deg, rgba(90, 202, 248, 0.08), transparent 70%); }
.pbars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 132px; align-items: end; }
.pbar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.pbar i { display: block; width: 100%; height: calc(max(var(--h), 0.03) * 100% - 18px); min-height: 3px; background: linear-gradient(180deg, var(--violet), rgba(9, 146, 249, 0.45)); clip-path: polygon(0 4px, 4px 0, 100% 0, 100% 100%, 0 100%); transform-origin: bottom; animation: pbar-up .9s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--h) * 300ms); opacity: calc(0.35 + var(--h) * 0.65); }
.pbar.today i { background: linear-gradient(180deg, var(--red-glow), rgba(239, 14, 13, 0.4)); opacity: 1; box-shadow: 0 0 18px rgba(239, 14, 13, 0.4); }
.pbar em { font: 600 9px/1 var(--mono); font-style: normal; color: var(--muted); letter-spacing: .08em; }
@keyframes pbar-up { from { transform: scaleY(0); } }
.ready { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 170px; }
.checks li, .checks a { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); text-decoration: none; }
.checks li.ok, .checks li.ok a { color: var(--text); }
.checks a:hover { color: var(--cyan); }
.checks .tick { width: 18px; height: 18px; flex: none; display: grid; place-items: center; font-size: 11px; box-shadow: inset 0 0 0 1px rgba(220, 203, 208, 0.25); }
.checks li.ok .tick { background: var(--green); color: #031; box-shadow: 0 0 10px rgba(68, 230, 160, 0.4); }
.checks li.soon { opacity: .55; }
.checks em { font: 600 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; font-style: normal; color: var(--amber); }
@media (prefers-reduced-motion: reduce) { .pbar i { animation: none; } }
