/* nda.nawapower.com. Tokens mirror nawa/src/styles/tokens.css. */

@font-face { font-family: 'Baron Neue'; src: url('/fonts/baron-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Baron Neue'; src: url('/fonts/baron-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Baron Neue'; src: url('/fonts/baron-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }

:root {
  --paper: #F7F4EC;
  --paper-strong: #EEE9DF;
  --white: #FCFBF8;
  --ink: #0B0E10;
  --ink-soft: #171C20;
  --muted: #5A6268;
  --line: #D5D0C6;
  --signal: #5757E6;
  --signal-hover: #4444C8;
  --signal-soft: #E8E7FF;
  --on-signal: #FFFFFF;
  --success: #1D6249;
  --critical: #8E3232;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-panel: 0 12px 36px rgba(11, 14, 16, 0.07);
  --shadow-sign: 0 10px 28px rgba(87, 87, 230, 0.34);
  --font-display: 'Baron Neue', 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Inter Tight', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1214;
    --paper-strong: #151A1D;
    --white: #1A2024;
    --ink: #F2EFE8;
    --ink-soft: #D8D4CC;
    --muted: #9AA3A9;
    --line: #2C3338;
    --signal: #7C7CF5;
    --signal-hover: #9292FA;
    --signal-soft: #23234A;
    --on-signal: #FFFFFF;
    --success: #5FBFA0;
    --critical: #E08585;
    --shadow-panel: 0 12px 36px rgba(0, 0, 0, 0.35);
    --shadow-sign: 0 10px 28px rgba(124, 124, 245, 0.3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 3px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; color: var(--ink); }
.logo { height: 30px; width: auto; display: block; }
.top-tag, .eyebrow, .doc-name, .facts dt, .field > span, .nda-field > span {
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Hero */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); max-width: 860px; }
.hero h1 {
  font: 700 clamp(32px, 5.4vw, 60px)/1.02 var(--font-display);
  letter-spacing: -0.01em; margin: 12px 0 18px; text-wrap: balance;
}
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--ink-soft); max-width: 640px; text-wrap: pretty; }
.facts {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: start;
  gap: 0; margin-top: 28px; border-top: 1px solid var(--line);
}
.facts div { padding: 14px 28px 0 0; margin-right: 28px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; margin-right: 0; }
.facts dd { font: 700 20px/1.2 var(--font-display); margin-top: 6px; }

/* Layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 28px; align-items: start; padding-bottom: 72px; }

/* Document */
.doc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); overflow: clip; }
.doc-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--paper-strong);
}
.doc-links { display: flex; gap: 6px; }
.doc-links a {
  font: 500 12px/1 var(--font-mono); text-decoration: none; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}
