/* ═══════════════════════════════════════════════
   Schematic Layer  -  Grid Paper & Blueprint Effects
   The signature Elevator Blueprint visual identity
   ═══════════════════════════════════════════════ */

/* ── Grid Paper Background (applied to body via ::before) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.045;
  background-image:
    /* Minor grid lines (20px spacing) */
    linear-gradient(rgba(45,122,232,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,122,232,0.12) 1px, transparent 1px),
    /* Major grid lines (every 100px) */
    linear-gradient(rgba(45,122,232,0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,122,232,0.25) 1px, transparent 1px);
  background-size:
    20px 20px,
    20px 20px,
    100px 100px,
    100px 100px;
  /* Subtle drift animation for technical blueprint feel */
  animation: blueprint-grid-drift 60s linear infinite;
}

@keyframes blueprint-grid-drift {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 100px 50px, 100px 50px, 100px 50px, 100px 50px;
  }
}

/* Disable animation on mobile for performance */
@media (max-width: 768px) {
  body::before {
    animation: none;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

/* Legacy class kept for backward compatibility */
.schematic-grid {
  display: none;
}

/* ── Film Grain Overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Section Notation Labels (engineering style) ── */
.section-notation {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.section-notation::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent-line);
}

.section-notation .notation-num {
  color: var(--accent);
  font-weight: 600;
}

/* ── Dimension Line (horizontal divider with label) ── */
.dimension-line {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 var(--space-sm) 0;
}

.dimension-line::before,
.dimension-line::after {
  content: '';
  flex: 1;
  height: 1px;
}

.dimension-line::before {
  background: linear-gradient(90deg, transparent, var(--accent));
}

.dimension-line::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ── Schematic Decoration: Crosshair / Registration Mark ── */
.crosshair {
  position: relative;
  width: 24px;
  height: 24px;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: var(--accent-line);
}

.crosshair::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-0.5px);
}

.crosshair::after {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-0.5px);
}

/* ── Elevator Shaft SVG Schematic (hero background) ── */
.hero-schematic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero-schematic svg {
  width: 500px;
  height: 700px;
  opacity: 0.035;
  stroke: var(--accent);
  stroke-width: 0.5;
  fill: none;
}

/* Animate the elevator car (group with class="schematic-car") */
.hero-schematic .schematic-car {
  animation: schematic-car-drift 8s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes schematic-car-drift {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(40px);
  }
}

/* Animate the counterweight (opposite direction for realism) */
.hero-schematic .schematic-counterweight {
  animation: schematic-counterweight-drift 8s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes schematic-counterweight-drift {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-40px);
  }
}

/* Animate the cables connecting to car/counterweight */
.hero-schematic .schematic-cable-car {
  animation: schematic-cable-car-stretch 8s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes schematic-cable-car-stretch {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.15);
  }
}

.hero-schematic .schematic-cable-counterweight {
  animation: schematic-cable-cw-stretch 8s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes schematic-cable-cw-stretch {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.85);
  }
}

/* Animate the elevator doors  -  open when car is at floor, close when moving */
.hero-schematic .schematic-door-left {
  animation: schematic-door-left 8s ease-in-out infinite;
  transform-origin: left center;
}

.hero-schematic .schematic-door-right {
  animation: schematic-door-right 8s ease-in-out infinite;
  transform-origin: right center;
}

@keyframes schematic-door-left {
  0%, 15% {
    transform: translateX(0);
  }
  20%, 30% {
    transform: translateX(45px);
  }
  35%, 100% {
    transform: translateX(0);
  }
}

@keyframes schematic-door-right {
  0%, 15% {
    transform: translateX(0);
  }
  20%, 30% {
    transform: translateX(-45px);
  }
  35%, 100% {
    transform: translateX(0);
  }
}

