/* Selitia — enterprise data engineering. Dark, precise, layered. */

:root {
  --bg: #0a0d12;
  --bg-alt: #0e1219;
  --panel: #121722;
  --line: #1f2735;
  --ink: #e8edf5;
  --muted: #8a97ab;
  --faint: #566173;
  --violet: #8b7bff;
  --teal: #3ec8b4;
  --amber: #f0b64b;
  --slate: #7d93b2;
  --max: 1180px;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* The nav is sticky at 73px, so a bare fragment jump parks the target section's
   own kicker underneath it and the click reads as having gone nowhere. Reserve
   the header's height plus a little air. */
html { scroll-padding-top: 5.5rem; }

/* Scoped to :focus-within rather than declared on html outright. On html it
   also governs history-driven scroll restoration, so Back animated a ~5000px
   drift and a second Back mid-animation landed at an offset matching neither
   entry. This keeps the animation for clicked anchors and lets Back restore
   instantly. */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.08; font-weight: 640; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); }
h1 em { font-style: normal; color: var(--violet); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol, dl { margin: 0; padding: 0; }

.kicker {
  font: 650 0.72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.58rem 1.15rem; border-radius: 8px; font-weight: 600; font-size: 0.93rem;
  border: 1px solid transparent; transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--violet); color: #0d0930; }
.btn-solid:hover { background: #a294ff; }
.btn-line { background: transparent; border-color: #313d52; color: var(--ink); cursor: pointer; }
.btn-line:hover { border-color: var(--violet); }
.btn-lg { padding: 0.85rem 1.55rem; font-size: 1rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.6rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.4rem);
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.04rem; letter-spacing: -0.02em; }
.logo-mark { display: inline-grid; gap: 2px; }
.logo-mark i {
  display: block; width: 16px; height: 4px; border-radius: 2px;
}
.logo-mark i:nth-child(1) { background: var(--violet); }
.logo-mark i:nth-child(2) { background: var(--amber); width: 12px; }
.logo-mark i:nth-child(3) { background: var(--teal); width: 8px; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-login { color: var(--teal); font-weight: 600; font-size: 0.9rem; }
.nav-login:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.4rem) 2rem;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-copy { display: grid; gap: 1.3rem; justify-items: start; }
.lede { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.13rem); max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.3rem; }

.hero-proof { display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; margin-top: 1.1rem; }
.hero-proof dt { font: 650 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
.hero-proof dd { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--muted); }

/* isometric stack */
.hero-visual { min-width: 0; }
.stack { width: 100%; height: auto; overflow: visible; }
.layer { transition: transform 0.3s ease; }
.layer polygon { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.layer-tag {
  font: 600 13px var(--mono); fill: var(--muted);
  text-anchor: start;
}
.stack:hover .layer-4 { transform: translateY(-10px); }
.stack:hover .layer-3 { transform: translateY(-5px); }
.stack:hover .layer-1 { transform: translateY(6px); }

.beam { stroke: rgba(139, 123, 255, 0.25); stroke-width: 2; stroke-dasharray: 4 6; }
.packet { fill: var(--violet); opacity: 0; }
.p1 { animation: fall 3.2s linear infinite; }
.p2 { animation: fall 3.2s linear 1.1s infinite; fill: var(--teal); }
.p3 { animation: fall 3.2s linear 2.2s infinite; fill: var(--amber); }
@keyframes fall {
  0% { transform: translateY(20px); opacity: 0; }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(520px); opacity: 0; }
}

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding: 0.7rem 0; background: var(--bg-alt); }
.ticker-track {
  display: flex; gap: 1.6rem; width: max-content;
  animation: slide 36s linear infinite;
  font: 500 0.82rem var(--mono); color: var(--faint);
}
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2.4rem); }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: var(--max); margin: 0 auto 2.6rem; display: grid; gap: 0.9rem; }
.section-lede { color: var(--muted); max-width: 62ch; }

/* layers grid */
.layer-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1rem;
}
.layer-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem 1.4rem; display: grid; gap: 0.85rem; align-content: start;
  border-top: 3px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.layer-card:hover { transform: translateY(-4px); }
.accent-violet { border-top-color: var(--violet); }
.accent-amber { border-top-color: var(--amber); }
.accent-teal { border-top-color: var(--teal); }
.accent-slate { border-top-color: var(--slate); }
.layer-card header { display: flex; align-items: baseline; gap: 0.7rem; }
.index { font: 650 0.8rem var(--mono); color: var(--faint); }
.layer-card p { color: var(--muted); font-size: 0.93rem; }
.layer-card ul { display: grid; gap: 0.45rem; list-style: none; }
.layer-card li {
  position: relative; padding-left: 1.15rem; font-size: 0.88rem; color: #b6c1d1;
}
.layer-card li::before {
  content: ""; position: absolute; left: 0; top: 0.52em;
  width: 6px; height: 6px; border-radius: 2px; background: var(--faint);
}
.accent-violet li::before { background: var(--violet); }
.accent-amber li::before { background: var(--amber); }
.accent-teal li::before { background: var(--teal); }
.accent-slate li::before { background: var(--slate); }

