﻿/* ==========================================================================
   home.css — SmartDNS dns.dannny0117.com
   Page-specific styles for the home page only
   Requires: globalassets.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — Animated Gradient Mesh Background
   -------------------------------------------------------------------------- */
.hero__mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Orb 1 — Cyan, top-right */
.hero__mesh-orb--1 {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  top: -20%;
  right: -15%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 65%);
  animation: orb-drift-1 18s ease-in-out infinite alternate;
  will-change: transform;
  border-radius: 50%;
}

/* Orb 2 — Violet, bottom-left */
.hero__mesh-orb--2 {
  position: absolute;
  width: 55vw;
  height: 55vw;
  max-width: 640px;
  max-height: 640px;
  bottom: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(123, 47, 255, 0.15) 0%, transparent 65%);
  animation: orb-drift-2 22s ease-in-out infinite alternate;
  will-change: transform;
  border-radius: 50%;
}

/* Orb 3 — Cyan-violet blend, center */
.hero__mesh-orb--3 {
  position: absolute;
  width: 40vw;
  height: 40vw;
  max-width: 480px;
  max-height: 480px;
  top: 30%;
  left: 30%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, rgba(123, 47, 255, 0.06) 40%, transparent 70%);
  animation: orb-drift-3 26s ease-in-out infinite alternate;
  will-change: transform;
  border-radius: 50%;
}

/* Grid overlay */
.hero__mesh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
}

/* Noise texture layer */
.hero__mesh-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
}

@keyframes orb-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-3%, 5%) scale(1.08); }
}

@keyframes orb-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4%, -4%) scale(1.06); }
}

@keyframes orb-drift-3 {
  from { transform: translate(0, 0) scale(1) rotate(0deg); }
  to   { transform: translate(-2%, 3%) scale(0.94) rotate(5deg); }
}

/* --------------------------------------------------------------------------
   Animated Stats Counter
   -------------------------------------------------------------------------- */
.hero__stat-value.counting {
  animation: count-flicker 0.08s steps(1) infinite;
}

@keyframes count-flicker {
  0%  { opacity: 1; }
  50% { opacity: 0.85; }
}

.stat-unit {
  font-size: 0.65em;
  vertical-align: super;
  margin-left: 1px;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stats row entrance animation */
.hero__stats .hero__stat {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero__stats.visible .hero__stat:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.hero__stats.visible .hero__stat:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.42s; }
.hero__stats.visible .hero__stat:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.54s; }
.hero__stats.visible .hero__stat:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.66s; }

/* --------------------------------------------------------------------------
   Feature Cards — Home Page Hover Enhancements
   -------------------------------------------------------------------------- */
.home-features-grid .feature-card {
  cursor: default;
}

/* Gradient icon colors for each card position */
.home-features-grid .feature-card:nth-child(1) .feature-card__icon-wrap { background: rgba(0, 212, 255, 0.1); border-color: rgba(0, 212, 255, 0.2); }
.home-features-grid .feature-card:nth-child(2) .feature-card__icon-wrap { background: rgba(123, 47, 255, 0.1); border-color: rgba(123, 47, 255, 0.2); }
.home-features-grid .feature-card:nth-child(3) .feature-card__icon-wrap { background: rgba(255, 107, 53, 0.12); border-color: rgba(255, 107, 53, 0.25); }
.home-features-grid .feature-card:nth-child(4) .feature-card__icon-wrap { background: rgba(0, 212, 255, 0.1); border-color: rgba(0, 212, 255, 0.2); }
.home-features-grid .feature-card:nth-child(5) .feature-card__icon-wrap { background: rgba(123, 47, 255, 0.1); border-color: rgba(123, 47, 255, 0.2); }
.home-features-grid .feature-card:nth-child(6) .feature-card__icon-wrap { background: rgba(0, 212, 255, 0.1); border-color: rgba(0, 212, 255, 0.2); }

/* Card shine sweep on hover */
.home-features-grid .feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position 0.6s ease;
  pointer-events: none;
  border-radius: inherit;
}

.home-features-grid .feature-card:hover::after {
  background-position: -200% 0;
}

/* --------------------------------------------------------------------------
   Server Status Pulse Animations
   -------------------------------------------------------------------------- */
.server-status-pulse {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.server-status-pulse::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: status-ring 2.5s ease-out infinite;
}

.server-status-pulse.online::after  { background: rgba(0, 200, 83, 0.4); }
.server-status-pulse.pending::after { background: rgba(255, 193, 7, 0.4); }

@keyframes status-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Latency bar animated fill on load */
.latency-bar-fill {
  transform-origin: left;
  animation: latency-load 0.8s ease forwards;
  transform: scaleX(0);
}

.latency-bar-fill.loaded {
  transform: scaleX(1);
  animation: none;
}

