/* Junction Micro Repair — hand-rolled styles.
   Palette: circuit-board green + copper, workshop-technical. */

:root {
  --green-deep: #0b3d2e;
  --green: #11563f;
  --green-bright: #1a7a58;
  --copper: #c17c3f;
  --copper-light: #e0a56d;
  --copper-dark: #9c5f2a;
  --trace: #bfd8cd;
  --ink: #1b2420;
  --ink-soft: #45524b;
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-alt: #edf1ec;
  --line: #d8ddd6;
  --good-bg: #e5f2ea;
  --good-line: #1a7a58;
  --warn-bg: #f8efe2;
  --warn-line: #c17c3f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(27, 36, 32, 0.06), 0 8px 24px -12px rgba(27, 36, 32, 0.18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--green-deep);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green); }
a:hover { color: var(--green-bright); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--copper);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */

.site-header {
  background: var(--green-deep);
  color: #fff;
  border-bottom: 3px solid var(--copper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--copper-light); }

.logo-mark {
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  color: currentColor;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: #fff; }

.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--copper);
}

/* ---------- Buttons, chips, links ---------- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-lg { padding: 0.75rem 1.5rem; font-size: 1.05rem; }

.btn-copper { background: var(--copper); color: #fff !important; border-color: var(--copper); }
.btn-copper:hover { background: var(--copper-dark); border-color: var(--copper-dark); }

.btn-green { background: var(--green); color: #fff !important; border-color: var(--green); }
.btn-green:hover { background: var(--green-bright); border-color: var(--green-bright); }

.btn-ghost { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, 0.5); }
.btn-ghost:hover { border-color: #fff; }

.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.chip {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--green-deep);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.chip:hover { border-color: var(--copper); color: var(--copper-dark); }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(60rem 30rem at 110% -20%, rgba(26, 122, 88, 0.35), transparent 60%),
    var(--green-deep);
  color: #fff;
  padding: 4rem 0 4.5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero h1 { color: #fff; margin-bottom: 0.4em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper-light);
  margin-bottom: 0.75rem;
}

.page-hero .eyebrow { color: var(--copper-dark); }

.lede {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 42rem;
}

.hero .lede { color: rgba(255, 255, 255, 0.88); }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 1rem;
}

.hero-meta { color: rgba(255, 255, 255, 0.75); font-size: 0.95rem; }
.hero-meta a { color: var(--copper-light); text-decoration: none; font-weight: 600; }
.hero-meta a:hover { text-decoration: underline; }

.hero-art { max-width: 20rem; margin: 0 auto; }
.hero-art svg { width: 100%; height: auto; display: block; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
}

/* ---------- Sections ---------- */

.section { padding: 3.25rem 0; }
.section-alt { background: var(--surface-alt); }

.section-lede {
  color: var(--ink-soft);
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.card:hover {
  border-color: var(--copper);
  transform: translateY(-2px);
}

.service-card h3 { margin-bottom: 0.4rem; }
.service-card p { color: var(--ink-soft); font-size: 0.95rem; }

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--copper-dark);
}
a.card:hover .card-link { text-decoration: underline; }

.diff-card { padding: 0.5rem 0; }
.diff-card h3 { margin: 0.6rem 0 0.35rem; }
.diff-card p { color: var(--ink-soft); font-size: 0.95rem; }

.diff-icon {
  display: inline-flex;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--green-deep);
  color: var(--copper-light);
}
.diff-icon svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Icons (Lucide, inlined by src/lib/icons.js) ----------
   Sized in em so an icon tracks the type it sits beside, and coloured by
   inheritance so it picks up whatever the surrounding text is doing. All of
   them are decorative and aria-hidden; none carries meaning on its own. */

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.18em;
}

.card-icon {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--copper-dark);
}
.card-icon .icon { width: 1.6rem; height: 1.6rem; vertical-align: baseline; }

.heading-icon {
  display: inline-flex;
  margin-right: 0.5rem;
  color: var(--copper-dark);
}
.heading-icon .icon { width: 0.9em; height: 0.9em; vertical-align: baseline; }

.result-icon {
  display: inline-flex;
  margin-right: 0.45rem;
  vertical-align: -0.2em;
}

@keyframes icon-spin { to { transform: rotate(360deg); } }
.icon-spin { animation: icon-spin 1s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .icon-spin { animation: none; }
}

/* ---------- Testimonials ---------- */

.testimonial {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.testimonial blockquote { margin: 0; }
.testimonial blockquote p {
  font-size: 0.98rem;
  color: var(--ink);
}
.testimonial blockquote p::before { content: "\201C"; color: var(--copper); font-weight: 700; }
.testimonial blockquote p::after { content: "\201D"; color: var(--copper); font-weight: 700; }

.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.testimonial-detail { color: var(--ink-soft); }

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
  color: var(--copper-light);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--green-deep);
  color: #fff;
  padding: 2.75rem 0;
  border-top: 3px solid var(--copper);
}

.cta-band h2 { color: #fff; margin-bottom: 0.25em; }
.cta-band p { color: rgba(255, 255, 255, 0.8); }

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

/* ---------- Price tables ---------- */

.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.98rem;
}

.price-table th, .price-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.price-table thead th {
  background: var(--green-deep);
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--copper);
}

.price-table tbody tr:last-child th,
.price-table tbody tr:last-child td { border-bottom: none; }

