/* Meep HQ: a flat gate that lifts away, then Meep's dark sheet, Outfit type and hairlines.
   Colour carries category only; everything else stays in ink. */
@font-face { font-family: "Outfit"; src: url("outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0c0c11; --gate: #15151c; --card: #14141b; --card-hi: #1b1b24;
  --ink: #f4f4f8; --mute: #a3a3ae; --faint: #6e6e7a; --line: rgba(255, 255, 255, 0.14); --hair: rgba(255, 255, 255, 0.07);
  --social: #e94df5; --sports: #ff8a1f; --experiences: #ffd02e; --red: #ff6b6b;
  --sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1); --lift: cubic-bezier(0.76, 0, 0.24, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
p, h2, dl, dd, ol, ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: rgba(233, 77, 245, 0.35); }

.mark { font: 500 11px/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); }
.mark span { margin-left: 0.9em; color: var(--faint); font-weight: 400; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: var(--gate); transition: transform 720ms var(--lift); will-change: transform; }
.gate.is-open { transform: translateY(-100%); }
.gate.is-quiet .gate-box { opacity: 0; }
.gate-mid { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px var(--gutter); }
.gate-box { width: min(420px, 100%); animation: rise 600ms var(--ease) both; transition: opacity 200ms ease; }
.gate-box .mark { margin-bottom: 44px; }
.gate-who { min-height: 18px; margin-bottom: 10px; font: 400 12px/18px var(--mono); color: var(--mute); overflow-wrap: anywhere; }
.gate-line { display: flex; align-items: center; gap: 12px; height: 56px; border-bottom: 1px solid var(--line); transition: border-color 200ms ease; }
.gate-line:focus-within { border-bottom-color: var(--social); }
.gate-line.is-err { border-bottom-color: var(--red); animation: shake 380ms ease; }
.gate-line input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: 300 22px/1 var(--sans); letter-spacing: -0.01em; color: var(--ink); caret-color: var(--social); }
.gate-line input::placeholder { color: var(--faint); opacity: 1; }
.gate-line input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--gate) inset; -webkit-text-fill-color: var(--ink); }
.gate-line button { flex: 0 0 auto; height: 32px; padding: 0 2px; border: 0; background: transparent; font: 400 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); transition: color 160ms ease; }
.gate-line button:hover, .gate-line button:focus-visible { color: var(--ink); outline: 0; }
.gate-line.is-busy button { color: transparent; position: relative; }
.gate-line.is-busy button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 1px; margin-left: -11px; background: var(--ink); animation: pulse 900ms ease-in-out infinite; }
.gate-status { min-height: 18px; margin-top: 14px; font: 400 12px/18px var(--mono); color: var(--mute); }
.gate-status.is-err { color: var(--red); }
.gate-steps { display: flex; gap: 6px; margin-top: 30px; }
.gate-steps i { width: 18px; height: 2px; background: var(--line); transition: background 260ms ease; }
.gate-steps i.on { background: var(--ink); }
.gate-foot { display: flex; justify-content: space-between; gap: 16px; padding: 22px var(--gutter); font: 400 11px var(--mono); letter-spacing: 0.06em; color: var(--faint); }

