/* =========================================================
   Nepsium — Stealth landing
   Dark, technical, restrained. Designed for a single-page hold.
   ========================================================= */

:root {
  --bg:           #06080b;
  --bg-elev:      #0a0d11;
  --ink:          #e7ecf2;
  --ink-soft:     #aab3c0;
  --ink-mute:     #6b7480;
  --line:         rgba(231, 236, 242, 0.08);
  --line-strong:  rgba(231, 236, 242, 0.18);

  --accent:       #7dd3fc;            /* cool cyan, evokes lens / signal */
  --accent-soft:  rgba(125, 211, 252, 0.16);
  --accent-glow:  rgba(125, 211, 252, 0.45);
  --warn:         #fbbf77;

  --maxw:         1180px;
  --pad-x:        clamp(20px, 4vw, 56px);

  --t-fast:       180ms cubic-bezier(.2,.7,.2,1);
  --t-med:        420ms cubic-bezier(.2,.7,.2,1);
  --t-slow:       900ms cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
*::selection { background: var(--accent-soft); color: var(--ink); }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

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

/* =========================================================
   Ambient background — grid + scanline + glow + grain
   ========================================================= */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient__grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(to right,  rgba(231, 236, 242, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(231, 236, 242, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 30%, transparent 80%);
  animation: drift 60s linear infinite;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-64px, -64px, 0); }
}

.ambient__scan {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 0;
  height: 220px;
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(125, 211, 252, 0.05) 35%,
      rgba(125, 211, 252, 0.18) 50%,
      rgba(125, 211, 252, 0.05) 65%,
      transparent 100%
    );
  filter: blur(2px);
  opacity: 0.55;
  animation: scan 9s ease-in-out infinite;
}

@keyframes scan {
  0%   { transform: translateY(-30vh); opacity: 0; }
  10%  { opacity: 0.55; }
  50%  { transform: translateY(60vh); opacity: 0.55; }
  90%  { opacity: 0; }
  100% { transform: translateY(120vh); opacity: 0; }
}

.ambient__glow {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}
.ambient__glow--a {
  top: -25vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.35), transparent 60%);
}
.ambient__glow--b {
  bottom: -30vmax; right: -25vmax;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 60%);
}

.ambient__noise {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

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

.nav,
.main,
.foot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* =========================================================
   Header / Nav
   ========================================================= */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 28px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  letter-spacing: 0.18em;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
}

.nav__mark {
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav__name {
  position: relative;
  top: 1px;
}

.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 17, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   var(--accent-glow); }
  70%  { box-shadow: 0 0 0 10px rgba(125, 211, 252, 0); }
  100% { box-shadow: 0 0 0 0   rgba(125, 211, 252, 0); }
}

/* =========================================================
   Hero
   ========================================================= */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 12vh, 140px);
  padding-top: clamp(48px, 10vh, 120px);
  padding-bottom: clamp(72px, 10vh, 120px);
}

.hero {
  max-width: 880px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0;
  transform: translateY(8px);
  animation: rise 700ms var(--t-med) 120ms forwards;
}

