/* ═══════════════════════════════════════════════════════════════
   Sentinel Landing Pages — Shared Styles
   Used by: index.html, pricing.html, about.html, login.html
   Depends on: tokens.css (CSS custom properties)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Display Typography ─── */
.landing-display {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--fg-primary);
}

.landing-headline {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--fg-primary);
}

.landing-subhead {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.55;
  color: var(--fg-secondary);
  max-width: 600px;
}

/* Eyebrow label with leading dash */
.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-sm-size);
  color: var(--fg-muted);
  margin-bottom: 20px;
}
.landing-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--fg-disabled);
  flex-shrink: 0;
}

/* Muted second line of a headline */
.landing-headline-muted {
  color: var(--fg-tertiary);
}

/* Text-stroke outline effect */
.text-stroke {
  -webkit-text-stroke: 1.5px var(--fg-primary);
  -webkit-text-fill-color: transparent;
}

/* ─── Section containers ─── */
.landing-section {
  padding: 96px 0;
}
.landing-section-sm {
  padding: 64px 0;
}
.landing-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
.landing-container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

/* ─── Inverted section (How It Works, dark on light / light on dark) ─── */
.section-inverted {
  background: var(--fg-primary);
  color: var(--bg-0);
}
.section-inverted .landing-eyebrow {
  color: color-mix(in srgb, var(--bg-0) 50%, transparent);
}
.section-inverted .landing-eyebrow::before {
  background: color-mix(in srgb, var(--bg-0) 30%, transparent);
}
.section-inverted .landing-headline {
  color: var(--bg-0);
}
.section-inverted .landing-headline-muted {
  color: color-mix(in srgb, var(--bg-0) 50%, transparent);
}
/* Terminal theme: avoid amber bg inversion */
.theme-terminal .section-inverted {
  background: var(--bg-3);
  color: var(--fg-primary);
}
.theme-terminal .section-inverted .landing-eyebrow {
  color: var(--fg-muted);
}
.theme-terminal .section-inverted .landing-headline {
  color: var(--fg-primary);
}

/* Diagonal stripe background pattern */
.section-inverted-pattern {
  position: relative;
}
.section-inverted-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    currentColor 40px,
    currentColor 41px
  );
}

/* ─── Scroll Reveal Animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delay helpers (set via style attr: transition-delay) */

