/* <valt-hero>. The same glass as the node drawer: one material, two floating panels.
 *
 * Secondary text is mixed up off --text-2 rather than used raw, because the raw token measures
 * APCA Lc 51.0 on this glass at night, under both the Lc 60 a micro-caps label wants and the Lc 75
 * the instrument line wants. Re-measured against the glass composited over the real map, worst
 * case being land showing through rather than empty canvas:
 *
 *   --hero-quiet   labels, node id     Lc 65.8 night / 91.3 day   against a floor of 60
 *   --hero-read    the instrument line Lc 81.1 night / 98.6 day   against a floor of 75
 *
 * Both were computed for the sunken value and both still clear on glass, so the percentages did
 * not move. Neither is a new palette value; both derive from two that exist.
 */
valt-hero {
  display: block; font-family: var(--font); color: var(--text);
  transition: opacity var(--t-move) var(--ease), visibility 0s linear 0s;
  --hero-quiet: color-mix(in srgb, var(--text) 30%, var(--text-2));
  --hero-read: color-mix(in srgb, var(--text) 60%, var(--text-2));
}
/* Closed (list view, screens/network.js): visibility as well as opacity, or the card would keep its
   star and Connect in the tab order and a second live region under the list (node-drawer.css does
   the same for the drawer). The delay lets the fade finish. */
valt-hero[closed] { opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-move) var(--ease), visibility 0s linear var(--t-move); }
/* position: relative, because the landing's check flies inside the card (connect-action.js flyCheck). */
valt-hero .hero { position: relative; background: var(--glass-panel); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%); backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  box-shadow: var(--shadow-panel); }

/* The band across the top (what the tunnel is doing) is its own element: tunnel-state.css. The list
   view's open row is this same card (node-list.js), which drops only the blur there (node-list.css). */

/* A symmetric poster (hero.js). Flag, city, country, the exit address while connected and the facts line all sit on the card's centre line; the star keeps the corner. */
valt-hero .top { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 14px 6px; }
/* No facts to show: the gap the line would have closed on goes to the top block instead. */
valt-hero[data-nofacts] .top { padding-bottom: 15px; }
/* Three by two, uncropped: the flag read as a flag rather than as a badge made from one. */
valt-hero .flag { width: 72px; height: 48px; border-radius: 4px; flex: none; overflow: hidden;
  box-shadow: 0 0 0 1px var(--border), 0 1px 3px rgba(0, 0, 0, .45); }
valt-hero .flag svg { display: block; width: 100%; height: 100%; }
valt-hero .id { width: 100%; min-width: 0; text-align: center; }
/* The city never gives way: the longest live names ("Bad Soden am Taunus", "City of Westminster") set on
   one line at 375, and anything longer wraps, balanced, rather than clip. The country is the half the flag
   already carries, so it is the one that takes the ellipsis ("United Arab Emirates" is the longest). */
