/**
 * Modern page theme — include AFTER beauter.css on redesigned pages.
 * Resets beauter's 62.5% html hack so rem units render at readable sizes.
 */

:root {
  --sky-deep: #0a1628;
  --sky-mid: #0f2847;
  --sky-light: #1a4a7a;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --surface: #ffffff;
  --text-muted: #64748b;
  --radius: 16px;
}

/* Must load AFTER beauter.css — overrides its 62.5% html hack */
html {
  font-size: 16px !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px !important;
  line-height: 1.6;
  background: #f0f4f8;
}

/* ── Hero (centered) ── */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 24px 80px;
  text-align: center;
  color: #fff;
  background: linear-gradient(145deg, var(--sky-deep) 0%, var(--sky-mid) 45%, var(--sky-light) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(56, 189, 248, 0.18) 0%, transparent 70%),
    radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: #f0f4f8;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

/* ── Hero (split, home page) ── */

.hero-split {
  position: relative;
  overflow: hidden;
  padding: 56px 24px 72px;
  color: #fff;
  background: linear-gradient(145deg, var(--sky-deep) 0%, var(--sky-mid) 50%, var(--sky-light) 100%);
}

.hero-split::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% 0%, rgba(56, 189, 248, 0.2) 0%, transparent 65%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-split::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: #f0f4f8;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
}

.hero-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-tagline {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.hero-visual img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-visual .hero-demo {
  max-height: 320px;
  object-fit: contain;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Shared hero elements ── */

.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.75rem, 7vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-sub {
  margin: 0 0 22px;
  max-width: 580px;
  font-size: 21px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.hero-inner .hero-sub {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 28px;
}

.hero-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-split .hero-platforms {
  margin-bottom: 24px;
}

.hero:not(.hero-split) .hero-platforms,
.hero-inner .hero-platforms {
  justify-content: center;
}

.hero-platforms span {
  padding: 7px 16px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  font-size: 17px;
  font-weight: 600;
  color: var(--sky-deep);
  text-decoration: none;
  background: var(--accent);
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-cta:hover {
  opacity: 0.9;
  transform: scale(1.03);
  text-decoration: none;
  color: var(--sky-deep);
}

.btn-cta.outline {
  color: #fff;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn-cta.outline:hover {
  color: #fff;
}

/* ── Section headings ── */

.section-head {
  text-align: center;
  padding: 56px 24px 8px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  color: var(--sky-deep);
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 18px;
}

/* ── Product / download cards ── */

.cards-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(10, 22, 40, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(10, 22, 40, 0.13);
}

.product-card.featured {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.card-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 14px;
}

.card-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
}

.card-tag.xplane { color: #0369a1; background: #e0f2fe; }
.card-tag.msfs { color: #7c3aed; background: #ede9fe; }
.card-tag.scripts { color: #047857; background: #d1fae5; }
.card-tag.utility { color: #b45309; background: #fef3c7; }
.card-tag.hass { color: #047857; background: #d1fae5; }

.product-card h3 {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  color: var(--sky-deep);
}

.product-card p {
  flex: 1;
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
}

.card-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.55;
  color: #475569;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.card-note mark {
  background: #fef9c3;
  color: #854d0e;
  padding: 0 4px;
  border-radius: 3px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-download:hover {
  opacity: 0.92;
  transform: scale(1.02);
  text-decoration: none;
  color: #fff;
}

.btn-download.secondary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.btn-download.amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-download.outline {
  color: var(--sky-mid);
  background: transparent;
  border: 1.5px solid rgba(10, 22, 40, 0.15);
}

.btn-download.outline:hover {
  background: rgba(10, 22, 40, 0.04);
  color: var(--sky-deep);
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.hass-badge {
  margin-top: auto;
}

.hass-badge img {
  max-width: 100%;
  border-radius: 8px;
}

/* ── Promo banner ── */

.promo-banner {
  max-width: 1080px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.promo-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: var(--sky-deep);
  border-radius: var(--radius);
  color: #fff;
}

.promo-inner p {
  margin: 0;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
}

.promo-inner strong {
  color: #fff;
}

.btn-promo {
  flex-shrink: 0;
  padding: 12px 24px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--sky-deep);
  text-decoration: none;
  background: var(--accent);
  border-radius: 8px;
  transition: opacity 0.2s;
}

.btn-promo:hover {
  opacity: 0.88;
  text-decoration: none;
  color: var(--sky-deep);
}

/* ── Community ── */

.community {
  text-align: center;
  padding: 16px 24px 56px;
}

.community a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  font-size: 1.0625rem;
  font-weight: 500;
  color: #1877f2;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(24, 119, 242, 0.25);
  border-radius: 999px;
  transition: background 0.2s;
}

.community a:hover {
  background: #eff6ff;
  text-decoration: none;
}

/* ── Testimonials ── */

.testi-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.testi-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(10, 22, 40, 0.06);
}

.testi-card:nth-child(even) {
  direction: rtl;
}

.testi-card:nth-child(even) > * {
  direction: ltr;
}

.testi-body p {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.65;
  color: #334155;
}

.testi-body p:last-child {
  margin-bottom: 0;
}

.testi-photo img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ── Compatibility table ── */

.compat-section {
  max-width: 1080px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.compat-card {
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(10, 22, 40, 0.06);
}

.compat-card h2 {
  margin: 0 0 16px;
  font-size: 1.4375rem;
  font-weight: 700;
  color: var(--sky-deep);
}

.compat-card iframe {
  width: 100%;
  height: 800px;
  border: none;
  border-radius: 8px;
}

/* ── Contact & footer ── */

.contact-section {
  max-width: 1080px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 36px 32px;
  background: var(--sky-deep);
  border-radius: var(--radius);
  color: #fff;
}

.contact-card h2 {
  margin: 0 0 20px;
  font-size: 1.5rem;
  font-weight: 700;
}

.contact-links {
  display: grid;
  gap: 12px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s;
}

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

.contact-links .label {
  font-weight: 600;
  color: var(--accent);
  min-width: 72px;
}

.contact-logo img {
  width: 120px;
  border-radius: 12px;
}

.site-footer {
  padding: 24px 20px 32px;
  text-align: center;
  font-size: 16px;
  color: var(--text-muted);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--sky-mid);
  text-decoration: underline;
}

.footer-counter {
  margin-bottom: 12px;
  opacity: 0.7;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-split .hero-platforms,
  .hero-actions {
    justify-content: center;
  }

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

  .testi-card,
  .testi-card:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .contact-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-links a {
    justify-content: center;
  }
}