@keyframes latency-load {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Server row hover glow */
.servers-table tbody tr:hover .server-addr {
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Server cards (alternative mobile view) */
.server-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

.server-card:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}

.server-card-info { flex: 1; min-width: 0; }

.server-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.server-card-addr {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Setup Tabs — Home Page
   -------------------------------------------------------------------------- */

/* Platform icons in tabs */
.setup-tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.setup__tab.active .setup-tab-icon,
.setup__tab:hover .setup-tab-icon {
  opacity: 1;
}

/* Tab slider indicator */
.setup-tabs-inner {
  position: relative;
}

.setup-tab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: left 0.25s ease, width 0.25s ease;
  box-shadow: 0 0 8px var(--accent);
}

/* Panel content grid for larger setups */
.setup-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.setup-panel-steps { /* left column */ }

.setup-panel-visual {
  /* right column placeholder for platform illustration */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.setup-panel-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,212,255,0.05) 0%, transparent 70%);
}

.setup-visual-icon {
  font-size: 3rem;
  opacity: 0.4;
  position: relative;
  z-index: 1;
}

.setup-visual-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* DNS address highlight animation */
.code-block code {
  animation: none;
  transition: text-shadow 0.3s ease;
}

.code-block:focus-within code,
.code-block:hover code {
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

/* Copy success ripple */
.code-copy-btn.copied::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 200, 83, 0.2);
  border-radius: inherit;
  animation: copy-ripple 0.4s ease forwards;
}

@keyframes copy-ripple {
  from { opacity: 1; transform: scale(0.8); }
  to   { opacity: 0; transform: scale(1.3); }
}

/* --------------------------------------------------------------------------
   Platform-specific Step Illustrations (placeholders)
   -------------------------------------------------------------------------- */

/* Windows */
.setup-illus-windows {
  background: linear-gradient(135deg, rgba(0, 120, 215, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
}

/* Mac */
.setup-illus-mac {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.1) 0%, rgba(200, 200, 200, 0.03) 100%);
}

/* iOS */
.setup-illus-ios {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
}

/* Android */
.setup-illus-android {
  background: linear-gradient(135deg, rgba(61, 220, 132, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
}

/* Router */
.setup-illus-router {
  background: linear-gradient(135deg, rgba(123, 47, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
}

/* Xbox */
.setup-illus-xbox {
  background: linear-gradient(135deg, rgba(16, 124, 16, 0.12) 0%, rgba(0, 212, 255, 0.05) 100%);
}

/* PlayStation */
.setup-illus-playstation {
  background: linear-gradient(135deg, rgba(0, 70, 165, 0.12) 0%, rgba(123, 47, 255, 0.06) 100%);
}

/* --------------------------------------------------------------------------
   Home Page CTA Section
   -------------------------------------------------------------------------- */
#cta-section {
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}

.cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 50%, rgba(0,212,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 80% 50%, rgba(123,47,255,0.09) 0%, transparent 55%);
  pointer-events: none;
}

.cta-card > * { position: relative; z-index: 1; }

.cta-title {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Trust / Social Proof Row
   -------------------------------------------------------------------------- */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 3rem 0;
}

/* --------------------------------------------------------------------------
   Apps Download Section
   -------------------------------------------------------------------------- */
.apps {
  position: relative;
  overflow: hidden;
}

.apps__bg-orb--1,
.apps__bg-orb--2 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.apps__bg-orb--1 {
  width: 500px;
  height: 500px;
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.07) 0%, transparent 65%);
}
.apps__bg-orb--2 {
  width: 400px;
  height: 400px;
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, rgba(123, 47, 255, 0.07) 0%, transparent 65%);
}

.apps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.apps__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  gap: 0.75rem;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}

.apps__card--current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 40px rgba(0, 212, 255, 0.12);
}
.apps__card--current::before {
  content: 'Your Platform';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 0 0 6px 6px;
  white-space: nowrap;
}

.apps__card-icon {
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.apps__card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.apps__card-req {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.apps__card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0.25rem 0 auto;
}

.apps__card-btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

.apps__card-version {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.apps__footnote {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .apps__grid { grid-template-columns: 1fr; max-width: 400px; margin-inline: auto; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .apps__grid { grid-template-columns: repeat(2, 1fr); max-width: none; }
}

/* -------------------------------------------------------------------------- */

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.trust-item-icon {
  color: var(--accent);
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Responsive — Home Page Overrides
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .setup-panel-grid {
    grid-template-columns: 1fr;
  }

  .setup-panel-visual {
    display: none;
  }
}

@media (max-width: 768px) {
  .cta-card {
    padding: 2.5rem 1.5rem;
  }

  .trust-row {
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__mesh-orb--1,
  .hero__mesh-orb--2,
  .hero__mesh-orb--3 {
    opacity: 0.6;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion — Home Page
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero__mesh-orb--1,
  .hero__mesh-orb--2,
  .hero__mesh-orb--3 {
    animation: none;
  }

  .hero__stats .hero__stat {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .latency-bar-fill {
    animation: none;
    transform: scaleX(1);
  }

  .server-status-pulse::after {
    animation: none;
  }
}