/* ---------- dashboard ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px max(var(--gutter), calc((100% - 1200px) / 2 + var(--gutter))); border-bottom: 1px solid var(--hair); }
.top-meta { display: flex; align-items: center; gap: 20px; min-width: 0; font: 400 11px var(--mono); color: var(--faint); white-space: nowrap; }
#updated { overflow: hidden; text-overflow: ellipsis; }
.linkish { padding: 0; border: 0; background: none; font: 400 11px var(--mono); color: var(--mute); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.linkish:hover, .linkish:focus-visible { color: var(--ink); text-decoration-color: var(--ink); outline: 0; }
.wrap { display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 32px var(--gutter) 64px; }
.dash.is-in .wrap > * { animation: rise 560ms var(--ease) both; }
.dash.is-in .wrap > :nth-child(2) { animation-delay: 60ms; } .dash.is-in .wrap > :nth-child(3) { animation-delay: 120ms; }
.dash.is-in .wrap > :nth-child(4) { animation-delay: 180ms; } .dash.is-in .wrap > :nth-child(5) { animation-delay: 240ms; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 0 40px; }
.split .chart + .chart { margin-top: 22px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split .chart + .chart { margin-top: 28px; } }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 16px; }
.kpi { min-width: 0; padding: 20px 22px 22px; background: var(--card); border: 1px solid var(--hair); border-radius: 22px; }
.kpi dt { font: 400 10px/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.kpi dd { margin-top: 14px; font: 300 clamp(34px, 4vw, 46px)/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi .sub { margin-top: 10px; font: 400 11px/1.45 var(--mono); color: var(--faint); }

.card { position: relative; min-width: 0; padding: 22px 24px 24px; background: var(--card); border: 1px solid var(--hair); border-radius: 26px; }
.card h2 { font: 500 17px/1.2 var(--sans); letter-spacing: -0.01em; }
.note { margin-top: 6px; font: 400 11px/1.5 var(--mono); color: var(--faint); }

.chart { position: relative; height: 210px; margin-top: 22px; }
.chart.short { height: 150px; }
.chart + .chart { margin-top: 28px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font: 400 10px var(--mono); fill: var(--faint); }
.chart .grid { stroke: var(--hair); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { fill: var(--ink); opacity: 0.82; transition: opacity 120ms ease; }
.chart.is-hover .bar { opacity: 0.32; }
.chart.is-hover .bar.on { opacity: 1; }
.chart .cross { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .pt { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .none { font: 400 11px var(--mono); fill: var(--faint); }

.hbars { display: grid; gap: 18px; margin-top: 24px; list-style: none; }
.hbars li { display: grid; grid-template-columns: minmax(96px, 150px) 1fr auto; align-items: center; gap: 4px 16px; }
.hbars .name { display: flex; align-items: center; gap: 10px; min-width: 0; font: 400 14px/1.2 var(--sans); }
.hbars .name i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); }
.hbars .track { height: 10px; border-radius: 0 4px 4px 0; overflow: hidden; }
.hbars .track b { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c, var(--ink)); opacity: var(--o, 1); transform-origin: left; animation: grow 700ms var(--ease) both; }
.hbars .val { font: 400 13px var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hbars .more { grid-column: 2 / -1; font: 400 11px var(--mono); color: var(--faint); }
.hbars li.zero .name, .hbars li.zero .val { color: var(--faint); }

.people { display: grid; margin-top: 16px; list-style: none; }
.people li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); }
.people li:first-child { border-top: 0; }
.people .rank { font: 400 11px var(--mono); color: var(--faint); }
.people .who { min-width: 0; }
.people .who b { display: block; overflow: hidden; font: 500 15px/1.25 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.people .who span { display: block; overflow: hidden; margin-top: 2px; font: 400 11px var(--mono); color: var(--faint); text-overflow: ellipsis; white-space: nowrap; }
.people .num { text-align: right; }
.people .num b { display: block; font: 300 22px/1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.people .num span { display: block; margin-top: 4px; font: 400 10px var(--mono); color: var(--faint); white-space: nowrap; }
.empty { padding: 18px 0 4px; font: 400 12px var(--mono); color: var(--faint); list-style: none; }

.tip { position: fixed; z-index: 20; padding: 9px 12px; background: var(--card-hi); border: 1px solid var(--line); border-radius: 12px; pointer-events: none; font: 400 11px/1.5 var(--mono); color: var(--mute); white-space: nowrap; }
.tip b { display: block; font: 500 14px/1.3 var(--sans); color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .top { flex-wrap: wrap; }
  .top-meta { width: 100%; justify-content: space-between; gap: 14px; }
  .hbars li { grid-template-columns: 1fr auto; }
  .hbars .track { grid-column: 1 / -1; grid-row: 2; }
  .hbars .more { grid-column: 1 / -1; }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scaleX(0.4); } 50% { opacity: 1; transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
