/* ==========================================================================
   WILDCARDLABS HOME — Sovereign Software Hub  (v3)
   File: public/wildcardlabs.app/frontend/home/home.css

   Direction: lights in the dark.
   - The app icon is the product, so it is the only thing that glows by default:
     every icon sits on a glass plate with its own halo (a blurred copy of itself).
   - Slim display type (Sora 200) over quiet system UI text. Labels stay small.
   - One light follows the pointer. Everything else is still.
   - Open layout on hairlines, same vocabulary as the Build Portal / File Sync.
   ========================================================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --header-height: calc(108px + var(--safe-top));

  --bg-base: #060a11;
  --bg-surface: #0b1220;
  --bg-surface-hover: #111a2c;

  --text-main: #e8eef7;
  --text-muted: #a3b1c6;
  --text-dim: #667790;

  --line: rgba(148, 175, 214, .12);
  --line-2: rgba(148, 175, 214, .22);

  --wl-sky: #38bdf8;
  --wl-blue: #1d72f3;
  --wl-indigo: #818cf8;

  --status-green: #34d399;
  --status-yellow: #fbbf24;
  --status-red: #f87171;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", var(--font-ui);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wl-font-frontend: var(--font-ui);          /* fontBoot.js sets the live value */

  --ease: cubic-bezier(.2, .7, .2, 1);
  --maxw: 1040px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }

body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--wl-font-frontend, var(--font-ui));
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--wl-sky);
  outline-offset: 3px;
  border-radius: 8px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Status dots (shared) ---------- */
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--text-dim);
}
.dot-live  { background: var(--status-green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .14), 0 0 10px rgba(52, 211, 153, .85); }
.dot-build { background: var(--status-yellow); box-shadow: 0 0 0 3px rgba(251, 191, 36, .12), 0 0 10px rgba(251, 191, 36, .7); }
.dot-pending { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(148, 175, 214, .45); }

/* ---------- Background ---------- */
#neural-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block; pointer-events: none;
  z-index: 0;
  opacity: .06;
}
.ambient {
  position: fixed; inset: -10%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -5%, rgba(29, 114, 243, .22), transparent 70%),
    radial-gradient(40% 35% at 8% 95%, rgba(56, 189, 248, .07), transparent 70%),
    radial-gradient(35% 30% at 95% 70%, rgba(129, 140, 248, .07), transparent 70%);
  animation: ambientDrift 32s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  from { transform: translate3d(-1.5%, 0, 0) scale(1); }
  to   { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}
/* the one light that follows the pointer (fine pointers only) */
.pointer-light {
  position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none;
  width: 520px; height: 520px; margin: -260px 0 0 -260px;
  background: radial-gradient(closest-side, rgba(56, 189, 248, .075), transparent);
  opacity: 0; transition: opacity .6s;
  will-change: transform;
}
.pointer-light.on { opacity: 1; }
@media (hover: none) { .pointer-light { display: none; } }

/* ---------- Shell ---------- */
.app-shell {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  width: 100%; overflow: hidden;
}

/* ---------- Header ---------- */
.app-header-fixed {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 20px 0;
  background: linear-gradient(180deg, rgba(6, 10, 17, .95), rgba(6, 10, 17, .74));
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.app-header-fixed::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .5) 30%, rgba(56, 189, 248, .5) 70%, transparent);
  opacity: .55;
}

.header-top-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding-bottom: 10px;
}
.brand-logo-group { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.brand-mark {
  position: relative; width: 12px; height: 12px; border-radius: 50%;
  background: var(--wl-sky);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .14), 0 0 18px 2px rgba(56, 189, 248, .85);
  animation: markBreath 4.5s ease-in-out infinite;
}
@keyframes markBreath { 50% { box-shadow: 0 0 0 6px rgba(56, 189, 248, .08), 0 0 26px 4px rgba(56, 189, 248, .95); } }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.08rem; font-weight: 300; letter-spacing: -.02em; line-height: 1;
  color: var(--text-main);
}
.brand-name span { font-weight: 600; color: var(--wl-sky); }

.header-actions { display: flex; gap: 2px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--text-muted); position: relative;
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--text-main); background: rgba(148, 175, 214, .08); }
.icon-btn .badge-dot {
  position: absolute; top: 9px; right: 11px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-red);
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 8px rgba(248, 113, 113, .7);
}

