/* ============================================================
   NSOffice Hive style: the Hive's own stylesheet, cut down to what any Bee app needs.
   Light mode only. DM Sans, NS colours, solid surfaces (no glass). 8-point spacing.
   Class names match the Hive (github.com/bhargavpetla/hive, src/styles.css) so the two stay in step.
   Load DM Sans first: <link href="https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300..800&display=swap" rel="stylesheet">
   ============================================================ */

:root {
  --art-bg: #121320; /* the one backdrop behind every Bee's artwork */
  color-scheme: light;

  /* NS Office palette (from nsoffice.ai) */
  --blue: #2424FF;
  --blue-press: #0000EF;
  --blue-soft: #EEEEFF;
  --pink: #FF74BD;
  --ink: #16161E;
  --text: #323232;
  --muted: #696969;
  --line: rgba(20, 20, 60, 0.09);
  --line-strong: rgba(20, 20, 60, 0.15);
  --page: #F8F8FD;

  /* 8-point spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --control-h: 40px;
  --gutter: clamp(16px, 3.6vw, 64px);
  /* Caps the content column. Past this, the gutter keeps growing with the viewport instead of jumping
     straight to a big centering margin, so wide monitors (1920-2200px) don't show a sudden empty band. */
  --maxw: 2200px;
  --section-gap: clamp(40px, 4.2vw, 64px);

  /* Columns follow the screen: 5 on large monitors down to 1 on phones */
  --cols: 5;
  --tile-gap: 20px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --radius-tile: 18px;
  --shadow-tile: 0 1px 2px rgba(20, 20, 60, 0.06), 0 12px 30px -16px rgba(20, 20, 90, 0.3);
  --shadow-control: 0 1px 2px rgba(20, 20, 60, 0.08), 0 8px 20px -10px rgba(20, 20, 60, 0.3);

  font-family: 'DM Sans Variable', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-optical-sizing: auto;
}
@media (max-width: 1679px) { :root { --cols: 4; } }
@media (max-width: 1239px) { :root { --cols: 3; --tile-gap: 18px; } }
@media (max-width: 899px) { :root { --cols: 2; --tile-gap: 16px; } }
@media (max-width: 599px) { :root { --cols: 1; --tile-gap: 14px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A soft, refreshing wash behind everything: lavender, blush, mint and peach from the NS site. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 0% 0%, #E7E7FF 0%, rgba(231, 231, 255, 0) 70%),
    radial-gradient(45% 42% at 100% 0%, #FFE3F5 0%, rgba(255, 227, 245, 0) 70%),
    radial-gradient(55% 45% at 100% 100%, #DDF7F1 0%, rgba(221, 247, 241, 0) 70%),
    radial-gradient(50% 42% at 0% 100%, #FFEFE0 0%, rgba(255, 239, 224, 0) 70%),
    var(--page);
}

h1, h2, h3, p, dl, dd, ul { margin: 0; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.2s var(--ease-soft), transform 0.2s var(--ease);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-press); }
.btn-primary:active { transform: scale(0.97); }
.btn-muted { background: rgba(20, 20, 60, 0.06); color: var(--muted); cursor: default; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.text-btn {
  height: 36px; padding: 0 6px; border: 0; background: none; cursor: pointer;
  color: var(--blue); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.text-btn:hover { color: var(--blue-press); }
.text-btn:disabled { color: var(--muted); opacity: 0.55; cursor: default; }


/* ---------- Top bar: wordmark, Admin (admins only) and the account menu ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding-top: var(--s4); padding-bottom: var(--s2); min-height: 64px;
}
.topbar-actions { display: flex; align-items: center; gap: var(--s2); }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: box-shadow 0.2s var(--ease-soft), background-color 0.2s;
}
.pill-btn:hover { box-shadow: inset 0 0 0 1px rgba(20, 20, 60, 0.3); }
.pill-btn svg { color: var(--blue); }
.account { position: relative; }
.avatar-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #FF74BD, #2424FF); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 3px #fff, 0 4px 12px -4px rgba(36, 36, 255, 0.5);
}
.account-menu, .row-menu-list {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; min-width: 240px; padding: 6px;
  border-radius: 16px; background: #fff; transform-origin: top right;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -18px rgba(20, 20, 80, 0.35);
}
.account-head { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- Tile ---------- */
/* Hover (or keyboard focus) flips the card over: the artwork on the front, the details on the back.
   The card stays its own size and place; nothing grows, lifts or glows. */
.tile { position: relative; }
.tile-link {
  position: relative; display: block; border-radius: var(--radius-tile);
  color: inherit; text-decoration: none; outline: none;
  perspective: 1600px; container: tile / inline-size;
}
.tile-link[role='group'] { cursor: default; }
.tile-link:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
.tile-card {
  position: relative; display: block; aspect-ratio: 16 / 9;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
}
.tile-face {
  position: absolute; inset: 0; display: block; border-radius: var(--radius-tile);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: var(--shadow-tile);
}
.tile-back { overflow: hidden; background: #fff; transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) {
  /* A short wait first, so a cursor passing over a shelf doesn't flip every card on its way. */
  .tile:hover .tile-card { transform: rotateY(180deg); transition-delay: 0.14s; }
  .tile:hover .tile-back::before { animation-play-state: running; }
}
.tile-link:focus-visible .tile-card { transform: rotateY(180deg); }
.tile-link:focus-visible .tile-back::before { animation-play-state: running; }

/* A thin pink-to-blue line travels round the edge of the back, like light catching a card's rim. */
.tile-back::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 160%; aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 116, 189, 0.85) 76%, var(--blue) 90%, transparent 100%);
  animation: edge-spin 4.5s linear infinite paused;
}
@keyframes edge-spin { to { rotate: 360deg; } }

/* The back: name, what it does, two Impact KPIs, then the NU line and Open. Sized to the card's width. */
.back {
  position: absolute; inset: 1.5px; z-index: 1; display: flex; flex-direction: column; gap: 0.35em;
  padding: clamp(12px, 4.6cqw, 18px) clamp(12px, 5cqw, 20px);
  border-radius: calc(var(--radius-tile) - 1.5px); background: #fff;
  font-size: clamp(11.5px, 4.15cqw, 13.5px); line-height: 1.38; color: var(--text); text-align: left;
}
/* Nothing shrinks to fit: if the back ever ran out of room, the check would see the foot pushed out. */
.back > * { flex: none; }
.back-name {
  font-size: clamp(13px, 4.9cqw, 16px); line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.back-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.back[data-impact='false'] .back-desc { -webkit-line-clamp: 3; }
.back-impact { display: grid; gap: 1px; margin-top: 0.15em; }
.back-kpi {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.96em; color: var(--text);
}
.back-kpi > * + * { margin-left: 0.3em; }
.back-kpi strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.back-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  margin-top: auto; padding-top: 0.55em; border-top: 1px solid var(--line);
}
.back-nu { min-width: 0; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-xs { flex: none; height: 30px; padding: 0 12px; gap: 4px; font-size: 13px; }
/* Narrow cards (four or three across on smaller laptops): the name is already lettered on the front. */
@container tile (max-width: 305px) {
  .back-name { display: none; }
}
.tile-info {
  position: absolute; top: 8px; right: 8px; z-index: 3; display: none; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  box-shadow: 0 2px 8px rgba(20, 20, 60, 0.15);
}
.tile-info::after { content: ''; position: absolute; inset: -4px; } /* 44px touch target */
@media (hover: none) { .tile-info { display: grid; } }

/* ---------- Artwork ---------- */
/* One look for every Bee: full-bleed art on graphite, with the Bee's name lettered into the image. */
.art {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border-radius: inherit; background: var(--art-bg); container-type: inline-size;
}
/* A new Bee before its image is made: the name set where the artwork sets it, in the same light type. */
.art-title {
  position: absolute; left: 6%; right: 45%; top: 50%; translate: 0 -40%;
  font-size: 5.6cqw; line-height: 1.12; font-weight: 300; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.94);
}
.featured-stage { container-type: inline-size; }
.featured-title { font-size: 4.6cqw; }
.art-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s var(--ease-soft);
}
.art-img[data-loaded='true'] { opacity: 1; }
/* A soft fall-off at the foot keeps the outcome line readable on every image. */
.art::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 36%; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 11, 20, 0.62), rgba(10, 11, 20, 0));
}
.art-foot { position: absolute; left: 4.4%; right: 4.4%; bottom: 6.5%; z-index: 1; display: grid; gap: 2px; }
.art-kind {
  font-size: clamp(9.5px, 2.5cqw, 12px); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.art-outcome {
  font-size: clamp(12px, 3.5cqw, 16px); line-height: 1.3; font-weight: 500; color: rgba(255, 255, 255, 0.94);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}


/* ---------- Sign in, request access, passwords ---------- */
.splash { min-height: 100vh; }
.auth {
  min-height: 100vh; display: grid; background: #fff;
  grid-template-columns: minmax(420px, 0.82fr) minmax(0, 1.18fr);
}
.auth-pane { display: flex; flex-direction: column; min-height: 100vh; padding: 28px clamp(24px, 4vw, 64px) 24px; }
.auth-brand {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; text-decoration: none;
}
.auth-logo { display: block; height: 32px; width: auto; }
.auth-brand-hive {
  padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0;
}
.auth-body { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; margin: 0 auto; padding: 48px 0; }
.auth-step { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); margin-bottom: var(--s2); }
.auth-body h1 { font-size: clamp(32px, 2.8vw, 42px); line-height: 1.06; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.auth-help { font-size: 13px; color: var(--muted); text-align: center; }
.auth-help a { color: var(--ink); font-weight: 600; text-decoration: none; }
.auth-help a:hover { color: var(--blue); }

/* The key visual: the Hive with the AI at its centre, and a short headline on its calm lower third. */
.auth-visual {
  position: relative; overflow: hidden; margin: 16px 16px 16px 0; border-radius: 32px;
  background: linear-gradient(180deg, #E7E7F6 0%, #EEE6F8 55%, #FAE0F5 100%);
}
.auth-visual img {
  position: absolute; inset: -2%; width: 104%; height: 104%; max-width: none; object-fit: cover; object-position: center 28%;
  translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px);
  transition: translate 0.8s var(--ease);
}
.auth-visual-copy {
  position: absolute; left: clamp(32px, 4vw, 64px); right: clamp(32px, 4vw, 64px); bottom: clamp(32px, 6vh, 64px);
  max-width: 540px;
}
.auth-visual-copy h2 { font-size: clamp(30px, 2.9vw, 48px); line-height: 1.04; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.auth-visual-copy p { margin-top: var(--s3); max-width: 42ch; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.5; color: #4A4A57; }
.auth-lede { margin-top: var(--s2); font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.auth-lede strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: var(--s4); margin-top: var(--s5); }
.auth-form > .auth-lede:first-child { margin-top: 0; }
.auth-switch { margin-top: var(--s5); font-size: 14.5px; color: var(--muted); text-align: center; }
.text-link {
  border: 0; padding: 0; background: none; cursor: pointer; font-size: 14.5px; font-weight: 600;
  color: var(--blue); text-decoration: none;
}
.text-link:hover { color: var(--blue-press); }
.text-link:disabled { color: var(--muted); cursor: default; font-weight: 500; }
.form-row-end { display: flex; justify-content: flex-end; margin-top: -6px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field-wrap { position: relative; display: block; }
.field-input {
  width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong); font: inherit; font-size: 16px; color: var(--ink);
  transition: box-shadow 0.2s var(--ease-soft);
}
.field-wrap .field-input { padding-right: 48px; }
.field-input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(36, 36, 255, 0.12); }
.field-eye {
  position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
}
.field-eye:hover { color: var(--ink); }
.field-hint { font-size: 13px; line-height: 1.4; color: var(--muted); }

.form-notice { padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.form-error { background: #FFF1F4; color: #B01E45; }
.form-info { background: var(--blue-soft); color: #1A1AB8; }

.code-input { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
.code-input input {
  width: 100%; height: 56px; border: 0; border-radius: 14px; background: #fff; text-align: center;
  box-shadow: inset 0 0 0 1px var(--line-strong); font: inherit; font-size: 24px; font-weight: 700; color: var(--ink);
  transition: box-shadow 0.2s var(--ease-soft), transform 0.2s var(--ease);
}
.code-input input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(36, 36, 255, 0.12); transform: translateY(-1px); }
.code-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); }

.auth-done { justify-items: start; }
.done-mark {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #FF74BD, #2424FF); color: #fff;
  box-shadow: 0 12px 30px -10px rgba(36, 36, 255, 0.55);
}
.done-mail { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.done-wait { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.auth-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.auth-done .auth-switch { justify-self: stretch; }
/* Edge adds its own reveal button to password boxes; ours is the only one. */
.field-input::-ms-reveal, .field-input::-ms-clear { display: none; }



/* ---------- Loading ---------- */
.skeleton {
  border-radius: 20px; background-size: 300% 100%; animation: shimmer 1.4s linear infinite;
  background-image: linear-gradient(100deg, rgba(20, 20, 60, 0.05) 30%, rgba(20, 20, 60, 0.09) 50%, rgba(20, 20, 60, 0.05) 70%);
}
.skeleton-bar { height: 40px; width: min(720px, 100%); border-radius: 999px; margin-top: var(--s3); }
.skeleton-hero { aspect-ratio: 16 / 9; margin-top: var(--s4); border-radius: 30px; }
@media (min-width: 1024px) and (max-width: 1439px) { .skeleton-hero { aspect-ratio: 1.85 / 1; } }
@media (min-width: 1440px) { .skeleton-hero { aspect-ratio: 2 / 1; } }
.skeleton-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--tile-gap); margin-top: var(--s7); }
.skeleton-tile { aspect-ratio: 16 / 9; border-radius: 18px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 899px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-visual { grid-row: 1; height: clamp(180px, 34vw, 280px); margin: 12px 12px 0; border-radius: 24px; }
  .auth-visual img { object-position: center 22%; }
  .auth-visual-copy { display: none; }
  .auth-pane { min-height: 0; padding-top: 20px; }
  .auth-body { padding: 32px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .skeleton { animation: none; }
  .tile-card { transition: none; transform: none !important; }
  .tile-back { transform: none; opacity: 0; transition: opacity 0.2s linear; }
  .tile-link:focus-visible .tile-back { opacity: 1; }
  .tile-back::before { animation: none; }
  .auth-visual img { transition: none; translate: none; }
}

/* ---------- Bee details: description, Impact KPIs and the NU line (Hive mobile sheet) ---------- */

/* Details in the mobile sheet */
.details-desc {
  font-size: 14.5px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.impact { margin-top: 14px; }
.impact h4 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.impact ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.impact li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font-size: 14px; line-height: 1.4; color: var(--text); }
.impact-arrow { color: var(--blue); font-weight: 800; }
.impact li strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.details-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s4); padding-top: 14px; border-top: 1px solid var(--line);
}
.nu { display: grid; gap: 2px; }
.nu-main { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.nu-sub { font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* ---------- Section heading ---------- */
.shelf-head h2 {
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
  font-size: clamp(21px, 1.7vw, 27px); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em;
  color: var(--ink);
}
.shelf-count { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.shelf-blurb { margin-top: var(--s1); font-size: 15px; line-height: 1.45; color: var(--muted); }