valt-hero .id .c { display: block; font: 700 26px/30px var(--font); letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; }
valt-hero .id .k { display: block; margin-top: 4px; font: 500 13px/16px var(--font); letter-spacing: -.01em; color: var(--hero-read);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The exit address, under the country. 15 characters at most, so the ellipsis is a backstop for IPv6. */
valt-hero .meta { margin-top: 5px; display: flex; justify-content: center; align-items: center; font: 500 12px/14px var(--font);
  letter-spacing: -.01em; color: var(--hero-read); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; }
/* Only while the tunnel is up and the exit has an IP (hero.js); `hidden` must beat the flex above. */
valt-hero .meta[hidden] { display: none; }
valt-hero .meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
valt-hero .star { position: absolute; top: 6px; right: 6px; width: var(--tap); height: var(--tap); border-radius: var(--r-pill); display: grid; place-items: center;
  border: 0; background: transparent; color: var(--hero-quiet); cursor: pointer; -webkit-appearance: none;
  transition: color var(--t-feedback) var(--ease), background var(--t-feedback) var(--ease), transform var(--t-feedback) var(--ease); }
valt-hero .star:hover { background: var(--glass-cap); color: var(--text); }
valt-hero .star:active { transform: scale(.9); }
valt-hero .star:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
/* Gold, not signal: the green is the tunnel's, and a starred exit is not one. */
valt-hero .star[aria-pressed="true"] { color: var(--favourite); }
valt-hero .star[aria-pressed="true"] svg { fill: currentColor; }

/* What the node is, in one centred line in the text colour: Proxy node · 5 servers · 12% busy (hero.js). It
   replaced the Down and Protocol cells and their hairline; the same line in every state. */
valt-hero .facts { margin: 0; padding: 4px 14px 15px; text-align: center; font: 500 14px/17px var(--font); letter-spacing: -.01em;
  color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
valt-hero .facts[hidden] { display: none; }

/* CONNECTED: thin glass, lit from the band. The card goes clearer: the fill drops to 64% of the drawer's glass and the blur to 10, BELOW the drawer's,
 * because haze is heavy blur on a milky fill; saturation goes to 180% so what shows through keeps its colour.
 * The signal is a wash that falls from 10% behind the CONNECTED row (7% by day) to nothing by the flag, and
 * the edge is glass's own: a lit top line and a faint ring inside the hairline, whitish, never green (the
 * palette forbids green as a border). The wash and the edge live on ::before, under the words (z -1 in the
 * glass's own stacking context), and fade in, since a gradient cannot transition. It bends DESIGN.md's
 * "never a background" for the green; the check disc stays the only solid green on the card.
 * It waits for the landing: hero.js sets data-lit as the check lifts off the key, not before.
 * The blur and saturation change at once, under the colour's fade: animating backdrop-filter made iOS redraw
 * the blurred globe behind the card on every frame, at the moment the app comes back from the Dynamic Island. */
valt-hero .hero { transition: background-color var(--t-move) var(--ease); }
valt-hero .hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  transition: opacity var(--t-move) var(--ease);
  background: linear-gradient(180deg, color-mix(in srgb, var(--signal) 10%, transparent) 0,
    color-mix(in srgb, var(--signal) 6%, transparent) 32px, transparent 104px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, color-mix(in srgb, #FFFFFF 85%, var(--signal)) 30%, transparent),
              inset 0 0 0 1px color-mix(in srgb, color-mix(in srgb, #FFFFFF 85%, var(--signal)) 8%, transparent); }
:root[data-theme="day"] valt-hero .hero::before {
  background: linear-gradient(180deg, color-mix(in srgb, var(--signal) 7%, transparent) 0,
    color-mix(in srgb, var(--signal) 4%, transparent) 32px, transparent 104px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #FFFFFF 90%, transparent),
              inset 0 0 0 1px color-mix(in srgb, #FFFFFF 50%, transparent); }
valt-hero[data-lit] .hero {
  background: color-mix(in srgb, var(--glass-panel) 64%, transparent);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 4px)) saturate(180%); backdrop-filter: blur(calc(var(--glass-blur) - 4px)) saturate(180%); }
valt-hero[data-lit] .hero::before { opacity: 1; }
/* Disconnect REVERSED: the green's ink as the fill, the green as the word, so it cannot be
   taken for Connect in either theme (light and dark swap, not just hue). This card, in both views: the list's
   open row is this card. Change connection keeps the recessed pane (connect-action.css). */
valt-hero[data-lit] valt-connect-action .cta {
  background: var(--signal-ink); color: var(--signal); -webkit-backdrop-filter: none; backdrop-filter: none; }
valt-hero[data-lit] valt-connect-action .gloss { display: none; }
/* A tunnel up that carries nothing (hero.js data-trouble): the card stops looking connected. The signal wash
   fades out and the exit address goes, since neither is true while nothing loads; Disconnect keeps its reversed
   look, the tunnel is still on. */
valt-hero[data-trouble] .hero::before { opacity: 0; }
valt-hero[data-trouble] .meta { display: none; }
@media (prefers-reduced-motion: reduce) {
  valt-hero .hero, valt-hero .hero::before { transition: none; } }

/* The action fused to the bottom edge is its own element, and so is its landing when a connect comes
   up: connect-action.css. */

/* The phone card: on every phone (under 448, network.js WIDE; the Pro Max too)
   the card lies down: the flag at the left, the city and country beside it, the exit address and the facts under
   them in the same column. Connect stays the full-width key. The poster above stays from 448 up, where the window
   is wide enough for the globe beside the column (folds, the desktop). */
@media (max-width: 447.98px) {
  /* The lockup (flag, then city, country and the exit) sits centred, the facts line centred under it, the star in its
     corner: the poster turned on its side. 56 clear on both sides, so the
     lockup never slides under the star and the centre is the card's. */
  valt-hero .top { flex-direction: row; align-items: center; justify-content: center; gap: 12px; padding: 10px 56px 6px; }
  valt-hero[data-nofacts] .top { padding-bottom: 10px; }
  valt-hero .flag { width: 48px; height: 32px; }
  valt-hero .id { width: auto; flex: 0 1 auto; text-align: left; }
  valt-hero .id .c { font: 700 20px/24px var(--font); letter-spacing: -.025em; }
  valt-hero .id .k { margin-top: 1px; }
  valt-hero .meta { justify-content: flex-start; margin-top: 2px; }
  valt-hero .facts { padding: 0 14px 10px; }
  valt-hero .star { top: 50%; transform: translateY(-50%); }
  valt-hero .star:active { transform: translateY(-50%) scale(.9); }
}
