/* ─── radical.tools landing — same visual language as Radical Hub ──────── */
/* Tokens mirror src/renderer/src/index.css (dark) + hub/hub.css. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #131322;
  --bg-panel:      #1c1c2e;
  --border:        #2b2b44;
  --border-strong: #3a3a5c;
  --text:          #eeeef8;
  --text-2:        #cacae0;
  --muted:         #9898b8;
  --accent:        #6ea8ff;
  --accent-rgb:    110,168,255;
  --hover:         rgba(255,255,255,0.07);
  --hover-faint:   rgba(255,255,255,0.035);
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.18);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --w: min(1080px, 92vw);

  /* aliases used by style.css (manual.html) */
  --text-muted: var(--muted);
  --bg-raised: var(--bg-panel);
  --accent-light: rgba(var(--accent-rgb), 0.12);
  --accent-border: rgba(var(--accent-rgb), 0.35);
  --radius: var(--radius-lg);
}

[data-theme="light"] {
  --bg:            #f4f5f9;
  --bg-panel:      #ffffff;
  --border:        #e1e3eb;
  --border-strong: #c8cbd6;
  --text:          #1a1a2e;
  --text-2:        #44485a;
  --muted:         #6b6b80;
  --accent:        #3b6fe6;
  --accent-rgb:    59,111,230;
  --hover:         rgba(0,0,0,0.05);
  --hover-faint:   rgba(0,0,0,0.022);
  --shadow-sm: 0 1px 2px rgba(20,30,60,0.06);
  --shadow-md: 0 4px 12px rgba(20,30,60,0.10), 0 1px 3px rgba(20,30,60,0.06);
}

/* Until theme.js has run, follow the OS preference to avoid a flash. */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #f4f5f9; --bg-panel: #ffffff; --border: #e1e3eb; --border-strong: #c8cbd6;
    --text: #1a1a2e; --text-2: #44485a; --muted: #6b6b80;
    --accent: #3b6fe6; --accent-rgb: 59,111,230;
    --hover: rgba(0,0,0,0.05); --hover-faint: rgba(0,0,0,0.022);
  }
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -120px, rgba(var(--accent-rgb), 0.18), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
svg { display: inline-block; vertical-align: middle; }

/* Same slim scrollbar as the app (src/renderer/src/index.css) — otherwise the
   15px default shifts the centred column by a few px between site and Hub. */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 160, 0.22);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(127, 127, 160, 0.40); background-clip: padding-box; border: 2px solid transparent; }
/* Firefox only — in Chromium `scrollbar-width` would override the 10px rule above with an 11px bar. */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: rgba(127,127,160,0.35) transparent; }
}
code { font-family: var(--mono); font-size: 0.92em; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.accent {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Shared site navigation — keep in sync with src/renderer/src/hub/hub.css ── */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 56px;
  /* Same left edge as the centred sections, but the bar itself spans the page. */
  padding: 0 calc((100% - var(--w)) / 2);
  background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.site-nav-logo em { font-style: normal; color: var(--accent); }
.site-nav-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: #fff; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed));
  box-shadow: var(--shadow-sm);
}
.site-nav-links { display: flex; align-items: center; gap: 6px; flex: 1; margin-left: 14px; }
.site-nav-sep { width: 1px; height: 22px; background: var(--border); margin: 0 8px; opacity: 0.8; }
/* First separator pushes Studio / GitHub / theme to the right edge. */
.site-nav-links .site-nav-sep:first-of-type { margin-left: auto; }
.site-nav-btn {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--hover-faint);
  color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.site-nav-btn:hover { background: var(--hover); border-color: var(--border-strong); }
.site-nav-btn.active { border-color: rgba(var(--accent-rgb), 0.5); color: var(--accent); }
.site-nav-btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
  color: #fff; border-color: transparent;
}
.site-nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; text-decoration: none;
  font: inherit; font-size: 14px;
}
.site-nav-icon:hover { color: var(--text); background: var(--hover); }
@media (max-width: 640px) {
  .site-nav-links .site-nav-btn:not(.primary):not(.active) { display: none; }
  .site-nav-sep { display: none; }
}

