/* ==========================================================================
   INNO BRAIN — core: tokens, reset, shell, motion
   One dark theme, in the charcoal and orange of inno.co.ke.
   ========================================================================== */

:root {
  /* Surfaces, taken from the marketing site's own section colours
     (src/js/animations/sectionTransitions.js) so the two halves of inno.co.ke
     sit on exactly the same charcoal — warm, never blue-black. */
  --bg:          #111111;
  --bg-2:        #191919;
  --panel:       #1c1c1c;
  --panel-2:     #202020;
  --panel-3:     #292929;
  --line:        #2d2d2d;
  --line-soft:   #232323;

  /* type */
  --ink:         #ffffff;
  --ink-2:       #8c8c8c;
  --ink-3:       #747474;
  --ink-4:       #545454;

  /* accents — also used by name from the database (color columns) */
  --inno:        #f4511e;
  --inno-bright: #ff5a1f;
  --mint:   #2dd4a7;
  --blue:   #5b9dff;
  --amber:  #f5b544;
  --coral:  #ff6b6b;
  --violet: #a78bfa;
  --cyan:   #38bdf8;
  --rose:   #fb7185;
  --lime:   #a3e635;

  /* The house accent. White on orange is the brand's own pairing, so buttons
     follow it; small text uses the tinted-on-dark form instead, which reads
     far better than either on a charcoal ground. */
  --accent:        var(--inno);
  --accent-bright: var(--inno-bright);
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(244, 81, 30, 0.15);
  --accent-line:   rgba(244, 81, 30, 0.35);
  --accent-glow:   rgba(255, 90, 31, 0.55);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow:    0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.95);

  --sidebar: 244px;
  --gap:     18px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;

  --ease:  cubic-bezier(.22, .8, .3, 1);
  --quick: 160ms var(--ease);
  --slow:  420ms var(--ease);

  color-scheme: dark;
}

/* Accent themes, switched from Settings (data-accent on <html>). "inno" is
   the house orange and the default; the rest are there if you want a change. */
[data-accent="mint"]   { --accent: var(--mint);   --accent-bright: #4ae3bb; --accent-ink: #052a20; --accent-soft: rgba(45,212,167,.16); --accent-glow: rgba(45,212,167,.5); }
[data-accent="blue"]   { --accent: var(--blue);   --accent-bright: #7db0ff; --accent-ink: #04203f; --accent-soft: rgba(91,157,255,.16); --accent-glow: rgba(91,157,255,.5); }
[data-accent="violet"] { --accent: var(--violet); --accent-bright: #c4aeff; --accent-ink: #1e1140; --accent-soft: rgba(167,139,250,.16); --accent-glow: rgba(167,139,250,.5); }
[data-accent="amber"]  { --accent: var(--amber);  --accent-bright: #ffc96b; --accent-ink: #2e1c00; --accent-soft: rgba(245,181,68,.16); --accent-glow: rgba(245,181,68,.5); }
[data-accent="coral"]  { --accent: var(--coral);  --accent-bright: #ff8f8f; --accent-ink: #3a0d0d; --accent-soft: rgba(255,107,107,.16); --accent-glow: rgba(255,107,107,.5); }
[data-accent="cyan"]   { --accent: var(--cyan);   --accent-bright: #6ed0fb; --accent-ink: #052738; --accent-soft: rgba(56,189,248,.16); --accent-glow: rgba(56,189,248,.5); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;                 /* the app scrolls its own panes */
}

/* The technical grid the marketing site draws behind its work panels. Two
   hairline gradients, fixed, costing one paint — no aurora, no blur. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 35%, transparent 100%);
}

/* One restrained ember of house orange, top left, barely moving. */
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  top: -30vmax; left: -18vmax;
  width: 64vmax; height: 64vmax;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent), transparent 62%);
  filter: blur(130px);
  opacity: .13;
  pointer-events: none;
  will-change: transform;
  animation: ember 46s ease-in-out infinite;
}

@keyframes ember {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vmax, 4vmax, 0) scale(1.1); }
}

