/* ── ClipRelay Design Tokens ── */
:root {
  /* Brand */
  --aqua: #00FFD5;
  --aqua-gradient: #00DDC0;
  --teal: #00796B;
  --board-dark: #0A3A34;
  --board-darker: #082A26;

  /* Dark UI Surfaces */
  --bg: #0A0A0F;
  --surface: #13131A;
  --border: #1E1E2A;
  --text: #E8E8ED;
  --text-dim: #6B6B7B;

  /* Gradients */
  --gradient-aqua: linear-gradient(135deg, #00FFD5, #00DDC0);
  --gradient-title: linear-gradient(135deg, #fff 30%, #00FFD5);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --section-pad: clamp(60px, 10vw, 120px);
  --container: min(1200px, 90vw);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 300;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Noise Overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Container ── */
.container {
  width: var(--container);
  margin: 0 auto;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(19, 19, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--aqua);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  text-decoration: none !important;
  transition: opacity 0.2s;
}

.nav-cta:hover { opacity: 0.85; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
  position: relative;
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 213, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
}

.hero-logo {
  width: clamp(100px, 15vw, 160px);
  height: clamp(100px, 15vw, 160px);
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 700px;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-dim);
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ── Device Showcase ── */
.hero-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 72px;
  position: relative;
  z-index: 1;
  perspective: 1200px;
}

/* ── Phone Mockup ── */
.mockup-phone {
  width: 200px;
  height: 400px;
  background: #111118;
  border-radius: 28px;
  border: 2px solid #2a2a38;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 255, 213, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 255, 213, 0.04);
  transform: rotateY(6deg) rotateX(2deg);
}

.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: #0A0A0F;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.phone-notch::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1a25;
}

.phone-screen {
  padding: 36px 12px 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #0d1a18 0%, #0e0e15 60%, #0f1614 100%);
}

.app-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 600;
  color: var(--aqua);
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.15);
  font-family: var(--font-body);
}

.app-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 6px var(--aqua);
}

.app-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 213, 0.1);
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.app-logo {
  width: 36px;
  height: 36px;
  margin-bottom: 2px;
}

.app-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--aqua);
  letter-spacing: -0.01em;
}

.app-desc {
  font-size: 8px;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.7;
}

.app-divider {
  width: 80%;
  height: 1px;
  background: rgba(0, 255, 213, 0.08);
  margin: 4px 0;
}

.app-conn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 0;
}

.app-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.app-node span {
  font-size: 7px;
  color: var(--text-dim);
  white-space: nowrap;
}

.app-node-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s;
}

.app-node-box.active {
  background: rgba(0, 255, 213, 0.08);
  border-color: rgba(0, 255, 213, 0.2);
}

.app-beam-track {
  flex: 1;
  min-width: 40px;
}

.app-encrypt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 7.5px;
  color: var(--aqua);
  opacity: 0.5;
  margin-top: auto;
}

/* ── Mac Mockup ── */
.mockup-mac {
  width: 320px;
  transform: rotateY(-6deg) rotateX(2deg);
}

.mac-screen {
  background: #1a1a24;
  border-radius: 12px 12px 0 0;
  border: 2px solid #2a2a38;
  border-bottom: none;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 255, 213, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 255, 213, 0.04);
}

.mac-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #0d0d14;
  border-bottom: 1px solid #222230;
}

.mac-dots {
  display: flex;
  gap: 5px;
}

