/* ============================================================================
   LxveLabs.com — company hub. Design system shared with LxveAce.github.io.
   Self-hosted fonts + no inline styles (strict CSP: style-src 'self').
   ============================================================================ */

/* ---- Fonts (self-hosted woff2; font-src 'self') ---- */
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/dm-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/dm-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Tokens ---- */
:root {
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1080px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
}
[data-theme="dark"] {
  --bg: #0a0a0f; --bg-alt: #101018; --surface: #14141e;
  --border: rgba(255,255,255,0.06); --border-hover: rgba(255,255,255,0.12);
  --text: #e8e8ed; --text-muted: #848494;
  --accent: #a78bfa; --accent-hover: #c4b5fd; --accent-glow: rgba(167,139,250,0.15);
  --tag-bg: rgba(167,139,250,0.08); --tag-text: #c4b5fd; --tag-border: rgba(167,139,250,0.15);
  --card-shadow: 0 2px 20px rgba(0,0,0,0.3);
  --header-bg: rgba(10,10,15,0.8);
  --hero-glow: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(167,139,250,0.06) 0%, transparent 70%);
  --soon: #f5b14c; --soon-bg: rgba(245,177,76,0.1); --soon-border: rgba(245,177,76,0.25);
  --dot: rgba(167,139,250,0.012);
}
[data-theme="light"] {
  --bg: #fafafa; --bg-alt: #f0f0f4; --surface: #ffffff;
  --border: rgba(0,0,0,0.06); --border-hover: rgba(0,0,0,0.12);
  --text: #18181b; --text-muted: #6b6b7b;
  --accent: #7c3aed; --accent-hover: #6d28d9; --accent-glow: rgba(124,58,237,0.1);
  --tag-bg: rgba(124,58,237,0.06); --tag-text: #7c3aed; --tag-border: rgba(124,58,237,0.12);
  --card-shadow: 0 2px 20px rgba(0,0,0,0.04);
  --header-bg: rgba(250,250,250,0.8);
  --hero-glow: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(124,58,237,0.04) 0%, transparent 70%);
  --soon: #b9770e; --soon-bg: rgba(185,119,14,0.08); --soon-border: rgba(185,119,14,0.22);
  --dot: rgba(124,58,237,0.018);
}

/* ---- Reset / base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--text);
  line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 28px 28px;
  transition: background var(--transition), color var(--transition);
}
img, svg, video, canvas { max-width: 100%; height: auto; }
a { color: var(--accent); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }
@media (min-width: 1440px) { .container { max-width: 1280px; } }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 12px; top: 12px; }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 150; transition: width 0.1s linear;
}

/* ---- Header / nav ---- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--header-bg); backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.header.scrolled { border-bottom-color: var(--border); }
.nav {
  max-width: var(--max-width); margin: 0 auto; padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.5px; display: inline-flex; align-items: center; gap: 9px;
}
.nav-logo .mark { color: var(--accent); flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.2px; transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center;
  transition: color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); transition: var(--transition); }

/* ---- Hero ---- */
.hero {
  position: relative; padding: 150px 0 90px; text-align: center; overflow: hidden;
}
.hero::before { content: ''; position: absolute; inset: 0; background: var(--hero-glow); pointer-events: none; }
.hero .container { position: relative; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-mono); font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800;
  letter-spacing: -1.5px; line-height: 1.05; margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-hover), var(--accent));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--text-muted); max-width: 620px; margin: 0 auto 14px; }
.hero-typed { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.95rem; margin-bottom: 34px; min-height: 1.4em; }
.hero-typed .caret { color: var(--accent); font-weight: 700; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600; text-decoration: none;
  cursor: pointer; border: none; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; position: relative; overflow: hidden; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); transform: translateY(-1px); }

/* ---- Sections ---- */
.section { padding: 92px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { margin-bottom: 44px; }
.section-title { font-family: var(--font-mono); font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; letter-spacing: -0.5px; }
.section-title::after { content: ''; display: block; width: 32px; height: 2px; background: var(--accent); margin-top: 14px; }
.section-lead { color: var(--text-muted); margin-top: 14px; max-width: 640px; }

/* ---- Cyber Controller centerpiece ---- */
.cc-feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--card-shadow); position: relative; overflow: hidden;
}
.cc-feature::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.cc-flag { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent); background: var(--accent-glow); border: 1px solid var(--tag-border); padding: 3px 9px; border-radius: 20px; }
.cc-feature h2 { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.5px; margin: 14px 0 6px; }
.cc-feature .cc-ver { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.85rem; }
.cc-feature p { color: var(--text-muted); margin: 16px 0; max-width: 640px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
.stat { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 20px; min-width: 130px; }
.stat-number { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; color: var(--accent); display: block; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); }
.cc-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Tease cards (mobile / node roadmap) ---- */
.tease-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; }
.tease-card { background: var(--bg-alt); border: 1px dashed var(--soon-border); border-radius: var(--radius); padding: 24px; }
.tease-card .status-badge.soon { color: var(--soon); background: var(--soon-bg); border-color: var(--soon-border); }
.tease-card h3 { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; margin: 12px 0 8px; }
.tease-card p { color: var(--text-muted); font-size: 0.86rem; }

