:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f5f0e8;
  --muted: #b8b2a9;
  --soft: #817b72;
  --cyan: #27d7d1;
  --green: #80d572;
  --amber: #f4b84f;
  --coral: #ff775d;
  --ink: #0c0d10;
  --max: 1180px;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(8, 9, 12, 0.78), var(--bg) 42%),
    radial-gradient(circle at 50% 0%, rgba(39, 215, 209, 0.12), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

#architecture-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.66;
}

.section-shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  width: min(var(--max), calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 9, 12, 0.7);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.site-header.is-scrolled { background: rgba(8, 9, 12, 0.9); border-color: rgba(255, 255, 255, 0.22); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(39, 215, 209, 0.4);
  border-radius: 6px;
  background: #0d1f1f;
  color: var(--cyan);
  font-size: 13px;
}
.brand-text { white-space: nowrap; }
.nav-links { display: flex; justify-content: center; gap: 8px; }
.nav-links a, .header-cta {
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  padding: 10px 12px;
}
.nav-links a:hover, .header-cta:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.header-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: max-content; }
.header-cta { border: 1px solid var(--line); }
.language-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
}
.lang-option {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  min-width: 34px;
  padding: 7px 8px;
}
.lang-option.active { background: var(--text); color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 52px;
  align-items: center;
  min-height: 84vh;
  padding: 112px 0 54px;
}
.eyebrow, .section-kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 980px; margin-bottom: 22px; font-size: clamp(56px, 10vw, 124px); line-height: 0.9; letter-spacing: 0; }
h2 { max-width: 860px; margin-bottom: 28px; font-size: clamp(32px, 5vw, 64px); line-height: 1; letter-spacing: 0; }
h3 { margin-bottom: 10px; font-size: 20px; letter-spacing: 0; }
.hero-lede { max-width: 780px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 7px;
  font-weight: 850;
  padding: 0 18px;
}
.button:hover, .project-card:hover, .demo-card:hover, .package-grid a:hover { transform: translateY(-4px); }
.button.primary { background: var(--text); color: var(--ink); }
.button.secondary { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); }

.hero-proof, .positioning-grid article, .project-card, .demo-card, .stack-panel, .package-grid a, .community-list p, .testimonial-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.hero-proof { padding: 18px; box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42); }
.avatar { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); margin-bottom: 16px; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.proof-grid div { border: 1px solid var(--line); border-radius: 7px; padding: 12px 8px; background: rgba(255, 255, 255, 0.05); }
.proof-grid strong { display: block; font-size: 24px; line-height: 1; }
.proof-grid span, .hero-proof p { color: var(--muted); font-size: 13px; }

.positioning, .work, .demos, .systems, .stack, .opensource, .community, .testimonials, .contact { padding: 86px 0; }
.positioning-grid, .project-grid, .demo-grid, .package-grid, .testimonial-grid { display: grid; gap: 14px; }
.positioning-grid { grid-template-columns: repeat(3, 1fr); }
.project-grid, .demo-grid { grid-template-columns: repeat(3, 1fr); }
.package-grid { grid-template-columns: repeat(4, 1fr); }
.testimonial-grid { grid-template-columns: repeat(4, 1fr); }
.positioning-grid article, .project-card, .demo-card, .stack-panel, .package-grid a, .community-list p, .testimonial-card { padding: 22px; }
.positioning-grid span { color: var(--amber); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: 850; }
.positioning-grid p, .project-card p, .demo-card p, .stack-panel, .package-grid span, .community-list, .testimonial-card p, .contact p { color: var(--muted); }

.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  padding: 9px 13px;
}
.filter.active, .filter:hover { border-color: rgba(39, 215, 209, 0.5); background: rgba(39, 215, 209, 0.12); color: var(--text); }

