/* ============================================================
   Zentura Home — Main Stylesheet
   Modern, professional design for Crestron Home custom drivers
   ============================================================ */

/* ---------- CSS Custom Properties (easy theming) ---------- */
:root {
  /* Primary palette */
  --color-primary:       #1a3a5c;   /* deep navy */
  --color-primary-light: #2a5a8c;
  --color-primary-dark:  #0e2340;
  --color-accent:        #00b4d8;   /* bright teal */
  --color-accent-hover:  #0096b7;

  /* Neutrals */
  --color-bg:            #f8f9fb;
  --color-surface:       #ffffff;
  --color-border:        #e2e6ec;
  --color-text:          #1e293b;
  --color-text-muted:    #64748b;
  --color-text-light:    #ffffff;

  /* Feedback */
  --color-success:       #16a34a;
  --color-warning:       #f59e0b;

  /* Typography */
  --font-family:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --font-mono:           'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Spacing & sizing */
  --header-height:       72px;
  --max-width:           1200px;
  --radius:              8px;
  --radius-lg:           16px;
  --shadow-sm:           0 1px 3px rgba(0,0,0,.08);
  --shadow-md:           0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:           0 8px 30px rgba(0,0,0,.12);
  --transition:          .25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4 { line-height: 1.2; color: var(--color-primary-dark); }
h1 { font-size: 2.75rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

/* ---------- Utilities ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-text-light);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-text-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: var(--color-text-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-primary);
  color: var(--color-text-light);
}
.btn-secondary:hover {
  background: var(--color-primary-light);
  color: var(--color-text-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo-text-accent {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
  font-size: .95rem;
  padding: .25rem 0;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 6px 0;
  transition: all var(--transition);
  border-radius: 2px;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  color: var(--color-text-light);
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(0, 180, 216, .08);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(0, 180, 216, .05);
  pointer-events: none;
}

.hero h1 {
  color: var(--color-text-light);
  margin-bottom: 1.25rem;
  max-width: 700px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  opacity: .9;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Sub-hero for inner pages */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: var(--color-text-light);
  padding: 3.5rem 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--color-text-light);
  font-size: 2.25rem;
  margin-bottom: .5rem;
}

.page-hero p {
  opacity: .85;
  font-size: 1.1rem;
}

/* ---------- Sections ---------- */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--color-surface);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: .75rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Feature Cards ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  color: white;
}

.feature-card h3 {
  margin-bottom: .5rem;
}

.feature-card p {
  color: var(--color-text-muted);
  font-size: .95rem;
}

/* ---------- Product / Driver Cards ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-border);
}

.product-card-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: 3rem;
}

.product-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-body h3 {
  margin-bottom: .5rem;
}

.product-card-body .product-description {
  color: var(--color-text-muted);
  font-size: .92rem;
  flex: 1;
  margin-bottom: 1rem;
}

.product-badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .75rem;
}

.badge-available {
  background: rgba(22, 163, 74, .1);
  color: var(--color-success);
}

.badge-coming-soon {
  background: rgba(245, 158, 11, .1);
  color: var(--color-warning);
}

.product-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
}

.product-price .price-period {
  font-size: .85rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.product-features {
  list-style: none;
  margin-bottom: 1.25rem;
}

.product-features li {
  font-size: .9rem;
  color: var(--color-text-muted);
  padding: .25rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.product-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}

.product-card-footer {
  padding: 0 1.5rem 1.5rem;
}

/* ---------- Pricing Tiers (optional) ---------- */
.pricing-note {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-top: 2rem;
}

/* ---------- FAQ / Accordion ---------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  background: var(--color-surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-family);
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--color-bg);
}

.faq-question .faq-icon {
  font-size: 1.25rem;
  transition: transform var(--transition);
  color: var(--color-accent);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---------- Documentation Cards ---------- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.doc-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}

.doc-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.doc-card h3 {
  margin-bottom: .5rem;
}

.doc-card p {
  color: var(--color-text-muted);
  font-size: .92rem;
  margin-bottom: 1rem;
}

.doc-card a {
  font-weight: 600;
  font-size: .9rem;
}

/* ---------- Contact Form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .4rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: .95rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, .15);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-info {
  padding: 1rem 0;
}

.contact-info h3 {
  margin-bottom: 1.5rem;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-info-item h4 {
  margin-bottom: .15rem;
}

.contact-info-item p {
  color: var(--color-text-muted);
  font-size: .92rem;
}

/* ---------- About Page ---------- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.about-image-placeholder {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  font-size: 1.1rem;
}

.about-text h2 {
  margin-bottom: 1rem;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.value-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.value-card .value-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.value-card h3 {
  margin-bottom: .5rem;
}

.value-card p {
  color: var(--color-text-muted);
  font-size: .92rem;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: var(--color-text-light);
  padding: 4rem 0;
  text-align: center;
}

.cta-banner h2 {
  color: var(--color-text-light);
  margin-bottom: .75rem;
}

.cta-banner p {
  opacity: .85;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.7);
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  font-size: .9rem;
  line-height: 1.7;
  margin-top: .75rem;
}

.footer-col h4 {
  color: var(--color-text-light);
  margin-bottom: 1rem;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: .5rem;
}

.footer-col ul a {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  transition: color var(--transition);
}

.footer-col ul a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    padding: 1.5rem;
    gap: .5rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: .75rem 0;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: 3rem 0;
  }

  .features-grid,
  .products-grid,
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