/* ─── Character Blur-In Animation ─── */
.char-in {
  display: inline-block;
  opacity: 0;
  filter: blur(30px);
  transform: translateY(80%);
  animation: sentinel-char-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sentinel-char-in {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* ─── Code Typing Animations ─── */
.code-line-reveal {
  opacity: 0;
  transform: translateX(-8px);
  animation: sentinel-line-reveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sentinel-line-reveal {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.code-char-reveal {
  opacity: 0;
  filter: blur(8px);
  animation: sentinel-char-reveal 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sentinel-char-reveal {
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ─── Marquee ─── */
.landing-marquee {
  display: flex;
  gap: 24px;
  animation: sentinel-marquee 35s linear infinite;
  white-space: nowrap;
}
.landing-marquee-reverse {
  display: flex;
  gap: 24px;
  animation: sentinel-marquee-reverse 30s linear infinite;
  white-space: nowrap;
}
@keyframes sentinel-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes sentinel-marquee-reverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* Marquee badge */
.marquee-badge {
  flex-shrink: 0;
  padding: 16px 28px;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm-size);
  color: var(--fg-tertiary);
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.marquee-badge:hover {
  border-color: var(--border-strong);
  background: var(--bg-2);
  color: var(--fg-secondary);
}

/* ─── Spotlight Box ─── */
.spotlight-box {
  position: relative;
  border: 1px solid var(--fg-primary);
  overflow: hidden;
}
.spotlight-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  transition: opacity 0.3s;
}
/* Corner decorations */
.spotlight-corner-tr {
  position: absolute;
  top: 0;
  right: 0;
  width: 128px;
  height: 128px;
  border-bottom: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  pointer-events: none;
}
.spotlight-corner-bl {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 128px;
  height: 128px;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  pointer-events: none;
}

/* ─── Animated Counters ─── */
.counter-value {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--fg-primary);
}

/* ─── Metrics Grid (1px gap-line trick) ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-subtle);
}
.metrics-cell {
  background: var(--bg-0);
  padding: clamp(24px, 4vw, 48px);
}

/* ─── Pricing Grid ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
}
.pricing-card {
  background: var(--bg-0);
  padding: 32px;
  position: relative;
}
.pricing-card--popular {
  border: 2px solid var(--accent);
  margin: -16px 0;
  padding: 48px 32px;
  z-index: 1;
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 32px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--text-2xs-size);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  font-weight: 500;
}
.pricing-price {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums slashed-zero;
  color: var(--fg-primary);
}
.pricing-price-unit {
  font-size: var(--text-md-size);
  font-weight: 400;
  color: var(--fg-muted);
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: var(--text-sm-size);
  color: var(--fg-secondary);
}
.pricing-features li::before {
  content: '✓';
  color: var(--fg-primary);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}
.pricing-features li.disabled {
  color: var(--fg-muted);
}
.pricing-features li.disabled::before {
  content: '—';
  color: var(--fg-disabled);
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.billing-toggle-label {
  font-size: var(--text-sm-size);
  color: var(--fg-muted);
  transition: color 0.2s;
}
.billing-toggle-label.active {
  color: var(--fg-primary);
}
.billing-toggle-track {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-3);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
  padding: 0;
}
.billing-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--fg-primary);
  border-radius: 50%;
  transition: transform 0.3s;
}
.billing-toggle-track.annual::after {
  transform: translateX(22px);
}
.billing-save {
  font-family: var(--font-mono);
  font-size: var(--text-2xs-size);
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
}

/* ─── Feature Rows (numbered) ─── */
.feature-row {
  display: flex;
  gap: 24px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}
.feature-row:last-child {
  border-bottom: none;
}
.feature-number {
  font-family: var(--font-mono);
  font-size: var(--text-sm-size);
  color: var(--fg-muted);
  flex-shrink: 0;
  width: 32px;
}
.feature-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.feature-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  margin-bottom: 8px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-row:hover .feature-title {
  transform: translateX(8px);
}
.feature-desc {
  font-size: var(--text-md-size);
  line-height: 1.6;
  color: var(--fg-tertiary);
}
.feature-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.feature-visual svg {
  width: 200px;
  height: 160px;
  color: var(--fg-tertiary);
}

/* ─── Pipeline Status Panel ─── */
.pipeline-panel {
  border: 1px solid var(--border-subtle);
}
.pipeline-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pipeline-header-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm-size);
  color: var(--fg-muted);
}
.pipeline-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs-size);
  color: var(--positive);
}
.pipeline-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
  animation: pipeline-pulse 2s ease-in-out infinite;
}
@keyframes pipeline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pipeline-row {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s;
}
.pipeline-row:last-child {
  border-bottom: none;
}
.pipeline-row.active {
  background: var(--bg-2);
}
.pipeline-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-disabled);
  transition: background 0.3s;
}
.pipeline-row.active .pipeline-dot {
  background: var(--positive);
}
.pipeline-row-name {
  font-weight: 500;
  color: var(--fg-primary);
  font-size: var(--text-sm-size);
}
.pipeline-row-cat {
  font-size: var(--text-xs-size);
  color: var(--fg-muted);
}
.pipeline-row-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs-size);
  color: var(--fg-muted);
}

/* ─── Code Window (How It Works) ─── */
.code-window {
  border: 1px solid color-mix(in srgb, var(--bg-0) 15%, transparent);
  overflow: hidden;
}
.code-window-header {
  padding: 16px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--bg-0) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.code-window-dots {
  display: flex;
  gap: 8px;
}
.code-window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg-0) 20%, transparent);
}
.code-window-file {
  font-family: var(--font-mono);
  font-size: var(--text-xs-size);
  color: color-mix(in srgb, var(--bg-0) 40%, transparent);
}
.code-window-body {
  padding: 32px;
  font-family: var(--font-mono);
  font-size: var(--text-sm-size);
  min-height: 260px;
  line-height: 2;
}
.code-window-body .line-num {
  color: color-mix(in srgb, var(--bg-0) 20%, transparent);
  user-select: none;
  display: inline-block;
  width: 24px;
  text-align: right;
  margin-right: 16px;
}
.code-window-footer {
  padding: 12px 24px;
  border-top: 1px solid color-mix(in srgb, var(--bg-0) 10%, transparent);
  display: flex;
  align-items: center;
  gap: 12px;
}
.code-window-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2FBF71;
  animation: pipeline-pulse 2s ease-in-out infinite;
}
.code-window-ready-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs-size);
  color: color-mix(in srgb, var(--bg-0) 40%, transparent);
}

