*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --bg:     #07080f;
  --bg2:    #0b0c18;
  --border: #181a2b;
  --blue:   #4a85f5;
  --silver: #94a3b8;
  --muted:  #c8d8ec;
  --dim:    #8ea2b8;
  --text:   #f0f4fa;
  --green:  #22c55e;
  --amber:  #f59e0b;
  --red:    #ef4444;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Canvas — Three.js */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; width: 100%; height: 100%;
  will-change: transform;
  transform: translateZ(0);
}

/* Scanlines — very subtle CRT texture over the whole viewport */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.024) 2px,
    rgba(0,0,0,0.024) 4px
  );
}

/* Gradient fades — center darkened so network stays on the edges */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    /* Center content-area darkening — stronger for text legibility */
    radial-gradient(ellipse 62% 95% at 50% 42%, rgba(7,8,15,0.90) 0%, rgba(7,8,15,0.45) 55%, transparent 100%),
    /* Top fade */
    linear-gradient(to bottom, rgba(7,8,15,0.88) 0%, transparent 18%),
    /* Bottom fade */
    linear-gradient(to bottom, transparent 52%, rgba(7,8,15,0.98) 100%),
    /* Left heavy vignette */
    linear-gradient(to right,  rgba(7,8,15,0.96) 0%, rgba(7,8,15,0.65) 20%, rgba(7,8,15,0.22) 44%, transparent 60%),
    /* Right vignette */
    linear-gradient(to left,   rgba(7,8,15,0.65) 0%, rgba(7,8,15,0.18) 16%, transparent 32%);
}

