/* ─────────────────────────────────────────────────────────────────────
 * Oplex Console — marketing site styles
 * ─────────────────────────────────────────────────────────────────────
 *
 * Animations, mesh gradients, and component classes that supplement
 * Tailwind utility usage in index.html. Kept loosely organised by the
 * section they belong to so it's easy to track down what styles what.
 */

/* ── globals ───────────────────────────────────────────────────────── */

html { font-feature-settings: 'cv11', 'ss01', 'ss03'; }
body { background: #05060c; }

::selection { background: #6366f1; color: #fff; }

/* Custom scrollbar — subtle, matches the rest of the dark theme */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ── ambient mesh gradient backdrop ────────────────────────────────── */
/*
 * Three blurred radial blobs drift slowly across the viewport. We
 * keep them fixed (cheap on scroll) and apply a subtle noise overlay
 * so the flat gradients don't feel like a phone wallpaper.
 */

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  will-change: transform;
}
.mesh-1 {
  width: 720px; height: 720px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -200px; left: -150px;
  animation: drift1 22s ease-in-out infinite;
}
.mesh-2 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  top: 30%; right: -180px;
  animation: drift2 26s ease-in-out infinite;
}
.mesh-3 {
  width: 580px; height: 580px;
  background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
  bottom: -180px; left: 30%;
  animation: drift3 30s ease-in-out infinite;
}

@keyframes drift1 {
  0%,100% { transform: translate(0, 0); }
  50%     { transform: translate(80px, 60px); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0, 0); }
  50%     { transform: translate(-90px, 80px); }
}
@keyframes drift3 {
  0%,100% { transform: translate(0, 0); }
  50%     { transform: translate(60px, -70px); }
}

.noise {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
}

/* ── shared headings ───────────────────────────────────────────────── */

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 14px;
}
.section-h {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-sub {
  margin-top: 18px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgb(148 163 184);
  max-width: 42rem;
}

/* ── hero ──────────────────────────────────────────────────────────── */

.net-glow {
  background: radial-gradient(circle at center, rgba(99,102,241,0.18) 0%, transparent 60%);
  filter: blur(8px);
}
.network-svg .net-line {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawLine 2.4s ease-out forwards;
}
.network-svg .net-line:nth-child(2) { animation-delay: 0.1s; }
.network-svg .net-line:nth-child(3) { animation-delay: 0.2s; }
.network-svg .net-line:nth-child(4) { animation-delay: 0.3s; }
.network-svg .net-line:nth-child(5) { animation-delay: 0.4s; }
.network-svg .net-line:nth-child(6) { animation-delay: 0.5s; }

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/*
 * Floating labels around the network diagram. The CSS custom prop
 * `--d` lets us stagger each card without writing an :nth-child rule
 * for every position. Cards bob softly in place using translateY.
 */
.floating-card {
  background: rgba(15, 21, 48, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  /* Two stacked animations: a one-shot fade-in (positioned by --d
   * so cards cascade) plus a perpetual bob. Shorthand chains them in
   * the same order so each line index refers to the matching anim. */
  animation:
    fadeIn 0.6s ease-out var(--d, 0s) forwards,
    bob    4s   ease-in-out var(--d, 0s) infinite;
}

@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── pillar cards ──────────────────────────────────────────────────── */

.pillar-card {
  position: relative;
  background: rgba(15, 21, 48, 0.55);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 32px;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
}
.pillar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(99,102,241,0.15), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.pillar-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.18);
}
.pillar-card:hover::before { opacity: 1; }

.pillar-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s ease;
}
.pillar-card:hover .pillar-icon { transform: rotate(-8deg) scale(1.05); }

.pillar-tick {
  position: relative;
  padding-left: 26px;
  color: rgb(203 213 225);
  font-size: 14px;
  line-height: 1.5;
}
.pillar-tick::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 14px; height: 7px;
  border-left: 2px solid #22d3ee;
  border-bottom: 2px solid #22d3ee;
  transform: rotate(-45deg);
}

/* ── capability cards ──────────────────────────────────────────────── */

.cap-card {
  background: rgba(15, 21, 48, 0.45);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 24px;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.cap-card h3 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-top: 14px;
}
.cap-card p {
  font-size: 14px;
  color: rgb(148 163 184);
  margin-top: 8px;
  line-height: 1.55;
}
.cap-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(15, 21, 48, 0.7);
}

/* ── step sections (alternating) ───────────────────────────────────── */

.step-num {
  display: inline-block;
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 4px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(129, 140, 248, 0.7);
}
.step-h {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 10px;
}
.step-p {
  margin-top: 16px;
  color: rgb(148 163 184);
  font-size: 16px;
  line-height: 1.65;
  max-width: 30rem;
}
.step-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step-list li {
  position: relative;
  padding-left: 28px;
  color: rgb(203 213 225);
  font-size: 14px;
}
.step-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}
.step-list li::after {
  content: "";
  position: absolute;
  left: 5px; top: 11px;
  width: 6px; height: 3px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg);
}

/* ── mock devices (terminal, device list, invoice, chart) ──────────── */

.mock {
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  position: relative;
}

