/* ============================================================
   NXN — NextNeural | Premium dark design system
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent CSS display overrides from clobbering the hidden attribute */
[hidden] { display: none !important; }

:root {
  /* Palette */
  --bg: #050507;
  --bg-2: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f4f5f7;
  --text-soft: #b9bcc6;
  --text-dim: #7c808d;

  /* Brand neural gradient */
  --c1: #5e9bff; /* blue */
  --c2: #a78bfa; /* violet */
  --c3: #22d3ee; /* cyan */
  --accent: #6ea0ff;
  --grad: linear-gradient(110deg, var(--c1), var(--c2) 48%, var(--c3));
  --grad-soft: linear-gradient(110deg, #8fb8ff, #c4b3ff 50%, #7fe6f6);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 56px);
  --nav-h: 60px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient background field */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(60vw 60vw at 75% -10%, rgba(94, 155, 255, 0.12), transparent 60%),
    radial-gradient(50vw 50vw at 10% 10%, rgba(167, 139, 250, 0.10), transparent 55%),
    radial-gradient(60vw 50vw at 50% 120%, rgba(34, 211, 238, 0.08), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.5;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(110, 160, 255, 0.3);
  color: #fff;
}

/* ---------- Utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grad-text {
  background: var(--grad-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(110, 160, 255, 0.8);
}

.btn {
  --bw: 1px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: var(--bw) solid transparent;
  transition: transform 0.4s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: #fff;
  color: #07080c;
}
.btn-primary:hover { background: #eef1f6; }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn .arr {
  transition: transform 0.4s var(--ease);
}
.btn:hover .arr { transform: translateX(4px); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 8, 12, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--line);
}
.nav .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 12px;
}
.nav-center { display: flex; justify-content: center; }
.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

/* Clean wordmark lockup: small gradient node + "NNL" (Anthropic-minimal) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  transition: opacity 0.25s;
}
.brand:hover { opacity: 0.9; }
.brand-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--grad);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brand:hover .brand-dot {
  transform: scale(1.35);
  box-shadow: 0 0 14px rgba(110, 160, 255, 0.85);
}
.brand-word {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.brand-img {
  height: 40px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.menu > li { position: relative; }

.menu a,
.menu .menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 100px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s, background 0.25s;
}
.menu a:hover,
.menu .menu-trigger:hover,
.menu a.active {
  color: var(--text);
  background: var(--surface-2);
}
.menu .caret {
  width: 9px;
  height: 9px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.35s var(--ease);
  opacity: 0.7;
}
.menu li.open .caret { transform: rotate(-135deg) translateY(-1px); }

/* Dropdown — outer is a transparent hover bridge (covers the gap to the trigger) */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 340px;
  transform: translateX(-50%);
  padding-top: 14px; /* bridge: keeps hover alive between trigger and card */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.dropdown-inner {
  background: rgba(14, 14, 20, 0.82);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(10px) scale(0.96);
  transform-origin: top center;
  filter: blur(8px);
  transition: transform 0.42s var(--ease), filter 0.42s var(--ease);
}
.menu li.open .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.menu li.open .dropdown .dropdown-inner { transform: translateY(0) scale(1); filter: blur(0); }
.dropdown a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  width: 100%;
}
.dropdown a:hover { background: var(--surface-2); }
.dd-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.4;
}
.dd-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  backdrop-filter: blur(10px);
}
.lang-switch button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 100px;
  transition: color 0.25s, background 0.25s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  color: #06070b;
  background: #fff;
}

/* Hamburger */
.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.6px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 25px; }
body.menu-open .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ============================================================
   Hero — pinned morph
   ============================================================ */
