/* portal/static/portal.css — layout, cards, motion, a11y for the Portal. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #0b1322 0%, var(--wr-bg) 55%, var(--wr-bg-deep) 100%);
  color: var(--wr-text);
  font-family: var(--wr-font-body);
  -webkit-font-smoothing: antialiased;
}
.shell { max-width: 1080px; margin: 0 auto; padding: 56px 24px 64px; }

/* ---- Hero ---- */
.hero { text-align: center; margin-bottom: 44px; }
.hero__logo {
  height: 140px; width: auto; max-width: 80%;
  filter: drop-shadow(0 6px 24px rgba(59,130,246,0.18));
  animation: logo-in 560ms cubic-bezier(.22,.61,.36,1) both;
}
.hero__title {
  font-family: var(--wr-font-display);
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  font-size: clamp(28px, 4vw, 44px); margin: 18px 0 6px;
  animation: rise-in 520ms cubic-bezier(.22,.61,.36,1) 120ms both;
}
.hero__subtitle {
  color: var(--wr-muted); margin: 0 0 20px; font-size: 15px;
  animation: rise-in 520ms cubic-bezier(.22,.61,.36,1) 200ms both;
}
.hero__status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--wr-line); background: rgba(255,255,255,0.02);
  font-size: 13px; color: var(--wr-muted);
  transition: color .3s ease, border-color .3s ease, background .3s ease;
  animation: rise-in 520ms cubic-bezier(.22,.61,.36,1) 280ms both;
}
.hero__status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.hero__status[data-tone="up"] { color: var(--wr-up); border-color: rgba(52,211,153,.35); }
.hero__status[data-tone="starting"] { color: var(--wr-starting); border-color: rgba(245,158,11,.35); }
.hero__status[data-tone="down"] { color: var(--wr-unavailable); border-color: rgba(230,126,34,.35); }

/* ---- Grid + cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--wr-gap); }
.card {
  position: relative; overflow: hidden;
  background: var(--wr-panel); border: 1px solid var(--wr-line);
  border-radius: var(--wr-radius); padding: 22px 20px 18px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card::before { /* status accent strip */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--wr-line); transition: background .3s ease;
}
.card[data-status="up"]::before { background: var(--wr-up); }
.card[data-status="starting"]::before { background: var(--wr-starting); }
.card[data-status="down"]::before { background: var(--wr-down); }
.card[data-status="unavailable"]::before { background: var(--wr-unavailable); }
.card:hover {
  transform: translateY(-3px); border-color: rgba(59,130,246,.45);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px rgba(59,130,246,.12) inset;
}
.card--enter { animation: rise-in 420ms cubic-bezier(.22,.61,.36,1) both; }

.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__name { font-family: var(--wr-font-display); font-weight: 600; font-size: 17px; letter-spacing: .02em; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #fff; background: var(--wr-down); /* default */
  transition: background .3s ease, color .3s ease;
}
.badge.up { background: var(--wr-up); }
.badge.starting { background: var(--wr-starting); }
.badge.down { background: var(--wr-down); color: #fff; }
.badge.unavailable { background: var(--wr-unavailable); color: #1a0d02; }
.badge.starting::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}

.card__actions { display: flex; gap: 8px; margin-top: 16px; }
.btn {
  appearance: none; border: 0; border-radius: 8px; cursor: pointer;
  padding: 8px 15px; font-size: 13px; font-weight: 600; font-family: var(--wr-font-body);
  background: var(--wr-accent); color: #fff; text-decoration: none;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--wr-accent-deep); box-shadow: 0 6px 16px rgba(59,130,246,.3); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--wr-text); border: 1px solid var(--wr-line); }
.btn--ghost:hover { background: var(--wr-panel-alt); border-color: var(--wr-accent); box-shadow: none; }
.btn:focus-visible {
  outline: 2px solid var(--wr-accent); outline-offset: 2px;
}
.msg { color: var(--wr-muted); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

/* ---- Keyframes ---- */
@keyframes logo-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
