/* Heart Control — Midnight Pulse theme */

:root {
  --midnight: #0B0D12;
  --surface-deep: #12151C;
  --surface-card: #161A22;
  --surface-raised: #1A1F2A;
  --surface-elevated: #222834;
  --pulse-red: #E53935;
  --pulse-red-deep: #4A1212;
  --steel-blue: #7E8EAE;
  --steel-muted: #9AA3B2;
  --warm-gold: #C4A882;
  --text-primary: #E8EAED;
  --text-secondary: #9AA3B2;
  --text-tertiary: #6B7280;
  --outline-subtle: #3A4254;
  --outline-faint: #2A3040;

  --font-display: "DM Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --container: 1120px;
  --nav-height: 72px;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--midnight);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(229, 57, 53, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(126, 142, 174, 0.08), transparent);
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Typography */
.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pulse-red);
  margin-bottom: 0.75rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 52ch;
  margin-top: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pulse-red), #c62828);
  color: white;
  box-shadow: 0 4px 24px rgba(229, 57, 53, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(229, 57, 53, 0.45);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--outline-subtle);
}

.btn-secondary:hover {
  background: var(--surface-raised);
  border-color: var(--steel-blue);
}

.btn-sm {
  min-height: 40px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background var(--transition), backdrop-filter var(--transition), border-color var(--transition);
}

.nav.scrolled {
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-faint);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-logo-icon {
  border-radius: 8px;
}

.nav-links {
  display: none;
  gap: 2rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-card);
  border: 1px solid var(--outline-faint);
  border-radius: 999px;
}

.lang-btn {
  min-width: 40px;
  min-height: 32px;
  padding: 0.25rem 0.625rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  color: var(--text-primary);
  background: var(--surface-elevated);
  box-shadow: inset 0 0 0 1px var(--outline-subtle);
}

.lang-switch-mobile {
  align-self: flex-start;
  margin-bottom: 0.5rem;
}

.nav-links a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(18, 21, 28, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--outline-faint);
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.mobile-menu.open {
  pointer-events: auto;
}

.mobile-menu a {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.mobile-menu a:hover {
  background: var(--surface-card);
  color: var(--text-primary);
}

.mobile-menu .btn {
  margin-top: 0.5rem;
}

/* Hero */
.hero {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 48ch;
  margin-top: 1.25rem;
}

.hero-bpm {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.pulse-ring {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-wave {
  position: absolute;
  inset: 0;
  border: 2px solid var(--pulse-red);
  border-radius: 50%;
  pointer-events: none;
}

.pulse-ring-inner {
  width: 12px;
  height: 12px;
  background: var(--pulse-red);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(229, 57, 53, 0.6);
}

.pulse-ring::before,
.pulse-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--pulse-red);
  border-radius: 50%;
  opacity: 0;
}

.bpm-display {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.bpm-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--pulse-red);
  font-variant-numeric: tabular-nums;
}

.bpm-label {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-ecg-wrap {
  width: 100%;
  max-width: 480px;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.hero-ecg {
  width: 100%;
  height: 80px;
  overflow: visible;
}

.hero-strap {
  width: min(280px, 70vw);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(22, 26, 34, 0.5), transparent);
}

.section-header {
  margin-bottom: 3rem;
}

.section-header h2 {
  max-width: 20ch;
}

/* Glass cards */
.glass-card {
  background: linear-gradient(145deg, rgba(26, 31, 42, 0.9), rgba(22, 26, 34, 0.95));
  border: 1px solid var(--outline-faint);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}

.glass-card:hover {
  border-color: var(--outline-subtle);
  transform: translateY(-2px);
}

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(229, 57, 53, 0.12);
  border-radius: 12px;
  color: var(--pulse-red);
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.glass-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.features-grid {
  display: grid;
  gap: 1.25rem;
}

/* Steps */
.steps {
  list-style: none;
  display: grid;
  gap: 0;
  position: relative;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--outline-faint);
}

.step:last-child {
  border-bottom: none;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--pulse-red);
  background: rgba(229, 57, 53, 0.12);
  border-radius: 50%;
  flex-shrink: 0;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.375rem;
}

/* Tests */
.tests-grid {
  display: grid;
  gap: 1.25rem;
}

.test-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.test-flow {
  color: var(--steel-blue);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.test-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
}

.test-bar {
  flex: 1;
  height: var(--h, 50%);
  background: linear-gradient(180deg, var(--pulse-red), rgba(229, 57, 53, 0.3));
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  transform: scaleY(0);
}

.test-note {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}

/* Sensors */
.sensor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.sensor-chip {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-card);
  border: 1px solid var(--outline-faint);
  border-radius: 999px;
  transition: border-color var(--transition), color var(--transition);
}

.sensor-chip:hover {
  border-color: var(--pulse-red);
  color: var(--text-primary);
}

.sensor-note {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  max-width: 60ch;
}

.sensor-note strong {
  color: var(--warm-gold);
}

/* Disclaimer */
.disclaimer-section {
  padding-bottom: 3rem;
}

.disclaimer {
  border-color: rgba(196, 168, 130, 0.25);
  background: linear-gradient(145deg, rgba(74, 48, 16, 0.2), rgba(22, 26, 34, 0.95));
}

.disclaimer p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.disclaimer strong {
  color: var(--warm-gold);
}

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--outline-faint);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* Animation initial states */
.hero-animate {
  opacity: 0;
}

[data-animate] {
  opacity: 0;
  transform: translateY(24px);
}

[data-animate].animated {
  opacity: 1;
  transform: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-animate,
  [data-animate] {
    opacity: 1;
    transform: none;
  }

  .pulse-ring::before,
  .pulse-ring::after,
  .pulse-wave {
    display: none;
  }

  .test-bar {
    transform: scaleY(1);
  }

  .btn-primary:hover,
  .glass-card:hover {
    transform: none;
  }
}

/* Responsive */
@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

  .lang-switch-mobile {
    display: none;
  }

  .nav-toggle {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .hero-visual {
    align-items: flex-end;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .step {
    flex-direction: column;
    grid-template-columns: 1fr;
    text-align: center;
    border-bottom: none;
    padding: 1.5rem;
    background: var(--surface-card);
    border-radius: var(--radius);
    border: 1px solid var(--outline-faint);
  }

  .step-num {
    margin: 0 auto 1rem;
  }
}