.pin-wrap {
  position: relative;
  height: 260vh; /* scroll distance that drives the morph */
}
.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.pin .glow {
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(94, 155, 255, 0.14), rgba(167, 139, 250, 0.06) 35%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Morphing title (NNL -> Next Neural Labs) */
.morph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-size: clamp(38px, 9vw, 120px);
  column-gap: var(--gap, 0.06em);
  white-space: nowrap;
  user-select: none;
}
.morph .word {
  display: inline-flex;
  align-items: baseline;
}
.morph .anchor { color: #fff; }
.morph .rest {
  display: inline-flex;
  overflow: hidden;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.morph .rest > span {
  display: block;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* sub copy + scroll hint that live in the pinned hero */
.hero-sub {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  max-width: 620px;
  font-size: clamp(16px, 2.2vw, 22px);
  color: var(--text-soft);
  letter-spacing: -0.01em;
}
.hero-actions {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.scroll-hint .mouse {
  width: 24px;
  height: 38px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  position: relative;
}
.scroll-hint .mouse::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--text-soft);
  transform: translateX(-50%);
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel {
  0% { opacity: 0; transform: translate(-50%, 0); }
  30% { opacity: 1; }
  60% { opacity: 1; transform: translate(-50%, 10px); }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* NINA monogram hero (2x2 -> two lines) */
.nina-morph {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: baseline;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-size: clamp(26px, 6vw, 82px);
  column-gap: var(--nina-col, 0.12em);
  row-gap: var(--nina-row, 0.04em);
  user-select: none;
}
.nina-morph .word {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.nina-morph .word.col2 { justify-self: start; }
.nina-morph .anchor {
  color: #fff;
}
.nina-morph .rest {
  display: inline-flex;
  overflow: hidden;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nina-morph .rest > span { display: block; flex: 0 0 auto; white-space: nowrap; }

/* ============================================================
   Sections / reveals
   ============================================================ */
section {
  position: relative;
  padding-block: clamp(80px, 12vh, 160px);
}
.section-head {
  max-width: 760px;
  margin-bottom: 56px;
}
.section-head.center {
  margin-inline: auto;
  text-align: center;
}
h2.title {
  font-size: clamp(30px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 18px;
}
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}
.lead {
  font-size: clamp(17px, 2.3vw, 22px);
  color: var(--text-soft);
  line-height: 1.55;
  margin-top: 20px;
}
p.body {
  color: var(--text-soft);
  font-size: 16.5px;
  line-height: 1.7;
}

/* Reveal animation base (JS toggles .in) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }

/* Card grid */
.grid {
  display: grid;
  gap: 18px;
}
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border-radius: 22px;
  padding: 30px;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s, background 0.4s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(110, 160, 255, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }
.card .ic {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 18px;
  font-size: 20px;
}
.card h3 { font-size: 20px; margin-bottom: 9px; }
.card p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }

.kicker-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* Pipeline (vertical connected steps) */
.pipeline {
  display: grid;
  gap: 14px;
  counter-reset: step;
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  align-items: start;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: border-color 0.4s, background 0.4s, transform 0.5s var(--ease);
}
.step:hover { border-color: var(--line-strong); background: var(--surface-2); }
.step .dot {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  background: var(--grad);
  color: #06070b;
}
.step h3 { font-size: 19px; margin-bottom: 7px; }
.step p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }
.step .stage {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

/* Big statement / quote block */
.statement {
  font-size: clamp(26px, 4.6vw, 54px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.18;
  max-width: 18ch;
}
.statement .grad-text { font-weight: 700; }

/* Feature split */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}
.visual {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  aspect-ratio: 4 / 3.2;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.visual .ring {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  opacity: 0.5;
}

/* Stat band */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  border-block: 1px solid var(--line);
  padding-block: 44px;
}
.stat .n {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.stat .l { color: var(--text-dim); font-size: 14.5px; margin-top: 6px; }

/* tag list */
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 13.5px;
  color: var(--text-soft);
  padding: 8px 15px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* CTA */
.cta {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: clamp(48px, 8vw, 96px) var(--pad);
  background:
    radial-gradient(70% 120% at 50% 0%, rgba(94, 155, 255, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  overflow: hidden;
  position: relative;
}
.cta h2 {
  font-size: clamp(30px, 5.4vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 60px 40px;
  margin-top: 40px;
}
.footer .cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
}
.footer h4 {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.footer a {
  display: block;
  color: var(--text-soft);
  font-size: 15px;
  padding: 6px 0;
  transition: color 0.25s;
}
.footer a:hover { color: var(--text); }
.footer .brand { margin-bottom: 14px; }
.footer .brand-dot { width: 7px; height: 7px; }
.footer .brand-word { font-size: 19px; }
.footer .brand-img { height: 46px; }
.footer .tag-line { color: var(--text-dim); font-size: 14.5px; max-width: 30ch; }
.footer .bottom {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* page intro spacing for non-pinned heroes */
.page-hero {
  padding-top: calc(var(--nav-h) + 60px);
}

/* ============================================================
   Custom cursor
   ============================================================ */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s;
}
body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring { opacity: 1; }
.cursor-dot {
  width: 7px;
  height: 7px;
  background: #fff;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid #fff;
  transition: width 0.28s var(--ease), height 0.28s var(--ease),
    background 0.28s, opacity 0.3s;
}
.cursor-ring.is-hover {
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.35);
  border-color: transparent;
}
.cursor-ring.is-down { width: 26px; height: 26px; }
body.cursor-ready { cursor: none; }
body.cursor-ready a,
body.cursor-ready button,
body.cursor-ready .card,
body.cursor-ready input,
body.cursor-ready textarea { cursor: none; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring { display: none !important; }
  body.cursor-ready { cursor: auto; }
}

/* ============================================================
   Neural constellation canvas (behind content)
   ============================================================ */
.constellation {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* ============================================================
   People / duo
   ============================================================ */
.people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.person-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border-radius: 22px;
  padding: 28px;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
.person-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.person-card { scroll-margin-top: 90px; }
.avatar {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 19px;
  color: #06070b;
  letter-spacing: -0.02em;
}
/* photo holders: the <img> covers the gradient + initials fallback.
   If the file is missing, inline onerror removes it and the initials show. */
.avatar img,
.profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.person-card .role {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.person-card .pname {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}
.person-card p { color: var(--text-dim); font-size: 14.5px; line-height: 1.55; }

.lead-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 14px;
  background: var(--surface);
}
.lead-badge .dotmark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
}
.lead-badge b { color: var(--text); font-weight: 600; }

/* footer people */
.f-person { margin-bottom: 14px; }
.f-person .fp-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

/* ============================================================
   Per-page accent themes (keep the three solutions distinct)
   ============================================================ */
body.theme-iris {
  --c1: #22d3ee;
  --c2: #38bdf8;
  --c3: #2dd4bf;
  --accent: #4fd6e6;
}
body.theme-luna {
  --c1: #a78bfa;
  --c2: #818cf8;
  --c3: #c084fc;
  --accent: #b9a4ff;
}

/* ============================================================
   IRIS hero morph — vertical left-aligned stack
   IRIS -> Intelligent / Retrieval (and) / Indexing / System
   ============================================================ */
.iris-morph {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.02em;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-size: clamp(34px, 7vw, 92px);
  user-select: none;
  text-align: left;
}
.iris-morph .row { display: inline-flex; align-items: baseline; white-space: nowrap; }
.iris-morph .anchor { color: #fff; }
.iris-morph .rest {
  display: inline-flex;
  overflow: hidden;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.iris-morph .rest > span { display: block; flex: 0 0 auto; white-space: nowrap; }
.iris-morph .conj {
  display: inline-block;
  overflow: hidden;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0.04em;
  margin-left: 0.35em;
  white-space: nowrap;
}

/* ============================================================
   LUNA hero morph — centered two lines
   LUNA -> Latent Understanding (and) / Narrative Assembly
   ============================================================ */
.luna-morph {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-size: clamp(34px, 8vw, 104px);
  user-select: none;
  text-align: center;
}
.luna-morph .line { display: inline-flex; align-items: baseline; justify-content: center; white-space: nowrap; }
.luna-morph .word { display: inline-flex; align-items: baseline; }
.luna-morph .anchor { color: #fff; }
.luna-morph .rest {
  display: inline-flex;
  overflow: hidden;
  background: var(--grad-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.luna-morph .rest > span { display: block; flex: 0 0 auto; white-space: nowrap; }
.luna-morph .gap { display: inline-block; width: var(--lgap, 0.18em); }
.luna-morph .conj {
  display: inline-block;
  overflow: hidden;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.4em;
  letter-spacing: 0.05em;
  margin-left: 0.34em;
  white-space: nowrap;
}
/* soft moon halo for LUNA hero */
.luna-halo {
  position: absolute;
  z-index: 0;
  width: min(58vmin, 520px);
  height: min(58vmin, 520px);
  border-radius: 50%;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 38% 34%, rgba(199, 187, 255, 0.20), rgba(129, 140, 248, 0.10) 42%, transparent 66%);
  box-shadow: inset -28px -22px 70px rgba(80, 70, 160, 0.25);
  pointer-events: none;
  filter: blur(2px);
}

/* ============================================================
   Gradient divider
   ============================================================ */
.divider-grad {
  height: 2px;
  border: 0;
  margin: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--c1) 18%, var(--c2) 50%, var(--c3) 82%, transparent);
  opacity: 1;
}
.divider-grad.glow { box-shadow: 0 0 24px rgba(110, 160, 255, 0.55); }

/* ============================================================
   Home pinned scroll-stack (sections appear one over another)
   ============================================================ */
.stack-wrap { position: relative; }
.stack-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
}
.stack-slide {
  grid-area: 1 / 1;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 20px) 0 40px;
  opacity: 0;
  will-change: opacity, transform;
}
.stack-slide .wrap { width: 100%; }
.stack-progress {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  z-index: 3;
}
.stack-progress .pdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.4s, transform 0.4s var(--ease);
}
.stack-progress .pdot.on { background: var(--grad); transform: scale(1.35); }

/* ============================================================
   About-us mega dropdown (the showpiece)
   ============================================================ */
.dropdown.dropdown-about { width: 480px; }
/* the panel itself gets a soft aurora that warms up as it opens */
.dropdown-about .dropdown-inner { position: relative; overflow: hidden; }
.dropdown-about .dropdown-inner::before {
  content: "";
  position: absolute;
  inset: -30% -12% auto -12%;
  height: 150px;
  background: radial-gradient(58% 90% at 50% 0%, rgba(110, 160, 255, 0.20), transparent 72%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.menu li.open .dropdown-about .dropdown-inner::before { opacity: 1; }
.about-grid { display: grid; gap: 8px; position: relative; }
.about-head {
  padding: 8px 12px 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.about-person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background 0.3s;
}
.menu li.open .dropdown-about .about-person { opacity: 1; transform: none; }
.menu li.open .dropdown-about .about-person:nth-child(2) { transition-delay: 0.06s; }
.menu li.open .dropdown-about .about-person:nth-child(3) { transition-delay: 0.13s; }
.about-person:hover { background: var(--surface-2); }
.about-person::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 120px at var(--mx, 50%) var(--my, 50%), rgba(110, 160, 255, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.about-person:hover::after { opacity: 1; }
.about-avatar {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #06070b;
  background: var(--grad);
  position: relative;
}
.about-avatar::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c1));
  z-index: -1;
  opacity: 0.6;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes avatarIn {
  from { opacity: 0; transform: scale(0.72); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .profile-avatar { animation: avatarIn 0.65s var(--ease) 0.1s both; }
}
.about-person .ap-name { font-size: 16px; font-weight: 600; color: var(--text); }
.about-person .ap-role { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.about-person .ap-arrow {
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.4s var(--ease), color 0.3s;
}
.about-person:hover .ap-arrow { transform: translateX(4px); color: var(--text); }
.about-person:hover .about-avatar::before { opacity: 0.95; }
.about-person:hover .ap-name { color: #fff; }

/* enhanced person cards (mission / duo) */
.person-card { position: relative; overflow: hidden; }
.person-card .avatar { position: relative; }
.person-card .avatar::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c1));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
  animation: spin 7s linear infinite;
}
.person-card:hover .avatar::before { opacity: 0.7; }
.person-card .links { margin-top: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.person-card .links a {
  font-size: 13px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color 0.25s, border-color 0.25s;
}
.person-card .links a:hover { color: var(--text); border-color: var(--accent); }

/* ============================================================
   NINA hero feature — animated signal field (canvas)
   Flowing audio-like waveforms + drifting motes, drawn in nina.js.
   ============================================================ */
.nina-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(125% 88% at 50% 50%, #000 56%, transparent 100%);
  mask-image: radial-gradient(125% 88% at 50% 50%, #000 56%, transparent 100%);
}

/* ============================================================
   Profile (person) + Contact pages
   ============================================================ */
.profile-hero { position: relative; overflow: hidden; padding-top: calc(var(--nav-h) + 70px); }
.profile-top {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
  flex-wrap: wrap;
}
.profile-avatar {
  flex: 0 0 auto;
  width: clamp(96px, 16vw, 132px);
  height: clamp(96px, 16vw, 132px);
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 48px);
  color: #06070b;
  letter-spacing: -0.02em;
  position: relative;
}
.profile-avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c1));
  z-index: -1;
  opacity: 0.7;
  animation: spin 7s linear infinite;
}
.profile-name {
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 8px 0 4px;
}
.profile-role { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; font-size: 14.5px; text-transform: uppercase; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border-radius: 22px;
  padding: 28px;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
.contact-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.contact-card .c-rows { display: flex; flex-direction: column; gap: 6px; }
.contact-card .c-name { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.contact-card .c-rows a { color: var(--text-soft); font-size: 15.5px; transition: color 0.25s; width: fit-content; }
.contact-card .c-rows a:hover { color: var(--text); }

/* ============================================================
   PATRYK profile hero — cinematic P·M reveal
   ============================================================ */
.pm-pin { height: 220vh; }

.pm-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(68vw 68vw at 50% 46%,
    rgba(94, 155, 255, 0.22) 0%,
    rgba(167, 139, 250, 0.12) 40%,
    transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: pmGlowPulse 4.5s ease-in-out infinite alternate;
}
@keyframes pmGlowPulse {
  from { opacity: 0.72; }
  to   { opacity: 1; }
}

.pm-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}
.pm-mono {
  font-size: clamp(110px, 17vw, 230px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.88;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 72px rgba(94, 155, 255, 0.48));
}
.pm-byline {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 24px;
}

.pm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.pm-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-h) + 40px);
  opacity: 0;
  z-index: 3;
  will-change: opacity, transform;
}

/* ── Patryk auto-playing PM intro ───────────────────────────
   Time-based reveal (no scroll). One viewport tall; the PM glyph
   grows + glows in the centre, then the page auto-scrolls to
   .profile-intro below. */
.pm-hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.profile-intro {
  position: relative;
  padding-top: calc(var(--nav-h) + 70px);
}
/* page is locked from scrolling while the intro plays */
html.intro-lock {
  overflow: hidden;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  /* backdrop-filter on .nav makes it the containing block for the fixed
     menu overlay, collapsing it once scrolled — drop it on mobile. */
  .nav.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(8, 8, 12, 0.94);
  }
  .nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .nav-right { gap: 10px; }
  .menu {
    z-index: 90;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 22px var(--pad);
    background: rgba(8, 8, 12, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
    overflow-y: auto;
  }
  body.menu-open .menu { transform: none; }
  .menu a, .menu .menu-trigger {
    width: 100%;
    justify-content: space-between;
    font-size: 19px;
    padding: 16px 8px;
    border-radius: 14px;
  }
  .dropdown {
    position: static;
    width: 100%;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 0 0 6px 8px;
    display: none;
  }
  .dropdown-inner {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
    padding: 0;
  }
  .menu li.open .dropdown { display: block; }
  .dropdown.dropdown-about { width: 100%; }
  .about-person { opacity: 1; transform: none; padding: 12px 8px; }
  .burger { display: block; }

  .people { grid-template-columns: 1fr; }

  /* pm-glow is designed for wide screens (68vw radius); on mobile portrait
     it collapses into a concentrated blob that looks like a static shadow
     under the PM text — hide it, the canvas bloom is enough. */
  .pm-glow { display: none; }

  /* Fix iOS rubber-band: a fixed pm-hero during the intro can't be
     scrolled past, so profile-intro never bleeds through below. */
  html.intro-lock .pm-hero { position: fixed; inset: 0; z-index: 50; }

  /* scroll-stack falls back to normal flow on small screens */
  .stack-pin { position: static; height: auto; display: block; overflow: visible; }
  .stack-slide {
    position: static;
    height: auto;
    opacity: 1 !important;
    transform: none !important;
    display: block;
    padding: 0 0 60px;
  }
  .stack-progress { display: none; }

  /* hide decorative ring visuals on mobile — they take space without adding value */
  .visual { display: none; }
}

@media (max-width: 560px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .pin-wrap { height: 220vh; }
  .step { grid-template-columns: 1fr; gap: 14px; }
  .person-card { flex-direction: column; }
  .person-card .links { flex-wrap: wrap; }
  .person-card .links a { word-break: break-all; }
}

/* ---------- Stat number tooltips ---------- */
.stat-num-wrap {
  position: relative;
  display: inline-block;
}
.stat-num { cursor: default; }
.stat-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 30;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.stat-num-wrap:hover .stat-tip,
.card-has-tip:hover .stat-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.card-has-tip {
  position: relative;
  overflow: visible;
}
.card-has-tip::after { border-radius: inherit; }

/* ---------- NNL ring bounce animation ---------- */
@keyframes nnl-ring-bounce {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%       { transform: scale(1.06); opacity: 0.8; }
}
@media (prefers-reduced-motion: no-preference) {
  .visual .nnl-ring {
    transform-origin: center center;
    animation: nnl-ring-bounce 3.2s ease-in-out infinite;
    animation-delay: var(--ring-delay, 0s);
  }
}

/* ---------- LUNA WIP blur overlay ---------- */
.luna-wip-overlay {
  position: fixed;
  inset: var(--nav-h, 64px) 0 0 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(0.4);
  -webkit-backdrop-filter: blur(18px) saturate(0.4);
  background: rgba(8, 8, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.luna-wip-title {
  font-size: clamp(24px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

/* ---------- Mobile PM intro overlay (malina.html) ---------- */
.pm-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.pm-mobile-overlay.pm-overlay-exit { opacity: 0; }

.pm-mobile-glyph {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* mirror the canvas formula: min(w*0.30, h*0.42) */
  font-size: min(30vw, 42vh);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pm-mobile-grow 1.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pm-mobile-grow {
  0% {
    transform: scale(0.34);
    opacity: 0.22;
    filter: drop-shadow(0 0 6px rgba(94, 155, 255, 0.2));
  }
  55% {
    filter: drop-shadow(0 0 22px rgba(94, 155, 255, 0.6))
            drop-shadow(0 0 42px rgba(167, 139, 250, 0.4));
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 32px rgba(94, 155, 255, 0.85))
            drop-shadow(0 0 64px rgba(167, 139, 250, 0.65));
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Auth — login / register pill + morphing modal
   ============================================================ */
.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 13px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.3s, border-color 0.3s,
    box-shadow 0.3s;
  will-change: transform;
}
.auth-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn .auth-btn-ic {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.auth-btn .auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #06070b;
  background: var(--grad-soft);
  flex: 0 0 auto;
}

/* logged-in popover */
.auth-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  background: rgba(14, 14, 20, 0.92);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease),
    visibility 0.28s;
  z-index: 120;
}
.auth-wrap { position: relative; }
.auth-wrap.pop-open .auth-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.auth-pop-id {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.auth-pop-name { font-size: 14px; font-weight: 600; color: var(--text); }
.auth-pop-email {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 2px;
  word-break: break-all;
}
.auth-pop-out {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}
.auth-pop-out:hover { color: var(--text); background: var(--surface-2); }

/* overlay + backdrop */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-overlay.open { display: flex; }
.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.62);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  opacity: 0;
}

/* modal panel — morphs out of the auth button */
.auth-modal {
  position: relative;
  margin: auto;
  width: min(420px, 100%);
  background: rgba(14, 14, 20, 0.9);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 32px 26px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  will-change: transform, opacity;
}
.auth-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(110, 160, 255, 0.55), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
}
.auth-content { will-change: opacity, transform; }

.auth-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.35s var(--ease);
}
.auth-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); transform: rotate(90deg); }
.auth-close svg { width: 15px; height: 15px; }

/* segmented login / register switch */
.auth-tabs {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.auth-tab {
  position: relative;
  z-index: 1;
  padding: 9px 0;
  text-align: center;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  transition: color 0.3s;
}
.auth-tab.active { color: #06070b; }
.auth-tab-ind {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  background: #fff;
  border-radius: 100px;
  transition: transform 0.45s var(--ease);
}
.auth-modal.mode-register .auth-tab-ind { transform: translateX(100%); }

.auth-head { margin-bottom: 22px; }
.auth-title { font-size: 23px; font-weight: 700; letter-spacing: -0.03em; }
.auth-sub { margin-top: 6px; font-size: 14px; color: var(--text-dim); line-height: 1.45; }

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 7px;
}
.auth-field input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.auth-field input::placeholder { color: var(--text-dim); }
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(110, 160, 255, 0.18);
}

/* scrollable field region (keeps the submit button always visible) */
.auth-scroll {
  max-height: min(50vh, 380px);
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -6px;
  padding: 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  overscroll-behavior: contain;
}
.auth-scroll::-webkit-scrollbar { width: 9px; }
.auth-scroll::-webkit-scrollbar-track { background: transparent; }
.auth-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 100px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.auth-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  background-clip: padding-box;
  border: 3px solid transparent;
}

/* terms checkbox */
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 2px;
}
.auth-check-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.auth-check-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #06070b;
  transition: background 0.25s var(--ease), border-color 0.25s, transform 0.2s;
}
.auth-check-box svg {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
}
.auth-check-box:active { transform: scale(0.9); }
.auth-check-input:checked + .auth-check-box {
  background: var(--grad-soft);
  border-color: transparent;
}
.auth-check-input:checked + .auth-check-box svg { opacity: 1; transform: scale(1); }
.auth-check-input:focus-visible + .auth-check-box {
  box-shadow: 0 0 0 3px rgba(110, 160, 255, 0.25);
}
.auth-check-txt {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}
.auth-check-txt label { cursor: pointer; }
.auth-check-txt a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.auth-check-txt a:hover { text-decoration-color: var(--accent); }

