@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --brand: #3d8b7a;
  --brand-b: #4ea48f;
  --brand-dim: #2a6055;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 3px;
}
[data-theme="dark"] {
  --bg-0: #0b0c0e;
  --bg-1: #14161f;
  --bg-2: #1a1c24;
  --bg-3: #22242e;
  --fg-1: #f2efea;
  --fg-2: #a5a5ac;
  --fg-3: #60666d;
  --fg-4: #353540;
  --border: #2a2e38;
  --border-h: #3a3f4a;
  --grid-line: rgba(255, 255, 255, 0.025);
  --grain: 0.025;
}
[data-theme="light"] {
  --bg-0: #f4f2ed;
  --bg-1: #eae8e2;
  --bg-2: #dfddd6;
  --bg-3: #d2d0c9;
  --fg-1: #1a1c20;
  --fg-2: #4a4c52;
  --fg-3: #8a8a8e;
  --fg-4: #b8b8bc;
  --border: #ccc9c0;
  --border-h: #b0ada4;
  --grid-line: rgba(0, 0, 0, 0.035);
  --grain: 0.018;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--sans);
  line-height: 1.6;
  transition: background 0.35s, color 0.25s;
  min-height: 100vh;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-0) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
}
.nav a {
  color: var(--fg-2);
  text-decoration: none;
  transition: color 0.15s;
  position: relative;
}
.nav a:hover { color: var(--fg-1); }
.nav a[data-scroll]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav a[data-scroll]:hover::after { transform: scaleX(1); }
.nb { font-weight: 700; font-size: 0.95rem; color: var(--fg-1); }
.nb .a { color: var(--brand); }
.nav-right { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }

.lang-switch {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}
.lang-switch button {
  background: transparent;
  border: none;
  color: var(--fg-3);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  transition: color 0.15s, background 0.15s;
  text-transform: uppercase;
}
.lang-switch button:hover { color: var(--fg-1); }
.lang-switch button.active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.tog {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.06em;
}
.tog:hover { border-color: var(--brand); color: var(--brand); }