/* ── Container ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Brand ── */
.brand { text-decoration: none; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-sero {
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.07em;
  background: linear-gradient(110deg, #9cc8ff 0%, #4a85f5 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block;
  animation: brandGlitch 13s infinite;
}
.brand-rat {
  font-size: 1.05rem; font-weight: 500; letter-spacing: 0.05em;
  color: rgba(180,190,220,0.55);
}
.brand-icon { width: 20px; height: 20px; border-radius: 0; object-fit: contain; }

/* ── Nav ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 58px;
  background: rgba(7,8,15,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(24,26,43,0.8);
  display: flex; align-items: center;
  overflow: visible;
  transition: background 0.25s;
}
#nav.scrolled {
  background: rgba(7,8,15,0.97);
  border-bottom-color: rgba(59,130,246,0.18);
}
.nav-inner {
  display: flex; align-items: center; width: 100%; min-width: 0; gap: 8px;
}
.nav-right {
  display: flex; align-items: center; gap: 20px;
  margin-left: auto; flex-shrink: 0;
}
.nav-links {
  display: flex; gap: 24px; list-style: none; flex-shrink: 1; min-width: 0;
}
.nav-links a {
  font-size: 0.85rem; color: var(--muted);
  text-decoration: none; transition: color 0.15s; white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }
.btn-gh {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; font-size: 0.82rem; color: var(--silver);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 6px; text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.btn-gh:hover { border-color: rgba(59,130,246,0.4); color: var(--text); }

/* ── Hero ── */
.hero {
  position: relative; z-index: 1;
  padding: 148px 0 96px;
}
.eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; color: var(--muted); margin-bottom: 28px;
}
.prompt { color: var(--green); font-weight: 600; user-select: none; }
.eyebrow::after {
  content: '▋';
  color: var(--green);
  animation: cursorBlink 1.15s step-end infinite;
  flex-shrink: 0;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 7px var(--green);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes cursorBlink { 0%, 100% { opacity: 0.85; } 50% { opacity: 0; } }
@keyframes brandGlitch {
  0%, 86%, 100% { filter: none; transform: none; }
  87%           { filter: hue-rotate(38deg) saturate(2.2) brightness(1.18); transform: translateX(-2px); }
  88%           { filter: hue-rotate(-24deg) saturate(1.8) brightness(0.92); transform: translateX(3px); }
  89%           { filter: hue-rotate(18deg) saturate(1.4) brightness(1.05); transform: translateX(-1px); }
  90%           { filter: none; transform: none; }
}
.hero h1 { font-size: clamp(1.5rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.04em; margin-bottom: 24px; max-width: 700px; }
.hero-brand {
  font-size: clamp(3.4rem, 10.5vw, 8.5rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 10px;
  user-select: none;
}
.hb-sero {
  background: linear-gradient(115deg, #7db3f9 0%, #dce8ff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 32px rgba(74,133,245,0.22));
}
.hb-rat {
  background: linear-gradient(115deg, #94a3b8 0%, #c8d8ec 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  opacity: 0.55;
}
.hero-brand-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 32px;
}
.hero-lead {
  font-size: 1.05rem; color: var(--muted);
  line-height: 1.75; max-width: 500px; margin-bottom: 36px;
}
.hero-actions {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 40px; flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; font-size: 0.9rem; font-weight: 500; color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
  border-radius: 7px; text-decoration: none; border: none;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.25), 0 4px 16px rgba(59,130,246,0.18);
  transition: box-shadow 0.2s, transform 0.15s, background 0.2s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.55), 0 6px 32px rgba(59,130,246,0.42), 0 0 52px rgba(59,130,246,0.18);
  transform: translateY(-1px);
}
.btn-outline {
  display: inline-flex; align-items: center;
  padding: 10px 20px; font-size: 0.9rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 7px; text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: rgba(59,130,246,0.35); color: var(--text); }
.gh-stars {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.15); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.02em; color: #fde68a;
}
.hero-meta {
  font-family: 'JetBrains Mono', monospace; font-size: 0.77rem; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero-meta .sep { color: var(--dim); }

/* ── Screenshot ── */
.screenshot-section { position: relative; z-index: 1; padding-bottom: 56px; }
.screen-frame {
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 40px 100px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.03);
}
.screen-bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 16px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.screen-dot { width: 10px; height: 10px; border-radius: 50%; }
.screen-dot.red    { background: #ff5f57; }
.screen-dot.yellow { background: #febc2e; }
.screen-dot.green  { background: #28c840; }
.screen-label {
  margin-left: 8px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; color: var(--muted);
}
.screen-body { background: var(--bg2); }
.screen-body img { width: 100%; height: auto; display: block; cursor: pointer; }

/* Section dividers */
.oss-section, .features-section, .price-section,
.showcase-section, .tech-section, .deepdive-section, .cta-section {
  position: relative; z-index: 1; padding: 80px 0;
}
.oss-section::before, .features-section::before, .price-section::before,
.showcase-section::before, .tech-section::before, .deepdive-section::before,
.cta-section::before { content: none; }

/* ── OSS section ── */
.oss-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 64px; align-items: start;
}
.oss-sep { width: 1px; background: var(--border); align-self: stretch; }
.oss-title {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px;
}
.c-green { color: var(--green); }
.c-amber { color: var(--amber); }
.oss-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.oss-list li { font-size: 0.88rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.tag {
  font-family: 'JetBrains Mono', monospace; font-size: 0.63rem;
  padding: 2px 7px; border-radius: 4px; white-space: nowrap;
  background: rgba(245,158,11,0.09); border: 1px solid rgba(245,158,11,0.22); color: var(--amber);
}
.oss-note { font-size: 0.8rem; color: var(--muted); margin-top: 20px; line-height: 1.65; }

/* ── Features ── */
.section-h {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px;
}
.section-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0; margin-bottom: 44px; line-height: 1.6; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.feat-col h4 {
  font-family: 'JetBrains Mono', monospace; font-size: 0.67rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.feat-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.feat-col li {
  font-size: 0.865rem; color: var(--muted);
  padding-left: 16px; position: relative; line-height: 1.5;
  transition: color 0.15s;
}
.feat-col li:hover { color: var(--text); }
.feat-col li::before {
  content: '→'; position: absolute; left: 0;
  color: var(--blue); font-size: 0.72rem; top: 2px;
  transition: text-shadow 0.15s;
}
.feat-col li:hover::before { text-shadow: 0 0 8px rgba(74,133,245,0.9); }

/* ── Pricing ── */
.price-table-wrap { overflow-x: auto; margin-top: 44px; -webkit-overflow-scrolling: touch; }
.price-table { width: 100%; border-collapse: collapse; min-width: 360px; }
.price-table td {
  padding: 15px 20px; font-size: 0.9rem; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.price-table td:first-child { color: var(--text); }
.price-val { font-family: 'JetBrains Mono', monospace; font-size: 0.83rem; }
.strike { color: var(--dim); text-decoration: line-through; text-decoration-color: var(--red); }
.price-note-cell { font-size: 0.77rem; text-align: right; }
.red-note { color: #f87171; }
.price-highlight td { background: rgba(34,197,94,0.03); border-bottom-color: rgba(34,197,94,0.15); }
.price-highlight td:first-child { color: var(--text); font-weight: 600; }
.green-val { color: var(--green); font-weight: 600; }

/* ── Gallery / Showcase ── */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 44px; }
.gallery-item {
  position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
}
.gallery-item img {
  width: 100%; height: 100%; display: block; object-fit: cover; object-position: top left;
  cursor: pointer; transition: transform 0.35s ease; transform-origin: center center;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-label {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 14px;
  background: linear-gradient(transparent, rgba(7,8,15,0.94));
  font-family: 'JetBrains Mono', monospace; font-size: 0.73rem; color: var(--muted);
}

/* ── Technical ── */
.tech-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.tech-list { list-style: none; display: flex; flex-direction: column; gap: 28px; margin-top: 36px; }
.tech-list li { }
.tech-list li strong { display: block; font-size: 0.9rem; margin-bottom: 5px; color: var(--text); }
.tech-list li p { font-size: 0.83rem; color: var(--muted); line-height: 1.7; }
.code-block {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #050610;
}
.code-header {
  display: flex; align-items: center; gap: 6px; padding: 11px 16px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.cdot { width: 10px; height: 10px; border-radius: 50%; }
.cdot.red    { background: #ff5f57; }
.cdot.yellow { background: #febc2e; }
.cdot.green  { background: #28c840; }
.code-filename {
  margin-left: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.73rem; color: var(--muted);
}
.code-body { padding: 20px; overflow-x: auto; }
.code-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; line-height: 1.85; display: block;
}
.cm  { color: #3a5580; }
.kw  { color: #7c5ce8; }
.num { color: #f9e2af; }

/* ── Deep-dive cards ── */
.deepdive-section { text-align: center; }
.deepdive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.deepdive-card {
  background: rgba(255,255,255,0.018); border: 1px solid var(--border);
  border-radius: 10px; padding: 32px;
  transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
}
.deepdive-card:hover {
  border-color: rgba(74,133,245,0.30);
  background: rgba(255,255,255,0.028);
  box-shadow: 0 4px 32px rgba(74,133,245,0.08);
}
.dd-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.deepdive-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.deepdive-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.75; margin-bottom: 12px; }
.deepdive-card code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8em;
  color: var(--blue); background: rgba(59,130,246,0.08); padding: 1px 5px; border-radius: 3px;
}
.dd-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.dd-tags span {
  font-family: 'JetBrains Mono', monospace; font-size: 0.67rem;
  padding: 3px 9px; border-radius: 4px;
  background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.14); color: var(--blue);
}

/* ── Hero split + 3D logo ── */
.hero-split {
  display: flex;
  align-items: center;
  gap: 48px;
}
.hero-text {
  flex: 1 1 0;
  min-width: 0;
}
.hero-logo3d {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 340px;
}
.logo3d-scene {}
.logo3d-plane {}
.logo3d-img {
  width: 300px;
  max-width: 100%;
  display: block;
  opacity: 0.88;
  animation: logo3d 9s linear infinite;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.logo3d-glow {
  display: none;
  width: 340px;
  height: 160px;
  background: radial-gradient(ellipse at center, rgba(74,133,245,0.10) 0%, transparent 68%);
  pointer-events: none;
}
@media (max-width: 900px) {
  .hero-split { flex-direction: column; gap: 40px; }
  .hero-logo3d { width: 220px; order: -1; }
  .logo3d-img { width: 200px; }
}
@media (max-width: 600px) {
  .hero-logo3d { width: 160px; }
  .logo3d-img { width: 150px; }
}

/* ── Contributors ── */
.contrib-section {
  position: relative; z-index: 1; padding: 80px 0;
  text-align: center;
}
.contrib-section::before { content: none; }
.contrib-grid {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 44px;
  justify-content: center;
}
.contrib-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 28px;
  background: rgba(255,255,255,0.018); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  min-width: 160px;
}
.contrib-card:hover {
  border-color: rgba(74,133,245,0.35);
  background: rgba(74,133,245,0.04);
}
.contrib-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--border); object-fit: cover;
  filter: grayscale(0.1);
}
.contrib-avatar-hydra {
  background: #0a0a0a; padding: 4px; object-fit: contain; filter: none;
  border-color: rgba(180,30,30,0.45);
}
.contrib-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.contrib-roles {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.contrib-role {
  font-size: 0.68rem; color: var(--dim); text-align: center; line-height: 1.4;
}
.contrib-role .tag-blue {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 0.62rem;
  padding: 2px 7px; border-radius: 4px; margin: 2px 2px 0;
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.18); color: var(--blue);
}

/* ── Testimonial ── */
.testimonial-section {
  position: relative; z-index: 1; padding: 80px 0;
}
.testimonial-section::before { content: none; }
.link-muted { color: var(--blue); text-decoration: none; transition: color 0.15s; }
.link-muted:hover { color: var(--text); }
.video-wrap {
  margin: 40px auto 0;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.03);
  background: #000;
  max-width: 860px;
}
.video-wrap video {
  width: 100%; height: auto; display: block;
}

/* ── Lightbox ── */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.92); cursor: zoom-out;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: lbFadeIn 0.18s ease;
}
#lightbox.open { display: flex; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
#lightbox-img {
  max-width: min(92vw, 1280px); max-height: 88vh;
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.85);
  cursor: default;
}
#lightbox-close {
  position: fixed; top: 18px; right: 22px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 1.4rem; line-height: 1;
  width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#lightbox-close:hover { background: rgba(255,255,255,0.18); }

/* ── CTA ── */
.cta-section { text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta-logo {
  width: clamp(170px, 26vw, 310px);
  opacity: 0.82;
  margin-bottom: 8px;
  filter: brightness(1.55) contrast(1.12) saturate(1.05)
          drop-shadow(0 0 22px rgba(74,133,245,0.92))
          drop-shadow(0 0 44px rgba(74,133,245,0.50))
          drop-shadow(0 4px 10px rgba(0,0,0,0.65));
  animation: logo3d 9s linear infinite;
  will-change: transform;
}
/* Orbit: RIGHT → LEFT → TOP → BOTTOM → RIGHT.
   scale() linked to |rotateY|: face-on = 1.04, sideways = 0.96 (depth illusion).
   translateZ: face-on = +10px (closer), sideways = -10px (further).
   Per-keyframe ease-in-out: natural acceleration between each stop. */
@keyframes logo3d {
  0%   {
    transform: perspective(180px) rotateY(28deg)  rotateX(3deg)   rotateZ(2deg)    translateY(-5px)  translateZ(-10px) scale(0.96);
    animation-timing-function: ease-in-out;
  }
  12%  {
    transform: perspective(180px) rotateY(10deg)  rotateX(-2deg)  rotateZ(-1deg)   translateY(-11px) translateZ(3px)   scale(1.01);
    animation-timing-function: ease-in-out;
  }
  25%  {
    transform: perspective(180px) rotateY(-26deg) rotateX(2deg)   rotateZ(-2.5deg) translateY(-7px)  translateZ(-9px)  scale(0.97);
    animation-timing-function: ease-in-out;
  }
  37%  {
    transform: perspective(180px) rotateY(-14deg) rotateX(9deg)   rotateZ(1.5deg)  translateY(-2px)  translateZ(0px)   scale(1.00);
    animation-timing-function: ease-in-out;
  }
  50%  {
    transform: perspective(180px) rotateY(0deg)   rotateX(15deg)  rotateZ(-1deg)   translateY(-1px)  translateZ(10px)  scale(1.04);
    animation-timing-function: ease-in-out;
  }
  62%  {
    transform: perspective(180px) rotateY(8deg)   rotateX(4deg)   rotateZ(2.5deg)  translateY(-10px) translateZ(4px)   scale(1.02);
    animation-timing-function: ease-in-out;
  }
  75%  {
    transform: perspective(180px) rotateY(-2deg)  rotateX(-14deg) rotateZ(-2deg)   translateY(-17px) translateZ(9px)   scale(1.04);
    animation-timing-function: ease-in-out;
  }
  88%  {
    transform: perspective(180px) rotateY(18deg)  rotateX(-5deg)  rotateZ(1deg)    translateY(-12px) translateZ(-3px)  scale(0.99);
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: perspective(180px) rotateY(28deg)  rotateX(3deg)   rotateZ(2deg)    translateY(-5px)  translateZ(-10px) scale(0.96);
  }
}
.cta-section h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.cta-section > .container > p { color: var(--muted); font-size: 0.95rem; max-width: 420px; }
.legal { font-size: 0.73rem; color: var(--dim); max-width: 480px; line-height: 1.65; }

/* ── Footer ── */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-brand p { font-size: 0.8rem; color: var(--muted); margin-top: 7px; }
.footer-brand p a { color: var(--blue); text-decoration: none; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.82rem; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.footer-domain { font-family: 'JetBrains Mono', monospace; font-size: 0.77rem; color: var(--muted); }
.footer-copy { font-size: 0.73rem; color: var(--dim); }

/* ── Page-load intro ── */
#page-intro {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  pointer-events: none;
  animation: introFade 0.45s ease 0.78s forwards;
}
#page-intro::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, #2a62e8 25%, #7c5ce8 55%, #3b82f6 80%, transparent 100%);
  box-shadow: 0 0 14px rgba(74,133,245,0.8), 0 0 32px rgba(74,133,245,0.35);
  animation: scanLine 0.72s cubic-bezier(0.4, 0, 0.2, 1) 0.02s forwards;
}
@keyframes introFade { to { opacity: 0; } }
@keyframes scanLine  {
  from { transform: translateY(0);    opacity: 1; }
  85%  {                              opacity: 0.7; }
  to   { transform: translateY(100vh); opacity: 0; }
}

/* ── Pricing rows: override JS-injected stagger so rows appear together ── */
.price-table tr.reveal { transition-delay: 0ms !important; transition-duration: 0.3s; }

/* ── Entrance animations ── */
@keyframes enterBlur {
  from { opacity: 0; transform: translateY(18px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes enterSlide {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes enterNav {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes enterRight {
  from { opacity: 0; transform: translateX(44px); filter: blur(10px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

#nav            { animation: enterNav   0.45s ease 0.80s both; }
.hero .eyebrow       { animation: enterSlide 0.40s ease 0.90s both; }
.hero .hero-brand    { animation: enterBlur  0.65s cubic-bezier(0.2,0,0,1) 0.95s both; }
.hero .hero-brand-label { animation: enterSlide 0.40s ease 1.08s both; }
.hero .hero-lead     { animation: enterSlide 0.45s ease 1.15s both; }
.hero .hero-actions  { animation: enterSlide 0.40s ease 1.24s both; }
.hero .hero-meta     { animation: enterSlide 0.35s ease 1.32s both; }
.hero .hero-logo3d   { animation: enterRight 0.70s cubic-bezier(0.2,0,0,1) 1.00s both; }

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.38s ease, transform 0.38s ease; will-change: opacity, transform; }
.reveal.visible { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .container { padding: 0 28px; }
}

/* ── Hamburger ── */
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 5px; width: 34px; height: 34px; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--muted); border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav dropdown ── */
#mobile-nav {
  display: none; flex-direction: column;
  position: fixed; top: 58px; left: 0; right: 0; z-index: 99;
  background: rgba(7,8,15,0.97);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(59,130,246,0.12);
  padding: 6px 0 10px;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  display: block; padding: 12px 24px;
  font-size: 0.88rem; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: color 0.15s, background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
#mobile-nav a:last-child { border-bottom: none; }
#mobile-nav a:hover { color: var(--text); background: rgba(255,255,255,0.03); }

@media (max-width: 900px) {
  .container { padding: 0 22px; }
  .hamburger { display: flex; }
  .nav-links, #nav-links { display: none !important; }
  .oss-grid { grid-template-columns: 1fr; gap: 32px; }
  .oss-sep { display: none; }
  .feat-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .tech-layout { grid-template-columns: 1fr; gap: 36px; }
  .deepdive-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: center; gap: 20px; text-align: center; }
  .footer-right { align-items: center; }
  .footer-links { justify-content: center; }
  .code-block { max-width: 100%; overflow: visible; }
  .code-body { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .oss-section, .features-section, .price-section,
  .showcase-section, .tech-section, .deepdive-section,
  .testimonial-section, .contrib-section { padding: 56px 0; }
  .cta-section { padding: 64px 0; }
  .contrib-grid { gap: 14px; }
  .contrib-card { min-width: 140px; padding: 18px 20px; }
}

@media (max-width: 640px) {
  /* ── Lang menu: fixed so it can't be clipped by overflow-x: hidden ── */
  .lang-menu {
    position: fixed;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: calc(100vw - 32px);
    max-width: 420px;
    min-width: 0;
    max-height: 65vh;
    grid-template-columns: 1fr 1fr;
    border-radius: 10px;
  }
  .container { padding: 0 16px; }
  .nav-inner { justify-content: space-between; }
  .btn-gh { font-size: 0.78rem; padding: 6px 10px; }
  .hero { padding: 90px 0 48px; }
  .hero h1 { font-size: clamp(1.55rem, 7vw, 2.4rem); letter-spacing: -0.035em; }
  .hero-brand { font-size: clamp(2.8rem, 13vw, 5rem); letter-spacing: 0.04em; }
  .hero-lead { font-size: 0.93rem; }
  .hero-meta { font-size: 0.7rem; gap: 6px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-primary,
  .hero-actions .btn-outline { justify-content: center; width: 100%; }
  .feat-grid { grid-template-columns: 1fr; gap: 22px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gallery-item { aspect-ratio: 16 / 10; }
  .price-table td { padding: 10px 8px; font-size: 0.8rem; }
  .price-note-cell { display: none; }
  .price-table-wrap { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .deepdive-card { padding: 18px; }
  .deepdive-card h3 { font-size: 0.92rem; }
  .deepdive-card p { font-size: 0.83rem; }
  .screen-bar { padding: 9px 12px; }
  .screen-frame { box-shadow: 0 12px 32px rgba(0,0,0,0.55); border-radius: 8px; }
  .oss-section, .features-section, .price-section,
  .showcase-section, .tech-section, .deepdive-section,
  .testimonial-section, .contrib-section { padding: 44px 0; }
  .cta-section { padding: 52px 0; }
  .cta-section h2 { font-size: 1.7rem; }
  .footer-links { flex-wrap: wrap; gap: 14px; }
  .tech-list { gap: 18px; margin-top: 22px; }
  .tech-list li { }
  .tech-list li p { line-height: 1.60; }
  .deepdive-card p { line-height: 1.65; }
  .gallery { margin-top: 28px; }
  .contrib-grid { margin-top: 28px; }
  .code-body code { font-size: 0.7rem; }
  .code-body { padding: 14px; }
  .section-h { margin-bottom: 10px; }
  .section-sub { margin-bottom: 28px; }
  .screenshot-section { padding-bottom: 56px; }
  .oss-list li, .feat-col li { word-break: break-word; overflow-wrap: break-word; }
  /* contributors on small screens */
  .contrib-grid { gap: 10px; justify-content: center; }
  .contrib-card { min-width: 120px; max-width: 160px; padding: 16px 14px; gap: 9px; }
  .contrib-avatar { width: 50px; height: 50px; }
  .contrib-name { font-size: 0.82rem; }
  /* video */
  .video-wrap { border-radius: 7px; margin-top: 20px; }
}

@media (max-width: 420px) {
  .container { padding: 0 12px; }
  .hero { padding: 78px 0 32px; }
  .hero h1 { font-size: clamp(1.45rem, 8.5vw, 2rem); }
  .hero-brand { font-size: clamp(2.4rem, 15vw, 4rem); }
  .hero-lead { font-size: 0.86rem; }
  .eyebrow { font-size: 0.67rem; gap: 6px; }
  .btn-primary, .btn-outline { font-size: 0.84rem; padding: 10px 14px; }
  .deepdive-card { padding: 14px; }
  .oss-list li { font-size: 0.8rem; }
  .feat-col li { font-size: 0.8rem; }
  .feat-col h4 { font-size: 0.62rem; }
  .gallery { grid-template-columns: 1fr; gap: 10px; }
  .gallery-item { aspect-ratio: 16 / 9; }
  .footer-inner { gap: 18px; }
  .footer-links { gap: 10px; }
  .cta-section h2 { font-size: 1.45rem; }
  .cta-section p, .legal { font-size: 0.8rem; }
  .cta-section br { display: none; }
  .brand-sero, .brand-rat { font-size: 0.92rem; }
  .brand-icon { width: 16px; height: 16px; }
  .price-table { min-width: 0; width: 100%; }
  .price-table td:first-child { max-width: 120px; word-break: break-word; }
  .section-h { font-size: clamp(1.2rem, 5.5vw, 1.6rem); }
  .contrib-card { min-width: 100px; max-width: 140px; padding: 14px 10px; }
  .contrib-avatar { width: 44px; height: 44px; }
  .contrib-name { font-size: 0.78rem; }
  .contrib-role .tag-blue { font-size: 0.58rem; padding: 1px 5px; }
  .lang-menu { grid-template-columns: 1fr; }
}

/* ── Language switcher ─────────────────────────────────────────────────── */
.lang-wrap { position: relative; flex-shrink: 0; }

.lang-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.05em; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lang-btn:hover { background: rgba(255,255,255,0.09); color: var(--text); border-color: rgba(59,130,246,0.35); }
.lang-btn svg { flex-shrink: 0; opacity: 0.65; }
#lang-current { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; }

.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(10,11,20,0.97); border: 1px solid rgba(24,26,43,0.9);
  border-radius: 10px; padding: 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  min-width: 290px; max-height: 380px; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 300;
}
.lang-menu[hidden] { display: none; }

.lang-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.81rem; text-align: left;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap; width: 100%;
}
.lang-opt:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.lang-opt.active { color: var(--blue); }
.lang-flag { font-size: 1em; line-height: 1; flex-shrink: 0; }

/* ── Text readability ───────────────────────────────────────────────────── */
.section-h {
  text-shadow:
    0 0 40px rgba(7,8,15,1),
    0 2px 16px rgba(7,8,15,0.95),
    0 4px 32px rgba(7,8,15,0.80);
}
.section-sub {
  text-shadow:
    0 0 20px rgba(7,8,15,1),
    0 1px 10px rgba(7,8,15,0.90);
}
.hero-lead {
  text-shadow:
    0 0 16px rgba(7,8,15,0.95),
    0 1px 8px rgba(7,8,15,0.75);
}
.feat-col li, .tech-list li p, .tech-list strong {
  text-shadow: 0 1px 8px rgba(7,8,15,0.80);
}
.feat-col h4, .tech-list h4 {
  text-shadow: 0 0 20px rgba(7,8,15,0.95), 0 2px 8px rgba(7,8,15,0.75);
}

/* ── iPhone-specific fixes (≤390px — SE/12/13/14/15 standard) ──────────── */
@media (max-width: 390px) {
  /* Nav — tighter on iPhone */
  .btn-gh { padding: 6px 9px; font-size: 0.74rem; }
  .lang-btn { padding: 5px 7px; gap: 3px; font-size: 0.72rem; }
  #lang-current { display: none; }          /* globe icon only, no "EN" text */

  /* Hero */
  .hero { padding: 76px 0 28px; }
  .hero h1 { font-size: clamp(1.55rem, 9vw, 2.2rem); line-height: 1.10; }
  .hero-brand { font-size: clamp(2.2rem, 17vw, 3.6rem); letter-spacing: 0.03em; }
  .hero-lead { font-size: 0.84rem; margin-bottom: 24px; max-width: 100%; }
  .hero-meta { flex-wrap: wrap; column-gap: 6px; row-gap: 4px; }
  .hero-meta .sep { display: none; }

  /* Buttons — large touch targets */
  .btn-primary { padding: 13px 18px; font-size: 0.88rem; }
  .btn-outline  { padding: 12px 18px; font-size: 0.88rem; }

  /* Section headings */
  .section-h   { font-size: clamp(1.25rem, 7vw, 1.75rem); }
  .section-sub { font-size: 0.84rem; margin-bottom: 22px; }

  /* Code block — scrollable, not clipped */
  .code-block  { overflow: visible; }
  .code-body   { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: pre; }
  .code-body code { font-size: 0.62rem; }

  /* Inline code in prose — allow break */
  .deepdive-card code { word-break: break-all; }

  /* Price table edge-to-edge on tiny screen */
  .price-table-wrap { margin-left: -12px; margin-right: -12px; padding: 0 12px; }

  /* Deep dive cards */
  .deepdive-card { padding: 14px 12px; }
  .deepdive-card h3 { font-size: 0.88rem; }
  .deepdive-card p  { font-size: 0.79rem; }
  .dd-tags span     { font-size: 0.60rem; padding: 2px 7px; }

  /* Feature columns */
  .feat-col h4 { font-size: 0.60rem; }
  .feat-col li { font-size: 0.78rem; }

  /* Tech list */
  .tech-list li strong { font-size: 0.82rem; }
  .tech-list li p      { font-size: 0.78rem; }

  /* Contributors */
  .contrib-card  { min-width: 90px; max-width: 130px; padding: 12px 10px; }
  .contrib-avatar { width: 42px; height: 42px; }
  .contrib-name  { font-size: 0.76rem; }
  .contrib-role .tag-blue { font-size: 0.56rem; }

  /* CTA */
  .cta-section h2 { font-size: 1.4rem; line-height: 1.18; }
  .cta-section p  { font-size: 0.78rem; }
  .cta-logo { width: clamp(130px, 44vw, 190px); }

  /* Gallery — keep single col from 420px, tighten gap */
  .gallery { gap: 8px; }

  /* Price table */
  .price-table td { font-size: 0.76rem; padding: 9px 6px; }

  /* Footer compact */
  .footer-brand p  { font-size: 0.74rem; }
  .footer-links a  { font-size: 0.76rem; }
  .footer-domain, .footer-copy { font-size: 0.70rem; }
}

/* ── RTL support (Arabic) ──────────────────────────────────────────────── */
[dir=rtl] .hero-lead { }
[dir=rtl] .nav-right { margin-left: 0; margin-right: auto; }
[dir=rtl] .lang-menu { right: auto; left: 0; }
@media (max-width: 640px) {
  [dir=rtl] .lang-menu { left: 50%; transform: translateX(-50%); right: auto; }
}