.auth-submit { width: 100%; justify-content: center; margin-top: 14px; }
.auth-submit[disabled] { opacity: 0.6; cursor: progress; }

.auth-msg {
  display: none;
  font-size: 13px;
  color: #ff8c8c;
  margin: 2px 0 12px;
  line-height: 1.4;
}
.auth-msg.show { display: block; }
.auth-msg.ok { color: #7fe6a8; }

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 18px;
  text-align: center;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.auth-switch:hover { color: var(--text); }

/* mode-driven visibility */
.auth-modal.mode-login .only-register { display: none; }
.auth-modal.mode-register .only-login { display: none; }

@media (max-width: 480px) {
  .auth-modal { padding: 28px 22px 22px; border-radius: 20px; }
}
@media (max-width: 420px) {
  .auth-btn .auth-btn-label { display: none; }
  .auth-btn { padding: 8px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-backdrop { opacity: 1; }
}

/* ============================================================
   use.nnlabs.pl — gate page (login rectangle + tool panel)
   ============================================================ */
.use-body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* top bar */
.use-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--nav-h);
  padding-inline: var(--pad);
  flex: 0 0 auto;
}
.use-logout {
  display: inline-flex;
  align-items: center;
  width: auto;
  text-align: center;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.3s, transform 0.4s var(--ease);
}
.use-logout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* main centers whichever state is active */
.use-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--pad) 64px;
}
.use-stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* the login rectangle reuses .auth-modal, just shown inline */
.use-stage .auth-modal { margin: 0; }