/* Inverted code window overrides for terminal theme */
.theme-terminal .section-inverted .code-window {
  border-color: var(--border-subtle);
}

/* ─── Step Progress Bar (How It Works) ─── */
.step-progress {
  height: 1px;
  margin-top: 16px;
  background: color-mix(in srgb, var(--bg-0) 20%, transparent);
  overflow: hidden;
}
.step-progress-bar {
  height: 100%;
  background: var(--bg-0);
  width: 0;
  animation: sentinel-progress 5s linear forwards;
}
@keyframes sentinel-progress {
  from { width: 0; }
  to { width: 100%; }
}

/* How-it-works step buttons */
.hiw-step {
  width: 100%;
  text-align: left;
  padding: 32px 0;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--bg-0) 10%, transparent);
  background: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.5s;
  opacity: 0.4;
}
.hiw-step.active {
  opacity: 1;
}
.hiw-step:hover {
  opacity: 0.7;
}
.hiw-step.active:hover {
  opacity: 1;
}
.hiw-step-head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.hiw-step-num {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  opacity: 0.3;
  flex-shrink: 0;
}
.hiw-step-title {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 8px;
  transition: transform 0.3s;
}
.hiw-step:hover .hiw-step-title {
  transform: translateX(8px);
}
.hiw-step-desc {
  font-size: var(--text-md-size);
  line-height: 1.55;
  opacity: 0.6;
}

/* ─── Hero Grid Lines ─── */
.hero-grid-h {
  position: absolute;
  height: 1px;
  left: 0;
  right: 0;
  background: var(--fg-disabled);
  opacity: 0.12;
  pointer-events: none;
}
.hero-grid-v {
  position: absolute;
  width: 1px;
  top: 0;
  bottom: 0;
  background: var(--fg-disabled);
  opacity: 0.12;
  pointer-events: none;
}

/* ─── Noise Overlay ─── */
.noise-overlay {
  position: relative;
}
.noise-overlay::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ─── Methodology Cards (About page) ─── */
.method-card-v2 {
  border: 1px solid var(--border-subtle);
  padding: 24px;
  transition: border-color 0.3s;
}
.method-card-v2:hover {
  border-color: var(--border-strong);
}
.method-card-v2 .mc-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  transition: background 0.3s, color 0.3s;
}
.method-card-v2:hover .mc-icon {
  background: var(--fg-primary);
  color: var(--bg-0);
}

/* ─── Stats Bar ─── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-cell-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg-size);
  font-weight: 600;
  color: var(--fg-primary);
  font-variant-numeric: tabular-nums slashed-zero;
}
.stat-cell-label {
  font-size: var(--text-2xs-size);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  font-weight: 500;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  .char-in,
  .code-char-reveal,
  .code-line-reveal {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
  .landing-marquee,
  .landing-marquee-reverse {
    animation: none !important;
  }
  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .pipeline-status-dot,
  .code-window-ready-dot {
    animation: none !important;
  }
  .step-progress-bar {
    animation: none !important;
    width: 100% !important;
  }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-card--popular {
    margin: 0;
  }
  .feature-content {
    grid-template-columns: 1fr;
  }
  .feature-visual {
    display: none;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .landing-display {
    font-size: clamp(2.2rem, 12vw, 3.5rem);
  }
  .landing-section {
    padding: 64px 0;
  }
  .feature-row {
    padding: 32px 0;
  }
  .stats-bar {
    gap: 24px;
  }
}

/* ─── Utility: visually hidden ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
