/* HenWorks ecosystem hub — cosmic night aesthetic, own identity.
   Loaded only by /home so the welcome page CSS stays untouched. */

/* ---------- Cross-document view transition (home page side) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(hw-cosmos) { animation: vt-cosmos-old .9s cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(hw-cosmos) { animation: vt-cosmos-new .9s cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-old(hw-dashboard) { animation: vt-ui-out .42s ease both; }
::view-transition-new(hw-dashboard) { animation: vt-ui-in .65s ease both; }
::view-transition-old(root) { animation: vt-root-out .5s ease both; }
::view-transition-new(root) { animation: vt-root-in .65s ease both; }
@keyframes vt-cosmos-old { from { transform: scale(1); } to { transform: scale(1.2); } }
@keyframes vt-cosmos-new { from { transform: scale(1.45); } to { transform: scale(1); } }
@keyframes vt-ui-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.96); } }
@keyframes vt-ui-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes vt-root-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes vt-root-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Base ----------
   /home loads only this file, so it carries its own reset. Without it the page
   falls back to Times New Roman, black text on navy, and content-box widths
   that overflow the search field and the mobile nav. */
:root {
  color-scheme: dark;
  --ink: #eaf0ff;
  --muted: #9db0d4;
  --line: rgba(150, 180, 255, .14);
  --panel: rgba(12, 18, 42, .55);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  background: #04061a;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
svg { display: block; }
a { color: inherit; }
body.drawer-open { overflow: hidden; }

/* ---------- Shared cosmic backdrop ---------- */
.cosmic {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #04061a 0%, #0a0f2e 40%, #141042 72%, #1d1149 100%);
  view-transition-name: hw-cosmos;
}
.cosmic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 50%, rgba(2, 4, 14, .72) 100%);
}
.cosmic-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .5;
}
.cosmic-nebula--a {
  width: 60vmin; height: 38vmin; top: 8%; left: 4%;
  background: radial-gradient(circle, rgba(150, 110, 255, .48), rgba(80, 60, 200, .1) 62%, transparent 72%);
}
.cosmic-nebula--b {
  width: 52vmin; height: 32vmin; top: 26%; right: 4%;
  background: radial-gradient(circle, rgba(80, 140, 255, .4), rgba(40, 90, 200, .08) 64%, transparent 74%);
}
.cosmic-stars { position: absolute; inset: 0; }
.cosmic-stars .star {
  position: absolute;
  width: var(--s, 2px); height: var(--s, 2px);
  background: #dce6ff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(190, 210, 255, .7);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(150, 180, 255, .12);
  background: rgba(6, 9, 28, .72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand-mark {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, #9cc0ff, #7b6cf6);
  box-shadow: 0 0 16px rgba(130, 160, 255, .5), inset 0 0 0 3px rgba(6, 9, 28, .65);
}
.clock { display: flex; flex-direction: column; line-height: 1.2; margin-left: auto; text-align: right; }
.clock-time { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.topbar-actions { display: flex; flex-shrink: 0; gap: 8px; }
.ghost-btn {
  padding: 8px 14px;
  min-height: 34px;
  border: 1px solid rgba(150, 180, 255, .18);
  border-radius: 9px;
  background: rgba(20, 28, 58, .5);
  color: #c9d8ff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.ghost-btn:hover { border-color: rgba(170, 200, 255, .4); background: rgba(34, 48, 90, .7); transform: translateY(-1px); }
.ghost-btn:focus-visible, .cat:focus-visible, .more-btn:focus-visible,
.search-input:focus-visible, .clear-btn:focus-visible, .drawer-close:focus-visible,
.drawer-item:focus-visible, .nav-item:focus-visible, .card:focus-visible {
  outline: 2px solid #9cc0ff;
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.home {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 0 32px;
  view-transition-name: hw-dashboard;
}
.hero { max-width: 680px; }
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.1;
  text-wrap: balance;
}
.hero-tagline { margin: 8px 0 0; color: #a8c6ff; font-size: clamp(16px, 2vw, 20px); font-weight: 620; }
.hero-desc { margin: 10px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 54ch; }

/* ---------- Search ---------- */
.search-row { position: relative; display: flex; align-items: center; width: 100%; max-width: 560px; }
.search-icon { position: absolute; left: 14px; color: #8ea3c8; pointer-events: none; }
.search-icon svg { width: 17px; height: 17px; }
.search-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 44px 12px 42px;
  border: 1px solid rgba(150, 180, 255, .18);
  border-radius: 12px;
  background: rgba(12, 18, 42, .62);
  color: var(--ink);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 8px 24px rgba(2, 4, 16, .25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.search-input::placeholder { color: #6f82a6; }
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.clear-btn {
  position: absolute; right: 10px;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: 0; border-radius: 7px;
  background: rgba(120, 150, 230, .16);
  color: #c9d8ff;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Category tabs ---------- */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 14px;
}
.cat {
  padding: 8px 15px;
  min-height: 34px;
  border: 1px solid rgba(150, 180, 255, .14);
  border-radius: 999px;
  background: rgba(12, 18, 42, .5);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.cat:hover { color: #eaf0ff; border-color: rgba(170, 200, 255, .35); }
.cat[aria-pressed="true"] {
  color: #eaf2ff;
  border-color: rgba(160, 190, 255, .45);
  background: rgba(60, 80, 160, .55);
  box-shadow: 0 0 18px rgba(120, 160, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ---------- Toolbar + directory ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.count { color: #8ea3c8; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.more-btn {
  padding: 8px 14px;
  min-height: 34px;
  border: 1px solid rgba(150, 180, 255, .2);
  border-radius: 9px;
  background: rgba(20, 28, 58, .55);
  color: #c9d8ff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.more-btn:hover { border-color: rgba(170, 200, 255, .4); background: rgba(34, 48, 90, .7); }
.section-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  color: #8ea3c8;
  text-transform: uppercase;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(20, 28, 58, .72), rgba(12, 18, 42, .55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 26px rgba(2, 4, 16, .3);
  color: var(--ink);
  text-decoration: none;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
a.card:hover {
  transform: translateY(-3px);
  border-color: rgba(170, 200, 255, .35);
  box-shadow: 0 14px 34px rgba(10, 24, 60, .5), 0 0 22px rgba(120, 160, 255, .14);
}
.card-icon {
  display: grid; width: 38px; height: 38px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(120, 150, 230, .26), rgba(60, 80, 160, .14));
  color: #a8c6ff;
}
.card-icon svg { width: 20px; height: 20px; }
.card-name { font-size: 17px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; }
.card-tag { color: #a8c6ff; font-size: 12px; font-weight: 600; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.65; }
.card-features { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(150, 180, 255, .1); }
.card-cat { color: #8ea3c8; font-size: 10.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
/* Scoped to the status labels only: an unscoped [data-status] selector also
   matched the whole <a class="card" data-status="..."> and recolored it. */
.card-status, .drawer-status, .spotlight-facts [data-status] { font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.card-status[data-status="soon"], .drawer-status[data-status="soon"], .spotlight-facts [data-status="soon"] { color: #8ea3c8; }
.empty { margin: 20px 0; color: var(--muted); font-size: 14px; text-align: center; }
[hidden] { display: none !important; }

/* ---------- Featured + profile panels ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 40px; }
.panel { min-width: 0; }
.spotlight {
  padding: 22px;
  border: 1px solid rgba(150, 180, 255, .2);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(40, 34, 90, .6), rgba(12, 18, 42, .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 12px 30px rgba(2, 4, 16, .35);
}
.spotlight h3 { margin: 12px 0 6px; font-size: 21px; letter-spacing: -.03em; }
.spotlight p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.spotlight-facts { margin: 0 0 18px; padding-left: 18px; color: #a8b8d8; font-size: 12.5px; line-height: 1.85; }
.card--feature {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-height: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
/* Not a link any more, so drop the pointer affordance. */
.card--feature.is-soon { cursor: default; color: var(--muted); }
.panel-note { color: var(--muted); font-size: 13px; line-height: 1.65; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 18, 42, .5); }
.facts dt { color: #8ea3c8; font-size: 10.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.facts dd { margin: 4px 0 0; font-size: 13.5px; }

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(150, 180, 255, .18);
  border-radius: 16px;
  background: rgba(8, 12, 32, .88);
  box-shadow: 0 12px 34px rgba(2, 4, 16, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #8ea3c8;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="true"] { color: #eaf2ff; background: rgba(60, 80, 160, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 104px;
  border-top: 1px solid rgba(150, 180, 255, .1);
  color: #8ea3c8;
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- More Apps drawer ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(2, 4, 14, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: drawer-in .28s ease both;
}
.drawer[hidden] { display: none !important; }
/* Auto margins center the head/body pair without clipping the top when the
   drawer is taller than the viewport (unlike place-items / justify-content). */
.drawer-head {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  width: min(760px, 100%);
  margin-top: auto;
  color: var(--ink);
}
.drawer-title { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.drawer-count { color: #8ea3c8; font-size: 12px; }
.drawer-close {
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 34px; height: 34px;
  border: 1px solid rgba(150, 180, 255, .2);
  border-radius: 9px;
  background: rgba(20, 28, 58, .7);
  color: #c9d8ff;
  font-size: 14px;
  cursor: pointer;
}
.drawer-body {
  width: min(760px, 100%);
  max-height: min(72vh, 720px);
  margin-top: 12px;
  margin-bottom: auto;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(150, 180, 255, .2);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(20, 28, 58, .96), rgba(8, 12, 32, .96));
  box-shadow: 0 24px 70px rgba(2, 4, 16, .7), inset 0 1px 0 rgba(255, 255, 255, .07);
}
/* The drawer input has no leading icon, so drop the icon gutter. */
.drawer-body .search-input { margin-bottom: 16px; padding-left: 14px; }
.drawer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.drawer-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(12, 18, 42, .55);
  color: var(--ink);
  text-align: left;
}
.drawer-name { font-size: 13.5px; font-weight: 700; }
.drawer-status { color: #8ea3c8; }

/* ---------- Reveal + responsive ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }
/* Never leave content invisible when scripting is off. */
@media (scripting: none) { [data-reveal] { opacity: 1; transform: none; } }
@keyframes drawer-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
  .clock {
    order: 3;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    margin-left: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(150, 180, 255, .1);
    text-align: left;
  }
  .clock-time { font-size: 15px; }
  .topbar-actions { margin-left: auto; }
  .home { padding-top: 24px; }
  html { scroll-padding-top: 124px; }
  .grid { grid-template-columns: 1fr; }
  .panels { margin-top: 32px; }
  .bottom-nav { bottom: 10px; width: calc(100% - 24px); justify-content: space-around; }
  .nav-item { flex: 1; flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 11px; }
  .foot { padding-bottom: 112px; }
  .cosmic-nebula { filter: blur(20px); opacity: .38; }
}

@media (max-width: 400px) {
  .home, .foot { width: calc(100% - 24px); }
  .ghost-btn { padding: 8px 10px; }
  .drawer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .drawer { animation: none; }
  .bottom-nav .nav-item { scroll-behavior: auto; }
}