/* terminal */
.terminal-mock { padding: 0; overflow: hidden; }
.mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: rgba(15, 21, 48, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mock-bar span { width: 11px; height: 11px; border-radius: 50%; background: #475569; }
.mock-bar span:nth-child(1) { background: #ef4444; }
.mock-bar span:nth-child(2) { background: #f59e0b; }
.mock-bar span:nth-child(3) { background: #10b981; }

.terminal-body {
  margin: 0;
  padding: 18px 22px 24px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  white-space: pre;
}
.term-prompt { color: #6366f1; font-weight: 700; }
.term-cmd    { color: #22d3ee; }
.term-out    { display: block; color: #94a3b8; }
.term-ok     { display: block; color: #10b981; font-weight: 700; }
.blink       { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* tenant-provisioning card (step 1 mock) */
/*
 * Replaces the old terminal `deploy.sh` mock. Tells the SaaS story:
 * a checklist of items we provision for the customer, animating in
 * sequence so the eye lands on "Tenant ready" as a finished state.
 */
.provision-mock { padding: 0; overflow: hidden; }
.provision-body { padding: 22px 24px 24px; }
.provision-head {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.provision-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 18px;
}
.provision-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.provision-pill::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16,185,129,0.8);
  animation: pulse-dot 2s ease-in-out infinite;
}

.provision-list { display: flex; flex-direction: column; gap: 10px; }
.provision-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  color: rgb(203 213 225);
  opacity: 0;
  transform: translateY(6px);
  animation: provisionIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
.provision-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
@keyframes provisionIn {
  to { opacity: 1; transform: translateY(0); }
}

.provision-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(34,211,238,0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  opacity: 0;
  animation: provisionIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 2s;
}
.provision-cta:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(34,211,238,0.25));
  transform: translateY(-1px);
}

/* device list */
.device-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
  font-size: 14px;
  transition: background 0.2s ease;
}
.device-row:hover { background: rgba(255,255,255,0.06); }
.device-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.device-dot.online {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16,185,129,0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}
.device-dot.warn {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245,158,11,0.6);
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 8px rgba(16,185,129,0.5); }
  50%     { box-shadow: 0 0 16px rgba(16,185,129,0.9); }
}

/* invoice */
.invoice-mock { padding: 0; overflow: hidden; }
.invoice-stripe { height: 8px; background: linear-gradient(90deg, #6366f1, #22d3ee); }
.invoice-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 24px 0;
}
.invoice-amount {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  text-align: right;
}
.invoice-mock .grid { padding: 0 24px; }
.invoice-table {
  margin: 18px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}
.invoice-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; padding: 8px 0;
  font-size: 13px; color: rgb(203 213 225);
}
.invoice-row span:last-child { color: #fff; font-weight: 600; }
.invoice-total {
  margin: 6px 24px 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between;
  font-family: 'Manrope', sans-serif;
  font-size: 15px; font-weight: 700;
}
.invoice-total span:last-child { color: #818cf8; }

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.status-issued { background: rgba(129,140,248,0.15); color: #a5b4fc; }

/* chart */
.chart-mock { padding: 20px; }
.chart-svg .chart-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawChart 2.6s ease-out 0.4s forwards;
}
.chart-svg .chart-area {
  opacity: 0;
  animation: fadeArea 1.4s ease-out 2.4s forwards;
}
@keyframes drawChart { to { stroke-dashoffset: 0; } }
@keyframes fadeArea  { to { opacity: 1; } }

/* ── stats ────────────────────────────────────────────────────────── */

.stat-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: 18px;
  background: rgba(15, 21, 48, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
}

/* ── integrations marquee ──────────────────────────────────────────── */

.marquee-wrap {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee 35s linear infinite;
}
.marquee:hover { animation-play-state: paused; }
.marquee-row {
  display: flex; align-items: center; gap: 20px;
  padding-right: 20px;
}
.logo-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(15, 21, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 500;
  color: rgb(203 213 225);
  white-space: nowrap;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.logo-chip:hover { border-color: rgba(99,102,241,0.5); background: rgba(15,21,48,0.9); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── reseller section ──────────────────────────────────────────────── */

.reseller-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(34,211,238,0.06) 50%, rgba(124,58,237,0.12) 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 28px;
  padding: 60px 50px;
}
@media (max-width: 768px) {
  .reseller-card { padding: 40px 28px; }
}
.reseller-shine {
  position: absolute;
  inset: -2px;
  border-radius: 28px;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(99,102,241,0.5) 90deg, transparent 180deg, rgba(34,211,238,0.5) 270deg, transparent 360deg);
  filter: blur(40px);
  opacity: 0.25;
  animation: spin 18s linear infinite;
  pointer-events: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.tenants-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tenant-tile {
  background: rgba(11, 16, 32, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  animation: tile-bob 5s ease-in-out infinite;
}
.tenant-tile:nth-child(2) { animation-delay: 1.2s; }
.tenant-tile:nth-child(3) { animation-delay: 0.6s; transform: translateY(20px); }
.tenant-tile:nth-child(4) { animation-delay: 1.8s; transform: translateY(20px); }
.tenant-tile:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(99,102,241,0.5);
}
@keyframes tile-bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
.tenant-tile:nth-child(3), .tenant-tile:nth-child(4) {
  animation-name: tile-bob-offset;
}
@keyframes tile-bob-offset {
  0%,100% { transform: translateY(20px); }
  50%     { transform: translateY(12px); }
}

.tenant-logo {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c1, #6366f1), var(--c2, #22d3ee));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 800; color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ── contact form ──────────────────────────────────────────────────── */

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgb(148 163 184);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 21, 48, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.form-input::placeholder { color: rgb(100 116 139); }
.form-input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(15, 21, 48, 0.9);
}

/* ── reveal on scroll ──────────────────────────────────────────────── */
/*
 * Every section with `data-reveal` starts hidden + translated and
 * gets `.is-visible` from the IntersectionObserver in script.js.
 * Stagger via `data-reveal-delay` (in ms) applied as transition delay
 * on a per-element basis.
 */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── reduced motion ────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