/* loading spinner (avoids a flash of the wrong view) */
.use-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}
.use-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: use-spin 0.8s linear infinite;
}
@keyframes use-spin { to { transform: rotate(360deg); } }

/* logged-in tool picker */
.use-panel {
  width: 100%;
  max-width: 980px;
  text-align: center;
}
.use-panel-head { margin-bottom: 40px; }
.use-greeting {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 12px;
}
.use-panel-sub {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 16px;
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.use-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 28px 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s,
    box-shadow 0.3s;
  will-change: transform;
}
.use-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.use-card-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(110, 160, 255, 0.7);
  margin-bottom: 16px;
}
.use-card h3 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.use-card p {
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.5;
  flex: 1 1 auto;
}
.use-card-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.use-card-go .arr { transition: transform 0.4s var(--ease); }
.use-card:hover .use-card-go .arr { transform: translateX(4px); }

/* footer */
.use-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px var(--pad);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-dim);
}
.use-foot a {
  color: var(--text-soft);
  transition: color 0.2s;
}
.use-foot a:hover { color: var(--text); }

@media (max-width: 760px) {
  .use-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   app.nnlabs.pl — centred gate page
   ============================================================ */

/* full-screen centred layout */
.app-body {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* floating NNL brand (top-left, never shifts layout) */
.app-wordmark {
  position: fixed;
  top: 20px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  z-index: 10;
  opacity: 0.65;
  transition: opacity 0.2s;
}
.app-wordmark:hover { opacity: 1; }
.app-wordmark .brand-img { height: 30px; width: auto; }
.app-wordmark .brand-dot { width: 5px; height: 5px; }

/* centred stage container */
.app-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* auth card wrapper (keeps auth-modal centred without margin:auto fighting) */
.app-card-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.app-card-wrap .auth-modal { margin: 0; }

/* loading spinner */
.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.app-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: app-spin 0.75s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* logged-in panel */
.app-panel {
  width: 100%;
  max-width: 880px;
  text-align: center;
  padding: 60px 0 80px;
}
.app-panel-inner { }
.app-greeting {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 12px;
}
.app-panel-sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 10px;
  margin-bottom: 34px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}
.app-tool-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 24px 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.3s,
              background 0.3s, box-shadow 0.3s;
  will-change: transform;
}
.app-tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.app-tool-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(110, 160, 255, 0.7);
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.app-tool-card h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.app-tool-card p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
  flex: 1 1 auto;
}
.app-tool-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.app-tool-go .arr { transition: transform 0.4s var(--ease); }
.app-tool-card:hover .app-tool-go .arr { transform: translateX(4px); }

