/* Carmann E-Bike Batteries — custom CSS, no framework */
:root {
  --ink: #1c241f;
  --ink-soft: #3d4540;
  --muted: #5e5a52;
  --paper: #f6f1e8;
  --paper-2: #efe8db;
  --sand: #e4dccb;
  --pine: #1e3a34;
  --pine-2: #16302b;
  --copper: #c46a38;
  --copper-dark: #9a4d26;
  --copper-soft: #f0d8c8;
  --line: rgba(28, 36, 31, 0.12);
  --white: #fffcf7;
  --shadow: 0 16px 40px rgba(28, 36, 31, 0.12);
  --radius: 18px;
  --max: 1120px;
  --header-h: 4.25rem;
  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
}
img, picture, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--pine); text-underline-offset: 0.15em; }
a:hover { color: var(--copper-dark); }
:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--pine);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.15rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 42rem; }
.muted { color: var(--muted); }
.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--copper-dark);
  margin-bottom: 0.7rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark { width: 2.1rem; height: 2.1rem; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text strong { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; }
.logo-text span { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.05rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--pine); }
.nav-call {
  background: var(--pine);
  color: var(--white) !important;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
}
.nav-call:hover { background: var(--pine-2); color: var(--white) !important; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
  position: relative;
  margin: 0 auto;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.areas-menu { position: relative; }
.areas-menu > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.areas-menu > summary::-webkit-details-marker { display: none; }
.areas-menu > summary::after { content: " ▾"; font-size: 0.7em; }
.areas-menu .submenu {
  position: absolute;
  top: 1.6rem;
  left: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 10rem;
  padding: 0.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.areas-menu .submenu a { padding: 0.35rem 0.6rem; border-radius: 8px; }
.areas-menu .submenu a:hover { background: var(--paper-2); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    inset: var(--header-h) 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem 1rem 1.2rem;
    gap: 0.4rem;
  }
  .nav.is-open { display: flex; }
  .areas-menu .submenu { position: static; box-shadow: none; border: 0; padding-left: 0.6rem; }
  .nav-call { text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}
.btn-primary { background: var(--copper); color: var(--white); }
.btn-primary:hover { background: var(--copper-dark); color: var(--white); }
.btn-dark { background: var(--pine); color: var(--white); }
.btn-dark:hover { background: var(--pine-2); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }

/* Hero */
.hero {
  padding: 3.2rem 0 3.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero-photo {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background: var(--sand);
  box-shadow: var(--shadow);
}
.hero-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; gap: 1.6rem; }
}

/* Sections */
section, .section { padding: 3.4rem 0; }
.section-alt { background: var(--paper-2); }
.section-pine { background: var(--pine); color: var(--paper); }
.section-pine h2, .section-pine h3 { color: var(--white); }
.section-pine .muted, .section-pine p { color: color-mix(in srgb, var(--paper) 82%, transparent); }
.grid-3, .grid-2, .grid-4 {
  display: grid;
  gap: 1.25rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem 1.4rem;
  height: 100%;
}
.card h3 { margin-bottom: 0.4em; }
.card img, .card picture { border-radius: 12px; margin-bottom: 0.9rem; }
.price {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 700;
  color: var(--pine);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0.2rem 0 0.5rem;
}
.price small { font-size: 0.95rem; font-weight: 560; color: var(--muted); letter-spacing: 0; }
.price-note { font-size: 0.95rem; color: var(--ink-soft); }
.card ul { margin: 0.4rem 0 0; padding-left: 1.15rem; }
.card li { margin: 0.25rem 0; }

.policy {
  background: var(--white);
  border-left: 4px solid var(--copper);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.25rem;
}
.policy h3 { font-size: 1.2rem; }

.media-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem;
  align-items: center;
}
.media-split img { border-radius: var(--radius); width: 100%; }
@media (max-width: 800px) { .media-split { grid-template-columns: 1fr; } }

.cta-band {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Contact form */
form label { display: block; font-weight: 600; margin: 0.8rem 0 0.3rem; }
form input, form textarea, form select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font: inherit;
  color: var(--ink);
}
form textarea { min-height: 8rem; resize: vertical; }
.form-note {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.8rem;
}
.form-status { margin-top: 0.8rem; font-weight: 600; }
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.2rem; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-aside a { color: inherit; }

/* Footer */
.site-footer {
  background: var(--pine-2);
  color: #e7efe9;
  padding: 2.6rem 0 1.6rem;
  margin-top: 0;
}
.site-footer a { color: #f0d8c8; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.site-footer h2 { color: var(--white); font-size: 1.05rem; margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #b7c4be;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* Blog */
.post-list article { margin-bottom: 0; }
.post-meta { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.6rem; }
.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.6em; }
.crumb { font-size: 0.92rem; color: var(--muted); margin-bottom: 1rem; }
.crumb a { color: inherit; }

/* Chat widget */
.chat-root { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60; font-family: var(--font-sans); }
.chat-toggle {
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--copper);
  color: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.chat-toggle:hover { background: var(--copper-dark); }
.chat-toggle svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.chat-panel {
  position: absolute;
  right: 0;
  bottom: 4.3rem;
  width: min(22.5rem, calc(100vw - 1.6rem));
  height: min(32rem, calc(100vh - 7rem));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-root.is-open .chat-panel { display: flex; }
.chat-head {
  background: var(--pine);
  color: var(--white);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.chat-head h2 { color: var(--white); font-size: 1.05rem; margin: 0; }
.chat-head p { margin: 0; font-size: 0.8rem; color: #d5e0da; }
.chat-close {
  background: transparent;
  border: 0;
  color: var(--white);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--paper);
}
.chat-bubble {
  max-width: 92%;
  padding: 0.6rem 0.75rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-bubble.bot { background: var(--white); border: 1px solid var(--line); align-self: flex-start; }
.chat-bubble.user { background: var(--pine); color: var(--white); align-self: flex-end; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 0.9rem 0.5rem; background: var(--paper); }
.chat-chips button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.chat-form, .chat-handoff {
  display: flex;
  gap: 0.35rem;
  padding: 0.6rem;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.chat-form input[type="text"], .chat-handoff input, .chat-handoff textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.chat-form button, .chat-handoff button {
  background: var(--copper);
  color: var(--white);
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.chat-handoff { flex-direction: column; display: none; }
.chat-handoff.is-visible { display: flex; }
.chat-form.is-hidden { display: none; }

/* 404 */
.error-page { min-height: 60vh; display: grid; align-content: center; padding: 4rem 0; }

/* Utilities */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
