/* ==========================================================================
   CUEALARM INDUSTRIAL DESIGN SYSTEM - LANDING PAGE
   Theme: Matte Obsidian / Dark Anodized / Safety Orange #FF4F00 / LED Green
   ========================================================================== */

:root {
  --bg-deep: #080808;
  --bg-canvas: #0e0e0e;
  --bg-surface: #141414;
  --bg-surface-elevated: #1a1a1a;
  --bg-card: #161616;
  --border-subtle: #222222;
  --border-medium: #2e2e2e;
  --border-active: #3a3a3a;
  --text-primary: #f4f4f4;
  --text-secondary: #8e8d88;
  --text-muted: #555450;
  --orange: #ff4f00;
  --orange-glow: rgba(255, 79, 0, 0.28);
  --orange-subtle: rgba(255, 79, 0, 0.08);
  --green: #00e676;
  --green-glow: rgba(0, 230, 118, 0.3);
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Space Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 79, 0, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 90% 40%, rgba(0, 230, 118, 0.02) 0%, transparent 35%),
    var(--bg-deep);
}

/* Subtle Industrial Dot Grid Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 1;
}

/* Scroll Progress Bar (Native Scroll-Driven Animation + Fallback) */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), #ff7733);
  box-shadow: 0 0 10px var(--orange-glow);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 9999;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-scroll {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    #scroll-progress {
      animation: grow-scroll auto linear;
      animation-timeline: scroll();
    }
  }
}

/* Common Layout Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Typography Utilities */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mono-tag.orange {
  color: var(--orange);
  border-color: rgba(255, 79, 0, 0.35);
  background: var(--orange-subtle);
}

.mono-tag.green {
  color: var(--green);
  border-color: rgba(0, 230, 118, 0.3);
  background: rgba(0, 230, 118, 0.06);
}

.led-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-led 2s infinite ease-in-out;
}

.led-indicator.orange {
  background-color: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

@keyframes pulse-led {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(14, 14, 14, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background var(--transition-normal);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.brand-icon img {
  width: 36px;
  height: 36px;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--orange);
  letter-spacing: 1px;
}

/* Header Telemetry Pill */
.header-telemetry {
  display: none;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 4px;
}

@media (min-width: 900px) {
  .header-telemetry {
    display: flex;
  }
}

.live-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

/* Navigation Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--orange);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Button Component Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 18px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--orange);
  color: #000000;
  border-color: var(--orange);
  box-shadow: 0 0 16px rgba(255, 79, 0, 0.35);
}

.btn-primary:hover {
  background-color: #ff651f;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(255, 79, 0, 0.55);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  background-color: var(--bg-surface-elevated);
}

.btn-outline-orange {
  background-color: transparent;
  color: var(--orange);
  border-color: var(--orange);
}

.btn-outline-orange:hover {
  background-color: var(--orange-subtle);
  transform: translateY(-1px);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 60px 0 80px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-badge-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.2vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.hero-title .highlight-orange {
  color: var(--orange);
  display: inline-block;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 580px;
}

/* CTA Download Button Cluster */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
}

.hero-actions .btn {
  padding: 14px 22px;
  font-size: 13px;
}

/* Telemetry Spec Strip Under Hero */
.telemetry-spec-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-cell .cell-title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.spec-cell .cell-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   INTERACTIVE PHONE CHASSIS VIEWPORT (HERO RIGHT)
   ========================================================================== */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.phone-rack-container {
  position: relative;
  width: 100%;
  max-width: 360px;
}

/* Industrial Frame around Smartphone */
.phone-chassis {
  position: relative;
  background: #000000;
  border: 3px solid #2a2a2a;
  border-radius: 38px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(255, 79, 0, 0.12);
  overflow: hidden;
  aspect-ratio: 9 / 20;
}

/* Subtle Front Camera Punch Hole */
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 11px;
  height: 11px;
  background: #000000;
  border-radius: 50%;
  z-index: 10;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.phone-screen-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-normal);
}

/* Interactive Screen Selector Switch */
.screen-selector-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  border-radius: 6px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.tab-btn.active {
  background: var(--orange);
  color: #000000;
  box-shadow: 0 0 12px var(--orange-glow);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   WORKFLOW SECTION (THE CORE SEQUENCE)
   ========================================================================== */
.section-block {
  padding: 90px 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.workflow-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) and (max-width: 1099px) {
  .workflow-steps-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
  }
  .workflow-steps-grid .step-card:nth-child(1),
  .workflow-steps-grid .step-card:nth-child(2),
  .workflow-steps-grid .step-card:nth-child(3) {
    grid-column: span 2;
  }
  .workflow-steps-grid .step-card:nth-child(4),
  .workflow-steps-grid .step-card:nth-child(5) {
    grid-column: span 3;
  }
}

@media (min-width: 1100px) {
  .workflow-steps-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--orange);
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 18px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.step-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.step-badge {
  margin-top: auto;
  align-self: flex-start;
}

/* ==========================================================================
   RACK MODULES / FEATURE DECK
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.module-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.module-box:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 79, 0, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.module-header {
  background: #111111;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-header-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--text-primary);
}

.module-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.module-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
}

.module-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.module-badge {
  margin-top: auto;
  padding-top: 14px;
}

/* ==========================================================================
   INTERACTIVE LIVE SOUND & FADE SIMULATOR
   ========================================================================== */
.simulator-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 850px) {
  .simulator-wrapper {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
  }
}

.sim-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-control-panel {
  background: #0d0d0d;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meter-track {
  width: 100%;
  height: 28px;
  background: #000000;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4f00, #ff8c00);
  transition: width 0.1s linear;
  box-shadow: 0 0 16px var(--orange-glow);
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.sim-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   SPECIFICATIONS TABLE
   ========================================================================== */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.specs-table th,
.specs-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.specs-table th {
  background: #111111;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--orange);
  text-transform: uppercase;
}

.specs-table td {
  font-size: 13px;
  color: var(--text-secondary);
}

.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table td:first-child {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  width: 30%;
}

/* ==========================================================================
   DOWNLOADS DECK
   ========================================================================== */
.downloads-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition: all var(--transition-fast);
}

.download-card.highlight {
  border-color: var(--orange);
  box-shadow: 0 0 30px rgba(255, 79, 0, 0.15);
}

.download-card:hover {
  transform: translateY(-4px);
  border-color: var(--orange);
}

.platform-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.download-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.download-card-logo {
  width: 48px;
  height: 48px;
  background: transparent !important;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

.download-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
}

.download-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.download-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.download-meta li {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.download-meta li span:last-child {
  color: var(--text-primary);
}

/* ==========================================================================
   MODAL FOR TESTFLIGHT / WEB APP
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--orange);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 32px;
  background: #090909;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Responsive table container */
.specs-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.specs-table {
  min-width: 540px;
  border: none;
}

/* Ensure no elements overflow or get cut off on small screens */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .screen-selector-tabs {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
  }
  .tab-btn {
    flex: 1 1 calc(50% - 6px);
    font-size: 11px;
    padding: 8px 10px;
  }
  .header-actions .btn {
    padding: 8px 12px;
    font-size: 11px;
  }
  .brand-title {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .brand-sub {
    font-size: 8px;
  }
  .telemetry-spec-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .sim-buttons .btn {
    width: 100%;
  }
}