/* Category tabs */
.category-tab-bar {
  display: flex; gap: 24px;
  overflow-x: auto;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  padding-right: 28px;
}
.category-tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  position: relative; flex-shrink: 0; white-space: nowrap;
  padding: 8px 0 14px;
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  transition: color .2s;
}
.tab-item:hover { color: var(--text-main); }
.tab-item.active { color: var(--text-main); }
.tab-item::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--wl-sky);
  box-shadow: 0 0 14px rgba(56, 189, 248, .7);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.tab-item.active::after { transform: scaleX(1); }

/* ---------- Viewport ---------- */
.app-viewport-scrollable {
  margin-top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 175, 214, .2) transparent;
  padding: clamp(28px, 6vw, 64px) 20px calc(56px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 2;
}
.viewport-content-wrapper {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column;
}

/* ---------- Section heads (same vocabulary as the portal panels) ---------- */
.section-head {
  position: relative;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 24px; margin-bottom: 20px;
}
.section-head::before {                                   /* hairline */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--line) 55%, transparent);
}
.section-head::after {                                    /* lit tick */
  content: ""; position: absolute; top: -1px; left: 0; width: 30px; height: 2px;
  background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(56, 189, 248, .6);
}
.section-head h2 {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted);
}
.section-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

/* ---------- Hero ---------- */
.store-hero-intro { padding: 0 0 clamp(34px, 6vw, 60px); text-align: left; }
.store-hero-intro h1 {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7.4vw, 4.1rem);
  font-weight: 200;
  line-height: 1.06;
  letter-spacing: -.045em;
  color: var(--text-main);
  text-shadow: 0 0 44px rgba(56, 189, 248, .28);
  text-wrap: balance;
}
.store-hero-intro p {
  margin-top: clamp(14px, 2.4vw, 22px);
  max-width: 46ch;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}
.hero-stats {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px clamp(18px, 4vw, 34px);
  margin-top: clamp(22px, 4vw, 34px);
}
.hero-stats li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); }
.hero-stats b {
  font-family: var(--font-display); font-weight: 300; font-size: 1.15rem; letter-spacing: -.02em;
  color: var(--text-main); font-variant-numeric: tabular-nums;
}

/* ---------- Discovery bar ---------- */
.discover { margin-bottom: clamp(40px, 7vw, 76px); }
.discover-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.discover-search {
  position: relative; flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 0; color: var(--text-dim);
  border-bottom: 1px solid var(--line-2);
  transition: border-color .25s, box-shadow .25s, color .25s;
}
.discover-search:focus-within {
  color: var(--wl-sky);
  border-bottom-color: rgba(56, 189, 248, .8);
  box-shadow: 0 10px 18px -14px rgba(56, 189, 248, .9);
}
.discover-search svg { flex: none; }
.discover-search input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  background: none; border: 0; outline: 0;
  padding: 8px 0 11px; font-size: 14px; color: var(--text-main);
  -webkit-appearance: none; appearance: none;
}
.discover-search input::placeholder { color: var(--text-dim); }
.discover-search input::-webkit-search-cancel-button { display: none; }
.discover-search input:focus-visible { outline: 0; }
.search-clear { width: 28px; height: 28px; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--text-dim); }
.search-clear:hover { color: var(--text-main); }

.stage-chip {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s, background .2s;
}
.stage-chip svg { color: var(--text-dim); }
.stage-chip:hover { background: rgba(56, 189, 248, .05); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .5), 0 0 18px rgba(56, 189, 248, .14); }

/* ---------- App tiles: the icon is the product ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 164px), 1fr));
  gap: 4px;
  min-height: 120px;
}

.app-tile {
  --icon: 96px;
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 22px 16px 16px;
  border-radius: 22px;
  color: var(--text-main);
  transition: transform .4s var(--ease);
}
.app-tile::before {                                       /* light that follows the pointer */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 30%) var(--my, 20%), rgba(56, 189, 248, .14), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(148, 175, 214, .16);
  opacity: 0; transition: opacity .35s;
}
.app-tile:focus-visible::before { opacity: 1; }
.app-tile:active { transform: scale(.975); }

/* plate + halo */
.app-plate { position: relative; flex: none; width: var(--icon); height: var(--icon); margin-bottom: 18px; }
.app-halo {
  position: absolute; inset: -16%; z-index: 0; border-radius: 32%;
  filter: blur(22px) saturate(1.7);
  opacity: .6; transform: scale(.94);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  pointer-events: none;
}
.app-halo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.app-halo.is-glow { background: radial-gradient(closest-side, rgba(56, 189, 248, .7), transparent); }
.app-halo.is-mono { background: radial-gradient(closest-side, hsl(var(--h) 85% 55% / .75), transparent); }