.doc-links a:hover { border-color: var(--signal); color: var(--signal); }
.toc {
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 20px;
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc a {
  flex: none; font-size: 13px; text-decoration: none; white-space: nowrap; color: var(--muted);
  padding: 6px 11px; border-radius: 999px; border: 1px solid transparent;
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.toc a span { font: 500 11px var(--font-mono); margin-right: 6px; opacity: 0.7; }
.toc a:hover, .toc a.on { background: var(--signal-soft); color: var(--ink); }

.nda { padding: clamp(24px, 4.5vw, 56px) clamp(20px, 5vw, 64px) 8px; max-width: 800px; margin: 0 auto; }
.nda h2 { font: 700 clamp(22px, 2.6vw, 30px)/1.15 var(--font-display); margin-bottom: 18px; }
.nda p { margin-bottom: 14px; font-size: 15.5px; line-height: 1.68; color: var(--ink-soft); text-wrap: pretty; hyphens: manual; }
.nda p strong { color: var(--ink); font-weight: 650; }
.nda-section { padding-top: 26px; margin-top: 12px; border-top: 1px solid var(--line); }
.nda-section h3 { display: flex; align-items: baseline; gap: 12px; font: 700 18px/1.25 var(--font-display); margin-bottom: 12px; }
.nda-num { font: 500 12px var(--font-mono); color: var(--signal); min-width: 18px; }
.nda-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0 8px; }
.nda-party { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; background: var(--paper); }
.nda-party h4 { font: 700 15px var(--font-display); margin-bottom: 14px; }
.nda-field { margin-bottom: 12px; font-size: 14.5px; line-height: 1.45; }
.nda-field > span { display: block; margin-bottom: 3px; font-size: 10px; }
.nda-blank { display: block; height: 22px; border-bottom: 1px solid var(--muted); opacity: 0.55; }
.doc-end {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 28px; padding: 22px clamp(20px, 5vw, 64px); border-top: 1px solid var(--line); background: var(--paper-strong);
}
.doc-end p { color: var(--muted); font-size: 14.5px; }

/* Rail */
.rail { position: sticky; top: 74px; display: grid; gap: 12px; max-height: calc(100vh - 86px); overflow-y: auto; padding-bottom: 4px; scrollbar-width: thin; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.card h2 { font: 700 16px/1.25 var(--font-display); margin-bottom: 8px; }
.card h2:has(+ .btn) { margin-bottom: 12px; }
.card-sign { border-color: color-mix(in srgb, var(--signal) 45%, var(--line)); box-shadow: var(--shadow-panel); }
.card-sign h2 { margin-bottom: 14px; }
.hint { font-size: 13.5px; line-height: 1.45; color: var(--muted); margin-bottom: 12px; }
.hint a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
.card-sign .hint { margin: 12px 0 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font-sans); text-decoration: none; cursor: pointer;
  padding: 13px 16px; border-radius: var(--radius-md); border: 1px solid transparent;
  transition: background 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn small { font: 500 11px var(--font-mono); color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn-sign { background: var(--signal); color: var(--on-signal); box-shadow: var(--shadow-sign); }
.btn-sign:hover { background: var(--signal-hover); transform: translateY(-1px); }
.btn-big { width: 100%; padding: 22px 20px; font: 700 21px/1 var(--font-display); border-radius: 14px; letter-spacing: 0.01em; }
.btn-big svg { width: 22px; height: 22px; transition: transform 200ms var(--ease); }
.btn-big:hover svg { transform: translateX(4px); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-line { width: 100%; background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-dark { width: 100%; background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--ink-soft); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* Form */
#redline-form { display: grid; gap: 12px; margin-top: 14px; }
#redline-form .btn-sign { width: 100%; padding: 15px; box-shadow: none; }
.drop {
  display: grid; justify-items: center; gap: 5px; text-align: center; cursor: pointer;
  padding: 14px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius-md); background: var(--paper);
  font-size: 14px; font-weight: 550;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--signal); background: var(--signal-soft); }
.drop svg { width: 22px; height: 22px; color: var(--signal); }
.drop small { font-weight: 400; font-size: 12px; color: var(--muted); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.card .status { margin-top: 10px; }
.chip { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--signal); border-radius: var(--radius-sm); background: var(--signal-soft); font-size: 14px; font-weight: 550; }
.chip svg { width: 18px; height: 18px; color: var(--signal); }
.chip span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chip label { font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.field { display: grid; gap: 5px; min-width: 0; }
.field em { font-style: normal; opacity: 0.7; text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  width: 100%; font: 15px/1.4 var(--font-sans); color: var(--ink);
  padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 13.5px; line-height: 1.45; min-height: 0; margin: 0; }
.status:empty { display: none; }
.status.ok { color: var(--success); }
.status.err { color: var(--critical); }

/* Dialog */
dialog {
  width: min(460px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--white); color: var(--ink); box-shadow: 0 28px 80px rgba(11, 14, 16, 0.3);
}
dialog::backdrop { background: rgba(11, 14, 16, 0.5); backdrop-filter: blur(3px); }
dialog h2 { font: 700 22px/1.2 var(--font-display); margin-bottom: 8px; padding-right: 32px; }
dialog .x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--paper-strong); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.choices { display: grid; gap: 10px; }
.choice {
  display: grid; gap: 3px; padding: 15px 16px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.choice:hover { border-color: var(--signal); background: var(--signal-soft); }
.choice strong { font-size: 15.5px; }
.choice span { font-size: 13px; color: var(--muted); }

/* Footer and mobile sign bar */
.foot {
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding: 22px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.signbar { display: none; }

@media (max-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; max-height: none; overflow: visible; order: -1; }
  .card-sign .btn-big { display: none; }
  .card-sign h2, .card-sign .hint { display: none; }
  .card-sign { box-shadow: none; border-color: var(--line); }
  .downloads { padding-top: 0; border-top: 0; }
  .signbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: 1fr auto; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .signbar .btn-sign { padding: 16px; font: 700 17px/1 var(--font-display); }
  .foot { padding-bottom: 96px; }
  .doc-end .btn { display: none; }
}

@media (max-width: 560px) {
  .top-tag { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { border-right: 0; margin-right: 0; padding-right: 12px; padding-bottom: 4px; }
  .nda-sign { grid-template-columns: 1fr; }
  .doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .top, .rail, .signbar, .toc, .doc-bar, .doc-end, .foot, .hero { display: none; }
  .grid { display: block; }
  .doc { border: 0; box-shadow: none; }
}
