/* HomeAid Hub skin. Sits on top of Duo's app.css and re-points its tokens:
   deep night navy, glass panels, HomeAid teal (#166e62 lifted to a glow) and HomeAid gold
   (#f9ae48). Gold means "needs HomeAid"; red means something is down. Nothing else.
   Every animation stops under prefers-reduced-motion. */

:root, :root[data-theme="dark"], :root[data-theme="light"] {
  --night: #050B14;
  --teal: #2DD4BF;
  --teal-deep: #166e62;
  --gold: #F9AE48;
  --red: #FB7185;
  --blue: #60A5FA;
  --ground: #050B14;
  --surface: rgba(13, 24, 38, .62);
  --surface-solid: #0C1726;
  --line: rgba(120, 200, 210, .16);
  --ink: #E6F4F1;
  --ink-soft: #B8CFCB;
  --ink-2: #B8CFCB;
  --muted: #7F99A3;
  --forest-900: #2DD4BF;
  --forest-700: #2DD4BF;
  --lime-500: #2DD4BF;
  --lime-100: rgba(45, 212, 191, .16);
  --lime-50: rgba(45, 212, 191, .08);
  --warn: #F9AE48;
  --warn-100: rgba(249, 174, 72, .14);
  --warn-ink: #F9C67E;
  --link: #5EEAD4;
  --shadow: 0 0 0 1px rgba(120, 200, 210, .06), 0 20px 50px -20px rgba(0, 0, 0, .7);
  --head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --glow: 0 0 24px rgba(45, 212, 191, .35);
  color-scheme: dark;
}

body { background: var(--night); color: var(--ink); }
::selection { background: rgba(45, 212, 191, .35); }

/* ---------------------------------------------------------- background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-grid {
  position: absolute; inset: -50%;
  background-image: linear-gradient(rgba(45, 212, 191, .07) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(45, 212, 191, .07) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(900px) rotateX(62deg) translateY(-8%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
  animation: gridmove 18s linear infinite;
}
@keyframes gridmove { to { background-position: 0 56px, 56px 0; } }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg-glow.g1 { width: 620px; height: 620px; left: -180px; top: -200px; background: radial-gradient(circle, rgba(22, 110, 98, .9), transparent 70%); animation: drift 22s ease-in-out infinite alternate; }
.bg-glow.g2 { width: 520px; height: 520px; right: -160px; bottom: -220px; background: radial-gradient(circle, rgba(249, 174, 72, .35), transparent 70%); animation: drift 28s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(120px, 80px) scale(1.15); } }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------------------------------------------------- frame */
.top {
  background: rgba(5, 11, 20, .72); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(45, 212, 191, .12);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--gold), transparent); opacity: .6; animation: scan 6s linear infinite; background-size: 200% 100%; }