.app-icon {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: 24%;
  overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(148, 175, 214, .14), rgba(148, 175, 214, .03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .11), 0 16px 30px -14px rgba(0, 0, 0, .85);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.app-icon::after {                                        /* glass sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, .17), transparent 42%);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon svg { width: 56%; height: 56%; }
.app-icon.is-mono {
  background: linear-gradient(150deg, hsl(var(--h) 72% 46%), hsl(calc(var(--h) + 38) 70% 20%));
}
.app-icon.is-mono span {
  font-family: var(--font-display); font-weight: 200;
  font-size: calc(var(--icon) * .4); letter-spacing: -.04em; color: rgba(255, 255, 255, .95);
  text-shadow: 0 0 18px rgba(255, 255, 255, .45);
}

.app-name {
  font-size: 15px; font-weight: 500; letter-spacing: -.005em; line-height: 1.3;
  max-width: 100%;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.app-sub {
  margin-top: 4px;
  font-size: 12.5px; line-height: 1.45; color: var(--text-dim);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  transition: color .25s;
}
.app-foot {
  width: 100%; margin-top: auto; padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-dim);
}
.app-stage { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.app-stage em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-go { flex: none; opacity: .5; transform: translateX(-3px); transition: opacity .3s, transform .35s var(--ease), color .3s; }

@media (hover: hover) {
  .app-tile:hover { transform: translateY(-3px); }
  .app-tile:hover::before { opacity: 1; }
  .app-tile:hover .app-halo, .app-feature:hover .app-halo { opacity: .85; transform: scale(1.04); }
  .app-tile:hover .app-icon, .app-feature:hover .app-icon {
    transform: scale(1.045);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 20px 36px -14px rgba(0, 0, 0, .9);
  }
  .app-tile:hover .app-sub { color: var(--text-muted); }
  .app-tile:hover .app-go { opacity: 1; transform: none; color: var(--wl-sky); }
}

/* one orchestrated moment: icons light up in sequence when a set appears */
.app-tile.is-new .app-halo { animation: ignite 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.app-tile.is-new .app-icon { animation: iconIn .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.app-tile.is-new .app-name, .app-tile.is-new .app-sub, .app-tile.is-new .app-foot { animation: textIn .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 160ms); }
@keyframes ignite { from { opacity: 0; transform: scale(.55); } 55% { opacity: 1; } }
@keyframes iconIn { from { opacity: 0; transform: translateY(8px) scale(.9); } }
@keyframes textIn { from { opacity: 0; } }

/* skeletons */
.app-tile.is-skeleton { pointer-events: none; }
.is-skeleton .app-icon { background: rgba(148, 175, 214, .06); box-shadow: inset 0 0 0 1px var(--line); animation: skPulse 1.6s ease-in-out infinite; }
.is-skeleton .app-icon::after { display: none; }
.sk { display: block; height: 10px; border-radius: 5px; background: rgba(148, 175, 214, .08); animation: skPulse 1.6s ease-in-out infinite; }
.sk-a { width: 62%; margin-bottom: 8px; } .sk-b { width: 84%; height: 8px; }
@keyframes skPulse { 50% { opacity: .45; } }

/* ---------- Featured app ---------- */
.app-feature {
  --icon: clamp(92px, 17vw, 150px);
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: clamp(20px, 4.5vw, 46px);
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 8px;
  border-radius: 28px;
  background:
    radial-gradient(65% 130% at 10% 50%, rgba(56, 189, 248, .13), transparent 70%),
    linear-gradient(180deg, rgba(148, 175, 214, .05), transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .4s;
}
.app-feature::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 20%) var(--my, 50%), rgba(56, 189, 248, .12), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
@media (hover: hover) {
  .app-feature:hover { box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .35); }
  .app-feature:hover::before { opacity: 1; }
}
.app-feature .app-plate { margin: 0; }
.app-feature .app-halo { opacity: .6; }
.app-feature-body { min-width: 0; }
.feature-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; font-size: 12px; color: var(--text-dim); }
.feature-tags .is-featured { color: var(--wl-sky); font-weight: 500; }
.app-feature .app-name {
  display: block; font-family: var(--font-display); font-weight: 200;
  font-size: clamp(1.6rem, 4.2vw, 2.7rem); letter-spacing: -.04em; line-height: 1.08;
  text-shadow: 0 0 34px rgba(56, 189, 248, .25); -webkit-line-clamp: unset;
}
.app-feature .app-sub { margin-top: 10px; max-width: 46ch; font-size: clamp(13px, 1.6vw, 15px); color: var(--text-muted); -webkit-line-clamp: 3; }
.open-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(16px, 3vw, 24px);
  padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: rgba(56, 189, 248, .1);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .55), 0 0 22px rgba(56, 189, 248, .16);
  transition: background .25s, box-shadow .25s;
}
.app-feature:hover .open-pill { background: rgba(56, 189, 248, .18); box-shadow: inset 0 0 0 1px var(--wl-sky), 0 0 30px rgba(56, 189, 248, .3); }
@media (max-width: 560px) { .app-feature { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- Empty / error states ---------- */
.apps-empty-hint {
  grid-column: 1 / -1;
  padding: 36px 4px; max-width: 46ch;
  font-size: 13.5px; line-height: 1.6; color: var(--text-dim);
}
.apps-empty-hint strong { display: block; margin-bottom: 4px; font-weight: 500; font-size: 15px; color: var(--text-main); }
.apps-empty-hint button { margin-top: 12px; padding: 4px 0; font-size: 13px; color: var(--wl-sky); border-bottom: 1px solid rgba(56, 189, 248, .45); }
.apps-empty-hint.is-error { color: var(--status-red); font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- Explore ---------- */
.explore { margin-bottom: clamp(40px, 7vw, 76px); }
.feature-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 28px); }
.feature-card {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 18px 4px 20px;
}
.feature-card::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--line);
}
.feature-card::after {
  content: ""; position: absolute; top: -1px; left: 0; width: 100%; height: 1px;
  background: var(--wl-sky); box-shadow: 0 0 12px rgba(56, 189, 248, .8);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.feature-icon-wrap {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px;
  color: var(--text-muted);
  background: linear-gradient(160deg, rgba(148, 175, 214, .1), rgba(148, 175, 214, .02));
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .3s, box-shadow .3s;
}
.feature-icon-wrap svg { width: 24px; height: 24px; }
.feature-text h3 { font-size: 15px; font-weight: 500; line-height: 1.3; margin-bottom: 5px; }
.feature-text p { font-size: 12.5px; line-height: 1.55; color: var(--text-dim); transition: color .3s; }
@media (hover: hover) {
  .feature-card:hover::after { transform: scaleX(1); }
  .feature-card:hover .feature-icon-wrap { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .45), 0 0 24px rgba(56, 189, 248, .18); }
  .feature-card:hover .feature-text p { color: var(--text-muted); }
}
@media (max-width: 760px) {
  .feature-action-grid { grid-template-columns: 1fr; gap: 0; }
  .feature-card { grid-template-columns: 48px minmax(0, 1fr); padding: 16px 4px; }
  .feature-icon-wrap { width: 48px; height: 48px; border-radius: 14px; }
}

