/* ── Design tokens: mirrored from apps/web/src/styles/base.css ── */
:root {
  --bg: #ffffff;
  --bg2: #f5f5f4;
  --bg3: #eeece7;
  --text: #1a1a18;
  --text2: #5f5e5a;
  --text3: #888780;
  --border: rgba(0,0,0,0.12);
  --border2: rgba(0,0,0,0.22);
  --accent: #d97706;
  --success: #059669;
  --radius: 10px;
  --radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1a;
    --bg2: #242422;
    --bg3: #2c2c2a;
    --text: #f0ede6;
    --text2: #b4b2a9;
    --text3: #888780;
    --border: rgba(255,255,255,0.1);
    --border2: rgba(255,255,255,0.2);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Containers ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 740px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Skip link ── */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 0; top: 0; width: auto; height: auto;
  padding: 8px 16px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none; overflow: visible; z-index: 9999;
}

/* ── Header / Nav ── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }
.logo-mark { font-size: 22px; }
.site-nav {
  display: flex; align-items: center; gap: 4px;
}
.site-nav a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--text2); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--bg2); color: var(--text); text-decoration: none; }
.site-nav a.nav-cta {
  background: var(--accent); color: #fff; padding: 6px 14px;
}
.site-nav a.nav-cta:hover { opacity: 0.88; background: var(--accent); }
.nav-toggle {
  display: none; flex-direction: column; justify-content: space-between;
  width: 24px; height: 18px; background: none; border: none;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all 0.15s; border: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-secondary:hover { background: rgba(217,119,6,0.08); }

/* ── Hero ── */
.hero {
  background: var(--bg3);
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.125rem; color: var(--text2);
  max-width: 560px; margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Section headings ── */
.section-heading { text-align: center; margin-bottom: 2.5rem; }
.section-heading h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-heading p { color: var(--text2); max-width: 540px; margin: 0 auto; }

/* ── How it works ── */
.how-it-works { padding: 4.5rem 0; background: var(--bg); }
.steps-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem;
}
.step { text-align: center; padding: 0 0.5rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: #fef3c7; color: #92400e;
  font-size: 20px; font-weight: 800; margin-bottom: 1rem;
}
@media (prefers-color-scheme: dark) {
  .step-num { background: #422006; color: #fcd34d; }
}
.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.step p { color: var(--text2); font-size: 0.95rem; }

/* ── Trust bar ── */
.trust-bar {
  padding: 2.5rem 0; background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-bar .container { text-align: center; }
.trust-bar-label {
  font-size: 12px; color: var(--text3); margin-bottom: 1.25rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.trust-logos {
  display: flex; justify-content: center; gap: 2.5rem;
  flex-wrap: wrap; align-items: center;
}
.trust-logo-placeholder {
  width: 100px; height: 32px; background: var(--border);
  border-radius: 6px; display: inline-block;
}

/* ── Post card grid ── */
.posts-section { padding: 4.5rem 0; }
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: box-shadow 0.15s;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.07); }
.post-card h3 { font-size: 1.025rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.35; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card p { color: var(--text2); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.post-card .read-more { font-size: 14px; font-weight: 600; color: var(--accent); }
.post-card .read-more:hover { text-decoration: underline; }
.post-date { font-size: 12px; color: var(--text3); margin-bottom: 0.5rem; }

/* ── CTA banner ── */
.cta-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 4rem 0; text-align: center;
}
@media (prefers-color-scheme: dark) {
  .cta-banner { background: linear-gradient(135deg, #422006, #78350f); }
}
.cta-banner h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; color: #92400e; }
@media (prefers-color-scheme: dark) { .cta-banner h2 { color: #fcd34d; } }
.cta-banner p { color: #78350f; margin-bottom: 1.75rem; font-size: 1rem; }
@media (prefers-color-scheme: dark) { .cta-banner p { color: #fde68a; } }

/* ── Page hero (interior pages) ── */
.page-hero {
  background: var(--bg3); padding: 3rem 0 2.5rem; text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: 0.75rem;
}
.page-hero p { color: var(--text2); max-width: 560px; margin: 0 auto; }

/* ── Blog listing ── */
.learn-page { padding: 3rem 0; }

/* ── Comparison table ── */
.products-page { padding: 3rem 0; }
.comparison-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.comparison-table {
  width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap;
}
.comparison-table th {
  background: var(--bg2); padding: 12px 14px; text-align: left;
  font-weight: 600; border-bottom: 2px solid var(--border2);
}
.comparison-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.comparison-table tbody tr:nth-child(even) td { background: var(--bg2); }
.comparison-table tbody tr:hover td { background: #fef3c7; }
@media (prefers-color-scheme: dark) {
  .comparison-table tbody tr:hover td { background: #422006; }
}
.table-note { font-size: 13px; color: var(--text3); font-style: italic; }

/* ── Installer cards ── */
.installers-page { padding: 3rem 0; }
.installers-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin-bottom: 3rem;
}
.installer-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.installer-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.installer-location { font-size: 13px; color: var(--text3); margin-bottom: 1.25rem; }
.installer-cta-box {
  background: var(--bg2); border-radius: var(--radius);
  padding: 2rem; text-align: center; border: 1px solid var(--border);
}
.installer-cta-box h3 { margin-bottom: 0.5rem; }
.installer-cta-box p { color: var(--text2); margin-bottom: 1.25rem; font-size: 15px; }

/* ── Partners page ── */
.partners-page { padding: 3rem 0; }
.value-props {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; margin-bottom: 3rem;
}
.value-prop { background: var(--bg2); border-radius: var(--radius); padding: 1.5rem; }
.value-prop h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.value-prop p { font-size: 14px; color: var(--text2); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; margin-bottom: 3rem;
}
.pricing-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; text-align: center;
}
.pricing-card.featured { border-color: var(--accent); border-width: 2px; }
.pricing-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.pricing-price { font-size: 2rem; font-weight: 800; color: var(--accent); margin-bottom: 0.25rem; }
.pricing-period { font-size: 13px; color: var(--text3); margin-bottom: 1.25rem; }
.pricing-features { list-style: none; text-align: left; font-size: 14px; color: var(--text2); margin-bottom: 1.5rem; }
.pricing-features li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* ── Netlify form ── */
.enquiry-form { max-width: 560px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--text2); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* ── Post article ── */
.post-article { padding: 3.5rem 0; }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem;
}
.post-header time { font-size: 14px; color: var(--text3); }
.post-body { font-size: 1.0625rem; line-height: 1.8; }
.post-body h2 {
  font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.post-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
.post-body p { margin-bottom: 1.25rem; }
.post-body ul, .post-body ol { margin: 0 0 1.25rem 1.75rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1.25rem; margin: 1.5rem 0;
  color: var(--text2); font-style: italic;
  background: var(--bg2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-cta {
  margin-top: 3rem; padding: 2rem;
  background: #fef3c7; border-radius: var(--radius); text-align: center;
}
@media (prefers-color-scheme: dark) { .post-cta { background: #422006; } }
.post-cta p { color: #78350f; margin-bottom: 1rem; font-weight: 600; font-size: 1.05rem; }
@media (prefers-color-scheme: dark) { .post-cta p { color: #fcd34d; } }

/* ── Generic content page (privacy etc.) ── */
.content-page { padding: 3rem 0; }
.content-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 2rem; }
.content-page h2 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.content-page p { margin-bottom: 1rem; color: var(--text2); }
.content-page ul { margin: 0 0 1rem 1.5rem; color: var(--text2); }
.content-page li { margin-bottom: 0.3rem; }

/* ── Footer ── */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 2rem 0; text-align: center;
  font-size: 14px; color: var(--text3);
}
.site-footer a { color: var(--text3); }
.site-footer a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    gap: 0; padding: 0.75rem 1rem;
    z-index: 99;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 12px; }
  .site-nav a.nav-cta { text-align: center; margin-top: 8px; }

  .hero { padding: 3.5rem 0 3rem; }
  .steps-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .how-it-works { padding: 3rem 0; }
  .value-props { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .posts-section { padding: 3rem 0; }
  .cta-banner { padding: 3rem 0; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { text-align: center; justify-content: center; }
}
