/**
 * Homepage Redesign - V0 Autopilot Implementation
 * Based on Vince's v0.app/hubbly2025 Hubbly Autopilot design (Nov 6, 2026)
 * Wired to real scanner + real Voice orb
 */

:root {
  --hubbly-orange: #FF7029;
  --hubbly-black: #0a0a09;
  --hubbly-gray: #666;
  --hubbly-text-secondary: #999;
}

/* Reset and ensure redesign styles apply */
.home-page[data-redesign] {
  background: var(--hubbly-black);
  color: #fff;
}

/* ===== HERO SECTION ===== */
.redesign-hero {
  min-height: auto;
  padding: 100px 0 60px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 80px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.redesign-hero-content {
  max-width: 680px;
  padding: 0 24px;
  text-align: left;
}

/* Large HUBBLY display lettering - geometric, heavy, left-aligned with orange grid cells */
/* Reduced by 22.5% from original (110px → 85px max, 56px → 43px min) */
.redesign-hero-hubbly-mark {
  font-size: clamp(43px, 7vw, 85px);
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 32px;
  line-height: 0.95;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  background: transparent;
  padding: 0.05em 0.15em;
  width: fit-content;
}

.redesign-hero-hubbly-mark .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 0.08em;
  background: transparent;
  color: #fff;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, color, background-color;
}

/* Animation states */
/* Phase 1 (0-0.5s): White letters on black background */
.redesign-hero-hubbly-mark[data-animation-state="initial"] {
  background: var(--hubbly-black);
}

.redesign-hero-hubbly-mark[data-animation-state="initial"] .letter {
  color: #fff;
  background: transparent;
  opacity: 0;
  transform: translateY(20px);
}

.redesign-hero-hubbly-mark[data-animation-state="entering"] {
  background: var(--hubbly-black);
}

.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter {
  color: #fff;
  background: transparent;
}

.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter {
  animation: letterEnter 0.5s ease-out forwards;
}

.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(1) {
  animation-delay: 0s;
}
.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(2) {
  animation-delay: 0.05s;
}
.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(3) {
  animation-delay: 0.1s;
}
.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(4) {
  animation-delay: 0.15s;
}
.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(5) {
  animation-delay: 0.2s;
}
.redesign-hero-hubbly-mark[data-animation-state="entering"] .letter:nth-child(6) {
  animation-delay: 0.25s;
}

/* Phase 2 (0.5-1.5s): Letters flip, backgrounds transition to orange */
.redesign-hero-hubbly-mark[data-animation-state="flipping"] {
  background: var(--hubbly-black);
}

.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter {
  animation: letterFlip 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(1) {
  animation-delay: 0s;
}
.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(2) {
  animation-delay: 0.08s;
}
.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(3) {
  animation-delay: 0.16s;
}
.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(4) {
  animation-delay: 0.24s;
}
.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(5) {
  animation-delay: 0.32s;
}
.redesign-hero-hubbly-mark[data-animation-state="flipping"] .letter:nth-child(6) {
  animation-delay: 0.4s;
}

/* Phase 3 & 4: Landing and final - all letters black on continuous orange background */
.redesign-hero-hubbly-mark[data-animation-state="landing"] {
  background: var(--hubbly-orange);
}

.redesign-hero-hubbly-mark[data-animation-state="landing"] .letter {
  color: var(--hubbly-black);
  background: transparent;
}

.redesign-hero-hubbly-mark[data-animation-state="complete"] {
  background: var(--hubbly-orange);
}

.redesign-hero-hubbly-mark[data-animation-state="complete"] .letter {
  color: var(--hubbly-black);
  background: transparent;
}

/* Keyframe animations */
@keyframes letterEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    color: #fff;
  }
}

@keyframes letterFlip {
  0% {
    transform: rotateX(0deg);
    color: #fff;
    background-color: transparent;
  }
  49% {
    background-color: transparent;
  }
  50% {
    transform: rotateX(90deg);
    color: #fff;
    background-color: var(--hubbly-orange);
  }
  51% {
    color: var(--hubbly-black);
    background-color: var(--hubbly-orange);
  }
  100% {
    transform: rotateX(0deg);
    color: var(--hubbly-black);
    background-color: var(--hubbly-orange);
  }
}

