:root {
  --cream: #f8f2e4;
  --cream-deep: #f0e8d4;
  --ink: #14170d;
  --red: #c2381f;
  --orange: #d97e1e;
  --blue: #2c6d99;
  --leaf: #588a34;
  --font-display: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--blue);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 242, 228, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(20, 23, 13, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { border-radius: 12px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
.nav-desktop a {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(20, 23, 13, 0.8);
}
.nav-desktop a:hover { background: rgba(20, 23, 13, 0.06); color: var(--ink); }
.nav-desktop a.active { background: var(--ink); color: var(--cream); }
.btn-call {
  margin-left: 0.5rem;
  background: var(--blue) !important;
  color: var(--cream) !important;
  font-weight: 600 !important;
}
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0 1.25rem 1rem;
  border-top: 1px solid rgba(20,23,13,0.1);
}
.nav-mobile.open { display: flex; }
.nav-mobile a { padding: 0.6rem 0.5rem; border-radius: 8px; font-size: 0.9rem; font-weight: 500; }
.nav-mobile a:hover { background: rgba(20,23,13,0.05); }
.nav-mobile .btn-call { text-align: center; margin-top: 0.4rem; border-radius: 8px; padding: 0.6rem; }

@media (min-width: 720px) {
  .nav-desktop { display: flex; }
  .nav-toggle { display: none; }
}

/* Hero */
.hero {
  border-bottom: 1px solid rgba(20,23,13,0.1);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  gap: 2.5rem;
  padding: 3rem 1.25rem;
}
@media (min-width: 960px) {
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: 5rem 1.25rem; }
}
.hero h1 {
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 1.1rem;
}
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
.hero p.lead { font-size: 1.1rem; color: rgba(20,23,13,0.7); max-width: 34rem; margin-top: 1.4rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }
.btn-primary, .btn-secondary {
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  transition: transform 0.15s;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-secondary { border: 1px solid rgba(20,23,13,0.2); color: var(--ink); }
.btn-primary:hover, .btn-secondary:hover { transform: scale(1.03); }

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.hero-grid .big { grid-column: span 2; aspect-ratio: 16 / 9; }
.hero-grid figure { margin: 0; overflow: hidden; border-radius: 18px; border: 1px solid rgba(20,23,13,0.1); aspect-ratio: 1 / 1; }
.hero-grid img { width: 100%; height: 100%; object-fit: cover; }

/* Circuit divider */
.circuit-divider { padding: 0.5rem 1.25rem; }
.circuit-divider svg { display: block; width: 100%; height: 40px; color: rgba(20,23,13,0.25); margin: 0 auto; max-width: 1120px; }
.circuit-divider.flip svg { transform: rotate(180deg); }

/* Sections */
.section { padding: 4rem 1.25rem; }
.section.alt { background: var(--cream-deep); }
.section-head { max-width: 42rem; }
.section-head h2 { font-size: 1.9rem; font-weight: 600; margin-top: 0.6rem; }
@media (min-width: 640px) { .section-head h2 { font-size: 2.3rem; } }
.section-head p { color: rgba(20,23,13,0.65); margin-top: 0.8rem; }

/* Breaker cards (services) */
.breaker-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .breaker-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .breaker-grid { grid-template-columns: 1fr 1fr 1fr; } }
.breaker-card {
  border: 1px solid rgba(20,23,13,0.1);
  background: rgba(255,255,255,0.6);
  border-radius: 18px;
  padding: 1.4rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.breaker-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px -12px rgba(20,23,13,0.25); }
.breaker-top { display: flex; align-items: center; justify-content: space-between; }
.breaker-num { font-family: var(--font-mono); font-size: 0.75rem; color: rgba(20,23,13,0.4); }
.breaker-switch { width: 26px; height: 12px; border-radius: 3px; border: 1px solid rgba(20,23,13,0.3); }
.breaker-card h3 { font-size: 1.05rem; font-weight: 600; margin-top: 0.9rem; line-height: 1.3; }
.breaker-card p { font-size: 0.9rem; color: rgba(20,23,13,0.65); margin-top: 0.4rem; }
.sw-0 { background: rgba(194,56,31,0.7); }
.sw-1 { background: rgba(217,126,30,0.7); }
.sw-2 { background: rgba(44,109,153,0.7); }
.sw-3 { background: rgba(88,138,52,0.7); }

/* Detail sections */
.detail-grid {
  display: grid;
  gap: 2.2rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 960px) { .detail-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }
.detail-grid ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.detail-grid li { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.9rem; }
.detail-grid li::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--leaf);
  margin-top: 0.4rem;
  flex: none;
}
.detail-footer { margin-top: 1.4rem; font-size: 0.9rem; font-weight: 500; color: rgba(20,23,13,0.6); }

/* CTA */
.cta {
  background: var(--ink);
  color: var(--cream);
  text-align: center;
  padding: 4rem 1.25rem;
}
.cta h2 { font-size: 1.9rem; font-weight: 600; }
@media (min-width: 640px) { .cta h2 { font-size: 2.3rem; } }
.cta p { max-width: 34rem; margin: 0.9rem auto 0; color: rgba(248,242,228,0.7); }
.cta .btn-primary { background: var(--cream); color: var(--ink); margin-top: 1.8rem; }