.mac-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mac-dots span:nth-child(1) { background: #ff5f57; }
.mac-dots span:nth-child(2) { background: #febc2e; }
.mac-dots span:nth-child(3) { background: #28c840; }

.mac-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-bar-right svg {
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(0, 255, 213, 0.5));
}

.mac-desktop {
  min-height: 200px;
  padding: 12px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  background:
    radial-gradient(ellipse at 70% 40%, rgba(0, 255, 213, 0.03) 0%, transparent 60%),
    linear-gradient(180deg, #13131a 0%, #16161f 100%);
}

.mac-popover {
  width: 170px;
  background: rgba(30, 30, 42, 0.95);
  border: 1px solid #333345;
  border-radius: 8px;
  padding: 6px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-family: var(--font-body);
}

.pop-header {
  padding: 4px 12px 6px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pop-device {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  color: var(--text);
  font-size: 11px;
}

.pop-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 6px var(--aqua);
}

.pop-sep {
  height: 1px;
  background: #333345;
  margin: 4px 0;
}

.pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  color: var(--text);
  font-size: 11px;
}

.pop-key {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.6;
}

.mac-base {
  height: 14px;
  background: linear-gradient(180deg, #1e1e2a 0%, #16161f 100%);
  border-radius: 0 0 4px 4px;
  border: 2px solid #2a2a38;
  border-top: 1px solid #333345;
  position: relative;
}

.mac-hinge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: #333345;
  border-radius: 0 0 3px 3px;
}

/* ── Showcase Beam ── */
.showcase-beam {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--aqua);
  color: var(--bg);
  box-shadow: 0 4px 24px rgba(0, 255, 213, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(0, 255, 213, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--aqua);
  border: 1.5px solid var(--aqua);
}

.btn-outline:hover {
  background: rgba(0, 255, 213, 0.08);
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* ── Section Common ── */
section {
  padding: var(--section-pad) 0;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--aqua);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 48px;
}

.section-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Features Grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
  border-color: rgba(0, 255, 213, 0.2);
  transform: translateY(-4px);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 213, 0.3), transparent);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 255, 213, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--aqua);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 8px;
}

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

/* ── How It Works ── */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 255, 213, 0.1);
  border: 1.5px solid var(--aqua);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--aqua);
  margin-bottom: 20px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.step-connector {
  position: absolute;
  top: 24px;
  right: -20px;
  width: 40px;
  height: 1px;
  border-top: 2px dashed rgba(0, 255, 213, 0.25);
}

.step:last-child .step-connector { display: none; }

/* ── Comparison Table ── */
.comparison-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table thead th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.comparison-table thead th.highlight {
  color: var(--aqua);
  background: rgba(0, 255, 213, 0.04);
}

.comparison-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.comparison-table tbody td:first-child {
  font-weight: 500;
  color: var(--text);
}

.comparison-table tbody td.highlight {
  background: rgba(0, 255, 213, 0.04);
  color: var(--aqua);
  font-weight: 500;
}

.check { color: var(--aqua); }
.cross { color: var(--text-dim); opacity: 0.5; }

/* Mobile comparison cards */
.comparison-cards { display: none; }

.comparison-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

.comparison-card.is-cliprelay {
  border-color: rgba(0, 255, 213, 0.3);
}

.comparison-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 16px;
}

.comparison-card.is-cliprelay h4 {
  color: var(--aqua);
}

.comparison-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comparison-row:last-child { border-bottom: none; }
.comparison-row .label { color: var(--text-dim); }
.comparison-row .value { font-weight: 500; }

/* ── FAQ ── */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 20px 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.2s;
}

.faq-item summary:hover { color: var(--aqua); }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 20px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .brand-name svg { width: 24px; height: 24px; }

.footer-tagline {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-bottom a {
  color: var(--text-dim);
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hamburger { display: block; }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    border-left: 1px solid var(--border);
    transition: right 0.3s ease;
  }

  .nav-links.open { right: 0; }

  .nav-links a { font-size: 1.1rem; }

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

  .steps {
    flex-direction: column;
    gap: 32px;
  }

  .step { padding: 0; text-align: left; display: flex; gap: 16px; align-items: flex-start; }
  .step-number { flex-shrink: 0; }
  .step-content { text-align: left; }
  .step-connector { display: none !important; }

  .comparison-wrapper { display: none; }
  .comparison-cards { display: block; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .hero { padding: 100px 20px 60px; }

  .hero-showcase {
    flex-direction: column;
    gap: 24px;
    margin-top: 48px;
  }

  .mockup-phone,
  .mockup-mac {
    transform: none;
  }

  .mockup-phone {
    width: 180px;
    height: 360px;
  }

  .mockup-mac {
    width: 280px;
  }

  .showcase-beam {
    transform: rotate(90deg);
    width: 60px;
    height: 40px;
  }
}

@media (min-width: 1440px) {
  :root { --container: 1280px; }
}
