/* The house shell: one chrome for every house, one energy per house.
   Pair with spheres.css (the signal is the house's sphere colour) and
   house-nav.css (the room list in the bar). A house supplies its fonts
   through --xio-shell-text, --xio-shell-wide and --xio-shell-mono.

   <section class="xio-shell" data-house="xiphirium">
     <header class="xio-shell-bar">mark · <HouseNav> · .xio-shell-clock</header>
     <h1 class="xio-statement"><b>Name</b> the rest of the sentence.</h1>
     <div class="xio-console"> .xio-rail · .xio-vp · .xio-rail </div>
     <div class="xio-dock">…</div>
   </section> */

.xio-shell {
  --xio-shell-ground: #080b0e;
  --xio-shell-slate: #0b1015;
  --xio-shell-fg: #d6e4ea;
  --xio-shell-fg2: #93a9b3;
  --xio-shell-steel: #566b76;
  --xio-shell-rule: rgba(200, 224, 236, .11);
  --xio-shell-rule2: rgba(200, 224, 236, .2);
  --xio-shell-ease: cubic-bezier(.22, 1, .36, 1);
  --xio-shell-tempo: 4s;
  --xio-signal: #8fc3e4;
  --xio-nav-fg: var(--xio-shell-fg);
  --xio-nav-muted: var(--xio-shell-steel);
  --xio-nav-accent: var(--xio-signal);
  --xio-nav-font: var(--xio-shell-text, inherit);
  position: relative; isolation: isolate;
  display: grid; gap: clamp(18px, 2.2vw, 32px);
  padding-inline: clamp(16px, 2.4vw, 36px);
  padding-block: clamp(16px, 2vw, 28px) clamp(20px, 2.4vw, 32px);
  color: var(--xio-shell-fg);
  font-family: var(--xio-shell-text, system-ui, sans-serif);
  background:
    radial-gradient(80% 50% at 50% -10%, rgba(143, 195, 228, .07), transparent 70%),
    radial-gradient(60% 55% at 50% 58%, color-mix(in srgb, var(--xio-signal) 5%, transparent), transparent 70%),
    linear-gradient(180deg, var(--xio-shell-ground), var(--xio-shell-slate));
}
.xio-shell[data-house="xirophi"] { --xio-signal: var(--xio-sphere-xirophi); }
.xio-shell[data-house="xio"] { --xio-signal: var(--xio-sphere-xio-open); }
.xio-shell[data-house="xiphion"] { --xio-signal: var(--xio-sphere-xiphion); }
.xio-shell[data-house="xiphirium"] { --xio-signal: var(--xio-sphere-xiphirium); }

/* bar: house mark, every house as one comma-set line, the Sydney clock */
.xio-shell-bar {
  display: flex; align-items: center; gap: 18px; min-width: 0;
  padding: 12px 16px; border: 1px solid var(--xio-shell-rule);
  background: color-mix(in srgb, var(--xio-shell-ground) 60%, transparent);
}
.xio-shell-bar > svg, .xio-shell-bar > img { width: 22px; height: 22px; flex: none; }
.xio-shell-bar .xio-houses { margin-left: auto; }
.xio-shell-bar .xio-houses-list { gap: 0 .3em; }
.xio-shell-bar .xio-house a { gap: 0; font-size: 15px; letter-spacing: .02em; padding-block: 2px; transition: color .4s var(--xio-shell-ease); }
.xio-shell-bar .xio-house:not(:last-child) a::after { content: ","; color: var(--xio-shell-steel); }
.xio-shell-bar .xio-house-code, .xio-shell-bar .xio-house-role { display: none; }
.xio-shell-clock {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding-left: 18px; border-left: 1px solid var(--xio-shell-rule);
  font: 400 11px/1 var(--xio-shell-mono, ui-monospace, monospace); letter-spacing: .14em; color: var(--xio-shell-steel);
}
.xio-shell-clock b { font-weight: 400; color: var(--xio-shell-fg); }
.xio-live { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--xio-signal); animation: xio-breathe var(--xio-shell-tempo) var(--xio-shell-ease) infinite; }

/* statement: the house's name bright, the rest of the sentence in steel */
.xio-statement {
  margin: 0; max-width: 24ch; text-wrap: balance;
  font: 400 clamp(28px, 3.6vw, 54px)/1.04 var(--xio-shell-text, system-ui, sans-serif);
  letter-spacing: -.035em; color: var(--xio-shell-steel);
}
.xio-statement b { font-weight: 400; color: var(--xio-shell-fg); }

