/* ============================================================
   FLUXWORKS — design system
   Visual language borrowed from the Unity scene view:
   a graphite editor surface, a perspective grid floor,
   and the XYZ axis gizmo colors used functionally to
   encode product categories.
     X (red)   -> Controllers
     Y (green) -> Systems
     Z (blue)  -> Environments
   ============================================================ */

:root {
  --bg: #15181d;
  --bg-raised: #1c2026;
  --panel: #20252c;
  --line: #2c333d;
  --line-soft: #262c35;
  --text: #e9edf2;
  --text-muted: #98a2b0;
  --text-dim: #6b7585;

  --axis-x: #ff5c6a; /* controllers */
  --axis-y: #7fd96c; /* systems */
  --axis-z: #5ca8ff; /* environments */

  --font-display: "Chakra Petch", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 6px;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--axis-z);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- utility ---------- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(21, 24, 29, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-gizmo { width: 22px; height: 22px; }
.brand-gizmo line { stroke-width: 2; stroke-linecap: round; }
.brand-gizmo .axis-x { stroke: var(--axis-x); }
.brand-gizmo .axis-y { stroke: var(--axis-y); }
.brand-gizmo .axis-z { stroke: var(--axis-z); }
.brand-gizmo .gizmo-origin { fill: var(--text); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 7.5rem 1.5rem 6.5rem;
  border-bottom: 1px solid var(--line-soft);
}

/* the signature: a perspective grid floor, like Unity's scene view */
.hero-grid-floor {
  position: absolute;
  left: 50%;
  bottom: -12%;
  width: 220%;
  height: 70%;
  transform: translateX(-50%) perspective(420px) rotateX(62deg);
  transform-origin: center bottom;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.7), transparent 85%);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.7), transparent 85%);
  animation: grid-drift 14s linear infinite;
  pointer-events: none;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 56px, 0 56px; }
}

.hero-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--axis-y);
  margin-bottom: 1.1rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}

.hero-sub {
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 2.2rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.hero-legend {
  position: relative;
  max-width: var(--maxw);
  margin: 4.5rem auto 0;
  display: flex;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.hero-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }

.dot {
  width: 9px; height: 9px;
  border-radius: 2px;
  display: inline-block;
}
.dot-x { background: var(--axis-x); }
.dot-y { background: var(--axis-y); }
.dot-z { background: var(--axis-z); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #ffffff; }

.btn-buy {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.55rem 1.25rem;
}

/* ---------- sections ---------- */
.products, .license, .faq {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem 1.5rem 1rem;
}

.section-head { margin-bottom: 2.5rem; }

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}

.section-head p { color: var(--text-muted); max-width: 36rem; }

/* ---------- product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}

.noscript-note { color: var(--text-muted); }

/* card = inspector panel */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover { transform: translateY(-3px); }

/* category accent via axis colors */
.cat-x { --axis: var(--axis-x); }
.cat-y { --axis: var(--axis-y); }
.cat-z { --axis: var(--axis-z); }

.card:hover { border-color: var(--axis); }

.card .thumb {
  position: relative;
  aspect-ratio: 5 / 3;
  background: var(--panel);
  border-bottom: 2px solid var(--axis);
}

.card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.thumb-placeholder svg { width: 100%; height: 100%; }
.thumb-placeholder .wire path,
.thumb-placeholder .wire rect {
  fill: none;
  stroke: var(--axis);
  stroke-opacity: 0.45;
  stroke-width: 1.2;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.25rem 1.25rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.7rem;
}

.card-cat { color: var(--axis); }
.card-unity { color: var(--text-dim); }

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.card-tagline {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.card-features {
  list-style: none;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.card-features li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.card-features li::before {
  content: ">";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--axis);
}

.card-pipelines {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.pipe {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
}

.card-price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25rem;
}

.card .btn-buy:hover {
  background: var(--axis);
  border-color: var(--axis);
  color: var(--bg);
}

/* ---------- license ---------- */
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.license-item {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

.license-item h3 { margin-bottom: 0.6rem; }

.license-item p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- faq ---------- */
.faq { padding-bottom: 4rem; }

.faq-list details {
  border-bottom: 1px solid var(--line-soft);
}

.faq-list summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.faq-list details[open] summary::after {
  content: "−";
  color: var(--axis-y);
}

.faq-list details p {
  color: var(--text-muted);
  padding: 0 0 1.2rem;
  max-width: 44rem;
  font-size: 0.95rem;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text); }

/* ---------- thanks page ---------- */
.thanks-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.thanks-card { max-width: 30rem; }

.thanks-card .hero-eyebrow { margin-bottom: 0.8rem; }

.thanks-card h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.thanks-card p { color: var(--text-muted); margin-bottom: 1.8rem; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .site-nav { gap: 1rem; }
  .hero { padding: 5rem 1.25rem 4.5rem; }
  .hero-legend { margin-top: 3rem; }
  .products, .license, .faq { padding-top: 3.5rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-grid-floor { animation: none; }
  .card, .card:hover { transform: none; transition: none; }
}
