/**
 * EdgeNova — home.css
 * Hero page specific styles
 */

/* ── Hero Layout ──────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--nav-height) 0 80px;
  background: var(--off-white);
  position: relative;
  overflow: hidden;
}

/* Particle canvas */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.45;
}

/* Two-column layout */
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}

/* ── Hero Text ────────────────────────────────────────────────────────── */
.hero-text { max-width: 560px; }

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  background: rgba(200,169,122,0.1);
  border: 1px solid rgba(200,169,122,0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--bronze-dark);
  margin-bottom: 1.75rem;
  opacity: 0;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bronze);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* Headline */
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
  opacity: 0;
}

.hero-em {
  font-style: normal;
  background: linear-gradient(135deg, var(--bronze-dark) 0%, var(--bronze) 50%, var(--bronze-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Description */
.hero-desc {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: var(--mid-grey);
  line-height: 1.75;
  margin-bottom: 2.25rem;
  max-width: 480px;
  opacity: 0;
}

/* CTA buttons */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  opacity: 0;
}

/* Stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  opacity: 0;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  padding: 0 1.5rem 0 0;
}

.hero-stat:first-child { padding-left: 0; }

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--charcoal);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-plus {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bronze);
  line-height: 1;
  vertical-align: top;
  margin-left: 1px;
}

.stat-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--mid-grey);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--divider);
  margin: 0 1.5rem;
  flex-shrink: 0;
}

/* ── IoT Visual ───────────────────────────────────────────────────────── */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
}

.iot-canvas {
  position: relative;
  width: 420px;
  height: 380px;
  flex-shrink: 0;
}

/* PCB grid background */
.pcb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,169,122,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,169,122,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(200,169,122,0.12);
}

/* Circuit SVG */
.circuit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trace {
  stroke: rgba(200,169,122,0.35);
  stroke-width: 1.5;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawTrace 2.5s ease forwards;
  fill: none;
}

.trace:nth-child(2) { animation-delay: 0.2s; }
.trace:nth-child(3) { animation-delay: 0.4s; }
.trace:nth-child(4) { animation-delay: 0.6s; }
.trace:nth-child(5) { animation-delay: 0.8s; }

.node {
  fill: var(--bronze);
  opacity: 0;
  animation: fadeInNode 0.4s ease forwards;
}

.node:nth-child(6)  { animation-delay: 1.2s; }
.node:nth-child(7)  { animation-delay: 1.4s; }
.node:nth-child(8)  { animation-delay: 1.6s; }
.node:nth-child(9)  { animation-delay: 1.8s; }
.node:nth-child(10) { animation-delay: 2.0s; }
.node:nth-child(11) { animation-delay: 2.2s; }

@keyframes drawTrace {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeInNode {
  to { opacity: 1; transform: scale(1); }
  from { opacity: 0; transform: scale(0); }
}

/* Main chip */
.main-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: var(--charcoal);
  border: 2px solid rgba(200,169,122,0.4);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(200,169,122,0.15), var(--shadow-lg);
}

.chip-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--bronze);
}

.chip-pins {
  position: absolute;
  display: flex;
  gap: 6px;
}

.chip-pins--left {
  left: -8px;
  flex-direction: column;
  top: 50%;
  transform: translateY(-50%);
}

.chip-pins--right {
  right: -8px;
  flex-direction: column;
  top: 50%;
  transform: translateY(-50%);
}

.chip-pins span {
  width: 8px;
  height: 2px;
  background: rgba(200,169,122,0.5);
  border-radius: 1px;
}

/* Device cards */
.device-card {
  position: absolute;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200,169,122,0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  min-width: 110px;
}

.dc1 { top: 14%;  left: 2%;  animation: floatCard1 6s ease-in-out infinite; }
.dc2 { bottom: 8%; right: 2%; animation: floatCard2 7s ease-in-out infinite 0.5s; }
.dc3 { top: 10%; right: 5%; animation: floatCard1 8s ease-in-out infinite 1s; }

@keyframes floatCard1 {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes floatCard2 {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

.dc-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--mid-grey);
  margin-bottom: 6px;
}

.dc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: blinkStatus 2s ease-in-out infinite;
}

.dc-dot--green { background: #4ade80; }
.dc-dot--blue  { background: #60a5fa; }
.dc-dot--amber { background: var(--bronze); }

@keyframes blinkStatus {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.dc-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1;
}

.dc-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--mid-grey);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* Mini chart */
.mini-chart { margin-top: 8px; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.bar {
  width: 4px;
  background: linear-gradient(to top, var(--bronze-dark), var(--bronze-light));
  border-radius: 2px 2px 0 0;
  transition: height 0.6s var(--ease);
}

/* Pulse rings */
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(200,169,122,0.3);
  animation: pulseRing 4s ease-out infinite;
  pointer-events: none;
}

.pr1 {
  width: 120px; height: 120px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.pr2 {
  width: 120px; height: 120px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 2s;
}

@keyframes pulseRing {
  0%   { width: 80px; height: 80px; opacity: 0.6; }
  100% { width: 200px; height: 200px; opacity: 0; }
}

/* ── Scroll Hint ──────────────────────────────────────────────────────── */
.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards 2s;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bronze));
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-grey);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1050px) {
  .hero-layout { gap: 40px; }
  .iot-canvas { width: 360px; height: 320px; }
}

@media (max-width: 900px) {
  .hero { padding-top: calc(var(--nav-height) + 32px); }
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }
  .hero-text { max-width: 100%; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { justify-content: center; }
}

@media (max-width: 768px) {
  .hero { padding-top: 32px; min-height: auto; padding-bottom: 48px; }
  .hero-headline { font-size: clamp(2.2rem, 8vw, 3rem); }
  .iot-canvas { width: 300px; height: 270px; }
  .dc3 { display: none; }
}

@media (max-width: 480px) {
  .hero-stats { gap: 0; flex-wrap: wrap; justify-content: flex-start; }
  .hero-stat { padding: 0 1rem 0 0; margin-bottom: 0.5rem; }
  .hero-stat:first-child { padding-left: 0; }
  .hero-stat-divider { display: none; }
  .iot-canvas { width: 260px; height: 240px; }
  .dc2 { display: none; }
}