/* services */
.svc-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem;
}
.svc {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.7rem 1.5rem; display: grid; gap: 0.9rem; align-content: start;
}
.svc.featured { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), 0 24px 60px rgba(139, 123, 255, 0.09); }
.svc-tag { font: 600 0.75rem var(--mono); color: var(--teal); text-transform: uppercase; letter-spacing: 0.1em; }
.svc p { color: var(--muted); font-size: 0.94rem; }
.svc-out { border-top: 1px dashed var(--line); padding-top: 0.85rem; font-size: 0.86rem !important; color: #b6c1d1 !important; }

/* monitoring split */
.split {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center;
}
.split-copy { display: grid; gap: 1.1rem; }
.split-copy > p { color: var(--muted); }
.ticks { display: grid; gap: 0.55rem; list-style: none; margin-top: 0.4rem; }
.ticks li { position: relative; padding-left: 1.4rem; font-size: 0.94rem; color: #b6c1d1; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--teal);
}
.ticks strong { color: var(--ink); font-weight: 640; }

/* console */
.console {
  background: #0b0f16; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
}
.console-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); background: #0e131c;
}
.console-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #26303f; }
.console-title { margin-left: 0.5rem; font-size: 0.74rem; color: var(--faint); }
.console-live { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: var(--teal); text-transform: uppercase; letter-spacing: 0.1em; }
.console-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.console-body { padding: 1rem; display: grid; gap: 0.9rem; }
.metric { display: grid; gap: 0.35rem; }
.metric-head { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--muted); }
.metric-val { color: var(--ink); font-weight: 600; }
.spark { width: 100%; height: 34px; }
.spark polyline { fill: none; stroke: var(--teal); stroke-width: 1.6; opacity: 0.9; }
.metric:nth-child(1) .spark polyline { stroke: var(--violet); }
.metric:nth-child(2) .spark polyline { stroke: var(--amber); }
.metric:nth-child(4) .spark polyline { stroke: var(--slate); }

.console-log {
  border-top: 1px solid var(--line); padding-top: 0.7rem;
  font-size: 0.72rem; line-height: 1.7; color: var(--faint);
  height: 5.2em; overflow: hidden;
}
.console-log .ok { color: var(--teal); }
.console-log .warn { color: var(--amber); }

/* method */
.method {
  max-width: var(--max); margin: 0 auto; counter-reset: step;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem;
  list-style: none;
}
.method li {
  counter-increment: step;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem 1.4rem; display: grid; gap: 0.7rem; align-content: start;
}
.method li::before {
  content: "0" counter(step);
  font: 650 0.8rem var(--mono); color: var(--violet);
}
.method p { color: var(--muted); font-size: 0.92rem; }

/* closer + footer */
/* overflow-x clip: the glow pseudo below overhangs its column; without this it
   widens the page on narrow viewports. clip (not hidden) so no scroll context. */
.closer { padding: clamp(4rem, 9vw, 6.5rem) clamp(1rem, 4vw, 2.4rem); overflow-x: clip; }
.closer-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.closer-copy { display: grid; gap: 1.1rem; justify-items: start; }
.closer-copy p:not(.kicker) { color: var(--muted); max-width: 52ch; }

.closer-viz { position: relative; min-width: 0; }
.closer-viz::before {
  content: ""; position: absolute; inset: -10%;
  background: radial-gradient(circle at 50% 45%, rgba(139, 123, 255, 0.13), transparent 62%);
  pointer-events: none;
}
#cube { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; display: block; margin: 0 auto; }
.viz-cap {
  text-align: center; margin-top: 0.5rem;
  font: 500 0.7rem var(--mono); color: var(--faint);
  letter-spacing: 0.14em; text-transform: uppercase;
}

.foot { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 2.4rem clamp(1rem, 4vw, 2.4rem) 1.6rem; }
.foot-grid { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.foot-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.foot-line { color: var(--faint); font-size: 0.85rem; max-width: 44ch; margin-top: 0.5rem; }
.foot-cols { display: grid; gap: 0.5rem; font-size: 0.88rem; color: var(--muted); align-content: start; }
.foot-cols a:hover { color: var(--ink); }
.fine { max-width: var(--max); margin: 1.8rem auto 0; color: #414b59; font-size: 0.74rem; }

/* responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .split { grid-template-columns: 1fr; }
  .closer-grid { grid-template-columns: 1fr; }
  /* Only the in-page section links collapse. .nav-login is a sibling of
     .nav-links now, so the single route into the portal survives on phones.
     margin-left:auto moves here with it, since it was .nav-links that pushed
     the right-hand group over and .nav-links is gone at this width. */
  .nav-links { display: none; }
  .nav-login { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  .packet, .ticker-track, .console-live i { animation: none; }
  .btn:hover, .layer-card:hover { transform: none; }
  .stack:hover .layer-1, .stack:hover .layer-3, .stack:hover .layer-4 { transform: none; }
}

/* logo */
img.logo-mark { display: block; width: 28px; height: auto; }
.foot-logo { display: block; width: 240px; height: auto; margin-bottom: 0.4rem; }