/* === LAYOUT === */
section { max-width: 1120px; margin: 0 auto; padding: 5rem 2rem; }
.lab {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.lab::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brand);
  display: inline-block;
}
h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 0.5rem; line-height: 1.15; }
.dsc {
  color: var(--fg-2);
  font-weight: 300;
  font-size: 0.95rem;
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

/* === HERO === */
.hero-wrap { position: relative; border-bottom: 1px solid var(--border); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg canvas { width: 100%; height: 100%; display: block; }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%),
    linear-gradient(to bottom, transparent 0%, var(--bg-0) 98%);
  pointer-events: none;
}
.hero { position: relative; z-index: 2; text-align: center; padding: 6rem 2rem 4rem; max-width: 1120px; margin: 0 auto; }
.lt { font-family: var(--mono); font-size: 3.2rem; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.lt .a { color: var(--brand); }
.hl {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  line-height: 1.22;
  margin: 1.6rem auto 0;
  max-width: 680px;
  color: var(--fg-1);
}
.hl .rotor { color: var(--brand); }
.hl .cursor {
  display: inline-block;
  width: 0.08em;
  background: var(--brand);
  margin-left: 0.08em;
  vertical-align: -0.12em;
  height: 0.95em;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.ls { color: var(--fg-2); font-weight: 300; font-size: 1rem; margin: 1.1rem auto 0; max-width: 560px; line-height: 1.6; }
.lb { display: flex; gap: 0.6rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.lb a {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.62rem 1.15rem;
  border-radius: 2px;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.bp {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.bp:hover {
  background: var(--brand);
  color: var(--bg-0);
  box-shadow: 0 0 24px color-mix(in srgb, var(--brand) 45%, transparent);
}
.bp .arr { transition: transform 0.2s var(--ease); }
.bp:hover .arr { transform: translateX(2px); }
.bs { border: 1px solid var(--border-h); color: var(--fg-2); }
.bs:hover { border-color: var(--fg-2); color: var(--fg-1); }

/* === TRUST STRIP === */
.trust {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-1) 50%, transparent);
}
.trust-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.2rem;
  justify-content: center;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.trust-inner span { display: inline-flex; align-items: center; gap: 0.55rem; transition: color 0.2s; }
.trust-inner span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}
.trust-inner span:hover { color: var(--fg-1); }
.trust-inner span:hover::before { opacity: 1; transform: scale(1.3); }

/* === FEATURED === */
.featured {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 1.1rem;
  overflow: hidden;
  position: relative;
  transition: all 0.25s var(--ease);
}
.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 80% 50%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s;
}
.featured:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 12px 40px color-mix(in srgb, var(--accent) 14%, transparent);
}
.featured:hover::before { opacity: 1; }
.featured-grid { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 260px; position: relative; z-index: 1; }
.featured-text { padding: 1.8rem 1.8rem 1.6rem; display: flex; flex-direction: column; }
.featured-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.featured-head .prm { width: 48px; height: 48px; flex-shrink: 0; }
.featured-head .prm svg { width: 100%; height: 100%; }
.featured-head .prn { font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.featured-head .flag {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border-h);
  border-radius: 2px;
  margin-left: auto;
}
.featured-tag { font-family: var(--sans); font-size: 1.18rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.015em; margin-bottom: 0.7rem; }
.featured-dsc { font-size: 0.9rem; color: var(--fg-2); font-weight: 300; line-height: 1.65; margin-bottom: 1.4rem; flex: 1; }
.featured-foot { display: flex; align-items: center; gap: 0.8rem; }
.featured-vis {
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-0) 40%, var(--bg-1));
}
.featured-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.featured-vis-overlay {
  position: absolute;
  top: 1rem; left: 1rem; right: 1rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

/* === PRODUCTS === */
.prg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.pr {
  background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 1.4rem;
  transition: all 0.25s var(--ease);
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pr::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.pr:hover {
  background: var(--bg-1);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
    0 8px 32px color-mix(in srgb, var(--accent) 18%, transparent);
}
.pr:hover::before { opacity: 1; }
.pr:hover .prm svg { filter: brightness(1.15) saturate(1.12); }
.pr > * { position: relative; z-index: 1; }

.prh { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.prm { width: 44px; height: 44px; flex-shrink: 0; transition: filter 0.25s ease; }
.prm svg { width: 100%; height: 100%; display: block; }
.prhead { flex: 1; min-width: 0; }
.prn { font-family: var(--mono); font-weight: 700; font-size: 0.98rem; letter-spacing: -0.005em; }
.prs { font-size: 0.62rem; color: var(--fg-3); font-family: var(--mono); letter-spacing: 0.04em; }
.prt { font-family: var(--sans); font-size: 0.96rem; color: var(--fg-1); font-weight: 500; line-height: 1.4; margin-bottom: 0.7rem; letter-spacing: -0.01em; }
.prd { font-family: var(--sans); font-size: 0.82rem; color: var(--fg-2); font-weight: 300; line-height: 1.6; margin-bottom: 1.1rem; flex: 1; }
.prfoot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  padding: 0.3rem 0.62rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-weight: 500;
  background: color-mix(in srgb, var(--sc) 18%, transparent);
  color: var(--sc);
  border: 1px solid color-mix(in srgb, var(--sc) 38%, transparent);
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sc); }
.status[data-status="in-development"]::before,
.status[data-status="in-testing"]::before,
.status[data-status="burn-in"]::before { animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
a.status { text-decoration: none; transition: all 0.15s; }
a.status:hover {
  background: color-mix(in srgb, var(--sc) 28%, transparent);
  border-color: var(--sc);
}
.repo {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--fg-3);
  text-decoration: none;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.repo:hover { color: var(--fg-1); }
.repo .arr { transition: transform 0.15s; }
.repo:hover .arr { transform: translateX(2px); }

/* === LEGEND === */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.legend .status { cursor: default; }

/* === ARCHITECTURE === */
.arch-wrap { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-1) 40%, transparent); }
#arch { padding-top: 5rem; padding-bottom: 5rem; }
.arch-frame {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    color-mix(in srgb, var(--bg-1) 85%, var(--bg-0));
  padding: 2rem 1.5rem;
  margin-top: 1.8rem;
  overflow: hidden;
}
.arch-frame svg { width: 100%; height: auto; display: block; overflow: visible; }
.arch-caption {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--fg-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.arch-caption span { display: inline-flex; align-items: center; gap: 0.5rem; }
.arch-caption span::before { content: ""; width: 14px; height: 2px; background: var(--fg-3); display: inline-block; }
.arch-caption span.ctl::before { background: var(--brand); }
.arch-caption span.data::before {
  background-image: repeating-linear-gradient(90deg, var(--fg-2) 0 4px, transparent 4px 7px);
  height: 2px;
}
.arch-node rect { fill: var(--bg-0); stroke: var(--border-h); stroke-width: 1; transition: stroke 0.25s var(--ease), filter 0.25s var(--ease); }
.arch-node:hover rect { stroke: var(--brand); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--brand) 40%, transparent)); }
.arch-node text { font-family: var(--mono); font-size: 11px; fill: var(--fg-1); font-weight: 600; }
.arch-node .sub { font-size: 8px; fill: var(--fg-3); font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.arch-group-label { font-family: var(--mono); font-size: 9px; fill: var(--fg-3); letter-spacing: 0.14em; text-transform: uppercase; }
.arch-group-line { stroke: var(--border); stroke-width: 1; fill: none; }
.arch-edge.ctl { stroke: var(--brand); stroke-width: 1.4; fill: none; opacity: 0.75; }
.arch-edge.data { stroke: var(--fg-2); stroke-width: 1; fill: none; opacity: 0.5; stroke-dasharray: 4 3; }
.arch-dot { fill: var(--brand); }

/* === FOOTER === */
footer {
  max-width: 1120px;
  margin: 3rem auto 0;
  padding: 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--fg-3);
  border-top: 1px solid var(--border);
}
footer .row { line-height: 1.9; }
footer .hint { margin-top: 0.6rem; opacity: 0.4; font-size: 0.55rem; letter-spacing: 0.1em; }
footer a { color: var(--fg-2); text-decoration: none; transition: color 0.15s; }
footer a:hover { color: var(--fg-1); }
footer .sep { opacity: 0.35; margin: 0 0.2rem; }

/* === RESPONSIVE === */
@media (max-width: 1000px) {
  .prg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-vis { border-left: none; border-top: 1px solid var(--border); min-height: 220px; }
}
@media (max-width: 680px) {
  .prg { grid-template-columns: 1fr; }
  h2 { font-size: 1.5rem; }
  .lt { font-size: 2.2rem; }
  .hl { font-size: 1.25rem; }
  .nav { padding: 0.75rem 1rem; gap: 0.7rem; flex-wrap: wrap; }
  section { padding: 3.5rem 1rem; }
  .hero { padding: 4rem 1.25rem 2.5rem; }
  .featured-text { padding: 1.3rem; }
  .trust-inner { padding: 1rem 1.25rem; gap: 0.9rem 1.4rem; font-size: 0.6rem; }
}
