/* ================================================================
   DEMO PAGE — Page Wrapper, 3D Monitor, Scroll Journey
   Williamson Automation
   ================================================================ */

/* ======================== HERO ======================== */
.demo-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.demo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(196,162,101,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(91,143,185,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.demo-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.demo-hero__badge svg {
  color: #C4A265;
}

.demo-hero__title {
  font-family: var(--font-body);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 700px;
}

.demo-hero__title em {
  font-style: italic;
  font-family: var(--font-display);
  color: #C4A265;
  text-shadow: 0 0 40px rgba(196,162,101,0.3);
}

.demo-hero__sub {
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.demo-hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: demo-scroll-pulse 2s ease-in-out infinite;
}

.demo-hero__scroll svg {
  width: 20px;
  height: 20px;
}

@keyframes demo-scroll-pulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(6px); }
}

/* ======================== STICKY CONTROLS ======================== */
.demo-controls {
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  transition: box-shadow 0.3s;
}

.demo-controls--stuck {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.demo-controls__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.demo-controls__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

.demo-controls__group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-controls__divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* Theme pills */
.demo-theme-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding: 0;
  background: none;
}

.demo-theme-pill__color {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.demo-theme-pill.active {
  border-color: #C4A265;
  box-shadow: 0 0 12px rgba(196,162,101,0.3);
}

.demo-theme-pill:hover {
  transform: scale(1.1);
}

/* Font pills */
.demo-font-pill {
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.demo-font-pill.active {
  background: #C4A265;
  color: #09090B;
  border-color: #C4A265;
}

.demo-font-pill:hover:not(.active) {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* ======================== 3D MONITOR ======================== */
.demo-journey {
  position: relative;
  overflow: hidden;
  padding-top: 120px; /* space for nav (64px) + absolute controls (56px) */
  background:
    radial-gradient(ellipse at 50% 30%, rgba(196,162,101,0.045) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 15%, rgba(91,143,185,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 70%, rgba(196,162,101,0.025) 0%, transparent 55%);
}

.demo-journey__inner {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.demo-monitor-wrapper {
  position: relative;
  width: 50%;
  max-width: 640px;
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1);
}

.demo-monitor {
  background: linear-gradient(145deg, #2e2e32, #1c1c20);
  border-radius: 14px;
  padding: 14px 14px 44px 14px;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 100px rgba(196,162,101,0.02);
  transform: perspective(1400px) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1);
  position: relative;
}

/* Webcam dot */
.demo-monitor::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1a1a1a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

/* Logo on chin */
.demo-monitor__logo {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.15;
}

.demo-screen {
  background: var(--ds-bg, #1a1510);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
  cursor: default;
}

/* Screen reflection */
.demo-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(255,255,255,0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 5;
  border-radius: 6px;
}

.demo-screen-content {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / 0.75);
  transform: scale(0.75);
  transform-origin: top left;
  will-change: transform;
}

/* Stand */
.demo-stand {
  width: 100px;
  height: 50px;
  background: linear-gradient(to bottom, #2a2a2e 0%, #1e1e22 100%);
  margin: 0 auto;
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0% 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.demo-stand-base {
  width: 180px;
  height: 8px;
  background: linear-gradient(to right, #1a1a1e, #2a2a2e, #1a1a1e);
  margin: 0 auto;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Desk surface */
.demo-desk {
  height: 50px;
  background: linear-gradient(to bottom, rgba(25,20,16,0.6), transparent);
  margin-top: -4px;
}

/* ======================== EXPLANATION PANELS ======================== */
.demo-explain {
  position: absolute;
  max-width: 420px;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
}

.demo-explain--right {
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
}

.demo-explain--left {
  left: 6%;
  top: 50%;
  transform: translateY(-50%);
}

@media (min-width: 1400px) {
  .demo-explain { max-width: 460px; }
  .demo-explain--right { right: 8%; }
  .demo-explain--left { left: 8%; }
}

.demo-explain__label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #C4A265;
  font-weight: 600;
  margin-bottom: 12px;
}

.demo-explain__title {
  font-family: var(--font-body);
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.demo-explain__text {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.demo-explain__accent {
  color: #C4A265;
  font-weight: 500;
}

/* ======================== PRICING TEASER ======================== */
.demo-pricing {
  padding: var(--section-padding) 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.demo-pricing::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(196,162,101,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.demo-pricing__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #C4A265;
  font-weight: 600;
  margin-bottom: 16px;
}

.demo-pricing__title {
  font-family: var(--font-body);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.02em;
}

.demo-pricing__tiers {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.demo-pricing__tier {
  text-align: center;
}

.demo-pricing__amount {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.demo-pricing__tier-label {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

.demo-pricing__tier-divider {
  width: 1px;
  height: 60px;
  background: var(--border);
  align-self: center;
}

.demo-pricing__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #C4A265;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.3s;
}

.demo-pricing__link:hover {
  gap: 12px;
}

.demo-pricing__link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

.demo-pricing__link:hover svg {
  transform: translateX(4px);
}

/* ======================== CTA ======================== */
.demo-cta {
  padding: var(--section-padding) 24px;
  text-align: center;
  position: relative;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.demo-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(196,162,101,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 20%, rgba(91,143,185,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.demo-cta__title {
  font-family: var(--font-body);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.demo-cta__title em {
  font-family: var(--font-display);
  font-style: italic;
  color: #C4A265;
}

.demo-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.demo-cta__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: #C4A265;
  color: #09090B;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.demo-cta__phone:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196,162,101,0.3);
}

.demo-cta__phone svg {
  width: 20px;
  height: 20px;
}

.demo-cta__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.demo-cta__link {
  color: var(--text-secondary);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s;
}

.demo-cta__link:hover {
  color: #C4A265;
}

.demo-cta__email {
  display: block;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
}

/* ======================== MOBILE RESPONSIVE ======================== */
@media (max-width: 1023px) {
  .demo-monitor-wrapper {
    width: 90%;
    max-width: 500px;
  }

  .demo-explain {
    position: relative;
    max-width: 100%;
    padding: 40px 24px;
    text-align: center;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .demo-explain--right,
  .demo-explain--left {
    right: auto;
    left: auto;
    top: auto;
    transform: none;
  }

  .demo-journey__inner {
    height: auto;
    flex-direction: column;
    padding: 60px 0;
  }

  .demo-controls__inner {
    gap: 10px;
  }

  .demo-controls__divider {
    display: none;
  }
}

@media (max-width: 640px) {
  .demo-hero {
    padding: 100px 20px 60px;
  }

  .demo-hero__title {
    font-size: clamp(32px, 8vw, 48px);
  }

  .demo-controls__inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .demo-controls__group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .demo-pricing__tiers {
    gap: 20px;
  }

  .demo-pricing__tier-divider {
    height: 1px;
    width: 40px;
    align-self: center;
  }

  .demo-monitor-wrapper {
    width: 95%;
  }
}

/* ======================== MOBILE: TOUCH-SCROLLABLE MONITOR ======================== */
@media (max-width: 1023px) {
  .demo-screen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .demo-screen-content {
    position: relative;
    width: 100%;
    transform: none;
  }
}

/* ======================== REDUCED MOTION ======================== */
@media (prefers-reduced-motion: reduce) {
  .demo-hero__scroll {
    animation: none;
    opacity: 0.6;
  }

  .demo-monitor {
    transform: none;
    transition: none;
  }
}