.price-table tbody th { font-weight: 600; color: var(--ink); }

.price {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--copper-dark);
  white-space: nowrap;
}

.price-note { color: var(--ink-soft); font-size: 0.9rem; }

.service-section { padding: 2.25rem 0; }
.service-section h2 { margin-bottom: 0.25em; }

/* ---------- FAQ ---------- */

.faq-list { max-width: 50rem; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary h2 {
  font-size: 1.08rem;
  margin: 0;
  display: inline;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--copper);
  flex: none;
  line-height: 1;
}

.faq-item[open] summary::after { content: "\2212"; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }

.faq-answer { padding: 1rem 1.25rem; color: var(--ink-soft); }
.faq-answer strong { color: var(--ink); }

/* ---------- Forms ---------- */

.form-container { max-width: 44rem; }

.big-form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem 1.4rem 1.4rem;
  margin: 0 0 1.4rem;
  box-shadow: var(--shadow);
}

.big-form legend {
  font-weight: 700;
  color: var(--green-deep);
  padding: 0 0.4rem;
}

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}

input:focus-visible, select:focus-visible, textarea:focus-visible,
.btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--copper-light);
  outline-offset: 1px;
}

input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #b3502c;
}

textarea { resize: vertical; }

.field-error {
  color: #a03d1c;
  font-size: 0.88rem;
  margin: 0.3rem 0 0;
  font-weight: 500;
}

.hp-field { position: absolute; left: -9999px; top: -9999px; }

.form-fine-print {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.form-result {
  border-radius: var(--radius);
  border: 1px solid;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.form-result p { margin: 0.35rem 0 0; }

.result-good { background: var(--good-bg); border-color: var(--good-line); }
.result-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.result-pending { background: var(--surface-alt); border-color: var(--line); color: var(--ink-soft); }

/* The coverage answer arrives from the browser's own lookup, so the box is
   empty until then. Reserve its height so the page below doesn't jump. */
.coverage-result { min-height: 5.5rem; }
.coverage-result:empty { min-height: 0; }

.attribution {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.inline-form { max-width: 30rem; }

.inline-form-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.inline-form-row input { flex: 1; }

/* ---------- Service area ---------- */

.area-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
}

.area-card p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

.fsa-badge {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--green-deep);
  color: var(--copper-light);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  flex: none;
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.contact-aside h2 { font-size: 1.1rem; }
.contact-aside p { font-size: 0.95rem; margin-bottom: 0.9rem; }
.contact-aside .icon { margin-right: 0.4rem; color: var(--copper-dark); }

/* ---------- Prose & lists ---------- */

.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.75em; }
.prose h2:first-child { margin-top: 0; }

.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.check-list li {
  padding-left: 1.7rem;
  position: relative;
  margin-bottom: 0.7rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 3px;
  background: var(--green);
  clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 18%, 84% 4%, 39% 71%);
}

.ref-badge {
  display: inline-block;
  background: var(--surface);
  border: 1.5px solid var(--copper);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 1.05rem;
}

.ref-badge strong { font-family: var(--mono); color: var(--copper-dark); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--green-deep);
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0;
  border-top: 3px solid var(--copper);
}

.cta-band + .site-footer { border-top: 1px solid rgba(255, 255, 255, 0.15); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-top: 2.75rem;
  padding-bottom: 2rem;
  font-size: 0.95rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
}

.footer-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--copper-light);
  margin-bottom: 0.6rem;
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--copper-light); }

.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.footer-contact .icon { color: var(--copper); }

.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li { margin-bottom: 0.35rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Client-rendered panels ---------- */
/* Testimonials, the covered postal codes, and the price/notes columns arrive
   from /api/… after load. The skeleton mirrors the real content's box so the
   page doesn't jump when it settles. */

/* Seven chips wrap to two rows at every width the design supports, so the row
   reserves two rows' height. Only the horizontal packing settles. */
.panel-slot.chip-row { min-height: 5.1rem; align-content: flex-start; }
.panel-slot.pricing-panel { display: block; }

.skeleton-line {
  display: block;
  height: 0.85em;
  margin: 0.42em 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--line) 25%, var(--surface-alt) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: skeleton-sheen 1.4s ease-in-out infinite;
}

.skeleton-line-short { width: 58%; }
.skeleton-block { display: block; }

.skeleton-testimonial { display: block; min-height: 14rem; }
.skeleton-line-caption { width: 55%; height: 2.5rem; margin-top: 1.4rem; border-radius: 999px; }

.skeleton-area { min-height: 4.6rem; }
.skeleton-badge { width: 2.65rem; height: 2.2rem; background: var(--line); }
.skeleton-line-area { flex: 1; height: 0.85em; margin: 0; }

.skeleton-chip { width: 15rem; height: 2.3rem; border-color: var(--line); }

.skeleton-price { width: 5.4rem; height: 0.9em; margin: 0.3em 0; }
.skeleton-note { display: block; }
.skeleton-note .skeleton-line { height: 0.75em; margin: 0.32em 0; }

@keyframes skeleton-sheen {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

.panel-error {
  margin: 1rem 0 0;
  padding: 0.85rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 56rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 14rem; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 38rem) {
  body { font-size: 1rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; gap: 0.8rem; }
  .price-table { display: block; overflow-x: auto; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .skeleton-line { animation: none; background: var(--line); }
}