/* ---------- Client portal ---------- */
.portal { position: relative; isolation: isolate; margin-bottom: clamp(40px, 7vw, 76px); }
.portal::before {                                         /* the beam */
  content: ""; position: absolute; z-index: -1; left: -10%; right: -10%; top: 0; height: 280px;
  background: radial-gradient(50% 100% at 30% 0%, rgba(56, 189, 248, .13), transparent 70%);
  pointer-events: none;
}
.cta-heading {
  max-width: 20ch; text-wrap: balance;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(1.8rem, 5.4vw, 3.1rem); letter-spacing: -.04em; line-height: 1.08;
  text-shadow: 0 0 40px rgba(56, 189, 248, .25);
}
.cta-body { margin-top: 16px; max-width: 52ch; font-size: 14px; line-height: 1.65; color: var(--text-muted); }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 22px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--text-main);
  background: rgba(56, 189, 248, .12);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .6), 0 0 22px rgba(56, 189, 248, .18);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.primary-btn:hover { background: rgba(56, 189, 248, .2); box-shadow: inset 0 0 0 1px var(--wl-sky), 0 0 32px rgba(56, 189, 248, .34); }
.primary-btn:active { transform: scale(.98); }
.primary-btn:disabled { opacity: .55; cursor: wait; }
.cta-button { margin-top: 26px; }
.cta-button svg { transition: transform .3s var(--ease); }
.cta-button:hover svg { transform: translateX(3px); }