@keyframes scan { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark img { height: 30px; width: auto; }
.mark b { font: 700 13px/1 var(--mono); letter-spacing: .3em; color: var(--night); background: var(--teal);
  padding: 5px 7px 5px 9px; border-radius: 6px; box-shadow: var(--glow); }
.nav a { color: var(--muted); }
.nav a.on, .nav a:hover { color: var(--ink); }
.nav a.on { box-shadow: inset 0 -2px 0 var(--teal); }

.rail { background: transparent; border-right: 1px solid var(--line); }
.station { border-radius: 10px; }
.station:hover, .station.on { background: rgba(45, 212, 191, .08); }
.station i { box-shadow: 0 0 10px var(--c); }
.together { background: linear-gradient(160deg, rgba(22, 110, 98, .35), rgba(249, 174, 72, .08)); border: 1px solid var(--line); border-radius: 14px; }
.together .glow { font: 600 15px var(--head); color: var(--teal); text-shadow: var(--glow); }

/* ---------------------------------------------------------- surfaces */
.panel, .stat, .card, .col, .modal, .advice, .app-card {
  background: var(--surface); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.panel, .app-card { border-radius: 18px; }
.col { background: rgba(9, 18, 30, .55); }
.card:hover { border-color: rgba(45, 212, 191, .5); box-shadow: var(--glow); }
input, select, textarea { background: rgba(5, 11, 20, .6) !important; border-color: var(--line) !important; color: var(--ink) !important; }
input:focus, select:focus, textarea:focus { border-color: var(--teal) !important; box-shadow: 0 0 0 3px rgba(45, 212, 191, .18); outline: none; }
:focus-visible { outline: 2px solid var(--teal); }
.modal { background: var(--surface-solid); }
.scrim { background: rgba(2, 6, 12, .72); backdrop-filter: blur(6px); }
.toast { background: var(--surface-solid); color: var(--ink); border: 1px solid var(--teal); box-shadow: var(--glow); }

.btn { border-color: var(--line); background: rgba(255, 255, 255, .03); color: var(--ink); transition: transform .15s, box-shadow .2s, border-color .2s; }
.btn:hover { border-color: var(--teal); box-shadow: 0 0 16px rgba(45, 212, 191, .25); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #14B8A6, #166e62); border-color: transparent; color: #fff; box-shadow: 0 0 20px rgba(45, 212, 191, .3); }
.btn.signal { background: linear-gradient(135deg, #F9AE48, #F59E0B); color: #1A1204; border-color: transparent; }
.btn.danger { color: var(--red); border-color: rgba(251, 113, 133, .4); }

h1, h2, h3 { color: var(--ink); font-family: var(--head); letter-spacing: -.01em; }
h1 { font-weight: 600; }
.eyebrow { color: var(--teal); font-family: var(--mono); letter-spacing: .14em; }
.grad { background: linear-gradient(90deg, var(--teal), #93F5E6 40%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shimmer 8s ease-in-out infinite; }
@keyframes shimmer { 50% { background-position: 100% 0; } }
.lede { color: var(--ink-soft); max-width: 62ch; font-size: 16px; }
.sect { margin: 30px 0 14px; font-size: 14px; font-family: var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------- hero + radar */
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 28px; align-items: center; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.02; margin: 10px 0 12px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(45, 212, 191, .7); animation: ping 2s infinite; vertical-align: 1px; margin-right: 4px; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } }
.radar { position: relative; width: 240px; height: 240px; border-radius: 50%; justify-self: end;
  background: radial-gradient(circle, rgba(45, 212, 191, .12), transparent 70%); border: 1px solid rgba(45, 212, 191, .3); overflow: hidden; }
.radar > i { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px solid rgba(45, 212, 191, .18); }
.radar > i:nth-child(1) { width: 75%; height: 75%; } .radar > i:nth-child(2) { width: 50%; height: 50%; } .radar > i:nth-child(3) { width: 25%; height: 25%; }
.radar > b { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(45, 212, 191, .45), transparent 22%); animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar > em { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 12px var(--c); transform: rotate(var(--a)) translateX(var(--r)); animation: blip 4s ease-in-out infinite; }
@keyframes blip { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

.alertbar { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 18px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid rgba(249, 174, 72, .45); background: linear-gradient(90deg, rgba(249, 174, 72, .14), rgba(249, 174, 72, .03)); }
.alertbar span { display: flex; gap: 10px; align-items: baseline; }
.alertbar i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; animation: ping-gold 1.6s infinite; }
@keyframes ping-gold { 70% { box-shadow: 0 0 0 9px rgba(249, 174, 72, 0); } 0% { box-shadow: 0 0 0 0 rgba(249, 174, 72, .7); } }

/* ---------------------------------------------------------- stats */
.stats { grid-template-columns: repeat(5, 1fr) !important; }
.stat { border-radius: 16px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); }
.stat:nth-child(2)::before { background: linear-gradient(90deg, var(--gold), transparent); }
.stat b { font-family: var(--head); color: var(--ink); text-shadow: 0 0 18px rgba(45, 212, 191, .35); }

/* ---------------------------------------------------------- apps */
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.apps.big { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.app-link { color: inherit; cursor: pointer; border-radius: 18px; }
.app-card { padding: 20px; position: relative; overflow: hidden; transition: transform .2s, border-color .2s; }
.app-link:hover .app-card { transform: translateY(-2px); border-color: rgba(45, 212, 191, .45); }
.app-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .05) 50%, transparent 60%); background-size: 250% 100%; animation: sheen 7s ease-in-out infinite; }
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.app-card.s-alert { border-color: rgba(249, 174, 72, .5); }
.app-card.s-down { border-color: rgba(251, 113, 133, .55); }
.app-top { display: flex; gap: 16px; align-items: center; }
.app-top h2 { font-size: 22px; margin: 2px 0; }
.app-top .tag { margin: 0 0 8px; font-size: 13px; }
.app-sum { margin: 14px 0 12px; color: var(--ink-soft); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.facts div { background: rgba(5, 11, 20, .45); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.facts dt { font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font: 600 16px var(--head); }
.app-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.app-foot .spark { flex: 1; height: 34px; min-width: 80px; }
.spark polyline { fill: none; stroke: var(--teal); stroke-width: 1.6; filter: drop-shadow(0 0 4px rgba(45, 212, 191, .6)); }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font: 600 11px/1 var(--mono);
  letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ping 2s infinite; }
.pill.s-ok { color: var(--teal); border-color: rgba(45, 212, 191, .4); }
.pill.s-building { color: var(--blue); border-color: rgba(96, 165, 250, .4); }
.pill.s-alert, .pill.s-warn { color: var(--gold); border-color: rgba(249, 174, 72, .45); }
.pill.s-down { color: var(--red); border-color: rgba(251, 113, 133, .45); }
.pill.s-unknown { color: var(--muted); }

/* orbit ring */
.orb { position: relative; width: 104px; height: 104px; flex: none; --col: var(--teal); }
.orb.s-alert, .orb.s-warn { --col: var(--gold); }
.orb.s-down { --col: var(--red); }
.orb.s-building { --col: var(--blue); }
.orb svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.orb-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 7; }
.orb-fill { fill: none; stroke: var(--col); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--col));
  transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); animation: drawin 1.4s cubic-bezier(.2, .8, .2, 1); }
