/* ── Homepage Specific Styles ── */

/* ── Section 01: Hero (looping video) ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + var(--space-8));
  padding-bottom: var(--space-16);
  background: var(--iotnow-black);
  color: var(--iotnow-white);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--iotnow-black);
  pointer-events: none;
}

.hero-photos,
.hero-video {
  position: absolute;
  inset: 0;
}

.hero-photos {
  z-index: 1;
}

.hero-photo,
.hero-video {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero-photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  animation: hero-kenburns 6s infinite linear;
}

.hero-photo-1 {
  opacity: 1;
  animation-name: hero-kenburns-first;
  animation-delay: 0s;
}

.hero-photo--still { animation: none; opacity: 1; transform: none; }

@keyframes hero-kenburns-first {
  0% {
    opacity: 1;
    transform: scale(1.04);
  }
  18% {
    opacity: 1;
    transform: scale(1.12);
  }
  24%,
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

.hero-photo-2 { animation-delay: 1.2s; }
.hero-photo-3 { animation-delay: 2.4s; }
.hero-photo-4 { animation-delay: 3.6s; }
.hero-photo-5 { animation-delay: 4.8s; }

@keyframes hero-kenburns {
  0% {
    opacity: 0;
    transform: scale(1.04);
  }
  4% {
    opacity: 1;
  }
  18% {
    opacity: 1;
    transform: scale(1.12);
  }
  24% {
    opacity: 0;
    transform: scale(1.14);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

.hero-video {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-media.is-playing .hero-video {
  opacity: 1;
}

.hero-media.is-playing .hero-photos {
  opacity: 0;
}

.hero-media.is-static .hero-video {
  display: none;
}

.hero-media.is-static .hero-photo {
  animation: none;
  opacity: 0;
}

.hero-media.is-static .hero-photo-1 {
  opacity: 1;
  transform: scale(1.04);
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(90deg, rgba(16, 19, 18, 0.9) 0%, rgba(16, 19, 18, 0.68) 36%, rgba(16, 19, 18, 0.28) 68%, rgba(16, 19, 18, 0.42) 100%),
    linear-gradient(180deg, rgba(16, 19, 18, 0.46) 0%, rgba(16, 19, 18, 0.12) 32%, rgba(16, 19, 18, 0.18) 62%, rgba(16, 19, 18, 0.78) 100%);
  pointer-events: none;
}

@media (max-width: 767px) {
  .hero-video, .hero-photo--still { object-position: center; }
  .hero-bg-overlay {
    background-image:
      linear-gradient(180deg, rgba(16, 19, 18, 0.78) 0%, rgba(16, 19, 18, 0.58) 42%, rgba(16, 19, 18, 0.84) 100%);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(0, 168, 107, 0.12);
  border: 1px solid rgba(0, 168, 107, 0.3);
  color: var(--iotnow-green);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-6);
}

.hero-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--iotnow-green);
  box-shadow: 0 0 10px var(--iotnow-green);
}

.hero-title {
  font-size: clamp(2.1rem, 5.5vw, 4.25rem);
  font-weight: var(--weight-extrabold);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  color: var(--iotnow-white);
  margin-bottom: var(--space-6);
  word-break: break-word;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: var(--space-8);
  max-width: 680px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (max-width: 560px) {
  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 2.75rem);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 720px;
}

@media (max-width: 640px) {
  .hero-stats {
    gap: 0.75rem;
  }
  .hero-stats .stat-item {
    padding: 0;
  }
  .hero-stats .stat-number {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }
  .hero-stats .stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }
}

.hero-story {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-10);
  max-width: 760px;
}

.hero-story-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 19, 18, 0.35);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.hero-story-index {
  font-family: var(--font-mono);
  color: var(--iotnow-green);
  opacity: 0.55;
}

.hero-story-step.is-active {
  color: var(--iotnow-white);
  border-color: rgba(0, 168, 107, 0.55);
  background: rgba(0, 168, 107, 0.16);
}

.hero-story-step.is-active .hero-story-index {
  opacity: 1;
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  z-index: 2;
}

@media (max-height: 780px) {
  .hero-scroll {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo,
  .hero-video {
    animation: none;
  }

  .hero-photo {
    opacity: 0;
  }

  .hero-photo-1 {
    opacity: 1;
    transform: none;
  }
}

/* ── Section 02: What IoTNow Does ── */
.pillar-card {
  background: var(--iotnow-white);
  border: 1px solid var(--iotnow-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pillar-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--iotnow-green);
}

