/* ============================================================
   RFPVAULT /next : landing + login
   Editorial brutalism, kinetic. Paper, ink, one signal.
   Tokens come from design-tokens.css (loaded before this file).
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overscroll-behavior-y: none; }

body.next {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--paper); }

/* ---------- grain ---------- */
.nx-grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: nx-grain-shift 0.9s steps(4) infinite;
}
@keyframes nx-grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- custom cursor (fine pointers only) ---------- */
.nx-cursor { display: none; }
@media (pointer: fine) {
  .nx-cursor {
    display: block;
    position: fixed; top: 0; left: 0;
    width: 14px; height: 14px;
    background: var(--ink);
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.18s ease, height 0.18s ease, background 0.18s ease;
    mix-blend-mode: exclusion;
  }
  .nx-cursor.is-hover { width: 38px; height: 38px; background: var(--signal); mix-blend-mode: normal; opacity: 0.9; }
}

/* ---------- loader ---------- */
.nx-loader {
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 9500;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
}
.nx-loader .nx-loader-count {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.22em;
}
.nx-loader .nx-loader-bar {
  width: min(420px, 70vw); height: 14px;
  border: var(--b-rule);
  position: relative; overflow: hidden;
}
.nx-loader .nx-loader-fill {
  position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---------- nav ---------- */
.nx-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 8000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: transparent;
  border-bottom: 3px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.nx-nav.is-stuck { background: var(--paper); border-bottom-color: var(--ink); }
.nx-brand {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.nx-brand .dot { color: var(--signal); }
.nx-nav-right { display: flex; align-items: center; gap: 18px; }
.nx-nav-link {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.nx-nav-link:hover { border-bottom-color: var(--signal); }

/* ---------- stamp buttons ---------- */
.nx-stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  border: var(--b-rule);
  padding: 14px 26px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--signal);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  will-change: transform;
}
.nx-stamp:hover { box-shadow: 10px 10px 0 var(--signal); }
.nx-stamp.signal { background: var(--signal); box-shadow: 6px 6px 0 var(--ink); }
.nx-stamp.signal:hover { box-shadow: 10px 10px 0 var(--ink); }
.nx-stamp.outline { background: var(--paper); color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.nx-stamp.small { font-size: 12px; padding: 10px 18px; box-shadow: 4px 4px 0 var(--signal); }

/* ---------- hero ---------- */
.nx-hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 28px 90px;
  overflow: hidden;
}

/* the faint requirement wall behind everything */
.nx-matrix {
  position: absolute; inset: -12% -6%;
  z-index: 0;
  opacity: 0.13;
  transform: rotate(-4deg);
  pointer-events: none;
}
.nx-matrix-track { will-change: transform; }
.nx-mrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 7px 0;
  border-bottom: 1px solid rgba(10,10,10,0.35);
}
.nx-mrow .mid { color: rgba(10,10,10,0.55); }
.nx-mrow .mstamp {
  font-family: var(--font-display); font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  background: var(--ink); color: var(--paper);
  transform-origin: center;
}
.nx-mrow .mstamp.partial { background: var(--hilite); color: var(--ink); }
.nx-mrow .mstamp.nc { background: var(--paper); color: var(--signal); border-color: var(--signal); }

