/* ============================================================
   Wiltro// — Data & Analytics
   Modern dark theme + glitch aesthetic
   ============================================================ */

:root {
  --bg: #060810;
  --bg-alt: #0a0e1a;
  --surface: #0e1322;
  --line: rgba(139, 160, 220, 0.14);
  --text: #e8ecf6;
  --text-dim: #96a0b8;
  --accent: #00f0b5;      /* neon mint */
  --accent-2: #7c5cff;    /* electric violet */
  --glitch-r: #ff2e63;    /* glitch red channel */
  --glitch-c: #08f7fe;    /* glitch cyan channel */
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --nav-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.container { width: min(1160px, 92%); margin-inline: auto; }

::selection { background: var(--accent); color: #04231a; }

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

#data-field {
  position: fixed;
  inset: 0;
  z-index: -3;
  display: block;
}

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

@keyframes noise-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.12) 51%
  );
  background-size: 100% 4px;
  opacity: 0.35;
}

/* ---------- Glitch text effect ---------- */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--glitch-r);
  z-index: -1;
  animation: glitch-r 3.5s infinite steps(1);
}

.glitch::after {
  color: var(--glitch-c);
  z-index: -2;
  animation: glitch-c 3.5s infinite steps(1);
}

@keyframes glitch-r {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: none; }
  92% { opacity: 0.85; transform: translate(-3px, 1px); clip-path: inset(15% 0 60% 0); }
  93% { opacity: 0.85; transform: translate(4px, -2px);  clip-path: inset(60% 0 10% 0); }
  94% { opacity: 0.85; transform: translate(-2px, 0);    clip-path: inset(35% 0 40% 0); }
  95% { opacity: 0; }
}

@keyframes glitch-c {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: none; }
  92% { opacity: 0.85; transform: translate(3px, -1px);  clip-path: inset(50% 0 20% 0); }
  93% { opacity: 0.85; transform: translate(-4px, 2px);  clip-path: inset(10% 0 70% 0); }
  94% { opacity: 0.85; transform: translate(2px, 1px);   clip-path: inset(70% 0 5% 0); }
  95% { opacity: 0; }
}

/* Hover-triggered glitch (nav logo, buttons) */
.glitch-hover { position: relative; }

.glitch-hover:hover {
  animation: micro-shake 0.25s linear;
  text-shadow:
    2px 0 var(--glitch-r),
   -2px 0 var(--glitch-c);
}

@keyframes micro-shake {
  0%   { transform: translate(0); }
  20%  { transform: translate(-2px, 1px); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, -1px); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(6, 8, 16, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav.scrolled {
  background: rgba(6, 8, 16, 0.85);
  border-bottom-color: var(--line);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav__logo-sub {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

@media (max-width: 480px) {
  .nav__logo-sub { display: none; }
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}

.nav__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav__cta {
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent) !important;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav__cta:hover {
  background: var(--accent);
  color: #04231a !important;
  box-shadow: 0 0 24px rgba(0, 240, 181, 0.45);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav__burger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

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

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-h) + 4rem);
  position: relative;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4rem;
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.hero__title {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}

/* The sizer reserves space for the longest phrase so the
   scrambling text never changes the line's height/width and
   the content below stays put. */
.hero__scramble-wrap {
  position: relative;
  display: block;
  overflow: hidden;
}

.hero__scramble-sizer {
  display: inline-block;
  visibility: hidden;
}

.hero__scramble {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-shadow: 0 0 32px rgba(0, 240, 181, 0.35);
}

.hero__sub {
  color: var(--text-dim);
  font-size: 1.12rem;
  max-width: 34rem;
  margin-bottom: 2.4rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.9rem 1.9rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn--primary {
  background: var(--accent);
  color: #04231a;
  box-shadow: 0 0 0 rgba(0, 240, 181, 0);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 240, 181, 0.4);
}

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.btn--ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
}

.btn--big {
  font-size: 1.15rem;
  padding: 1.1rem 2.4rem;
  font-family: var(--font-mono);
}

/* Terminal */

.terminal {
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 48px rgba(124, 92, 255, 0.08);
  backdrop-filter: blur(8px);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.terminal__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a4258;
}

.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #febc2e; }
.terminal__dot:nth-child(3) { background: #28c840; }

.terminal__title {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.terminal__body {
  padding: 1.2rem 1.4rem;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--accent);
  min-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal__body .dim { color: var(--text-dim); }

.cursor-block {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Marquee */

.hero__marquee {
  margin-top: auto;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: rgba(10, 14, 26, 0.5);
}

.marquee {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */

.section { padding: 7.5rem 0; position: relative; }

.section--alt {
  background:
    linear-gradient(180deg, rgba(124, 92, 255, 0.05), transparent 40%),
    rgba(10, 14, 26, 0.45);
  border-block: 1px solid var(--line);
}

.section__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
}

.section__title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3.2rem;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.4rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s, box-shadow 0.25s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 240, 181, 0.07), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 181, 0.4);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.card:hover::before { opacity: 1; }

.card__num {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.18em;
}

.card__icon {
  font-size: 1.9rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
  line-height: 1;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.3rem;
}

.card p em { color: var(--text); font-style: normal; font-weight: 600; }

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
}

.card__tags li {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(0, 240, 181, 0.05);
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2.4rem;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.step__num {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.step h3 {
  margin: 0.6rem 0 0.5rem;
  font-size: 1.2rem;
}

.step p {
  color: var(--text-dim);
  font-size: 0.93rem;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.4rem;
  margin-bottom: 4.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  text-align: center;
  transition: border-color 0.25s;
}

.stat:hover { border-color: rgba(124, 92, 255, 0.5); }

.stat__value {
  display: block;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(0, 240, 181, 0.35);
  margin-bottom: 0.5rem;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.quote {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.quote p {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

.quote cite {
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

/* Contact */

.section--contact {
  text-align: center;
  padding: 9rem 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 60%, rgba(0, 240, 181, 0.07), transparent),
    radial-gradient(ellipse 45% 40% at 50% 30%, rgba(124, 92, 255, 0.08), transparent);
}

.contact__title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

.contact__sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0 auto 2.6rem;
}

.contact__actions { margin-bottom: 2.2rem; }

.contact__meta {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  background: rgba(6, 8, 16, 0.8);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.footer__blink {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger siblings */
.cards .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: 0.1s; }
.cards .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: 0.2s; }
.cards .reveal:nth-child(4), .steps .reveal:nth-child(4) { transition-delay: 0.3s; }

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

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero__terminal { max-width: 560px; }

  .nav__links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.6rem;
    background: rgba(6, 8, 16, 0.97);
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 2rem 2.4rem 2.4rem;
    transform: translateX(110%);
    transition: transform 0.3s ease;
  }

  .nav__links.open { transform: none; }

  .nav__burger { display: flex; }

  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 5rem 0; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .glitch::before,
  .glitch::after,
  .noise-overlay,
  .marquee,
  .status-dot,
  .footer__blink,
  .cursor-block { animation: none !important; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