.app-logout { display: inline-flex; }

/* email validation visual feedback */
.auth-field input.invalid {
  border-color: rgba(255, 100, 100, 0.75);
  background: rgba(255, 100, 100, 0.04);
  box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.14);
}
.auth-field-err {
  font-size: 12px;
  color: #ff8c8c;
  margin-top: 5px;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .app-body  { padding: 16px; }
  .app-grid  { grid-template-columns: 1fr; }
  .app-panel { padding: 40px 0 60px; }
}
@media (max-width: 480px) {
  .app-greeting { font-size: 22px; }
}

/* ── Agent picker panel ────────────────────────────────── */
.app-hi-title {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 44px;
}

.app-agents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 960px;
  margin-bottom: 44px;
}

.app-agent-card {
  display: flex;
  flex-direction: column;
  padding: 32px 24px 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.3s,
              background 0.3s, box-shadow 0.3s;
  will-change: transform, opacity;
}

.app-agent-card:hover {
  transform: translateY(-7px);
  border-color: rgba(110, 160, 255, 0.35);
  background: var(--surface-2);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(110, 160, 255, 0.18);
}

.app-agent-name {
  display: block;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  line-height: 1;
}

.app-agent-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  flex: 1;
  margin-bottom: 20px;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.app-agent-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s, gap 0.35s var(--ease);
}
.app-agent-card:hover .app-agent-go {
  color: var(--text);
  gap: 10px;
}


@media (max-width: 760px) {
  .app-hi-title { margin-bottom: 28px; }
  .app-agents {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 460px;
    margin-inline: auto;
    padding-inline: 8px;
  }
  .app-agent-name  { font-size: 28px; }
  .app-agent-card  { padding: 28px 20px 20px; }
  .app-agent-desc  { font-size: 13px; }
}