.nx-hero-inner {
  position: relative; z-index: 2;
  max-width: 1500px; margin: 0 auto; width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  column-gap: 48px;
  align-items: center;
}
.nx-hero-inner .nx-kicker { grid-column: 1 / -1; justify-self: start; }
.nx-hero-inner .nx-h1 { grid-column: 1 / -1; }
.nx-hero-inner .nx-hero-sub { grid-column: 1; }
.nx-hero-inner .nx-hero-cta { grid-column: 1; }
.nx-kicker {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.26em; text-transform: uppercase;
  display: inline-block;
  background: var(--hilite);
  border: var(--b-hair);
  padding: 5px 12px;
  margin-bottom: 26px;
}
.nx-h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7.6vw, 118px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.nx-h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.nx-h1 .line > span { display: inline-block; will-change: transform; }
.nx-h1 .sig { color: var(--signal); }
.nx-hero-sub {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(17px, 1.7vw, 24px);
  color: rgba(10,10,10,0.75);
  max-width: 44ch;
  margin: 28px 0 36px;
}
.nx-hero-cta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* live answer card */
.nx-card {
  grid-column: 2;
  grid-row: 3 / span 2;
  justify-self: end;
  align-self: center;
  margin-top: 48px;
  transform: rotate(2deg);
  z-index: 3;
  width: min(380px, 86vw);
  background: var(--paper);
  border: var(--b-rule);
  box-shadow: 12px 12px 0 var(--ink);
  padding: 18px 18px 16px;
}
.nx-card .chead {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  border-bottom: var(--b-hair); padding-bottom: 8px; margin-bottom: 12px;
}
.nx-card .chead .live { color: var(--signal); animation: nx-blink 1.1s steps(2) infinite; }
@keyframes nx-blink { 50% { opacity: 0.15; } }
.nx-card .cq {
  font-family: var(--font-mono); font-size: 12px;
  line-height: 1.55; min-height: 56px;
  color: rgba(10,10,10,0.85);
}
.nx-card .ca {
  font-size: 13.5px; line-height: 1.5;
  min-height: 80px;
  border-left: 3px solid var(--ink);
  padding-left: 12px; margin: 12px 0;
}
.nx-card .ca .caret { display: inline-block; width: 8px; height: 15px; background: var(--ink); vertical-align: -2px; animation: nx-blink 0.8s steps(2) infinite; }
.nx-card .cfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nx-card .cconf { flex: 1; height: 12px; border: var(--b-hair); position: relative; overflow: hidden; }
.nx-card .cconf .fill { position: absolute; inset: 0; background: var(--hilite); transform: scaleX(0); transform-origin: left; }
.nx-card .cconf .pct {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.08em;
}
.nx-card .cstamp {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.05em;
  padding: 5px 12px;
  border: var(--b-rule);
  background: var(--ink); color: var(--paper);
  opacity: 0; transform: scale(2.4) rotate(-14deg);
  will-change: transform, opacity;
  white-space: nowrap;
}
.nx-card .cstamp.partial { background: var(--hilite); color: var(--ink); }
.nx-card .cstamp.nc { background: var(--paper); color: var(--signal); border-color: var(--signal); }

/* marquee */
.nx-marquee {
  position: relative; z-index: 4;
  background: var(--ink); color: var(--paper);
  border-top: var(--b-rule); border-bottom: var(--b-rule);
  overflow: hidden;
  padding: 13px 0;
}
.nx-marquee .track {
  display: flex; gap: 0; white-space: nowrap; width: max-content;
  font-family: var(--font-display); font-size: 15px;
  letter-spacing: 0.1em; text-transform: uppercase;
  will-change: transform;
}
.nx-marquee .track span { padding: 0 18px; }
.nx-marquee .track .x { color: var(--signal); }
.nx-marquee.lite { background: var(--paper); color: var(--ink); }

/* ---------- story sections ---------- */
.nx-section {
  position: relative;
  padding: 130px 28px;
  max-width: 1500px; margin: 0 auto;
}
.nx-num {
  position: absolute;
  top: 30px;
  font-family: var(--font-display);
  font-size: clamp(120px, 24vw, 380px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(10,10,10,0.16);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.nx-section:nth-child(odd) .nx-num { right: 0; }
.nx-section:nth-child(even) .nx-num { left: 0; }
.nx-sgrid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: center;
}
.nx-section.flip .nx-sgrid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.nx-section.flip .nx-scopy { order: 2; }
.nx-section.flip .nx-svis { order: 1; }
.nx-h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 72px);
  line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase;
  margin: 14px 0 18px;
}
.nx-lede {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(16px, 1.5vw, 21px);
  color: rgba(10,10,10,0.72);
  max-width: 46ch;
  margin-bottom: 16px;
}
.nx-body { font-size: 15px; max-width: 52ch; color: rgba(10,10,10,0.85); }
.nx-body strong { font-weight: 700; }

