/* ==========================================================================
   Top Hand — Landing Page Styles
   Dark charcoal theme · Trade-direct · Modern
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand palette */
  --bg-primary: #0e0e10;
  --bg-secondary: #161619;
  --bg-card: #1c1c20;
  --bg-card-hover: #242428;

  --text-primary: #f0f0f2;
  --text-secondary: #a0a0a8;
  --text-muted: #6b6b74;

  --accent: #3dd68c;          /* VALID green */
  --accent-dim: rgba(61,214,140,0.12);
  --fault: #ff4d4d;           /* FAULT red */
  --floating: #4d9eff;        /* FLOATING blue */
  --phase-a: #ff4d4d;
  --phase-b: #4d9eff;
  --phase-c: #4dcc7a;

  /* Sizing */
  --max-width: 1180px;
  --section-pad: clamp(4rem, 10vw, 8rem);
  --radius: 14px;
  --radius-sm: 8px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #5eeaa8;
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.75rem;
}

.section-title--left {
  text-align: left;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}

.btn-nav {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 100px;
}

.btn-nav:hover {
  background: #5eeaa8;
  color: var(--bg-primary);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 1rem;
}

.btn-primary:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(61,214,140,0.2);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
}

.btn-xl {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 16px;
}

.btn-icon {
  flex-shrink: 0;
}

.btn-text-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.btn-text-stack small {
  font-size: 0.7em;
  font-weight: 400;
  opacity: 0.8;
}

.btn-text-stack strong {
  font-size: 1.1em;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag--valid {
  background: rgba(61,214,140,0.15);
  color: var(--accent);
}

.tag--floating {
  background: rgba(77,158,255,0.15);
  color: var(--floating);
}

.tag--fault {
  background: rgba(255,77,77,0.15);
  color: var(--fault);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.875rem 0;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav.scrolled {
  background: rgba(14,14,16,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-primary);
}

.nav-logo:hover {
  color: var(--text-primary);
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 0 3rem;
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  top: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(61,214,140,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 560px;
}

.hero-eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-title-line {
  display: block;
}

.hero-title-line.accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-cta {
  margin-bottom: 1rem;
}

.hero-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-device {
  display: flex;
  justify-content: center;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2.5s ease infinite;
}

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

/* ---------- Phone Frame ---------- */
.phone-frame {
  position: relative;
  width: 280px;
  padding: 12px;
  background: #000;
  border-radius: 40px;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.08),
    0 20px 60px rgba(0,0,0,0.5),
    0 0 80px rgba(61,214,140,0.06);
}

.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}

.phone-screen {
  border-radius: 28px;
  width: 100%;
  height: auto;
}

.phone-frame--showcase {
  width: 260px;
}

.phone-frame--small {
  width: 240px;
}

/* ---------- Proof Bar ---------- */
.proof-bar {
  padding: 2rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.proof-items {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.proof-icon {
  font-size: 1.1rem;
}

/* ---------- Features ---------- */
.features {
  padding: var(--section-pad) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s var(--ease);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-3px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-icon--components {
  background: rgba(77,158,255,0.12);
  color: var(--floating);
}

.feature-icon--instant {
  background: rgba(255,214,61,0.12);
  color: #ffd63d;
}

.feature-icon--faults {
  background: rgba(255,77,77,0.12);
  color: var(--fault);
}

.feature-icon--tables {
  background: rgba(61,214,140,0.12);
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---------- Showcase / Carousel ---------- */
.showcase {
  padding: var(--section-pad) 0;
  background: var(--bg-secondary);
}

.showcase-carousel {
  position: relative;
  overflow: hidden;
}

.showcase-track {
  display: flex;
  transition: transform 0.5s var(--ease);
}

.showcase-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  opacity: 0.3;
  transition: opacity 0.4s var(--ease);
}

.showcase-slide.active {
  opacity: 1;
}

.showcase-caption {
  text-align: center;
  max-width: 440px;
}

.showcase-caption h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.showcase-caption p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.showcase-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.showcase-dot {
  width: 10px;
  height: 10px;
  border-radius: 100px;
  border: none;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  padding: 0;
}

.showcase-dot:hover {
  background: rgba(255,255,255,0.3);
}

.showcase-dot.active {
  background: var(--accent);
  width: 28px;
}

/* ---------- Connections Table ---------- */
.connections {
  padding: var(--section-pad) 0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
}

.connections-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.connections-table thead {
  background: var(--bg-card);
}

.connections-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.connections-table td {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.connections-table td strong {
  color: var(--text-primary);
  font-weight: 600;
}

.connections-table tbody tr {
  transition: background 0.2s var(--ease);
}

.connections-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.connections-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- How It Works ---------- */
.how-it-works {
  padding: var(--section-pad) 0;
  background: var(--bg-secondary);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 960px;
  margin: 3rem auto 0;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 1.25rem;
  max-width: 240px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 2px solid rgba(61,214,140,0.25);
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-connector {
  width: 48px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin-top: 24px;
  flex-shrink: 0;
}

/* ---------- Audience ---------- */
.audience {
  padding: var(--section-pad) 0;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.audience-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s var(--ease);
}

.audience-card:hover {
  border-color: rgba(61,214,140,0.2);
  transform: translateY(-3px);
}

.audience-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.audience-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.audience-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---------- Engine / Under the Hood ---------- */
.engine {
  padding: var(--section-pad) 0;
  background: var(--bg-secondary);
}

.engine-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.engine-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.engine-content strong {
  color: var(--text-primary);
}

.engine-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.engine-list li {
  padding: 0.5rem 0;
  padding-left: 1.75rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.engine-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.engine-note {
  font-size: 0.95rem !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

.engine-visual {
  display: flex;
  justify-content: center;
}

/* ---------- Final CTA ---------- */
.cta {
  padding: var(--section-pad) 0;
  text-align: center;
}

.cta-inner {
  max-width: 640px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ---------- Footer ---------- */
.footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.footer-inner {
  text-align: center;
}

.footer-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Animations ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .hero-device {
    order: -1;
  }

  .phone-frame {
    width: 220px;
  }

  .phone-frame--showcase {
    width: 220px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .engine-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .engine-visual {
    order: -1;
  }

  .section-title--left {
    text-align: center;
  }

  .steps {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .step {
    max-width: 320px;
  }

  .step-connector {
    width: 2px;
    height: 32px;
    margin: 0;
  }

  .audience-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 5rem 0 2rem;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .phone-frame {
    width: 200px;
    padding: 8px;
    border-radius: 32px;
  }

  .phone-frame::before {
    width: 90px;
    height: 22px;
    border-radius: 0 0 14px 14px;
  }

  .phone-screen {
    border-radius: 24px;
  }

  .phone-frame--showcase {
    width: 200px;
  }

  .phone-frame--small {
    width: 180px;
  }

  .proof-items {
    gap: 1.25rem;
  }

  .proof-item {
    font-size: 0.8rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .connections-table th,
  .connections-table td {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .btn-xl {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