/* The orange hairline across the very top, as on inno.co.ke. */
.app::before,
.gate::before {
  content: "";
  position: fixed;
  z-index: 70;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright) 45%, transparent);
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p  { margin: 0; }
a  { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   Shell
   ========================================================================== */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  height: 100vh;
  height: 100dvh;
}

.app[hidden] { display: none; }

/* --- sidebar -------------------------------------------------------------- */

.side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px;
  background: linear-gradient(180deg, rgba(28, 28, 28, .94), rgba(17, 17, 17, .94));
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}

.brand-mark {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 0 22px -6px var(--accent-glow);
  animation: pulse-mark 5s var(--ease) infinite;
}
.brand-mark svg { width: 19px; height: 19px; }

@keyframes pulse-mark {
  0%, 100% { box-shadow: 0 0 20px -6px var(--accent); }
  50%      { box-shadow: 0 0 30px -2px var(--accent); }
}

.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .06em; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .09em; text-transform: uppercase; }

.nav-label {
  padding: 16px 10px 6px;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .09em;
  text-align: left;
  transition: background var(--quick), color var(--quick), transform var(--quick);
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; transition: opacity var(--quick), transform var(--quick); }
.nav-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-item:hover svg { opacity: 1; transform: scale(1.08); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active svg { opacity: 1; }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px; top: 50%;
  width: 3px; height: 22px;
  margin-top: -11px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: slide-in-left 260ms var(--ease);
}
.nav-item .count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--panel-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}
.nav-item.is-active .count { background: var(--accent); color: var(--accent-ink); }

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

.side-foot { margin-top: auto; padding-top: 16px; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
}
.avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 11px; color: var(--ink-3); }

/* --- main ----------------------------------------------------------------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(17, 17, 17, .78);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.topbar .sub { font-size: 12.5px; color: var(--ink-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-btn { display: none; }

.view {
  flex: 1;
  min-height: 0;
  padding: 22px 26px 40px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Stagger: every direct child of a freshly painted view drifts up in turn. */
.view.is-entering > * {
  animation: rise 520ms var(--ease) backwards;
}
.view.is-entering > *:nth-child(1) { animation-delay: 20ms; }
.view.is-entering > *:nth-child(2) { animation-delay: 60ms; }
.view.is-entering > *:nth-child(3) { animation-delay: 100ms; }
.view.is-entering > *:nth-child(4) { animation-delay: 140ms; }
.view.is-entering > *:nth-child(5) { animation-delay: 180ms; }
.view.is-entering > *:nth-child(6) { animation-delay: 220ms; }
.view.is-entering > *:nth-child(n+7) { animation-delay: 260ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes pop {
  0%   { transform: scale(.9); opacity: 0; }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split  { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.split-l{ grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row   { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { margin-left: auto; }
.mb-0 { margin-bottom: 0; }

.muted   { color: var(--ink-3); }
.tiny    { font-size: 11.5px; }
.small   { font-size: 12.5px; }
.strong  { font-weight: 650; }
.mono    { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center  { text-align: center; }

.c-mint   { color: var(--mint); }
.c-blue   { color: var(--blue); }
.c-amber  { color: var(--amber); }
.c-coral  { color: var(--coral); }
.c-violet { color: var(--violet); }
.c-cyan   { color: var(--cyan); }
.c-rose   { color: var(--rose); }
.c-lime   { color: var(--lime); }
.c-accent { color: var(--accent); }

/* ==========================================================================
   Responsive — the same page has to work on a phone
   ========================================================================== */

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split, .grid.split-l { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    z-index: 60;
    top: 0; bottom: 0; left: 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform 280ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(4, 8, 16, .6);
    backdrop-filter: blur(2px);
    animation: fade-in 200ms var(--ease);
  }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 14px 16px; }
  .view { padding: 16px 16px 90px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
}

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