/* section visuals share a framed box */
.nx-frame {
  border: var(--b-rule);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--ink);
  padding: 20px;
}

/* 01 vault: doc chips */
.nx-vault { position: relative; min-height: 280px; display: flex; align-items: center; justify-content: center; }
.nx-vault .vbox {
  border: var(--b-rule); background: var(--hilite);
  font-family: var(--font-display); letter-spacing: 0.04em;
  padding: 26px 34px; font-size: 22px;
  box-shadow: 8px 8px 0 var(--ink);
}
.nx-doc {
  position: absolute;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  border: var(--b-hair); background: var(--paper);
  padding: 8px 12px;
  box-shadow: 4px 4px 0 var(--ink);
  will-change: transform;
}

/* 02 answering rows */
.nx-arow { border-bottom: var(--b-hair); padding: 11px 2px; }
.nx-arow .aq { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: rgba(10,10,10,0.82); margin-bottom: 7px; }
.nx-arow .abar { height: 11px; border: var(--b-hair); position: relative; overflow: hidden; }
.nx-arow .abar .fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--ink); }
.nx-arow .abar .fill.warm { background: var(--hilite); }
.nx-arow .abar .fill.hot { background: var(--signal); }
.nx-arow .alabel { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; margin-top: 5px; color: rgba(10,10,10,0.62); }

/* 03 judge */
.nx-judge .jrow { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.nx-judge .jbtn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  border: var(--b-hair); background: var(--paper); padding: 7px 13px;
}
.nx-judge .jbtn.on { background: var(--ink); color: var(--paper); }
.nx-note {
  background: var(--hilite); border-left: 3px solid var(--ink);
  padding: 12px 14px; font-size: 13px;
}
.nx-note .nlabel { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; display: block; margin-bottom: 6px; }

/* 04 export */
.nx-export { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; min-height: 200px; }
.nx-ext {
  font-family: var(--font-display); font-size: 18px;
  border: var(--b-rule); padding: 18px 22px; background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  will-change: transform;
}
.nx-ext.sig { background: var(--signal); color: var(--paper); }