/* Footer */
.site-footer { margin-top: 5rem; background: var(--ink); color: var(--cream); }
.busbar { height: 6px; opacity: 0.7; background-image: repeating-linear-gradient(90deg, var(--cream) 0 6px, transparent 6px 12px); }
.footer-grid { display: grid; gap: 2.2rem; padding: 3.2rem 1.25rem; font-size: 0.9rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; } }
.footer-grid .brand-name { font-size: 1.05rem; }
.footer-tagline { margin-top: 1rem; color: rgba(248,242,228,0.7); max-width: 20rem; }
.footer-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: rgba(248,242,228,0.4); margin: 0 0 0.4rem; }
.footer-grid a:hover { color: var(--orange); }
.footer-nav { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 1.2rem; }
.footer-admin { margin-top: 0.6rem; color: rgba(248,242,228,0.4) !important; }
.footer-bottom { border-top: 1px solid rgba(248,242,228,0.1); padding: 1.1rem; text-align: center; font-size: 0.75rem; color: rgba(248,242,228,0.4); }

/* Gallery */
.gallery {
  columns: 1;
  column-gap: 1rem;
  margin-top: 2.2rem;
}
@media (min-width: 640px) { .gallery { columns: 2; } }
@media (min-width: 960px) { .gallery { columns: 3; } }
.gallery figure {
  break-inside: avoid;
  margin: 0 0 1rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(20,23,13,0.1);
  background: rgba(255,255,255,0.5);
}
.gallery figcaption { padding: 0.8rem 1rem; font-size: 0.85rem; color: rgba(20,23,13,0.6); }
.empty-state { color: rgba(20,23,13,0.5); margin-top: 2.5rem; }

/* Contact */
.contact-grid { display: grid; gap: 2.8rem; padding: 4rem 1.25rem; max-width: 1120px; margin: 0 auto; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1.2fr; } }
.contact-info h1 { font-size: 1.9rem; font-weight: 600; margin-top: 0.6rem; }
@media (min-width: 640px) { .contact-info h1 { font-size: 2.3rem; } }
.contact-info p.lead { color: rgba(20,23,13,0.65); max-width: 24rem; margin-top: 1rem; }
.contact-items { margin-top: 1.8rem; display: grid; gap: 0.9rem; font-size: 0.9rem; }
.contact-items div { display: flex; align-items: center; gap: 0.7rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.blue { background: var(--blue); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }

.card { border: 1px solid rgba(20,23,13,0.1); background: rgba(255,255,255,0.6); border-radius: 22px; padding: 1.6rem; }
@media (min-width: 640px) { .card { padding: 2rem; } }

.field { display: block; margin-bottom: 1.2rem; }
.field span { display: block; font-size: 0.87rem; font-weight: 500; margin-bottom: 0.4rem; }
.field .req { color: var(--red); }
.field input, .field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(20,23,13,0.15);
  background: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(44,109,153,0.15); }
.field-row { display: grid; gap: 1.2rem; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.hp-field { position: absolute; left: -9999px; }

.form-msg { padding: 0.8rem 1rem; border-radius: 10px; font-size: 0.87rem; margin-bottom: 1rem; }
.form-msg.error { background: rgba(194,56,31,0.1); color: var(--red); }
.form-msg.success { background: rgba(88,138,52,0.12); border: 1px solid rgba(88,138,52,0.3); text-align: center; padding: 2rem; border-radius: 18px; }
.form-msg.success h2 { font-size: 1.3rem; font-weight: 600; }
.form-msg.success p { margin-top: 0.5rem; color: rgba(20,23,13,0.65); }

.submit-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.9rem 1.6rem;
}
.submit-btn:disabled { opacity: 0.6; cursor: default; }
.submit-btn:hover:not(:disabled) { transform: scale(1.01); }

/* Admin */
.admin-shell { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.25rem; }
.admin-login-box { max-width: 22rem; margin: 4rem auto; }
.admin-login-box h1 { font-size: 1.6rem; font-weight: 600; margin-top: 0.4rem; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 1.4rem; border-bottom: 1px solid rgba(20,23,13,0.1); }
.admin-topbar h1 { font-size: 1.4rem; font-weight: 600; margin-top: 0.2rem; }
.btn-outline {
  border: 1px solid rgba(20,23,13,0.2);
  background: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-outline:hover { background: rgba(20,23,13,0.05); }
.tabs { display: flex; gap: 0.5rem; margin: 1.5rem 0; }
.tab-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(20,23,13,0.06);
  color: rgba(20,23,13,0.7);
}
.tab-btn.active { background: var(--ink); color: var(--cream); }
.admin-block { margin-bottom: 2.4rem; }
.admin-block h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.8rem; }
.admin-sub {
  border: 1px solid rgba(20,23,13,0.1);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.admin-field { display: block; margin-bottom: 0.8rem; }
.admin-field span { display: block; font-size: 0.75rem; font-weight: 500; color: rgba(20,23,13,0.6); margin-bottom: 0.3rem; }
.admin-field input, .admin-field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(20,23,13,0.15);
  background: #fff;
  padding: 0.6rem 0.8rem;
  font-size: 0.87rem;
  font-family: inherit;
}
.upload-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem; border: 1px solid rgba(20,23,13,0.1); border-radius: 14px; padding: 1rem; }
.upload-row > div { flex: 1 1 200px; }
.photo-grid { display: grid; gap: 1rem; margin-top: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .photo-grid { grid-template-columns: 1fr 1fr 1fr; } }
.photo-item { border: 1px solid rgba(20,23,13,0.1); border-radius: 14px; overflow: hidden; }
.photo-item .thumb { aspect-ratio: 4/3; overflow: hidden; }
.photo-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.8rem; }
.photo-item .row p { margin: 0; font-size: 0.75rem; color: rgba(20,23,13,0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-delete {
  flex: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(194,56,31,0.1);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
}
.btn-delete:hover { background: rgba(194,56,31,0.2); }
.save-row { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.msg-inline { font-size: 0.85rem; color: rgba(20,23,13,0.6); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
