/* AlertWeb tech experience — scroll chapters, automation, volumetric UI */

/* Scroll chapter rail */
.tech-rail {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  display: none;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.15);
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(10px);
}

@media (min-width: 1200px) {
  .tech-rail { display: flex; }
}

.tech-rail__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #334155;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.tech-rail__dot:hover {
  background: #64748b;
  transform: scale(1.15);
}

.tech-rail__dot.is-active {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  transform: scale(1.25);
}

/* Tech sections */
.tech-section {
  position: relative;
  isolation: isolate;
}

.tech-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(14, 165, 233, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 35% at 85% 100%, rgba(20, 184, 166, 0.06), transparent 50%);
}

.tech-section.is-chapter-active::before {
  opacity: 1;
}

.tech-section__grid-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent);
  pointer-events: none;
}

.tech-section__chapter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #38bdf8;
}

.tech-section__chapter::before {
  content: '';
  width: 24px;
  height: 1px;
  background: linear-gradient(90deg, #38bdf8, transparent);
}

/* Automation mega-block */
.auto-mega {
  padding: 4rem 0;
  background:
    linear-gradient(180deg, #dbeafe 0%, #eff6ff 35%, #f0f9ff 70%, transparent 100%);
  border-block: 1px solid color-mix(in srgb, var(--aw-from) 12%, var(--aw-border));
}

.landing:not(.landing-sub) .auto-mega {
  background:
    linear-gradient(180deg, rgba(12, 74, 110, 0.18) 0%, rgba(15, 23, 42, 0.08) 45%, transparent 100%);
  border-block-color: rgba(56, 189, 248, 0.12);
}

.auto-mega__head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.auto-mega__head h2 {
  margin: 0.5rem 0 0.75rem;
  font-family: var(--font-display, Inter, system-ui, sans-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--aw-text);
}

.auto-mega__head p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--aw-muted);
}

.auto-mega__head .label {
  display: inline-block;
  margin-top: 0.35rem;
}

.auto-pipeline {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 2rem;
}

.auto-pipeline__step {
  position: relative;
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: 1.2rem;
  border: 1px solid var(--aw-border);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.auto-pipeline__step::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--step-accent, #38bdf8), transparent);
  opacity: 0.6;
}

.auto-pipeline__step:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--step-accent, #38bdf8) 35%, var(--aw-border));
  box-shadow: 0 20px 48px color-mix(in srgb, var(--step-accent, #38bdf8) 15%, transparent);
}

.auto-pipeline__step.is-running {
  border-color: color-mix(in srgb, var(--step-accent, #38bdf8) 50%, var(--aw-border));
}

.auto-pipeline__step.is-running .auto-pipeline__status {
  color: #4ade80;
}

.auto-pipeline__step.is-running .auto-pipeline__status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: tech-pulse 1.8s ease-in-out infinite;
}

.auto-pipeline__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--step-accent, #0ea5e9), color-mix(in srgb, var(--step-accent, #0ea5e9) 60%, #020617));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--step-accent, #0ea5e9) 35%, transparent);
}

.auto-pipeline__step h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, Inter, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.auto-pipeline__step p {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #94a3b8;
}

.auto-pipeline__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.auto-pipeline__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
}

.auto-pipeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0;
  list-style: none;
}

.auto-pipeline__tags li {
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.15);
}

/* Live terminal block */
.tech-terminal {
  border-radius: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: #020617;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.tech-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: #64748b;
}

.tech-terminal__bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #334155;
}

.tech-terminal__bar span:nth-child(1) { background: #ef4444; }
.tech-terminal__bar span:nth-child(2) { background: #fbbf24; }
.tech-terminal__bar span:nth-child(3) { background: #22c55e; }

.tech-terminal__body {
  margin: 0;
  padding: 1rem 1.1rem;
  font-size: 0.78rem;
  line-height: 1.65;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: #94a3b8;
  min-height: 7.5rem;
}

.tech-terminal__body .t-cmd { color: #e2e8f0; }
.tech-terminal__body .t-ok { color: #4ade80; }
.tech-terminal__body .t-dim { color: #475569; }
.tech-terminal__body .t-accent { color: #38bdf8; }
.tech-terminal__body .t-warn { color: #fbbf24; }

.tech-terminal__cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: #38bdf8;
  animation: tech-blink 1s step-end infinite;
}

@keyframes tech-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes tech-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Tech metric strip */
.tech-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 1.5rem 0 0;
}

.tech-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--aw-from) 20%, var(--aw-border));
  background: var(--aw-surface);
  box-shadow: var(--aw-shadow, 0 8px 24px rgba(2, 132, 199, 0.08));
  transition: transform 0.2s, border-color 0.2s;
}

.tech-metric:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.tech-metric__value {
  font-family: var(--font-display, Inter, system-ui, sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--aw-from);
  font-variant-numeric: tabular-nums;
}

.tech-metric__label {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--aw-muted);
  text-align: center;
}

/* Tech cards grid (injected / reusable) */
.tech-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tech-card {
  position: relative;
  padding: 1.35rem;
  border-radius: 1.15rem;
  border: 1px solid var(--aw-border);
  background: linear-gradient(155deg, var(--aw-surface), color-mix(in srgb, var(--aw-surface) 85%, #0ea5e9 15%));
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--card-accent, #38bdf8) 25%, transparent), transparent 70%);
  pointer-events: none;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--card-accent, #38bdf8) 12%, transparent);
}

.tech-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.tech-card__badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.tech-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--aw-text);
}

.tech-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--aw-muted);
}

/* Stagger reveal */
.tech-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tech-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.tech-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.tech-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.tech-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.tech-stagger.is-visible > *:nth-child(4) { transition-delay: 0.2s; }
.tech-stagger.is-visible > *:nth-child(5) { transition-delay: 0.25s; }
.tech-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; }
.tech-stagger.is-visible > *:nth-child(7) { transition-delay: 0.35s; }
.tech-stagger.is-visible > *:nth-child(8) { transition-delay: 0.4s; }

/* Enhanced reveal slide variants */
.reveal.reveal--left {
  transform: translateX(-32px);
}

.reveal.reveal--right {
  transform: translateX(32px);
}

.reveal.reveal--scale {
  transform: scale(0.96);
}

.reveal.reveal--left.is-visible,
.reveal.reveal--right.is-visible,
.reveal.reveal--scale.is-visible {
  transform: none;
}

/* Bento / feature tech upgrade */
.bento-card,
.feature-card-v2,
.capability-card {
  position: relative;
}

.landing.tech-enhanced .bento-card__icon,
.landing.tech-enhanced .feature-card-v2__icon,
.landing.tech-enhanced .capability-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  font-size: 1.15rem;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.2), rgba(2, 6, 23, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px rgba(14, 165, 233, 0.15);
}

/* Scan line on active chapter */
.tech-section.is-chapter-active .tech-section__scan {
  opacity: 1;
}

.tech-section__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  top: 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.5), transparent);
  opacity: 0;
  animation: tech-scan 3s linear infinite;
  pointer-events: none;
}

@keyframes tech-scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.auto-mega__layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .auto-mega__layout {
    grid-template-columns: 1.35fr 0.65fr;
    align-items: stretch;
  }

  .auto-mega__layout .tech-terminal {
    min-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-rail__dot,
  .auto-pipeline__step,
  .tech-card,
  .tech-metric,
  .tech-stagger > * {
    transition: none;
  }
  .tech-section__scan,
  .auto-pipeline__step.is-running .auto-pipeline__status-dot,
  .tech-terminal__cursor {
    animation: none;
  }
}
