/* ============================================================
   matrAIx.ai — simulation console aesthetic
   Phosphor-green instrument readout on near-black.
   ============================================================ */

:root {
  --bg:        #060807;
  --bg-2:      #0a0e0c;
  --ink:       #d6e6d8;      /* primary text */
  --ink-dim:   #6f8273;      /* muted text */
  --phos:      #54f6a6;      /* phosphor green */
  --phos-deep: #1f7e58;
  --amber:     #ffb547;      /* warning accent */
  --rose:      #ff5c6c;      /* fail accent */
  --line:      rgba(84, 246, 166, 0.16);
  --line-soft: rgba(84, 246, 166, 0.07);
  --glow:      0 0 22px rgba(84, 246, 166, 0.45);

  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Syne", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ---------- Background layers ---------- */

#sim {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(4) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-4%, 3%); }
  50% { transform: translate(3%, -4%); }
  75% { transform: translate(-2%, -2%); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.16) 3px,
    rgba(0,0,0,0) 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 35%, transparent 45%, rgba(0,0,0,0.78) 100%);
}

/* ---------- Header ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(6,8,7,0.85), rgba(6,8,7,0));
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  color: var(--phos);
  font-size: 20px;
  text-shadow: var(--glow);
  animation: flick 4s infinite;
}
.brand-name {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-name em { color: var(--phos); font-style: normal; text-shadow: var(--glow); }
.brand-name .tld { color: var(--ink-dim); font-weight: 600; }
.brand-name.small { font-size: 16px; }

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--ink-dim);
  text-decoration: none;
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--phos);
  box-shadow: var(--glow);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--phos); }
.nav-links a:hover::after { width: 100%; }

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.btn-ghost:hover {
  border-color: var(--phos);
  color: var(--phos);
  box-shadow: inset 0 0 18px rgba(84,246,166,0.08), 0 0 14px rgba(84,246,166,0.12);
}
.btn-solid {
  background: var(--phos);
  color: #04140c;
  border-color: var(--phos);
  font-weight: 700;
  box-shadow: 0 0 26px rgba(84,246,166,0.32);
}
.btn-solid:hover {
  background: #76ffbf;
  box-shadow: 0 0 40px rgba(84,246,166,0.55);
  transform: translateY(-2px);
}
.btn-lg { padding: 18px 34px; font-size: 15px; }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(5px); }
.nav-cta { padding: 9px 16px; }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-dim);
  display: inline-block;
}
.dot.live {
  background: var(--phos);
  box-shadow: var(--glow);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- Hero ---------- */

main { position: relative; z-index: 10; }

.hero {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 160px 32px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  opacity: 0;
  animation: rise 0.7s 0.1s forwards;
}
.hero-eyebrow .tick { color: var(--phos); }
.hero-eyebrow .ver {
  color: var(--amber);
  border: 1px solid rgba(255,181,71,0.3);
  padding: 1px 7px;
}
.hero-eyebrow .sep { color: var(--line); }
.hero-eyebrow .status { display: inline-flex; align-items: center; gap: 7px; color: var(--phos); }

.headline {
  font-family: var(--disp);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: 34px;
}
.headline .line-1,
.headline .line-2 {
  display: block;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  color: var(--ink);
}
.headline .line-2 { color: var(--ink-dim); }
.headline .colon { color: var(--phos); text-shadow: var(--glow); }

.megacount {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}
.megacount .count {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(3rem, 13vw, 10.5rem);
  line-height: 0.85;
  color: var(--phos);
  text-shadow: 0 0 38px rgba(84,246,166,0.4);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.megacount .count-unit {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.headline .line-3 {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(0.95rem, 2.2vw, 1.5rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-top: 14px;
  border-left: 3px solid var(--phos);
  padding-left: 16px;
}

/* stagger headline lines */
.headline span { opacity: 0; animation: rise 0.8s forwards; }
.headline .line-1   { animation-delay: 0.18s; }
.headline .line-2   { animation-delay: 0.28s; }
.headline .megacount { animation-delay: 0.40s; }
.headline .line-3   { animation-delay: 0.58s; }

.subhead {
  max-width: 600px;
  font-size: 16px;
  color: var(--ink-dim);
  line-height: 1.75;
  margin-bottom: 38px;
  opacity: 0;
  animation: rise 0.8s 0.7s forwards;
}
.subhead em { color: var(--ink); font-style: italic; }

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
  opacity: 0;
  animation: rise 0.8s 0.85s forwards;
}

.telemetry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: rgba(10,14,12,0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: rise 0.9s 1s forwards;
}
.tele-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tele-cell:last-child { border-right: none; }
.tele-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.tele-val {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 700;
  color: var(--phos);
  text-shadow: 0 0 14px rgba(84,246,166,0.3);
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flick {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.3; }
  98% { opacity: 1; }
  99% { opacity: 0.5; }
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 90px 32px;
  border-top: 1px solid var(--line-soft);
}
.panel-head { margin-bottom: 44px; max-width: 640px; }
.panel-head .idx {
  font-size: 12px;
  color: var(--phos);
  letter-spacing: 0.2em;
}
.panel-head h2 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 10px 0 12px;
  line-height: 1.05;
}
.panel-head p { color: var(--ink-dim); font-size: 15px; }

/* Behavior grid */
.behavior-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
  gap: 4px;
  margin-bottom: 28px;
}
.cell {
  aspect-ratio: 1;
  background: rgba(84,246,166,0.05);
  border: 1px solid var(--line-soft);
  transition: background 0.5s, box-shadow 0.5s;
}
.cell.pass  { background: var(--phos);  box-shadow: 0 0 8px rgba(84,246,166,0.6); }
.cell.watch { background: var(--amber); box-shadow: 0 0 8px rgba(255,181,71,0.5); }
.cell.fail  { background: var(--rose);  box-shadow: 0 0 8px rgba(255,92,108,0.5); }

.legend {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 11px; height: 11px; display: inline-block; }
.sw-pass  { background: var(--phos); }
.sw-watch { background: var(--amber); }
.sw-fail  { background: var(--rose); }
.sw-idle  { background: rgba(84,246,166,0.12); border: 1px solid var(--line); }

/* Eval cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.card {
  background: var(--bg-2);
  padding: 34px 28px;
  transition: background 0.3s, transform 0.3s;
}
.card:hover { background: #0d1411; transform: translateY(-4px); }
.card-no { color: var(--phos); font-size: 13px; letter-spacing: 0.1em; }
.card h3 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 14px 0 12px;
}
.card p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.7; }

/* ---------- Closing ---------- */

.closing {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 32px 130px;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.closing h2 {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 40px;
}
.closing h2 span { color: var(--phos); text-shadow: var(--glow); font-style: italic; }

/* ---------- Footer ---------- */

.foot {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 32px;
  border-top: 1px solid var(--line);
  background: rgba(6,8,7,0.7);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.foot-meta { color: var(--ink-dim); text-transform: uppercase; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .nav-links { display: none; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .tele-cell:nth-child(2) { border-right: none; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nav { padding: 14px 18px; }
  .hero { padding: 130px 18px 60px; }
  .panel, .closing { padding-left: 18px; padding-right: 18px; }
  .telemetry { grid-template-columns: 1fr; }
  .tele-cell { border-right: none; border-bottom: 1px solid var(--line-soft); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-eyebrow, .headline span, .subhead, .cta-row, .telemetry { opacity: 1; }
}
