/* ==========================================================================
   AgentiqSI Hub — one stylesheet: tokens, shared components, then pages.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f1f1ef;
  --surface: #ffffff;
  --field: #f1f1ef;
  --ink: #0e0e10;
  --ink-2: #3a3a40;
  --muted: #74747b;
  --line: rgba(14, 14, 16, .08);
  --danger: #d93b2b;
  --danger-soft: #fdecea;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --r-card: 30px;
  --r-field: 16px;
  --shadow-card: 0 1px 2px rgba(14, 14, 16, .04), 0 18px 40px -22px rgba(14, 14, 16, .35);
  --shadow-float: 0 2px 6px rgba(14, 14, 16, .05), 0 40px 90px -30px rgba(14, 14, 16, .45);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Paper grain over the whole page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: .05;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }

@view-transition { navigation: auto; }

/* --------------------------------------------------------------------------
   Buttons & pills
   -------------------------------------------------------------------------- */
.btn {
  --h: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .35s var(--ease-out), background-color .2s, box-shadow .3s var(--ease-out), opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn .icon { transition: transform .35s var(--ease-out); }
.btn:hover .icon-nudge { transform: translate(2px, -2px); }
.btn:hover .icon-slide { transform: translateX(3px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #26262b; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(14, 14, 16, .06); }
.btn-block { width: 100%; }
.btn-lg { --h: 52px; font-size: 15px; padding: 0 26px; }
.btn-icon { width: var(--h); padding: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(14, 14, 16, .06);
  color: var(--ink-2);
}
.pill-glass {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.pill-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 7px; }
.field-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field-control { position: relative; display: flex; align-items: center; }
.field-control > .icon {
  position: absolute; left: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: color .2s;
}
.input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border: 1.5px solid transparent;
  border-radius: var(--r-field);
  background: var(--field);
  font-size: 15px;
  outline: none;
  transition: background-color .2s, border-color .2s, box-shadow .3s var(--ease-out);
}
.input::placeholder { color: #a3a3a8; }
.input:hover { background: #ebebe8; }
.input:focus { background: #fff; border-color: var(--ink); box-shadow: 0 0 0 5px rgba(14, 14, 16, .07); }
.field-control:focus-within > .icon { color: var(--ink); }
.field-action {
  position: absolute; right: 8px;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.field-action:hover { background: rgba(14, 14, 16, .06); color: var(--ink); }
.field-action .icon-eye-off { display: none; }
.field-action[aria-pressed="true"] .icon-eye { display: none; }
.field-action[aria-pressed="true"] .icon-eye-off { display: block; }

.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 550;
}
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--field); color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Art — the photo-like backdrop of a card. Uses a photo when there is one,
   otherwise layered gradients in the app colour (--c) plus a floating icon.
   -------------------------------------------------------------------------- */
.art {
  --c: #3b8fd8;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 20% 0%, color-mix(in oklab, var(--c) 45%, white) 0%, transparent 60%),
    radial-gradient(90% 60% at 100% 35%, color-mix(in oklab, var(--c) 70%, #ffd6c2) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--c) 80%, white) 0%, var(--c) 48%, color-mix(in oklab, var(--c) 72%, black) 100%);
}
@supports (color: oklch(from red l c h)) {
  .art {
    background:
      radial-gradient(120% 70% at 18% 0%, oklch(from var(--c) calc(l + .2) calc(c * .7) calc(h - 25)) 0%, transparent 62%),
      radial-gradient(80% 55% at 105% 38%, oklch(from var(--c) calc(l + .12) c calc(h + 55)) 0%, transparent 70%),
      radial-gradient(70% 45% at -10% 75%, oklch(from var(--c) calc(l + .06) calc(c * 1.1) calc(h - 60)) 0%, transparent 70%),
      linear-gradient(180deg, oklch(from var(--c) calc(l + .1) c h) 0%, var(--c) 50%, oklch(from var(--c) calc(l - .14) c calc(h + 10)) 100%);
  }
}
.art::after { /* grain */
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: .16;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.art-img {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .6s var(--ease-out);
}
/* Soft cloud-like orbs drifting behind the icon. */
.art-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  filter: blur(18px);
  animation: drift 14s ease-in-out infinite alternate;
}
.art-orb:nth-child(1) { width: 55%; aspect-ratio: 1; left: -12%; top: 40%; opacity: .55; }
.art-orb:nth-child(2) { width: 42%; aspect-ratio: 1; right: -10%; top: 8%; opacity: .35; animation-duration: 18s; animation-delay: -6s; }
.art-glyph {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 46%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 32%;
  color: #fff;
  background: linear-gradient(150deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    0 30px 50px -20px color-mix(in oklab, var(--c) 60%, black);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translate(-50%, -50%) translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .6s var(--ease-out);
}
.art-glyph .icon {
  width: 50%;
  height: 50%;
  stroke-width: 1.4;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
  animation: bob 6s ease-in-out infinite;
}
@keyframes drift { to { transform: translate(12%, -10%) scale(1.15); } }
@keyframes bob { 50% { transform: translateY(-6%); } }

/* --------------------------------------------------------------------------
   App card — the screenshot card: art, blurred colour veil, centred copy, pills.
   -------------------------------------------------------------------------- */
.app-card {
  --c: #3b8fd8;
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  aspect-ratio: 248 / 350;
  border-radius: var(--r-card);
  overflow: hidden;
  isolation: isolate;
  background: var(--c);
  box-shadow: var(--shadow-card);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s var(--ease-out), box-shadow .4s var(--ease-out), filter .4s, opacity .4s, scale .5s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.app-card:hover { box-shadow: 0 2px 4px rgba(14, 14, 16, .05), 0 30px 60px -24px color-mix(in oklab, var(--c) 70%, black); }
.app-card.is-tilting { transition: box-shadow .4s var(--ease-out), filter .4s, opacity .4s; }

/* Light glare that follows the pointer. */
.app-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .28), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
}
.app-card:hover::after { opacity: 1; }

/* The colour veil: heavy blur that fades in toward the bottom, tinted with --c. */
.card-veil {
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, color-mix(in oklab, var(--c) 55%, transparent) 55%, color-mix(in oklab, var(--c) 80%, white) 100%);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
}
.card-body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  pointer-events: none; /* clicks fall through to .card-peek, except on the buttons */
  padding: 0 22px 22px;
  text-align: center;
  color: #fff;
}
.card-status { justify-self: center; margin-bottom: 2px; }
.card-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
  text-shadow: 0 1px 12px color-mix(in oklab, var(--c) 60%, black);
}
.card-tagline {
  margin-top: -4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  opacity: .88;
  text-wrap: balance;
}
.card-actions { display: grid; gap: 8px; margin-top: 6px; }
.card-actions .btn { pointer-events: auto; }
/* Invisible button over the whole card: opens the detail card on click, tap or keyboard. */
.card-peek {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.card-peek:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* --------------------------------------------------------------------------
   Login — Angulo's split layout (brand panel + floating card), restyled.
   -------------------------------------------------------------------------- */
.auth-body { overflow-x: hidden; }
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 48px);
}

/* Brand panel = one big screenshot-style card. */
.auth-hero {
  --c: #4d9be6;
  position: relative;
  height: min(680px, calc(100vh - 64px));
  min-height: 520px;
  border-radius: 36px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-float);
  user-select: none;
}
.auth-hero .art {
  background:
    radial-gradient(60% 40% at 22% 62%, rgba(255, 255, 255, .85), transparent 70%),
    radial-gradient(55% 35% at 85% 70%, rgba(255, 214, 236, .9), transparent 70%),
    radial-gradient(70% 45% at 50% 100%, #f3b4d3 0%, transparent 70%),
    linear-gradient(180deg, #1f6fd1 0%, #3d93e6 38%, #9cc9f2 64%, #e9c8de 100%);
}
.auth-hero-brand {
  position: absolute;
  top: 26px; left: 28px;
  z-index: 3;
  display: flex; align-items: center; gap: 10px;
  color: #fff;
  font-size: 12px; font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
/* Floating glass tiles, a hint of the apps waiting behind the door. */
.auth-tiles { position: absolute; inset: 0; z-index: 1; }
.auth-tile {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 30%;
  color: #fff;
  background: linear-gradient(150deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(255, 255, 255, .25), 0 24px 40px -18px rgba(20, 50, 110, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .9s var(--ease-out);
}
.auth-tile .icon { width: 46%; height: 46%; stroke-width: 1.5; animation: bob var(--d, 6s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
.auth-hero .card-veil { height: 52%; --c: #e4b3cf; }
.auth-hero-copy {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 0 clamp(24px, 4vw, 44px) clamp(26px, 4vw, 40px);
  color: #fff;
}
.auth-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .55em;
  text-transform: uppercase;
  opacity: .9;
}
.auth-eyebrow-end { text-align: right; }
.auth-wordmark {
  margin: 4px 0 2px;
  font-family: var(--display);
  font-size: clamp(52px, 7.4vw, 104px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.045em;
  text-shadow: 0 2px 30px rgba(120, 60, 110, .25);
}
.auth-wordmark .char { display: inline-block; }
.auth-hero-tag {
  max-width: 340px;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  opacity: .92;
}

.auth-card {
  position: relative;
  width: min(100%, 440px);
  justify-self: center;
  padding: clamp(26px, 4vw, 40px);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.brand-name small { display: block; margin-top: 3px; font-family: var(--body); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.auth-heading { margin: 34px 0 26px; }
.auth-heading h1 {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1;
}
.auth-heading p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { margin-top: 10px; }
.auth-form .alert { margin-bottom: 2px; }
.auth-foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 12.5px;
}
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label,
.btn.is-loading .icon { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.auth-form .btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The "door" that opens after a successful sign-in. */
.door {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  pointer-events: none;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; align-content: start; padding-top: 16px; gap: 16px; }
  .auth-hero { height: 300px; min-height: 0; border-radius: 30px; }
  .auth-hero-tag, .auth-eyebrow { display: none; }
  .auth-wordmark { font-size: clamp(44px, 13vw, 72px); }
  .auth-card { width: 100%; max-width: 520px; box-shadow: var(--shadow-card); }
  .auth-heading { margin-top: 24px; }
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 64px;
}
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar-home { margin-right: auto; text-decoration: none; }
.search {
  position: relative;
  display: flex; align-items: center;
  width: min(300px, 40vw);
}
.search .icon { position: absolute; left: 15px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 2px rgba(14, 14, 16, .05);
  transition: border-color .2s, box-shadow .3s var(--ease-out), background-color .2s, width .5s var(--ease-out);
}
.search input:focus { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 5px rgba(14, 14, 16, .06); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute; right: 12px;
  display: grid; place-items: center;
  min-width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font: 600 12px var(--body);
  pointer-events: none;
}
.search input:focus ~ kbd { opacity: 0; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  height: 42px;
  padding: 0 4px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 1px 2px rgba(14, 14, 16, .05);
}
.avatar {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b8fd8, #e2553f);
  color: #fff;
  font-size: 13px; font-weight: 700;
}
.user-chip-name { font-size: 13.5px; font-weight: 650; }
.user-chip form { display: contents; }
.user-chip .btn { --h: 34px; }

.hero { display: grid; gap: 18px; margin: clamp(40px, 8vw, 84px) 0 34px; }
.hero-eyebrow {
  color: var(--muted);
  font-size: 14px; font-weight: 600;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 750;
  line-height: .95;
  letter-spacing: -.045em;
}
.hero-title .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.hero-title .word > span { display: inline-block; }
.hero-title em { font-style: normal; color: var(--muted); }
.hero-count {
  display: inline-grid; place-items: center;
  min-width: 1.6em;
  margin-left: .12em;
  padding: 0 .3em;
  border-radius: .3em;
  background: var(--ink);
  color: #fff;
  font-size: .42em;
  line-height: 1.45;
  letter-spacing: -.02em;
  vertical-align: .9em;
}

.filters {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 2px rgba(14, 14, 16, .05);
}
.filter {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 650;
  cursor: pointer;
  transition: color .3s;
}
.filter[aria-pressed="true"] { color: #fff; }
.filter-indicator {
  position: absolute;
  top: 4px; left: 0;
  height: 34px;
  border-radius: 999px;
  background: var(--ink);
  transition: transform .55s var(--ease-out), width .55s var(--ease-out);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 28px;
  margin-top: 30px;
}
.grid > li { list-style: none; }
.grid { padding: 0; }
.empty {
  display: grid; justify-items: center; gap: 8px;
  padding: 70px 20px;
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, .6);
  color: var(--muted);
  text-align: center;
}
.empty strong { color: var(--ink); font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.empty code { padding: 2px 6px; border-radius: 6px; background: var(--field); font-size: 13px; }
.foot { margin-top: 56px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* While a detail card is open the other cards step back. */
.is-peeking .app-card:not(.is-source) { filter: blur(3px) saturate(.7); opacity: .55; scale: .97; }

/* --------------------------------------------------------------------------
   Peek — the big detail card that grows out of a hovered card.
   -------------------------------------------------------------------------- */
.peek-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(241, 241, 239, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--ease-out);
}
.peek-scrim.is-on { opacity: 1; }
.peek-scrim.is-blocking { pointer-events: auto; }
.peek {
  --c: #3b8fd8;
  position: fixed;
  z-index: 50;
  display: flex;
  border-radius: 34px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-float), 0 50px 120px -40px color-mix(in oklab, var(--c) 60%, transparent);
}
.peek.is-flipped { flex-direction: row-reverse; }
.peek-art {
  position: relative;
  flex: 0 0 var(--art-w, 280px);
  overflow: hidden;
}
.peek-art .card-veil { height: 45%; }
/* The column is taller and narrower than a card: show a photo whole, at the top,
   fading into the app colour, instead of cropping its sides. */
.peek-art .art-img {
  inset: 0;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: cover;
  object-position: top;
  transform: none;
  -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent);
  mask-image: linear-gradient(180deg, #000 75%, transparent);
}
.peek-art .art-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
  filter: blur(28px) saturate(1.2);
  /* Only the image's bottom third (its background, under the veil) stretched up the column. */
  transform: scale(3);
  transform-origin: 50% 100%;
}
.peek-body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px 30px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.peek-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-right: 44px; }
.peek-meta .pill-accent { background: color-mix(in oklab, var(--c) 14%, white); color: color-mix(in oklab, var(--c) 70%, black); }
.peek-title {
  font-family: var(--display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.04em;
}
.peek-tagline { margin-top: -6px; color: var(--muted); font-size: 15.5px; font-weight: 500; }
.peek-desc { display: grid; gap: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.peek-desc code { padding: 1px 6px; border-radius: 6px; background: var(--field); font-size: .9em; }
.peek-desc a { text-underline-offset: 3px; }
.peek-section h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.peek-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.peek-list li { display: flex; gap: 10px; align-items: flex-start; }
.peek-list .tick {
  display: grid; place-items: center;
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 7px;
  background: color-mix(in oklab, var(--c) 16%, white);
  color: color-mix(in oklab, var(--c) 75%, black);
}
.peek-list .tick .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.peek-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.peek-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.peek-host {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.peek-close {
  position: absolute;
  top: 22px; right: 22px;
  z-index: 2;
  --h: 36px;
  background: var(--field);
}
.peek-close:hover { background: #e6e6e3; }

@media (max-width: 759px) {
  .topbar { flex-wrap: wrap; }
  .search { order: 3; width: 100%; }
  .user-chip-name { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .app-card { --r-card: 24px; }
  .card-body { padding: 0 12px 14px; gap: 8px; }
  .card-title { font-size: 16px; }
  .card-tagline { display: none; }
  .card-actions .btn { --h: 34px; font-size: 12.5px; padding: 0 12px; }
  .peek { flex-direction: column !important; border-radius: 28px; }
  .peek-art { flex-basis: 170px; }
  .peek-art .art-glyph { top: 50%; width: auto; height: 62%; }
  .peek-body { padding: 22px 20px 20px; }
}

/* --------------------------------------------------------------------------
   Entrance choreography (CSS; JS adds the interactive motion)
   -------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; translate: 0 18px; } }
@keyframes pop-in { from { opacity: 0; scale: .5; } }
@keyframes word-up { from { transform: translateY(105%); } }
@keyframes card-in {
  from { opacity: 0; transform: perspective(900px) translateY(46px) rotateX(14deg) scale(.94); filter: blur(10px); }
}
@keyframes reveal-up { from { clip-path: inset(100% 0 0 0 round 36px); } to { clip-path: inset(0 0 0 0 round 36px); } }
@keyframes zoom-out { from { transform: scale(1.18); } }
@keyframes char-up { from { opacity: 0; transform: translateY(60%) rotate(6deg); } }

.enter { animation: rise .8s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms); }
.hero-title .word > span { animation: word-up 1s var(--ease-out) both; animation-delay: calc(120ms + var(--w, 0) * 70ms); }
.app-card.enter { animation: card-in 1s var(--ease-out) both; animation-delay: calc(380ms + var(--i, 0) * 75ms); }
.auth-hero { animation: reveal-up 1.1s var(--ease-in-out) both; }
.auth-hero .art { animation: zoom-out 1.8s var(--ease-out) both; }
.auth-tile { animation: pop-in 1.1s var(--ease-out) both; animation-delay: calc(500ms + var(--k, 0) * 90ms); }
.auth-wordmark .char { animation: char-up .9s var(--ease-out) both; animation-delay: calc(550ms + var(--k, 0) * 40ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