/* ---------- Footer ---------- */
.clean-footer {
  position: relative; padding-top: 28px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px 40px;
}
.clean-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .55) 50%, transparent);
  box-shadow: 0 0 30px 4px rgba(56, 189, 248, .14);
}
.footer-intro-block h4 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 300; letter-spacing: -.02em; margin-bottom: 8px; }
.footer-intro-block h4 span { font-weight: 600; color: var(--wl-sky); }
.footer-intro-block p { max-width: 42ch; font-size: 12.5px; line-height: 1.6; color: var(--text-dim); }
.footer-links-grid { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 4px 22px; }
.footer-links-grid a { padding: 6px 0; font-size: 12.5px; font-weight: 500; color: var(--text-muted); transition: color .2s; }
.footer-links-grid a:hover { color: var(--wl-sky); }
.copyright { grid-column: 1 / -1; padding-top: 12px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
@media (max-width: 640px) {
  .clean-footer { grid-template-columns: 1fr; }
  .footer-links-grid { justify-content: flex-start; }
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 6, 12, .74);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
  position: relative; width: 100%; max-width: 420px;
  padding: 26px 24px 22px; border-radius: 18px;
  background: rgba(11, 18, 32, .98);
  border: 1px solid var(--line-2);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .65), 0 0 50px rgba(56, 189, 248, .07);
  transform: translateY(8px) scale(.985); transition: transform .3s var(--ease);
}
.modal-content::before {
  content: ""; position: absolute; top: -1px; left: 24px; width: 34px; height: 2px;
  background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(56, 189, 248, .6);
}
.modal-overlay.active .modal-content { transform: none; }
.modal-close-btn {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--text-dim);
  transition: color .2s, background .2s;
}
.modal-close-btn:hover { color: var(--text-main); background: rgba(148, 175, 214, .08); }
.modal-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 300; letter-spacing: -.02em; margin-bottom: 6px; }
.modal-body { font-size: 13px; line-height: 1.55; color: var(--text-dim); margin-bottom: 18px; }

.filter-options { display: flex; flex-direction: column; }
.filter-label {
  display: flex; align-items: center; gap: 14px; padding: 14px 2px;
  border-top: 1px solid var(--line); cursor: pointer;
  transition: background .2s, padding .2s var(--ease);
}
.filter-label:first-child { border-top: 0; }
.filter-label:hover { padding-left: 8px; background: linear-gradient(90deg, rgba(56, 189, 248, .05), transparent 80%); }
.filter-label input[type="radio"] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 14px; height: 14px; margin: 0; border-radius: 50%; outline: none;
  box-shadow: inset 0 0 0 1.5px var(--text-dim);
  transition: box-shadow .2s, background .2s;
}
.filter-label input[type="radio"]:checked {
  background: var(--wl-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .16), 0 0 14px rgba(56, 189, 248, .85);
}
.filter-label input[type="radio"]:focus-visible { outline: 2px solid var(--wl-sky); outline-offset: 3px; }
.filter-label span { flex: 1; font-size: 14px; color: var(--text-muted); transition: color .2s; }
.filter-label input:checked ~ span { color: var(--text-main); }
.filter-count { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

.proposal-form { display: flex; flex-direction: column; gap: 14px; }
.proposal-input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(6, 10, 17, .6);
  font-family: var(--font-mono); font-size: 15px; letter-spacing: .16em; text-align: center; text-transform: uppercase;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.proposal-input::placeholder { letter-spacing: .04em; font-family: var(--font-ui); text-transform: none; color: var(--text-dim); }
.proposal-input:hover { border-color: var(--line-2); }
.proposal-input:focus { border-color: var(--wl-sky); box-shadow: 0 0 0 3px rgba(56, 189, 248, .14); }
.proposal-error {
  padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: var(--status-red);
  background: rgba(248, 113, 113, .06); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .35);
}
.proposal-submit { width: 100%; padding: 12px 20px; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .app-header-fixed { padding-left: 16px; padding-right: 16px; }
  .app-viewport-scrollable { padding-left: 16px; padding-right: 16px; }
  .app-tile { --icon: 80px; padding: 18px 12px 14px; }
  .discover-bar { gap: 10px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