/* Accessibility: prefers-reduced-motion shows final state immediately */
@media (prefers-reduced-motion: reduce) {
  .redesign-hero-hubbly-mark {
    background: var(--hubbly-orange) !important;
  }
  
  .redesign-hero-hubbly-mark .letter {
    color: var(--hubbly-black) !important;
    background: transparent !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* Headline */
.redesign-hero h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  text-align: left;
}

.redesign-hero h1 .line {
  display: block;
}

.redesign-hero h1 .line:first-child {
  color: #fff;
}

.redesign-hero h1 .line:last-child {
  color: var(--hubbly-orange);
}

/* Supporting copy */
.redesign-hero-supporting {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 32px;
  max-width: 600px;
  text-align: left;
}

/* Input form */
.redesign-hero-form {
  max-width: 600px;
  margin: 0 0 12px;
}

.redesign-hero-form-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.redesign-hero-form input[name="url"] {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: inherit;
  border-radius: 3px;
  transition: border-color 0.2s, background 0.2s;
}

.redesign-hero-form input[name="url"]:focus {
  outline: none;
  border-color: var(--hubbly-orange);
  background: rgba(255, 255, 255, 0.08);
}

.redesign-hero-form input[name="url"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.redesign-hero-cta {
  padding: 16px 28px;
  background: var(--hubbly-orange);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 3px;
  transition: transform 0.2s, opacity 0.2s;
}

.redesign-hero-cta:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

/* Caption under input */
.redesign-hero-caption {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  text-align: left;
}

/* Error message */
.scan-error {
  color: #ff6b6b;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}

/* ===== THREE-STEP SECTION ===== */
.redesign-three-step {
  padding: 60px 0 80px;
  background: rgba(255, 255, 255, 0.02);
}

.redesign-three-step .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.redesign-step {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px 32px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  transition: border-color 0.3s;
}

.redesign-step:hover {
  border-color: rgba(255, 112, 41, 0.3);
}

.redesign-step-number {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--hubbly-orange);
  margin: 0 0 16px;
  text-transform: uppercase;
}

.redesign-step h3 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
  color: #fff;
}

.redesign-step p {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* ===== SCAN PROGRESS (initially hidden) ===== */
.redesign-scan-progress {
  padding: 80px 0;
  min-height: 60vh;
}

.redesign-scan-progress .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-scan-progress h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 48px;
  text-align: center;
  color: #fff;
}

.redesign-scan-status {
  list-style: none;
  padding: 0;
  margin: 0 0 60px;
}

.redesign-scan-status li {
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.6);
}

.redesign-scan-status li.active {
  color: var(--hubbly-orange);
}

.redesign-scan-status li.complete {
  color: rgba(255, 255, 255, 0.9);
}

.redesign-scan-status li::before {
  content: '○';
  font-size: 24px;
  flex-shrink: 0;
}

.redesign-scan-status li.active::before {
  content: '◉';
  animation: pulse 1.5s ease-in-out infinite;
}

.redesign-scan-status li.complete::before {
  content: '✓';
  color: var(--hubbly-orange);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Scanner jokes during scan - entertaining messages while scan runs */
.redesign-scan-oneliner {
  margin-top: 60px;
  padding: 32px;
  background: rgba(255, 112, 41, 0.08);
  border: 1px solid rgba(255, 112, 41, 0.25);
  border-radius: 4px;
  min-height: 140px; /* Reserve space to prevent layout shift */
  display: flex;
  align-items: center;
  justify-content: center;
}

.redesign-scan-oneliner p {
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  text-align: center;
  margin: 0;
  letter-spacing: -0.01em;
  transition: opacity 0.3s ease-in-out; /* 300ms fade per spec */
  max-width: 800px;
}

/* Orange highlighting for emphasis */
.redesign-scan-oneliner p .highlight {
  color: var(--hubbly-orange);
  font-weight: 700;
}

.redesign-scan-oneliner p.fade-out {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .redesign-scan-oneliner p {
    transition: none;
  }
}

@media (max-width: 768px) {
  .redesign-scan-oneliner {
    padding: 24px 20px;
    min-height: 160px; /* More space for mobile wrap */
    margin-top: 48px;
  }
  
  .redesign-scan-oneliner p {
    font-size: clamp(16px, 4vw, 19px);
    line-height: 1.6;
  }
}

/* ===== RESULTS SCREEN ===== */
.redesign-results {
  padding: 80px 0;
}

.redesign-results .container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-results h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 48px;
  color: #fff;
}

.redesign-findings {
  display: grid;
  gap: 32px;
  margin: 0 0 60px;
}

.redesign-finding {
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 32px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.redesign-finding h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #fff;
}

.redesign-finding-evidence {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 16px;
}

.redesign-finding-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.redesign-finding-action button,
.redesign-finding-action a {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--hubbly-orange);
  color: var(--hubbly-orange);
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.redesign-finding-action button:hover,
.redesign-finding-action a:hover {
  background: rgba(255, 112, 41, 0.1);
}

/* ===== PRODUCT SECTIONS ===== */
.redesign-products {
  padding: 80px 0;
}

.redesign-products .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-product {
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.redesign-product:first-child {
  border-top: none;
}

.redesign-product h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hubbly-orange);
  margin: 0 0 16px;
}

.redesign-product h3 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 16px;
  color: #fff;
  line-height: 1.2;
}

.redesign-product p {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 32px;
  max-width: 700px;
}