/* Disable on mobile for performance */
@media (max-width: 768px) {
  .hero-schematic .schematic-car,
  .hero-schematic .schematic-counterweight,
  .hero-schematic .schematic-cable-car,
  .hero-schematic .schematic-cable-counterweight,
  .hero-schematic .schematic-door-left,
  .hero-schematic .schematic-door-right {
    animation: none;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-schematic .schematic-car,
  .hero-schematic .schematic-counterweight,
  .hero-schematic .schematic-cable-car,
  .hero-schematic .schematic-cable-counterweight,
  .hero-schematic .schematic-door-left,
  .hero-schematic .schematic-door-right {
    animation: none;
  }
}

/* ── Reveal Animations (scroll-triggered) ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Section Clip-Path Reveal (scroll-triggered geometric transition) ── */
.section-clip-reveal {
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-clip-reveal.section-revealed {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Alternative: circle reveal from center */
.section-circle-reveal {
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-circle-reveal.section-revealed {
  clip-path: circle(150% at 50% 50%);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .section-clip-reveal,
  .section-circle-reveal {
    clip-path: none;
    transition: none;
  }
}

/* Disable on mobile for performance */
@media (max-width: 768px) {
  .section-clip-reveal,
  .section-circle-reveal {
    clip-path: none;
    transition: none;
  }
}

/* ── Hero Entrance (staggered page-load animation) ── */
.hero-entrance {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-entrance.entered {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll indicator needs to preserve translateX centering */
.scroll-indicator.hero-entrance {
  transform: translateY(20px);
}

.scroll-indicator.hero-entrance.entered {
  transform: translateY(0);
}

/* ── Scroll Indicator ── */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: var(--text-mute);
  animation: scrollAnim 2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scrollAnim {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.5); }
}

/* ── Cursor Glow (desktop only) ── */
.cursor-glow {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  position: fixed;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

@media (max-width: 768px) {
  .cursor-glow { display: none; }
}

/* ── Blueprint Title Block (for page headers) ── */
.title-block {
  position: relative;
  padding: var(--space-lg);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.title-block::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--bg);
}

.title-block .title-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  position: absolute;
  top: -8px;
  left: 16px;
  background: var(--bg);
  padding: 0 8px;
}

/* ── Hero Trust Bar Enhancement ── */
.hero-trust-bar > div {
  position: relative;
  padding-right: var(--space-lg);
}

.hero-trust-bar > div:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--border);
  opacity: 0.5;
}

/* ── Hero Pain Point Rotator ── */
.hero-pain-rotator {
  min-height: 24px;
}

.hero-pain-rotator .pain-text {
  display: inline-block;
  position: relative;
}


/* ── Hero Title Gradient ── */
.hero-title {
  background: linear-gradient(180deg, var(--white) 40%, rgba(255,255,255,0.5) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #6db3f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Hero Subhead Enhancement ── */
.hero-subhead {
  position: relative;
}

/* Mobile adjustments for hero */
@media (max-width: 768px) {
  .hero-trust-bar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: var(--space-sm) !important;
  }

  .hero-trust-bar > div {
    padding-right: 0;
  }

  .hero-trust-bar > div::after {
    display: none;
  }

  .hero-pain-rotator {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-pain-rotator .pain-text {
    min-width: auto;
  }
}

/* ── Mobile Small Screen (375px)  -  iPhone SE & Similar ── */
@media (max-width: 375px) {
  /* Hero typography tightening for smallest phones */
  .hero-subhead {
    font-size: var(--text-sm) !important;
    line-height: 1.6 !important;
  }

  /* Pain rotator  -  tighter on small screens */
  .hero-pain-rotator {
    margin-top: var(--space-sm) !important;
  }

  .hero-pain-rotator span {
    font-size: 0.7rem !important;
  }

  /* Trust bar items  -  tighter spacing at 375px */
  .hero-trust-bar {
    gap: var(--space-xs) !important;
    margin-top: var(--space-sm) !important;
  }

  .hero-trust-bar > div {
    font-size: 0.7rem !important;
  }

  .hero-trust-bar svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* Hero CTA buttons  -  full width at 375px */
  .flex.gap-md.mt-xl {
    flex-direction: column !important;
    gap: var(--space-sm) !important;
  }

  .flex.gap-md.mt-xl .btn {
    width: 100% !important;
    justify-content: center;
  }
}