.hero__eyebrow-line {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.hero__title {
  margin: 0 0 28px;
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 900ms var(--t-med) 200ms forwards;
}

.hero__title-italic {
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lede {
  max-width: 620px;
  margin: 0 0 44px;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.65;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(10px);
  animation: rise 900ms var(--t-med) 320ms forwards;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Waitlist
   ========================================================= */

.waitlist {
  max-width: 520px;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 900ms var(--t-med) 460ms forwards;
}

.waitlist__label {
  display: block;
  margin-bottom: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.waitlist__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(10, 13, 17, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--t-fast), background var(--t-fast),
              box-shadow var(--t-med);
}

.waitlist__row:focus-within {
  border-color: var(--accent);
  background: rgba(10, 13, 17, 0.75);
  box-shadow:
    0 0 0 4px var(--accent-soft),
    0 8px 30px rgba(0, 0, 0, 0.4);
}

.waitlist__input {
  flex: 1;
  min-width: 0;
  padding: 14px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.005em;
}

.waitlist__input::placeholder { color: var(--ink-mute); }

.waitlist__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4f6f8 0%, #d6dde6 100%);
  color: #0b0e12;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast),
              box-shadow var(--t-fast);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 6px 18px rgba(0,0,0,0.4);
}

.waitlist__button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #ffffff 0%, #e3e9f1 100%);
}

.waitlist__button:active { transform: translateY(0); }

.waitlist__button:disabled {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}

.waitlist__button-arrow {
  transition: transform var(--t-fast);
}

.waitlist__button:hover .waitlist__button-arrow {
  transform: translateX(2px);
}

.waitlist__hint {
  margin: 12px 4px 0;
  font-size: 12.5px;
  color: var(--ink-mute);
  transition: color var(--t-fast);
}

.waitlist__hint[data-state="ok"]    { color: var(--accent); }
.waitlist__hint[data-state="error"] { color: var(--warn); }

/* =========================================================
   Signals
   ========================================================= */

.signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.signal {
  background: var(--bg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: background var(--t-fast);
}

.signal:hover { background: var(--bg-elev); }

.signal__index {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
}

.signal__title {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.signal__body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* =========================================================
   Footer
   ========================================================= */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 32px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.foot__col {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.foot__sep { color: var(--line-strong); }

.foot__link {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.foot__link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 760px) {
  .signals { grid-template-columns: 1fr; }
  .signal  { padding: 24px 22px; }

  .waitlist__row { flex-direction: column; padding: 10px; gap: 10px; }
  .waitlist__input { padding: 12px; }
  .waitlist__button { justify-content: center; padding: 14px; }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .nav { padding-top: 20px; padding-bottom: 20px; }
  .nav__name { display: none; }
}

/* =========================================================
   Accessibility
   ========================================================= */

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

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

/* =========================================================
   Chat widget
   ========================================================= */

.chat-launcher {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 50;

  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;

  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(10, 13, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  color: var(--ink);
  font: inherit;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  cursor: pointer;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.35),
    0 0 0 0 var(--accent-glow);
  transition: transform var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-med);
}

.chat-launcher:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.45),
    0 0 0 6px var(--accent-soft);
}

.chat-launcher__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}

.chat-launcher__icon { color: var(--ink-soft); }

.chat-launcher__label { position: relative; top: 1px; }

/* Hide launcher while panel is open */
.chat-launcher[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* ---------- Panel ---------- */

.chat-panel {
  position: fixed;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  z-index: 51;

  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 24px));
  max-height: 80vh;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(14, 18, 23, 0.95), rgba(8, 11, 14, 0.95));
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;

  transform-origin: bottom right;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform var(--t-med), opacity var(--t-med);
}

.chat-panel[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-panel[hidden] { display: none; }

.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 17, 0.4);
}

.chat-panel__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.chat-panel__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}

.chat-panel__title {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.chat-panel__subtitle {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

.chat-panel__close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast);
}
.chat-panel__close:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ---------- Thread ---------- */

.chat-panel__thread {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-panel__thread::-webkit-scrollbar { width: 6px; }
.chat-panel__thread::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  animation: msgIn 280ms cubic-bezier(.2,.7,.2,1) forwards;
  opacity: 0;
  transform: translateY(6px);
}

@keyframes msgIn {
  to { opacity: 1; transform: translateY(0); }
}

.msg--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg--user {
  align-self: flex-end;
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.18), rgba(99, 102, 241, 0.16));
  color: var(--ink);
  border: 1px solid rgba(125, 211, 252, 0.3);
  border-bottom-right-radius: 4px;
}

.msg--system {
  align-self: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: transparent;
  border: 0;
  padding: 4px 8px;
}

.msg--error {
  border-color: rgba(251, 191, 119, 0.4);
  color: var(--warn);
}

/* Bot typing indicator */
.msg--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.msg--typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-mute);
  animation: typing 1s ease-in-out infinite;
}
.msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* ---------- Form ---------- */

.chat-panel__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(10, 13, 17, 0.5);
}

.chat-panel__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.chat-panel__input {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: none;
  outline: 0;
  transition: border-color var(--t-fast), background var(--t-fast),
              box-shadow var(--t-med);
}

.chat-panel__input::placeholder { color: var(--ink-mute); }

.chat-panel__input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-panel__input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-panel__send {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f6f8 0%, #d6dde6 100%);
  color: #0b0e12;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast),
              opacity var(--t-fast);
  flex: none;
}

.chat-panel__send:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #ffffff 0%, #e3e9f1 100%);
}

.chat-panel__send:disabled {
  opacity: 0.5;
  cursor: progress;
  transform: none;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .chat-launcher__label { display: none; }
  .chat-launcher { padding: 12px 14px; }

  .chat-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: min(78vh, 600px);
    border-radius: 16px;
  }
}