.project-card, .demo-card { display: flex; min-height: 286px; flex-direction: column; position: relative; overflow: hidden; transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.project-card::before, .demo-card::before { content: ""; position: absolute; inset: 0; border-top: 3px solid var(--accent, var(--cyan)); }
.demo-card.store::before { border-top-color: var(--green); }
.demo-card.webapp::before { border-top-color: var(--coral); }
.demo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(39, 215, 209, 0.08), transparent 38%);
  opacity: 0;
  transition: opacity 180ms ease;
}
.demo-card:hover::after { opacity: 1; }
.project-card:hover, .demo-card:hover, .package-grid a:hover { border-color: rgba(255, 255, 255, 0.28); background: var(--panel-strong); }
.project-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 18px; }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.demo-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
}
.project-tag, .demo-type {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  padding: 6px 9px;
  text-transform: uppercase;
}
.project-card p, .demo-card p { flex: 1; }
.project-card h3, .demo-card strong { word-break: break-word; }
.demo-card strong { display: block; margin: 0 0 10px; font-size: 22px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.project-meta span { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 750; padding: 6px 9px; }
.project-link, .demo-link { color: var(--text); font-weight: 850; }
.demo-link { position: relative; z-index: 1; }

.system-map { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 32px; }
.system-node { min-height: 118px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)); display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 850; }
.system-node:nth-child(2n) { color: var(--cyan); }
.system-node:nth-child(3n) { color: var(--amber); }
.stack-layout, .community { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 14px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cloud span { border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.05); color: var(--text); font-weight: 750; padding: 9px 12px; }
.focus-list { margin: 0; padding-left: 18px; }
.focus-list li + li { margin-top: 12px; }
.package-grid a { min-height: 170px; transition: transform 180ms ease, border-color 180ms ease; }
.package-grid strong, .package-grid span { display: block; }
.package-grid strong { margin-bottom: 12px; word-break: break-word; }
.community { align-items: start; }
.community-list { display: grid; gap: 10px; }
.community-list p { margin: 0; }
.testimonial-card { min-height: 248px; display: flex; flex-direction: column; justify-content: space-between; }
.testimonial-card.featured { grid-column: span 2; background: linear-gradient(135deg, rgba(128, 213, 114, 0.12), transparent 48%), var(--panel); }
.testimonial-card footer { border-top: 1px solid var(--line); padding-top: 14px; }
.testimonial-card strong, .testimonial-card span { display: block; }
.testimonial-card span { color: var(--soft); font-size: 13px; }
.contact { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(39, 215, 209, 0.13), transparent 42%), linear-gradient(315deg, rgba(244, 184, 79, 0.12), transparent 40%), rgba(255, 255, 255, 0.06); margin-top: 60px; padding: 50px; }
.contact h2 { margin-bottom: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--soft); font-size: 14px; padding: 28px 0 44px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 640ms ease, transform 640ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  #architecture-canvas { display: none; }
}

@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav-links { display: none; }
  .hero, .community, .stack-layout { grid-template-columns: 1fr; }
  .hero { align-items: start; min-height: auto; }
  .hero-proof { max-width: 420px; }
  .positioning-grid, .project-grid, .demo-grid, .package-grid, .system-map { grid-template-columns: repeat(2, 1fr); }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 640px) {
  .section-shell { width: min(100% - 28px, var(--max)); }
  .site-header { top: 10px; width: calc(100% - 20px); }
  .brand-text { display: none; }
  .header-cta { padding-inline: 10px; }
  .language-switch { padding: 2px; }
  .lang-option { min-width: 28px; padding: 6px; }
  .hero { padding-top: 112px; padding-bottom: 44px; }
  h1 { font-size: clamp(46px, 16vw, 72px); }
  h2 { font-size: clamp(30px, 11vw, 44px); }
  .positioning, .work, .demos, .systems, .stack, .opensource, .community, .testimonials, .contact { padding: 58px 0; }
  .positioning-grid, .project-grid, .demo-grid, .package-grid, .testimonial-grid, .system-map, .proof-grid { grid-template-columns: 1fr; }
  .testimonial-card.featured { grid-column: span 1; }
  .project-card, .demo-card { min-height: 0; }
  .contact { padding: 28px; }
  .site-footer { flex-direction: column; }
}
