/* TwoLine — design tokens
   Cinematic dark flagship; light mode for dashboard.
   Type: Inter Tight (display/body) + IBM Plex Mono (numerals, codes, system).
   Accent: electric cyan (single-tone). Status: green (success), amber (warn).
*/

:root {
  /* Type stacks */
  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale (display follows a tight, editorial step) */
  --fs-display-xl: clamp(56px, 7vw, 104px);
  --fs-display-l:  clamp(44px, 5.2vw, 76px);
  --fs-display-m:  clamp(34px, 3.6vw, 52px);
  --fs-h1: 40px;
  --fs-h2: 28px;
  --fs-h3: 20px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-micro: 11px;

  /* Spacing rail (4px) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Radius */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-4: 20px;
  --r-pill: 999px;

  /* Dark (flagship marketing + dashboard dark) */
  --bg-0: #07090C;          /* page */
  --bg-1: #0B0E13;          /* surface */
  --bg-2: #11151C;          /* raised */
  --bg-3: #161B24;          /* hover */
  --line-1: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --line-3: rgba(255,255,255,0.16);

  --fg-0: #F5F7FA;          /* primary text */
  --fg-1: #C8CFD9;          /* secondary */
  --fg-2: #8A93A2;          /* tertiary */
  --fg-3: #5A6373;          /* muted */

  /* Accent — single electric cyan */
  --acc:   #34E0FF;
  --acc-2: #6FE9FF;
  --acc-d: #1AC0E0;
  --acc-soft: rgba(52,224,255,0.10);
  --acc-line: rgba(52,224,255,0.32);

  --ok:    #4ED49A;
  --warn:  #F5B544;
  --err:   #FF6B6B;

  /* Glass */
  --glass-bg: rgba(20,24,32,0.55);
  --glass-line: rgba(255,255,255,0.08);
  --glass-blur: saturate(140%) blur(14px);

  /* Shadow */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.05) inset, 0 24px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(52,224,255,0.18), 0 12px 40px rgba(52,224,255,0.18);
}

/* Light mode */
.theme-light {
  --bg-0: #F7F8FA;
  --bg-1: #FFFFFF;
  --bg-2: #FFFFFF;
  --bg-3: #F1F3F7;
  --line-1: rgba(15,20,28,0.06);
  --line-2: rgba(15,20,28,0.10);
  --line-3: rgba(15,20,28,0.16);

  --fg-0: #0B0E13;
  --fg-1: #2A323F;
  --fg-2: #5A6373;
  --fg-3: #8A93A2;

  --acc:   #0098B8;
  --acc-2: #00B5DB;
  --acc-d: #007A93;
  --acc-soft: rgba(0,152,184,0.08);
  --acc-line: rgba(0,152,184,0.28);

  --glass-bg: rgba(255,255,255,0.7);
  --glass-line: rgba(15,20,28,0.06);

  --shadow-1: 0 1px 0 rgba(255,255,255,1) inset, 0 6px 18px rgba(15,20,28,0.06);
  --shadow-2: 0 1px 0 rgba(255,255,255,1) inset, 0 18px 48px rgba(15,20,28,0.10);
  --shadow-glow: 0 0 0 1px rgba(0,152,184,0.20), 0 10px 30px rgba(0,152,184,0.14);
}

/* Density */
.density-compact {
  --s-3: 8px;
  --s-4: 12px;
  --s-5: 14px;
  --s-6: 18px;
  --s-8: 24px;
  --s-10: 30px;
  --s-12: 36px;
  --fs-body: 14px;
  --fs-small: 12px;
}

/* Reduced motion */
.motion-off *, .motion-off *::before, .motion-off *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--fg-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

.font-mono { font-family: var(--font-mono); font-feature-settings: "zero", "tnum"; }
.tabular { font-variant-numeric: tabular-nums; }

/* Utility surface classes */
.surface { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--r-3); }
.surface-raised { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-3);
}

.hairline { background: var(--line-1); height: 1px; width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-5);
  border-radius: var(--r-2);
  font-family: var(--font-display); font-weight: 500; font-size: 14px; letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--acc); color: #021018; border-color: var(--acc-d); }
.btn-primary:hover { background: var(--acc-2); }
.btn-ghost { background: transparent; color: var(--fg-0); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line-3); }
.btn-quiet { background: transparent; color: var(--fg-1); }
.btn-quiet:hover { color: var(--fg-0); }
.btn-sm { height: 32px; padding: 0 var(--s-3); font-size: 13px; }
.btn-lg { height: 48px; padding: 0 var(--s-6); font-size: 15px; }

/* Chip / Badge */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--fg-1);
  background: var(--bg-2);
}
.chip-acc { color: var(--acc); border-color: var(--acc-line); background: var(--acc-soft); }
.chip-ok  { color: var(--ok); border-color: rgba(78,212,154,0.28); background: rgba(78,212,154,0.08); }
.chip-warn{ color: var(--warn); border-color: rgba(245,181,68,0.28); background: rgba(245,181,68,0.08); }
.chip-err { color: var(--err); border-color: rgba(255,107,107,0.28); background: rgba(255,107,107,0.08); }
.chip-dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}

/* Form */
.field {
  width: 100%; height: 44px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-2);
  color: var(--fg-0); padding: 0 var(--s-4);
  font: inherit;
}
.field:focus { outline: none; border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }

/* Headings */
.h-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.035em; line-height: 0.98; }
.h-display-2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }

/* Eyebrow */
.eyebrow {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 11px; color: var(--fg-2);
}

/* Grid rail (subtle) */
.rail-grid {
  background-image:
    linear-gradient(to right, var(--line-1) 1px, transparent 1px);
  background-size: calc(100%/12) 100%;
}

/* RTL helpers */
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* Small icon system — neutral 1.5px stroke */
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico-lg { width: 20px; height: 20px; }

/* Wordmark */
.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.035em;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-0);
}
.wordmark-glyph {
  width: 22px; height: 22px;
  display: inline-grid; place-items: center;
  position: relative;
}
.wordmark-glyph::before, .wordmark-glyph::after {
  content: ""; position: absolute; left: 2px; right: 2px; height: 2px; border-radius: 2px; background: currentColor;
}
.wordmark-glyph::before { top: 6px; }
.wordmark-glyph::after  { bottom: 6px; background: var(--acc); }
.wordmark-text { font-size: 17px; }
.wordmark-text em { font-style: normal; color: var(--acc); }
