/*
 * PulseClock - Official Product Website Styles
 * Supports Dark & Light mode, mobile drawer navigation, responsive layouts
 */

:root {
  --color-scheme: dark;
  --bg-primary: #090d14;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --border-subtle: #243048;
  --border-accent: rgba(0, 230, 118, 0.3);

  --neon-green: #00e676;
  --neon-cyan: #00e5ff;
  --neon-amber: #ffab00;
  --neon-purple: #7c4dff;
  --neon-red: #ff3d71;

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --hero-gradient: radial-gradient(circle at 50% 0%, #152238 0%, #090d14 70%);
  --header-bg: rgba(9, 13, 20, 0.88);
  --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --mockup-bg: linear-gradient(145deg, #1f2a3e, #0d131e);
  --mockup-glow: radial-gradient(circle, rgba(0, 230, 118, 0.2) 0%, rgba(0, 229, 255, 0.1) 40%, transparent 70%);
  --preset-bg: linear-gradient(135deg, #131d2e 0%, #0d1421 100%);
  --cta-bg: radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.15) 0%, rgba(9, 13, 20, 0) 70%),
             linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  --footer-bg: #06090e;
}

/* Light Theme Variables */
[data-theme="light"] {
  --color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-accent: rgba(5, 150, 105, 0.35);

  --neon-green: #059669;
  --neon-cyan: #0284c7;
  --neon-amber: #d97706;
  --neon-purple: #7c3aed;
  --neon-red: #e11d48;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --hero-gradient: radial-gradient(circle at 50% 0%, #e0f2fe 0%, #f8fafc 70%);
  --header-bg: rgba(248, 250, 252, 0.9);
  --card-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --mockup-bg: linear-gradient(145deg, #cbd5e1, #94a3b8);
  --mockup-glow: radial-gradient(circle, rgba(5, 150, 105, 0.15) 0%, rgba(2, 132, 199, 0.15) 40%, transparent 70%);
  --preset-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --cta-bg: radial-gradient(circle at 50% 50%, rgba(5, 150, 105, 0.1) 0%, transparent 70%),
             linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  --footer-bg: #0b1120;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: var(--color-scheme);
  scroll-behavior: smooth;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--hero-gradient);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
  color: var(--neon-green);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Header & Nav */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-logo img {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.35), 0 0 0 1px rgba(0, 230, 118, 0.25);
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-logo:hover img {
  transform: scale(1.06);
  box-shadow: 0 6px 26px rgba(0, 229, 255, 0.5), 0 0 0 1.5px rgba(0, 229, 255, 0.4);
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(0, 230, 118, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  display: inline-block;
}

[data-theme="light"] .brand-badge {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.3);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Icon Buttons */
.icon-btn {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  user-select: none;
}

.icon-btn:hover {
  background: var(--bg-surface);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
}

.mobile-only {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.72rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-green), #00c853);
  color: #090d14;
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.35);
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
  color: #090d14;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 230, 118, 0.5);
}

[data-theme="light"] .btn-primary:hover {
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

/* Mobile Drawer Menu */
.mobile-drawer {
  position: fixed;
  top: 4.25rem;
  left: 0;
  right: 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 1.25rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-block-end: 1.5rem;
}

.mobile-nav-links a {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.mobile-drawer-footer {
  margin-block-top: 1.25rem;
  text-align: center;
}

/* Hero Section */
.hero {
  padding-block: 4.5rem 3rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3.5rem;
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-block-end: 1.25rem;
}

[data-theme="light"] .hero-tagline {
  background: rgba(2, 132, 199, 0.1);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.3);
}

.hero-title {
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-block-end: 1.5rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--neon-green) 0%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-block-end: 2rem;
  max-width: 540px;
}

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

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-block-top: 2.5rem;
  padding-block-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Phone Mockup */
.mockup-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.mockup-glow {
  position: absolute;
  inset: -10% -10% -10% -10%;
  background: var(--mockup-glow);
  filter: blur(40px);
  z-index: 1;
}

.phone-card {
  position: relative;
  z-index: 2;
  border-radius: 36px;
  padding: 10px;
  background: var(--mockup-bg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 320px;
}

.phone-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 28px;
}

/* Section styling */
section {
  padding-block: 4.5rem;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-block-end: 3.5rem;
}

.section-pill {
  display: inline-block;
  background: rgba(124, 77, 255, 0.15);
  color: #b388ff;
  border: 1px solid rgba(124, 77, 255, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-block-end: 0.75rem;
}

[data-theme="light"] .section-pill {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.3);
}

.section-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-block-end: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
  box-shadow: var(--card-shadow);
}

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

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-block-end: 1.25rem;
}

.icon-green {
  background: rgba(0, 230, 118, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.icon-cyan {
  background: rgba(0, 229, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.icon-amber {
  background: rgba(255, 171, 0, 0.15);
  color: var(--neon-amber);
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.icon-purple {
  background: rgba(124, 77, 255, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(124, 77, 255, 0.3);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-block-end: 0.6rem;
}

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

/* Routine Presets Showcase */
.presets-banner {
  background: var(--preset-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2.5rem;
  box-shadow: var(--card-shadow);
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block: 1.5rem;
}

.preset-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.preset-chip.active {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

[data-theme="light"] .preset-chip.active {
  background: rgba(5, 150, 105, 0.15);
  border-color: #059669;
  color: #047857;
}

/* CTA Download Banner */
.cta-banner {
  background: var(--cta-bg);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.cta-banner h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-block-end: 1rem;
}

.cta-banner p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin-inline: auto;
  margin-block-end: 2rem;
}

/* Footer */
footer.site-footer {
  margin-block-start: auto;
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-subtle);
  padding-block: 3.5rem 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-block-end: 2.5rem;
}

.footer-brand p {
  margin-block-start: 0.75rem;
  color: var(--text-secondary);
  max-width: 320px;
}

.footer-brand .brand-logo img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 230, 118, 0.4), 0 0 0 1px rgba(0, 230, 118, 0.3);
}

.footer-col h4 {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-block-end: 1rem;
}

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

.footer-col a {
  color: #94a3b8;
}

.footer-col a:hover {
  color: var(--neon-cyan);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-block-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
  color: #64748b;
}

/* Responsive Styles */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-description {
    margin-inline: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .presets-banner {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
  .brand-badge {
    display: none; /* Hide badge on mobile to prevent navbar cramming */
  }
  .hero {
    padding-block: 2.5rem 2rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 1rem;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .hero-stats {
    gap: 1.25rem;
  }
  .stat-item h3 {
    font-size: 1.45rem;
  }
  .stat-item p {
    font-size: 0.72rem;
  }
}