/* console: status rail, viewport, feeds rail */
.xio-console { counter-reset: xio-mod; display: grid; grid-template-columns: minmax(220px, 272px) minmax(0, 1fr) minmax(220px, 272px); gap: 14px; align-items: stretch; }
.xio-rail { display: grid; gap: 14px; align-content: start; min-width: 0; }
.xio-mod { position: relative; min-width: 0; padding: 14px; border: 1px solid var(--xio-shell-rule); background: color-mix(in srgb, var(--xio-shell-ground) 55%, transparent); }
.xio-mod::before, .xio-mod::after { content: ""; position: absolute; width: 9px; height: 9px; border: 1px solid var(--xio-shell-fg2); pointer-events: none; }
.xio-mod::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.xio-mod::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.xio-lab {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px;
  font: 400 9px/1 var(--xio-shell-wide, var(--xio-shell-mono, ui-monospace, monospace)); letter-spacing: .16em; text-transform: uppercase; color: var(--xio-shell-fg2);
}
.xio-mod > .xio-lab > span:first-child::before { counter-increment: xio-mod; content: counter(xio-mod, decimal-leading-zero) " \00b7  "; color: var(--xio-shell-steel); }
.xio-tag {
  display: inline-block; padding: 4px 6px; background: var(--xio-shell-fg); color: var(--xio-shell-ground);
  font: 400 8px/1 var(--xio-shell-wide, var(--xio-shell-mono, ui-monospace, monospace)); letter-spacing: .14em; text-transform: uppercase;
}
.xio-tag.is-signal { background: var(--xio-signal); color: #fff; }
.xio-tag.is-outline { background: transparent; color: var(--xio-shell-fg2); border: 1px solid var(--xio-shell-rule2); }
.xio-feed { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--xio-shell-rule); align-items: baseline; }
.xio-feed:first-of-type { border-top: 0; }
.xio-feed > span { font: 400 8px/1.2 var(--xio-shell-wide, var(--xio-shell-mono, ui-monospace, monospace)); letter-spacing: .14em; text-transform: uppercase; color: var(--xio-shell-steel); }
.xio-feed > b { font: 300 18px/1 var(--xio-shell-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.xio-feed > em { grid-column: 1 / -1; font-style: normal; font-size: 11px; line-height: 1.3; color: var(--xio-shell-fg2); }

/* viewport: dot field, edge coordinates, hatched corners in the signal, outlined title */
.xio-vp {
  position: relative; min-width: 0; min-height: min(56vw, 560px); overflow: hidden; border: 1px solid var(--xio-shell-rule2);
  background: radial-gradient(circle, rgba(219, 231, 236, .16) 1px, transparent 1.5px) 0 0 / 28px 28px, color-mix(in srgb, var(--xio-shell-ground) 70%, transparent);
}
.xio-vp::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--xio-shell-rule2) 0 1px, transparent 1px 10%) 0 0 / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--xio-shell-rule) 0 1px, transparent 1px 2%) 0 0 / 100% 4px no-repeat,
    repeating-linear-gradient(180deg, var(--xio-shell-rule2) 0 1px, transparent 1px 12.5%) 0 0 / 9px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--xio-shell-rule) 0 1px, transparent 1px 2.5%) 0 0 / 4px 100% no-repeat;
}
.xio-vp::after {
  content: ""; position: absolute; inset: 6px; z-index: 3; pointer-events: none;
  --c: color-mix(in srgb, var(--xio-signal) 80%, transparent);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 16px 1px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 16px 1px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 16px 1px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 1px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 16px 1px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 1px 16px no-repeat;
}
.xio-vp-hatch { position: absolute; z-index: 1; opacity: .55; pointer-events: none; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--xio-signal) 70%, transparent) 0 1px, transparent 1px 7px); }
.xio-vp-hatch.is-start { left: 0; top: 0; width: 18%; height: 22%; -webkit-mask: linear-gradient(135deg, #000 30%, transparent 80%); mask: linear-gradient(135deg, #000 30%, transparent 80%); }
.xio-vp-hatch.is-end { right: 0; bottom: 0; width: 22%; height: 26%; -webkit-mask: linear-gradient(-45deg, #000 30%, transparent 80%); mask: linear-gradient(-45deg, #000 30%, transparent 80%); }
.xio-vp-head, .xio-vp-foot {
  position: absolute; z-index: 2; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font: 400 9px/1 var(--xio-shell-wide, var(--xio-shell-mono, ui-monospace, monospace)); letter-spacing: .16em; text-transform: uppercase; color: var(--xio-shell-fg2);
  white-space: nowrap;
}
.xio-vp-head { top: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--xio-shell-rule); }
.xio-vp-foot { bottom: 12px; padding-top: 10px; border-top: 1px solid var(--xio-shell-rule); }
.xio-vp-title {
  position: absolute; z-index: 2; left: 28px; right: 28px; bottom: 52px; overflow: hidden; white-space: nowrap; pointer-events: none;
  font: 400 clamp(26px, 4.4vw, 62px)/1 var(--xio-shell-wide, var(--xio-shell-text, sans-serif)); letter-spacing: .08em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--xio-shell-fg) 55%, transparent);
}

/* the one ask */
.xio-cta {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--xio-shell-fg); color: var(--xio-shell-ground);
  font: 400 9px/1 var(--xio-shell-wide, var(--xio-shell-mono, ui-monospace, monospace)); letter-spacing: .16em; text-transform: uppercase;
  transition: background .4s var(--xio-shell-ease), color .4s var(--xio-shell-ease), gap .4s var(--xio-shell-ease);
}
.xio-cta:hover { background: var(--xio-signal); color: #fff; gap: 20px; }

/* dock: what is playing, the same in every house */
.xio-dock { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 2.2fr) auto; gap: 18px; align-items: center; padding: 12px 16px; border: 1px solid var(--xio-shell-rule); }

.xio-shell a:focus-visible, .xio-shell button:focus-visible { outline: 1px solid var(--xio-signal); outline-offset: 3px; }

@media (max-width: 1080px) {
  .xio-console { grid-template-columns: 1fr 1fr; }
  .xio-vp { grid-column: 1 / -1; order: -1; min-height: 420px; }
}
@media (max-width: 640px) {
  .xio-console { grid-template-columns: 1fr; }
  .xio-shell-clock { display: none; }
  .xio-shell-bar .xio-house a { font-size: 13px; }
  .xio-vp { min-height: 380px; }
  .xio-vp-head, .xio-vp-foot { left: 16px; right: 16px; }
  .xio-vp-head > :not(:first-child), .xio-vp-foot > :not(:last-child) { display: none; }
  .xio-vp-foot { justify-content: flex-end; }
  .xio-dock { grid-template-columns: auto 1fr; }
  .xio-dock > :nth-child(n+3) { display: none; }
}
@keyframes xio-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .xio-live { animation: none; } .xio-cta { transition: none; } }