/* ── Layout ──────────────────────────────────────────────────────── */
main:not(.doc-main) > section { width: var(--w); margin: 0 auto; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero { padding: 76px 0 52px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 22px;
}
.eyebrow-tag { padding: 2px 8px; border-radius: 999px; background: rgba(var(--accent-rgb), 0.16); color: var(--accent); font-weight: 600; }
.eyebrow .sep { opacity: 0.4; }
.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.05; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.lead { max-width: 640px; margin: 0 auto 30px; font-size: 16.5px; line-height: 1.6; color: var(--text-2); }
.lead em { color: var(--text); font-style: normal; font-weight: 600; }
.cta-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cta {
  display: inline-flex; align-items: center;
  height: 44px; padding: 0 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, white), var(--accent));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, var(--shadow-sm);
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
.cta:hover { filter: brightness(1.06); }
.cta.ghost {
  background: color-mix(in srgb, var(--bg-panel) 85%, transparent);
  color: var(--text); border: 1px solid var(--border);
  box-shadow: none;
}
.cta.ghost:hover { border-color: var(--border-strong); background: var(--hover); }
.hero-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ── Tiles (four layers) ─────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  padding: 8px 0 64px;
}
.tile {
  --c: var(--accent);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-panel) 80%, transparent);
  transition: transform 0.15s cubic-bezier(0.4,0,0.2,1), border-color 0.15s, background 0.15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--bg-panel)); }
.tile-icon {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--c);
}
.tile-icon svg { width: 18px; height: 18px; fill: #fff; }
.tile-head { display: flex; align-items: baseline; width: 100%; }
.tile-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.tile-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tile-text { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.tile-text b { color: var(--text-2); font-weight: 600; }

/* ── Feature list ────────────────────────────────────────────────── */
.features { padding: 0 0 64px; }
.features h2 { margin-bottom: 18px; }
.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px 28px;
}
.feature-list li {
  display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; line-height: 1.55; color: var(--muted);
}
.feature-list strong { color: var(--text); font-weight: 600; }
/* A lone item in the last 3-column row stretches across instead of orphaning. */
@media (min-width: 1000px) {
  .feature-list li:nth-child(3n + 1):last-child { grid-column: 1 / -1; }
}
.feature-list em { color: var(--text-2); font-style: normal; font-weight: 500; }
.feature-list code { color: var(--text-2); background: var(--hover-faint); padding: 0 5px; border-radius: 4px; }
.f-icon {
  --c: var(--accent);
  width: 30px; height: 30px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: color-mix(in srgb, var(--c) 60%, white);
}
.f-icon svg { width: 15px; height: 15px; fill: currentColor; }

/* ── Hub ─────────────────────────────────────────────────────────── */
.hub {
  padding: 28px;
  margin-bottom: 64px !important;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 70%),
    color-mix(in srgb, var(--bg-panel) 80%, transparent);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center;
}
.hub-head p { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--hover-faint);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip svg { width: 13px; height: 13px; fill: color-mix(in srgb, var(--c) 60%, white); }
.chip:hover { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); }

/* ── Install ─────────────────────────────────────────────────────── */
.install {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: center;
  padding: 0 0 72px;
}
.install-text p { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.install-text p a { color: var(--accent); }
.install-links { display: flex; gap: 16px; margin-top: 16px; font-size: 13px; }
.install-links a { color: var(--accent); }
.install-links a:hover { text-decoration: underline; }
.code {
  margin: 0; padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #0f0f1c;
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
  color: #cacae0; /* code block stays dark in both themes */
  overflow-x: auto;
}
.code .cm { color: #9898b8; }

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
  width: var(--w); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 20px 0 32px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.footer a { color: var(--accent); }
.footer a:hover { text-decoration: underline; }
.footer-links { display: flex; gap: 16px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hero { padding: 44px 0 36px; }
  .hub, .install { grid-template-columns: 1fr; }
  .chips { justify-content: flex-start; }
}
