/* utility-protocol skeleton: structure only. Colour, type and ornament are the
   variant's (variants/*.css); everything here paints from --v-* tokens.
   Layout knobs a variant may turn (never the grid properties themselves, or the
   phone breakpoints below would lose to the variant's later rule):
     --up-side-w   side rail width          --up-hero-cols  hero columns (desktop)
     --up-h1       headline size; --up-h1-l / --up-h1-xl for long ones (app.js sets
                   data-up-len on the hero: s | m | l | xl) */

.up-app {
  --up-top-h: 64px;
  --up-side-w: 264px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--up-side-w) minmax(0, 1fr);
  grid-template-rows: var(--up-top-h) auto;
  grid-template-areas: "top top" "side main";
}

/* ---- top bar */
.up-top {
  grid-area: top;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--v-pad-x);
  height: var(--up-top-h);
}
/* a long name gives way (ellipsis) before the bar runs off a narrow screen */
.up-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: 0 1 auto; min-width: 0; }
.up-brand__mark { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; }
.up-brand__name { font-weight: 800; letter-spacing: -0.01em; font-size: 1.05rem; white-space: nowrap; min-width: 0; overflow-x: clip; text-overflow: ellipsis; }
.up-brand__tick { font-family: var(--v-font-mono); font-size: 0.78rem; opacity: 0.7; flex: none; white-space: nowrap; }
/* the nav only takes the room left over (basis 0), so it gives way before the name does */
.up-top__nav { display: flex; flex: 1 1 0; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.up-top__nav::-webkit-scrollbar { display: none; }
.up-top__nav .wl-nav__link { white-space: nowrap; text-decoration: none; padding: 8px 12px; font-size: 0.88rem; }
.up-top__status { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex: none; font-family: var(--v-font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.up-led { width: 8px; height: 8px; border-radius: 50%; background: var(--v-secondary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--v-secondary) 25%, transparent); animation: up-pulse 2.2s ease-in-out infinite; }
@keyframes up-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--v-secondary) 0%, transparent); } }

/* ---- side rail */
.up-side {
  grid-area: side;
  position: sticky; top: var(--up-top-h);
  align-self: start;
  height: calc(100vh - var(--up-top-h));
  overflow-y: auto;
  padding: 40px 24px 32px var(--v-pad-x);
  display: flex; flex-direction: column; gap: 14px;
}
.up-side__label { margin: 0; font-family: var(--v-font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.up-side__nav { display: flex; flex-direction: column; }
.up-side__nav .wl-nav__link { display: block; padding: 7px 14px; text-decoration: none; font-size: 0.92rem; border-left: 2px solid transparent; }
.up-side__ca { margin-top: auto; display: grid; gap: 6px; padding: 14px; border-radius: var(--v-radius-sm); }
.up-side__ca-label { font-family: var(--v-font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; }
.up-side__ca code { font-family: var(--v-font-mono); font-size: 0.85rem; }

/* ---- main + hero */
.up-main { grid-area: main; min-width: 0; }
.up-hero {
  position: relative;
  min-height: calc(100vh - var(--up-top-h));
  display: grid; align-items: center;
  grid-template-columns: var(--up-hero-cols, minmax(0, 1.05fr) minmax(0, 0.95fr));
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(48px, 7vw, 96px) var(--v-pad-x);
  overflow: hidden;
}
.up-hero__grid { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.up-hero__copy, .up-hero__visual { position: relative; z-index: 1; min-width: 0; }
.up-hero__kicker { margin: 0 0 26px; }
.up-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px; font-size: 0.84rem; font-weight: 600; }
.up-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--v-accent); }
.up-hero__headline {
  margin: 0;
  font-family: var(--v-font-display);
  font-weight: var(--v-display-weight);
  letter-spacing: var(--v-display-tracking);
  line-height: var(--v-display-lh);
  text-transform: var(--v-display-case);
  font-size: var(--up-h1, clamp(2.9rem, 6.4vw, 6rem));
  text-wrap: balance;
}
/* app.js sets data-up-len by headline length; a skin tunes the sizes (--up-h1-l / -xl) */
.up-hero[data-up-len="l"] .up-hero__headline { font-size: var(--up-h1-l, clamp(2.4rem, 4.6vw, 4.3rem)); }
.up-hero[data-up-len="xl"] .up-hero__headline { font-size: var(--up-h1-xl, clamp(2.1rem, 3.7vw, 3.5rem)); }
.up-hero__subhead { margin: 26px 0 0; max-width: 34rem; font-size: clamp(1.08rem, 1.5vw, 1.32rem); line-height: 1.55; }
.up-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.up-hero__cta .wl-btn__ca { display: none; } /* the telemetry row carries the address */
.up-telemetry { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; }
.up-tele { margin: 0; display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--v-radius-sm); }
.up-tele dt { font-family: var(--v-font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; }
.up-tele dd { margin: 0; font-family: var(--v-font-mono); font-size: 0.9rem; font-weight: 600; }

.up-panel { position: relative; border-radius: var(--v-radius-lg); overflow: hidden; }
.up-panel__bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-family: var(--v-font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.up-dots { display: inline-flex; gap: 6px; }
.up-dots i { width: 10px; height: 10px; border-radius: 50%; }
.up-panel__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-panel__live { display: inline-flex; align-items: center; gap: 6px; }
.up-panel__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; animation: up-pulse 1.6s ease-in-out infinite; }
.up-media { aspect-ratio: 4 / 3; }
/* no art delivered at all: no empty window; the copy takes the hero */
.up-hero:has(.wl-media--none) { grid-template-columns: minmax(0, 1fr); }
.up-hero__visual:has(.wl-media--none) { display: none; }
.up-media .wl-hero-img { width: 100%; height: 100%; object-fit: cover; }
.up-radar { position: absolute; right: 18px; bottom: 18px; width: 30%; max-width: 170px; pointer-events: none; }
.up-radar__ring, .up-radar__axis { fill: none; stroke: currentColor; stroke-opacity: 0.35; stroke-width: 1; }
.up-radar__sweep { transform-origin: 100px 100px; animation: up-sweep 4s linear infinite; }
.up-radar__blips circle { fill: currentColor; animation: up-blip 4s ease-out infinite; }
@keyframes up-sweep { to { transform: rotate(360deg); } }
@keyframes up-blip { 0%, 100% { opacity: 0.1; } 12% { opacity: 1; } }
.up-corner { position: absolute; width: 22px; height: 22px; border: 2px solid currentColor; pointer-events: none; }
.up-corner--tl { top: 58px; left: 12px; border-right: 0; border-bottom: 0; }
.up-corner--tr { top: 58px; right: 12px; border-left: 0; border-bottom: 0; }
.up-corner--bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.up-corner--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.up-ticker { padding: 14px 0; font-size: 0.9rem; }
.up-flow { padding-bottom: clamp(60px, 9vw, 120px); }
.up-footer { padding: 36px var(--v-pad-x) 48px; }

@media (max-width: 1080px) {
  .up-app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .up-side { display: none; }
}
@media (max-width: 860px) {
  .up-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .up-top__nav { display: none; }
}