.pillar-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: var(--iotnow-light-gray);
  color: var(--iotnow-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pillar-card:hover .pillar-icon-wrapper {
  background: var(--iotnow-green);
  color: var(--iotnow-white);
}

.pillar-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.pillar-desc {
  color: var(--iotnow-gray);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

/* ── Section 03 & 04: Product Spotlights ── */
.product-spotlight {
  align-items: center;
  gap: var(--space-12);
}

.product-spotlight-visual {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: linear-gradient(135deg, #1E2220 0%, #171A18 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}

.product-spotlight-visual img {
  border-radius: var(--radius-lg);
  transition: transform var(--transition-slow);
}

.product-spotlight:hover .product-spotlight-visual img {
  transform: scale(1.02);
}

.protocol-badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-6) 0 var(--space-8);
}

/* Dashboard Mockup UI Preview */
.dashboard-preview {
  width: 100%;
  background: #151817;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 168, 107, 0.2);
  overflow: hidden;
}

.dashboard-preview-header {
  height: 38px;
  background: #1A1D1C;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  gap: 8px;
}

.dashboard-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.dashboard-preview-body,
.dashboard-metrics-grid {
  padding: var(--space-6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .dashboard-preview-body,
  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
    padding: var(--space-4);
    gap: var(--space-3);
  }
}

.dash-metric-card {
  background: #202422;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-metric-title {
  font-size: var(--text-xs);
  color: var(--iotnow-gray-light);
  margin-bottom: var(--space-2);
}

.dash-metric-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--iotnow-white);
}

/* ── Section 05: Solutions ── */
.solution-card {
  background: var(--iotnow-white);
  border: 1px solid var(--iotnow-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.solution-card:hover {
  transform: translateY(-6px);
  border-color: var(--iotnow-green);
  box-shadow: var(--shadow-card-hover);
}

.solution-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--iotnow-green-light);
  color: var(--iotnow-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.solution-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.solution-desc {
  font-size: var(--text-sm);
  color: var(--iotnow-gray);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

/* ── Section 06: Architecture Diagram ── */
.arch-diagram-wrapper {
  background: #0D100F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-2xl);
  padding: var(--space-12) var(--space-8);
  margin-top: var(--space-8);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.arch-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  position: relative;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .arch-steps {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .arch-steps {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-6);
  }
}

.arch-step-node {
  background: #171B19;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  position: relative;
  transition: all var(--transition-base);
}

.arch-step-node:hover {
  border-color: var(--iotnow-green);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 168, 107, 0.2);
}

.arch-node-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--iotnow-green);
  margin-bottom: var(--space-2);
}

.arch-node-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--iotnow-white);
  margin-bottom: var(--space-2);
}

.arch-node-desc {
  font-size: var(--text-xs);
  color: var(--iotnow-gray-light);
  line-height: 1.4;
}

/* ── Section 07: Projects ── */
.project-card {
  background: var(--iotnow-white);
  border: 1px solid var(--iotnow-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--iotnow-green);
}

.project-card-header {
  padding: var(--space-8) var(--space-8) var(--space-4);
}

.project-tag {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--iotnow-green);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}

.project-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.project-card-body {
  padding: 0 var(--space-8) var(--space-8);
}

.project-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  background: var(--iotnow-light-gray);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

/* ── Section 08: Services ── */
.service-item {
  background: var(--iotnow-white);
  border: 1px solid var(--iotnow-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
}

.service-item:hover {
  border-color: var(--iotnow-green);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.service-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.service-list-item {
  font-size: var(--text-sm);
  color: var(--iotnow-gray);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.service-list-item::before {
  content: '✓';
  color: var(--iotnow-green);
  font-weight: var(--weight-bold);
}

/* ── Section 09: Why IoTNow ── */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) and (max-width: 1023px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .why-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
}

.why-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
}

.why-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--iotnow-green);
  transform: translateY(-4px);
}

.why-number {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--iotnow-green);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
}

.why-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--iotnow-white);
  margin-bottom: var(--space-3);
}

.why-desc {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  line-height: var(--leading-relaxed);
}

/* ── Section 10: Partners ── */
.partner-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(var(--space-6), 4vw, var(--space-12));
}

.partner-logo-item {
  padding: var(--space-4) var(--space-8);
  background: var(--iotnow-light-gray);
  border-radius: var(--radius-md);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  color: var(--iotnow-gray);
  letter-spacing: var(--tracking-wide);
  transition: all var(--transition-fast);
}

.partner-logo-item:hover {
  color: var(--iotnow-black);
  background: var(--iotnow-border-light);
}

/* ── Section 11: Resources ── */
.resource-card {
  background: var(--iotnow-white);
  border: 1px solid var(--iotnow-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
}

.resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--iotnow-green);
  box-shadow: var(--shadow-card-hover);
}

.resource-meta {
  font-size: var(--text-xs);
  color: var(--iotnow-gray);
  margin-bottom: var(--space-3);
}

.resource-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
}

/* ── Section 12: Final CTA ── */
.final-cta {
  background: radial-gradient(circle at center, #1B2420 0%, #101312 100%);
  border-radius: var(--radius-2xl);
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-8);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.final-cta-title {
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: var(--weight-extrabold);
  color: var(--iotnow-white);
  margin-bottom: var(--space-4);
}

.final-cta-desc {
  font-size: var(--text-lg);
  color: var(--iotnow-gray-light);
  max-width: 640px;
  margin: 0 auto var(--space-8);
}

/* Sitehub spotlight uses the current product model. */
.home-sitehub-visual { min-height: 0; padding: 0; background: #f4f5f2; border: 1px solid #e6ebe4; }
.home-sitehub-visual img { display: block; width: 100%; height: auto; border-radius: 0; }
