:root {
  --bg-image: linear-gradient(145deg, rgba(30, 12, 28, 0.48), rgba(27, 12, 47, 0.42)),
    linear-gradient(180deg, rgba(255, 167, 108, 0.12), rgba(83, 45, 116, 0.54)),
    url("/assets/citlali-bg.avif");
  --shell-width: min(1320px, calc(100vw - 32px));
  --glass: rgba(34, 20, 42, 0.34);
  --glass-strong: rgba(24, 13, 31, 0.48);
  --line: rgba(255, 233, 212, 0.18);
  --text: #fff5ea;
  --muted: rgba(255, 237, 220, 0.74);
  --accent: #ffc58f;
  --accent-2: #bba5ff;
  --ok: #a2ffd5;
  --bad: #ff9fab;
  --shadow: 0 24px 80px rgba(12, 5, 18, 0.42);
  --font-ui: "Noto Sans SC", sans-serif;
  --font-display: "Fraunces", "Noto Sans SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-ui);
  background: #160d1f;
}

body {
  position: relative;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 187, 128, 0.2), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(166, 118, 255, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(14, 8, 23, 0.08), rgba(14, 8, 23, 0.44));
  pointer-events: none;
}

.backdrop {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(2px) saturate(1.03);
  pointer-events: none;
}

.shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 28px 0 40px;
  position: relative;
  z-index: 1;
}

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.7fr);
  gap: 18px;
  padding: 24px 26px;
  border-radius: 30px;
  overflow: hidden;
}

.hero-copy,
.group-head > div,
.card-top > div {
  min-width: 0;
}

.eyebrow,
.group-label,
.card-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: rgba(255, 219, 193, 0.74);
}

.hero h1,
.group h2,
.card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "SOFT" 80, "WONK" 0;
}

.hero h1 {
  font-size: clamp(42px, 4.8vw, 78px);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: none;
  text-shadow: 0 10px 32px rgba(12, 8, 16, 0.45);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.brand-mark {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
}

.brand-ring,
.brand-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.brand-ring {
  border: 1px solid rgba(255, 228, 204, 0.38);
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 196, 137, 0.4), transparent 38%),
    linear-gradient(145deg, rgba(255, 160, 96, 0.16), rgba(136, 112, 255, 0.24));
  box-shadow: 0 0 24px rgba(255, 188, 126, 0.16);
}

.brand-core {
  inset: 10px;
  background: radial-gradient(circle at 32% 28%, rgba(255, 208, 166, 0.98), rgba(98, 56, 141, 0.58));
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  font-variation-settings: "SOFT" 90, "WONK" 1;
  letter-spacing: -0.03em;
  color: #fff7ec;
}

.summary {
  max-width: 40rem;
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pill,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 231, 211, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.range-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 231, 211, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.range-button {
  appearance: none;
  border: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 237, 220, 0.82);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.range-button:hover {
  color: var(--text);
}

.range-button.active {
  background: rgba(255, 214, 173, 0.18);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 228, 204, 0.12);
}

.hero-orb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
}

.orb-ring,
.orb-core {
  border-radius: 999px;
}

.orb-ring {
  position: absolute;
  width: min(240px, 54vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 225, 196, 0.28);
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 214, 173, 0.34), transparent 35%),
    linear-gradient(145deg, rgba(255, 176, 117, 0.16), rgba(136, 112, 255, 0.14));
  animation: drift 8s ease-in-out infinite;
}

.orb-core {
  position: relative;
  width: 152px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 198, 145, 0.94), rgba(96, 52, 140, 0.44));
  box-shadow:
    0 24px 50px rgba(255, 170, 107, 0.18),
    inset 0 0 40px rgba(255, 255, 255, 0.12);
}

.orb-core span {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  font-variation-settings: "SOFT" 70, "WONK" 0;
  letter-spacing: -0.03em;
  line-height: 1;
}

.orb-core small {
  display: block;
  margin-top: -8px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.groups {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.group {
  padding: 18px;
  border-radius: 24px;
}

.group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.group h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.group-stats {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  padding: 16px 16px 16px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 247, 240, 0.1), rgba(255, 247, 240, 0.03));
  border: 1px solid rgba(255, 228, 204, 0.14);
  overflow: hidden;
}

.status-rail {
  position: absolute;
  left: 10px;
  top: 14px;
  bottom: 14px;
  width: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.card h3 {
  font-size: 28px;
  line-height: 1;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric-box {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 228, 204, 0.1);
}

.metric-box dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 225, 196, 0.64);
}