/* ---------- proof band ---------- */
.nx-proof {
  background: var(--ink); color: var(--paper);
  border-top: var(--b-rule); border-bottom: var(--b-rule);
  padding: 90px 28px;
}
.nx-proof-grid {
  max-width: 1500px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
.nx-stat .v {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1; letter-spacing: -0.02em;
}
.nx-stat .v .sig { color: var(--signal); }
.nx-stat .l {
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(245,241,232,0.8);
  margin-top: 10px;
}
.nx-proof-foot {
  max-width: 1500px; margin: 46px auto 0;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(245,241,232,0.66);
}

/* ---------- honesty ---------- */
.nx-honest { background: var(--hilite); border-bottom: var(--b-rule); }
.nx-honest .inner { max-width: 1500px; margin: 0 auto; padding: 120px 28px; }
.nx-honest .nx-h2 { max-width: 16ch; }
.nx-quote {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(19px, 2.2vw, 30px);
  line-height: 1.35;
  max-width: 36ch;
  border-left: 4px solid var(--ink);
  padding-left: 22px;
  margin-top: 30px;
}
.nx-quote .who { display: block; font-family: var(--font-mono); font-style: normal; font-size: 10.5px; letter-spacing: 0.2em; margin-top: 14px; color: rgba(10,10,10,0.6); }

/* ---------- finale ---------- */
.nx-finale {
  position: relative;
  background: var(--paper);
  padding: 150px 28px 130px;
  text-align: center;
}
.nx-finale .nx-h1 { margin: 0 auto 38px; max-width: 16ch; }
.nx-foot {
  border-top: var(--b-rule);
  padding: 34px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
}
.nx-foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(10,10,10,0.3); }
.nx-foot a:hover { border-bottom-color: var(--signal); color: var(--signal); }
.nx-foot .links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- reveal primitives ---------- */
.nx-reveal { opacity: 0; transform: translateY(34px); will-change: transform, opacity; }
html.nx-static .nx-reveal { opacity: 1; transform: none; }
html.nx-static .nx-loader { display: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.nx-login {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
}
.nx-login-form {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 6vw, 84px);
  position: relative; z-index: 2;
  background: var(--paper);
  border-right: var(--b-rule);
}
.nx-login-form .nx-brand { font-size: 22px; position: absolute; top: 24px; left: clamp(28px, 6vw, 84px); }
.nx-login-h {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: 0.95; letter-spacing: -0.03em; text-transform: uppercase;
  margin: 10px 0 12px;
}
.nx-login-sub { font-family: var(--font-serif); font-style: italic; font-size: 17px; color: rgba(10,10,10,0.7); margin-bottom: 34px; }
.nx-field { margin-bottom: 18px; }
.nx-field label {
  display: block;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 7px;
}
.nx-input {
  width: 100%;
  font-family: var(--font-mono); font-size: 14px;
  background: var(--paper);
  border: var(--b-rule);
  padding: 13px 14px;
  outline: none;
  transition: box-shadow 0.12s ease;
}
.nx-input:focus { box-shadow: 5px 5px 0 var(--signal); }
.nx-login-actions { display: flex; align-items: center; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.nx-login-links { margin-top: 30px; display: flex; gap: 18px; flex-wrap: wrap; }
.nx-login-links a {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(10,10,10,0.7); text-decoration: none; border-bottom: 1px solid rgba(10,10,10,0.3);
}
.nx-login-links a:hover { color: var(--signal); border-bottom-color: var(--signal); }
.nx-error {
  background: var(--paper); border: 2px solid var(--signal); color: var(--signal);
  font-family: var(--font-mono); font-size: 12px;
  padding: 10px 13px; margin-bottom: 18px;
}

.nx-login-side {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.nx-login-side .nx-matrix { opacity: 0.18; inset: -20% -10%; }
.nx-login-side .nx-mrow { color: var(--paper); border-bottom-color: rgba(245,241,232,0.25); }
.nx-login-side .nx-mrow .mid { color: rgba(245,241,232,0.5); }
.nx-login-side .nx-card { position: relative; right: auto; top: auto; transform: rotate(2deg); }
.nx-login-vert {
  position: absolute; right: 14px; bottom: 10px;
  font-family: var(--font-display);
  font-size: clamp(60px, 9vw, 130px);
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(245,241,232,0.22);
  pointer-events: none; user-select: none;
  line-height: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .nx-card { display: none; }
  .nx-hero { min-height: 88svh; }
  .nx-hero-inner { display: block; }
}
@media (max-width: 900px) {
  .nx-sgrid, .nx-section.flip .nx-sgrid { grid-template-columns: 1fr; }
  .nx-section.flip .nx-scopy { order: 1; }
  .nx-section.flip .nx-svis { order: 2; }
  .nx-section { padding: 90px 20px; }
  .nx-proof-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
  .nx-login { grid-template-columns: 1fr; }
  .nx-login-side { min-height: 260px; order: -1; border-bottom: var(--b-rule); }
  .nx-login-form { border-right: none; }
  .nx-login-form .nx-brand { position: static; display: inline-block; margin-bottom: 30px; }
  .nx-login-side .nx-card { display: none; }
}
@media (max-width: 600px) {
  .nx-hero { padding: 100px 18px 70px; }
  .nx-nav { padding: 13px 18px; }
  .nx-nav .nx-stamp.small { padding: 8px 12px; font-size: 11px; }
  .nx-hero-cta .nx-stamp { width: 100%; text-align: center; }
  .nx-marquee .track { font-size: 13px; }
  .nx-num { opacity: 0.6; }
  .nx-foot { justify-content: center; text-align: center; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nx-grain, .nx-cursor { display: none !important; }
  .nx-loader { display: none !important; }
  .nx-reveal { opacity: 1 !important; transform: none !important; }
  .nx-card .cstamp { opacity: 1 !important; transform: none !important; }
  .nx-card .cconf .fill, .nx-arow .abar .fill { transform: scaleX(1) !important; }
  * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
}