/* ---- Project + hardware cards ---- */
.projects-grid, .hardware-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project-card, .hardware-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  text-decoration: none; color: inherit; transition: all var(--transition); display: block;
  opacity: 0; transform: translateY(16px);
}
.project-card.visible, .hardware-card.visible { opacity: 1; transform: translateY(0); }
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 36px var(--accent-glow), var(--card-shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-head h3 { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.3px; }
.card-head svg { color: var(--text-muted); flex-shrink: 0; margin-top: 3px; transition: transform var(--transition); }
.project-card:hover .card-head svg { transform: translate(2px, -2px); }
.card-cat { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.4px; text-transform: uppercase; }
.project-card p, .hardware-card p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.7; margin: 12px 0 18px; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent); background: var(--accent-glow);
  border: 1px solid var(--tag-border); padding: 3px 9px; border-radius: 20px;
}
.status-badge.soon { color: var(--soon); background: var(--soon-bg); border-color: var(--soon-border); }
.card-link { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); text-decoration: none; }
.project-card:hover .card-link { color: var(--accent); }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.project-tags span {
  font-family: var(--font-mono); font-size: 0.7rem; padding: 4px 10px; background: var(--tag-bg);
  color: var(--tag-text); border: 1px solid var(--tag-border); border-radius: 6px; font-weight: 500;
}

/* ---- Hardware section ---- */
.hardware-card { border-style: dashed; border-color: var(--soon-border); }
.hardware-card:hover { transform: translateY(-2px); border-color: var(--soon); box-shadow: var(--card-shadow); }
.pcbway-line {
  margin-top: 28px; padding: 18px 22px; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; color: var(--text-muted); text-align: center;
}
.pcbway-line a { color: var(--accent); text-decoration: none; font-weight: 600; }
.diy-note { margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }

/* ---- About / contact ---- */
.about-content { max-width: 720px; }
.about-content p { color: var(--text-muted); margin-bottom: 14px; }
.contact-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

/* ---- Footer (full, multi-column) ---- */
.footer {
  border-top: 1px solid var(--border); background: var(--bg-alt);
  padding: 56px 0 40px; color: var(--text-muted); font-size: 0.9rem;
}
.footer a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.footer a:hover { color: var(--accent); }
.footer-top { display: grid; grid-template-columns: 1.6fr 3fr; gap: 48px; }
.footer-brand { max-width: 38ch; }
.footer-logo { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.footer-logo span { color: var(--accent); }
.footer-blurb { margin: 14px 0 18px; line-height: 1.6; }
.footer-contact { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-contact a { font-family: var(--font-mono); font-size: 0.82rem; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-col h2 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col li a { display: inline-block; font-size: 0.88rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px 24px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.82rem;
}
.footer-use { opacity: 0.85; }
.footer-copy { font-family: var(--font-mono); }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr; gap: 36px; } .footer-cols { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (max-width: 480px) { .footer-cols { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; align-items: flex-start; } }

/* ---- Legal pages (prose; the global * reset zeroes margins, so supply the rhythm here) ---- */
.legal { max-width: 760px; }
.legal h1 { font-family: var(--font-mono); font-size: clamp(1.6rem, 4vw, 2rem); letter-spacing: -0.5px; margin-bottom: 8px; }
.legal .legal-updated { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 30px; }
.legal h2 { font-family: var(--font-mono); font-size: 1.08rem; font-weight: 700; margin: 34px 0 8px; color: var(--text); }
.legal p { color: var(--text-muted); margin-bottom: 14px; }
.legal ul { color: var(--text-muted); margin: 0 0 14px 22px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); text-decoration: underline; }

/* ---- 404 ---- */
.notfound { min-height: 66vh; display: flex; align-items: center; text-align: center; }
.notfound .code { font-family: var(--font-mono); font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -2px; }
.notfound h1 { font-family: var(--font-mono); font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.5px; margin: 10px 0 6px; }
.notfound p { color: var(--text-muted); margin: 14px auto 26px; max-width: 460px; }
.notfound .hero-cta { justify-content: center; }

/* ---- Keyboard focus ring (a11y) ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible, .btn:focus-visible, .theme-toggle:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }

/* ---- Reveal ---- */
.reveal-stagger { transition-delay: var(--stagger-delay, 0s); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height var(--transition);
  }
  .nav-links.open { max-height: 360px; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links li a { display: block; padding: 14px; }
  .section { padding: 64px 0; }
  .cc-feature { padding: 28px; }
  .btn { min-height: 44px; justify-content: center; }
}
@media (max-width: 400px) {
  .container, .nav { padding: 0 16px; }
  .section { padding: 48px 0; }
  .cc-feature, .project-card, .hardware-card { padding: 20px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .project-card, .hardware-card, .tease-card, .about-content, .stat { opacity: 1 !important; transform: none !important; }
}