.redesign-product-cta {
  padding: 16px 32px;
  background: var(--hubbly-orange);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

.redesign-product-cta:hover {
  transform: translateY(-2px);
}

/* ===== RESULTS FEED ===== */
.redesign-feed {
  padding: 80px 0;
  background: rgba(255, 255, 255, 0.02);
}

.redesign-feed .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-feed h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 40px;
  color: #fff;
}

.redesign-feed-items {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 0 24px;
}

.redesign-feed-item {
  background: var(--hubbly-black);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

.redesign-feed-item-type {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hubbly-orange);
  font-weight: 600;
}

.redesign-feed-item-content {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
}

.redesign-feed-item-time {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.redesign-feed-label {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin-top: 16px;
}

/* ===== TRUST SECTION ===== */
.redesign-trust {
  padding: 80px 0;
}

.redesign-trust .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-trust h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 0 0 32px;
  color: #fff;
}

.redesign-trust-content {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

.redesign-trust-content p {
  margin: 0 0 20px;
}

.redesign-trust-content strong {
  color: #fff;
}

/* ===== CLOSING SECTION ===== */
.redesign-closing {
  padding: 100px 0;
  text-align: center;
}

.redesign-closing .container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.redesign-closing h2 {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  color: #fff;
}

.redesign-closing h2 .line {
  display: block;
}

.redesign-closing h2 .line:last-child {
  color: var(--hubbly-orange);
}

.redesign-closing p {
  font-size: 20px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.redesign-closing-cta {
  padding: 20px 48px;
  background: var(--hubbly-orange);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 16px;
  border-radius: 4px;
  transition: transform 0.2s;
}

.redesign-closing-cta:hover {
  transform: translateY(-2px);
}

/* ===== VOICE ORB TOP-RIGHT ===== */
.redesign-voice-orb-slot {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0;
  padding-right: 24px;
  position: sticky;
  top: 120px;
}

/* Large dominant orb - 320px on desktop (balanced with lettering) */
.redesign-voice-orb-container {
  width: 320px;
  height: 320px;
  position: relative;
}

/* Hide the sidebar labels to reduce clutter */
.redesign-voice-label {
  display: none;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 1200px) {
  .redesign-hero {
    grid-template-columns: 1fr 280px;
    gap: 60px;
    padding: 110px 0 60px;
  }
  
  .redesign-voice-orb-container {
    width: 260px;
    height: 260px;
  }
}

@media (max-width: 1024px) {
  .redesign-hero {
    grid-template-columns: 1fr 240px;
    gap: 48px;
    padding: 100px 0 60px;
  }
  
  .redesign-voice-orb-container {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 900px) {
  .redesign-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 100px 0 60px;
  }
  
  .redesign-hero-content {
    text-align: left;
  }
  
  .redesign-hero-hubbly-mark {
    justify-content: flex-start;
    margin-bottom: 28px;
    font-size: clamp(44px, 9vw, 70px);
  }
  
  .redesign-voice-orb-slot {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 0;
    z-index: 90;
  }
  
  /* Mobile orb larger and more visible - 110px (up from 64-72px) */
  .redesign-voice-orb-container {
    width: 110px;
    height: 110px;
  }
  
  .redesign-step-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .redesign-hero-form-row {
    flex-direction: column;
  }
  
  .redesign-hero-cta {
    width: 100%;
  }
  
  .redesign-feed-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .redesign-hero {
    /* Increased top padding to prevent BOOK A DEMO overlap with HUBBLY wordmark */
    padding: 140px 0 48px;
  }
  
  .redesign-hero-hubbly-mark {
    font-size: clamp(34px, 8vw, 42px);
    margin-bottom: 20px;
    padding-right: 110px; /* Reserve space for orb on right */
  }
  
  /* Mobile: orb positioned top-right, larger for visibility */
  .redesign-voice-orb-slot {
    top: 90px;
    right: 16px;
    z-index: 100;
  }
  
  .redesign-voice-orb-container {
    width: 95px;
    height: 95px;
  }
  
  .redesign-three-step,
  .redesign-scan-progress,
  .redesign-results,
  .redesign-products,
  .redesign-feed,
  .redesign-trust,
  .redesign-closing {
    padding: 48px 0;
  }
  
  .redesign-step {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .redesign-hero {
    padding: 150px 0 48px;
  }
  
  .redesign-hero-hubbly-mark {
    font-size: clamp(32px, 8vw, 40px);
    margin-bottom: 16px;
  }
  
  .redesign-voice-orb-slot {
    top: 85px;
    right: 12px;
    z-index: 100;
  }
  
  .redesign-voice-orb-container {
    width: 85px;
    height: 85px;
  }
}

/* ===== VISIBILITY TOGGLES ===== */
.home-page:not([data-redesign]) .redesign-only {
  display: none;
}

.home-page[data-redesign] .current-only {
  display: none;
}

/* Hidden state helpers */
[hidden] {
  display: none !important;
}