@keyframes drawin { from { stroke-dashoffset: 290; } }
.orb-spin { fill: none; stroke: var(--col); stroke-width: 1; stroke-dasharray: 3 9; opacity: .55; transform-origin: 60px 60px; animation: sweep 14s linear infinite; }
.orb-core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.orb-core b { font: 700 24px/1 var(--head); color: var(--ink); }
.orb-core b small { font-size: 12px; color: var(--muted); }
.orb-core span { font: 500 9.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.orb.s-alert .orb-core b, .orb.s-down .orb-core b { animation: flicker 2.4s infinite; }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .4; } 96% { opacity: 1; } 98% { opacity: .6; } }

/* rollout steps */
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); border: 1px solid transparent; }
.steps li:hover { border-color: var(--line); }
.steps li i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.steps li.past { color: var(--ink-soft); }
.steps li.past i { background: var(--teal); border-color: var(--teal); }
.steps li.here { color: var(--ink); background: rgba(96, 165, 250, .08); border-color: rgba(96, 165, 250, .35); }
.steps li.here i { border-color: var(--blue); box-shadow: 0 0 0 0 rgba(96, 165, 250, .7); animation: ping 1.8s infinite; }

/* ---------------------------------------------------------- project line */
.map-row .track, .line { background: rgba(255, 255, 255, .06); }
.map-row .run, .line .fill { background: linear-gradient(90deg, var(--teal-deep), var(--c, var(--teal))); box-shadow: 0 0 10px var(--c, var(--teal)); }
.map-row .dot { box-shadow: 0 0 0 4px rgba(5, 11, 20, .9), 0 0 14px var(--c); animation: blip 2.6s ease-in-out infinite; }
.map-legend > div { display: grid !important; grid-template-columns: repeat(5, 1fr); }
.stop b { box-shadow: 0 0 0 4px var(--night); }
.stop.here b { box-shadow: 0 0 0 4px var(--night), 0 0 16px var(--c, var(--teal)); }

.approval { margin: 16px 0; }
.approval.is-ok { border-color: rgba(45, 212, 191, .35); }
.approval textarea { min-height: 96px; }

.advice { border-radius: 16px; border-color: rgba(249, 174, 72, .35); background: linear-gradient(135deg, rgba(249, 174, 72, .1), rgba(13, 24, 38, .6)); }
.advice .bulb { background: var(--gold); box-shadow: 0 0 20px rgba(249, 174, 72, .5); }

.avatar { background: linear-gradient(135deg, #14B8A6, #166e62); color: #fff; }
.avatar.adam { background: linear-gradient(135deg, #F9AE48, #D97706); color: #1A1204; }
.avatar.hub { background: rgba(96, 165, 250, .2); color: var(--blue); border: 1px solid rgba(96, 165, 250, .5); }
.feed time { color: var(--muted); }

/* entrance */
#main > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
#main > *:nth-child(2) { animation-delay: .05s; } #main > *:nth-child(3) { animation-delay: .1s; }
#main > *:nth-child(4) { animation-delay: .15s; } #main > *:nth-child(5) { animation-delay: .2s; } #main > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; } .radar { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .mark img { height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Five stops on the project line (Duo had four). */
.line { grid-template-columns: repeat(4, 1fr) auto; }
@media (max-width: 700px) { .map-legend { display: none !important; } .stop span { font-size: 10.5px; } }