.metric-primary {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  font-variation-settings: "SOFT" 70, "WONK" 0;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.card.ok .status-rail {
  background: linear-gradient(180deg, rgba(162, 255, 213, 0.98), rgba(123, 235, 192, 0.72));
  box-shadow: 0 0 18px rgba(162, 255, 213, 0.5);
}

.card.bad .status-rail {
  background: linear-gradient(180deg, rgba(255, 159, 171, 0.98), rgba(255, 111, 128, 0.72));
  box-shadow: 0 0 18px rgba(255, 159, 171, 0.44);
}

.card-grid {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card-grid dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 225, 196, 0.64);
}

.card-grid dd {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.card-updated {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 225, 196, 0.72);
}

.history {
  display: grid;
  grid-template-columns: repeat(var(--history-columns, 24), minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  margin-top: 14px;
  min-height: 28px;
}

.history-bar {
  height: calc(var(--bar-height, 100) * 1%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: default;
  transition: transform 120ms ease, opacity 120ms ease;
}

.history-bar.ok {
  background: linear-gradient(180deg, rgba(110, 255, 183, 1), rgba(91, 234, 168, 0.86));
  box-shadow: 0 0 10px rgba(110, 255, 183, 0.32);
}

.history-bar.bad {
  background: linear-gradient(180deg, rgba(255, 124, 143, 1), rgba(255, 105, 126, 0.82));
  box-shadow: 0 0 10px rgba(255, 124, 143, 0.26);
}

.history-bar.warn {
  background: linear-gradient(180deg, rgba(255, 212, 122, 1), rgba(255, 176, 117, 0.84));
  box-shadow: 0 0 10px rgba(255, 196, 118, 0.22);
}

.history-bar.empty {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  opacity: 0.48;
}

.history-bar:hover {
  transform: translateY(-2px);
  opacity: 0.96;
}

.tooltip {
  position: fixed;
  z-index: 20;
  max-width: min(260px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 228, 204, 0.16);
  background: rgba(19, 12, 26, 0.92);
  box-shadow: 0 18px 36px rgba(8, 5, 12, 0.34);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.03);
  }
}

@media (max-width: 860px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    width: min(100vw - 24px, 1320px);
    padding-top: 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 10px;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-orb {
    min-height: 160px;
  }

  .group-head {
    align-items: flex-start;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 20px;
    border-radius: 24px;
  }

  .brand-mark {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
  }

  .brand-core {
    font-size: 24px;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 52px);
    line-height: 1.03;
  }

  .summary {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.6;
  }

  .hero-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pill,
  .range-switch {
    width: 100%;
    justify-content: center;
  }

  .range-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .hero-orb {
    min-height: 132px;
  }

  .orb-ring {
    width: min(180px, 58vw);
  }

  .orb-core {
    width: 126px;
  }

  .orb-core span {
    font-size: 40px;
  }

  .orb-core small {
    margin-top: -5px;
    font-size: 11px;
  }

  .group {
    padding: 16px;
    border-radius: 22px;
  }

  .group-head {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .group h2 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .group-stats {
    text-align: left;
  }

  .cards {
    gap: 10px;
  }

  .card {
    padding: 14px 14px 14px 22px;
    border-radius: 18px;
  }

  .status-rail {
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 5px;
  }

  .card h3 {
    font-size: 24px;
  }

  .metric-strip {
    gap: 8px;
    margin-top: 12px;
  }

  .metric-box {
    padding: 11px;
  }

  .metric-primary {
    font-size: 26px;
  }

  .card-grid {
    gap: 10px;
  }

  .card-grid dd {
    font-size: 13px;
    line-height: 1.45;
  }

  .history {
    gap: 2px;
    margin-top: 12px;
    min-height: 24px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100vw - 16px, 1320px);
    padding-top: 14px;
    padding-bottom: 24px;
  }

  .hero,
  .group {
    border-radius: 20px;
    padding: 16px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .history {
    gap: 2px;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 31px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-core {
    inset: 8px;
    font-size: 22px;
  }

  .orb-ring {
    width: min(164px, 60vw);
  }

  .orb-core {
    width: 112px;
  }

  .orb-core span {
    font-size: 34px;
  }

  .metric-primary {
    font-size: 23px;
  }

  .range-button {
    padding: 0 10px;
    font-size: 11px;
  }
}
