/* ==========================================================================
   UnifyMail Website Styles
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary: #0ea5e9;
  --color-primary-dark: #0284c7;
  --color-primary-light: #38bdf8;
  --color-accent: #06b6d4;
  --color-bg: #ffffff;
  --color-bg-hero: #f0f9ff;
  --color-bg-alt: #f8fafc;
  --color-bg-footer: #0f172a;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-inverse: #f1f5f9;
  --color-border: #e2e8f0;
  --color-card-bg: #ffffff;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-white {
  background: #fff;
  color: var(--color-primary);
}

.btn-white:hover {
  background: #f0f9ff;
  color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.875rem;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

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


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

.nav-links a {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition);
}

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

.nav-cta {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  padding: 140px 0 100px;
  background: var(--color-bg-hero);
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg .circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 20s ease-in-out infinite;
}

.hero-bg .circle-1 {
  width: 500px;
  height: 500px;
  background: var(--color-primary-light);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.hero-bg .circle-2 {
  width: 400px;
  height: 400px;
  background: var(--color-accent);
  bottom: -100px;
  left: -80px;
  animation-delay: -7s;
}

.hero-bg .circle-3 {
  width: 300px;
  height: 300px;
  background: #a78bfa;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 30px) scale(1.02); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto 36px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Feature Chips ---------- */
.feature-chips {
  padding: 80px 0;
  background: var(--color-bg);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--color-text-light);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto;
}

.chips-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--transition);
}

.chip:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-hero);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.chip svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ---------- Feature Showcase ---------- */
.feature-showcase {
  padding: 80px 0;
  background: var(--color-bg-alt);
}

.feature-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 60px 0;
}

.feature-card:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

.feature-card:nth-child(even) .feature-card-content {
  order: 2;
}

.feature-card:nth-child(even) .feature-card-visual {
  order: 1;
}

.feature-card-content h3 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.feature-card-content p {
  color: var(--color-text-light);
  font-size: 1.0625rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.feature-list li svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-card-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon-box {
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, var(--color-bg-hero), #e0f2fe);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.feature-icon-box svg {
  width: 100px;
  height: 100px;
  color: var(--color-primary);
}

/* ---------- Open Source CTA ---------- */
.open-source {
  padding: 80px 0;
  background: var(--color-bg);
  text-align: center;
}

.open-source h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.open-source > .container > p {
  color: var(--color-text-light);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 36px;
}

.open-source-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.open-source-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Download CTA ---------- */
.download-cta {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  text-align: center;
  color: #fff;
}

.download-cta h2 {
  font-size: 2.25rem;
  color: #fff;
  margin-bottom: 12px;
}

.download-cta p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto 32px;
}

.download-platforms {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  opacity: 0.8;
}

.download-platforms span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.download-platforms svg {
  width: 18px;
  height: 18px;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-bg-footer);
  color: var(--color-text-inverse);
  padding: 60px 0 30px;
}

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

.footer-brand p {
  color: #94a3b8;
  font-size: 0.9375rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 16px;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul a {
  color: var(--color-text-inverse);
  font-size: 0.9375rem;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.footer ul a:hover {
  opacity: 1;
  color: var(--color-primary-light);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  text-align: center;
  color: #64748b;
  font-size: 0.8125rem;
}

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Legal Pages ---------- */
.legal-page {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  min-height: 100vh;
}

.legal-header {
  padding: 40px 0;
  background: var(--color-bg-hero);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.legal-header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.legal-header p {
  color: var(--color-text-light);
  font-size: 1rem;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding-top: 40px;
}

.legal-toc {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
}

.legal-toc h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc;
}

.legal-toc ol li {
  counter-increment: toc;
  margin-bottom: 8px;
}

.legal-toc ol li a {
  color: var(--color-text-light);
  font-size: 0.875rem;
  display: block;
  padding: 4px 0;
  transition: color var(--transition);
}

.legal-toc ol li a::before {
  content: counter(toc) ". ";
  color: var(--color-text-light);
}

.legal-toc ol li a:hover,
.legal-toc ol li a.active {
  color: var(--color-primary);
}

.toc-toggle {
  display: none;
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 24px;
  text-align: left;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 16px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: var(--color-text);
}

.legal-content ul,
.legal-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content ul {
  list-style: disc;
}

.legal-content ol {
  list-style: decimal;
}

.legal-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.legal-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.legal-content strong {
  font-weight: 600;
}

.legal-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0;
  }

  .feature-card:nth-child(even) .feature-card-content {
    order: 1;
  }

  .feature-card:nth-child(even) .feature-card-visual {
    order: 2;
  }

  .feature-icon-box {
    width: 220px;
    height: 220px;
  }

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

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

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-cta {
    margin-left: 0;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 120px 0 60px;
  }

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

  .hero p {
    font-size: 1.0625rem;
  }

  .section-header h2 {
    font-size: 1.625rem;
  }

  .feature-card-content h3 {
    font-size: 1.375rem;
  }

  .open-source h2,
  .download-cta h2 {
    font-size: 1.75rem;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    display: none;
  }

  .legal-toc ol.open {
    display: block;
    margin-bottom: 24px;
  }

  .toc-toggle {
    display: block;
  }

  .legal-header h1 {
    font-size: 1.875rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.875rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

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

  .chips-grid {
    gap: 8px;
  }

  .chip {
    padding: 8px 14px;
    font-size: 0.8125rem;
  }

  .download-platforms {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

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

  .open-source-stats {
    gap: 24px;
  }
}
