/* ============================================
   Elastcode / Elastbiz — shared design tokens
   Dark theme default. Light theme via [data-theme="light"] on <html>.
   ============================================ */

:root,
:root[data-theme="dark"] {
  --bg:           #0a0a0c;
  --bg-2:         #111114;
  --bg-3:         #17171c;
  --bg-elev:      #1c1c22;
  --border:       #23232a;
  --border-2:     #2d2d36;
  --border-strong:#3a3a45;

  --text:         #ececf1;
  --text-muted:   #a0a0ad;
  --text-dim:     #6c6c78;
  --text-dimmer:  #45454e;

  --accent:       #2563eb;
  --accent-hover: #3b82f6;
  --accent-fade:  rgba(37, 99, 235, 0.12);
  --accent-line:  rgba(37, 99, 235, 0.35);

  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;

  --shadow-soft:  0 1px 0 rgba(255,255,255,0.02) inset, 0 1px 2px rgba(0,0,0,0.4);
  --ring:         0 0 0 1px var(--border);
  --ring-strong:  0 0 0 1px var(--border-strong);
  --ring-accent:  0 0 0 1px var(--accent-line);
}

:root[data-theme="light"] {
  --bg:           #ffffff;
  --bg-2:         #fafafa;
  --bg-3:         #f4f4f5;
  --bg-elev:      #ffffff;
  --border:       #e7e7ec;
  --border-2:     #dcdce2;
  --border-strong:#c4c4cc;

  --text:         #18181b;
  --text-muted:   #52525b;
  --text-dim:     #71717a;
  --text-dimmer:  #a1a1aa;

  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-fade:  rgba(37, 99, 235, 0.08);
  --accent-line:  rgba(37, 99, 235, 0.30);

  --success:      #16a34a;
  --warning:      #d97706;
  --danger:       #dc2626;

  --shadow-soft:  0 1px 2px rgba(15, 23, 42, 0.06);
  --ring:         0 0 0 1px var(--border);
  --ring-strong:  0 0 0 1px var(--border-strong);
  --ring-accent:  0 0 0 1px var(--accent-line);
}

/* ============================================
   Type
   ============================================ */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-30: 30px;
  --fs-38: 38px;
  --fs-48: 48px;
  --fs-60: 60px;

  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-base:  1.5;
  --lh-loose: 1.65;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-15);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

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

code, kbd, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "calt" off;
}

::selection {
  background: var(--accent-fade);
  color: var(--text);
}

/* ============================================
   Layout primitives
   ============================================ */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}
.section--tight { padding: 56px 0; }
.section--loose { padding: 128px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section--loose { padding: 80px 0; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: var(--fs-60); line-height: var(--lh-tight); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-38); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-20); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-16); line-height: var(--lh-snug); }

@media (max-width: 720px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
}

p { margin: 0; color: var(--text-muted); }

.lead {
  font-size: var(--fs-18);
  line-height: var(--lh-loose);
  color: var(--text-muted);
}

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-fg    { color: var(--text); }
.text-accent{ color: var(--accent); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover { background: var(--bg-2); color: var(--text); }

.btn--lg { height: 48px; padding: 0 22px; font-size: var(--fs-15); }
.btn--sm { height: 30px; padding: 0 10px; font-size: var(--fs-13); }

.btn .arrow { transition: transform 160ms ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* ============================================
   Cards & surfaces
   ============================================ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.surface {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================
   Top nav (shared chrome)
   ============================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  font-size: var(--fs-15);
}
.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-dim);
  padding-left: 10px;
  margin-left: 6px;
  border-left: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sites {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sites a {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  padding: 5px 10px;
  border-radius: 5px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  transition: color 120ms ease, background 120ms ease;
}
.sites a:hover { color: var(--text); }
.sites a[aria-current="page"] {
  background: var(--bg-3);
  color: var(--text);
  box-shadow: var(--ring);
}

.topnav__spacer { flex: 1; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.icon-btn:hover { color: var(--text); background: var(--bg-3); }
.icon-btn svg { width: 14px; height: 14px; }

@media (max-width: 720px) {
  .topnav__inner { gap: 12px; }
  .brand__sub { display: none; }
  .sites a { padding: 5px 8px; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 56px 0 72px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer h5 {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 14px 0;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer a { color: var(--text-muted); font-size: var(--fs-14); }
.footer a:hover { color: var(--text); }
.footer__meta {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: var(--fs-13);
  font-family: var(--font-mono);
}
@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__meta { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ============================================
   "Coming soon" badge — shared across rail icons,
   app cards, footer links, and approws.
   ============================================ */
.soon-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 100px;
  line-height: 1;
}
.is-soon { opacity: 0.55; }
.is-soon:hover { opacity: 0.85; }
.rail__icon.is-soon::after,
.railicon.is-soon::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 6px color-mix(in oklab, var(--warning) 50%, transparent);
}
.rail__icon { position: relative; }

/* ============================================
   Utility
   ============================================ */
.hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.stack { display: flex; flex-direction: column; }
.row   { display: flex; align-items: center; }
.gap-4  { gap: 4px; } .gap-6{gap:6px;} .gap-8{gap:8px;} .gap-12{gap:12px;} .gap-16{gap:16px;} .gap-24{gap:24px;}
.mt-8  { margin-top: 8px; } .mt-12{margin-top:12px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;} .mt-48{margin-top:48px;}
.mb-8  { margin-bottom: 8px; } .mb-12{margin-bottom:12px;} .mb-16{margin-bottom:16px;} .mb-24{margin-bottom:24px;}
.flex-1 { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }

/* ============================================
   Tweaks panel
   ============================================ */
.tweaks {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 260px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  font-size: var(--fs-13);
  z-index: 200;
  display: none;
}
.tweaks.is-open { display: block; }
.tweaks__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tweaks__body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.tweaks__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.seg--3 { grid-template-columns: 1fr 1fr 1fr; }
.seg button {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  height: 28px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--ring);
}
