/*
  Upstate Tech Help
  Layout: one left-aligned reading column (max ~68ch) under a sky-colored hero that ends in
  three layered Blue Ridge foothills fading into the page. The ridge line is the one bold element;
  everything else stays plain, large and easy to read for homeowners on a phone.
*/

/* Fonts are served from /fonts (SIL Open Font License; license files are in that folder). */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

:root {
  --sky: #dde8f0;
  --paper: #f7f9fa;
  --ink: #17222d;
  --muted: #4b5c6b;
  --ridge: #2f5576;
  --haze: #8aa5bb;
  --mist: #b5c8d7;
  --line: #d3dee6;
  --porch: #f0b429;
  --porch-deep: #d99b10;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 68ch;
  --gutter: clamp(16px, 5vw, 40px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--ridge); text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--ridge); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  z-index: 100;
  transform: translateY(-200%);
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(12px);
  outline: 3px solid var(--porch);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ink);
}
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.7rem, 4vw, 2.25rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
.nw { white-space: nowrap; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: var(--gutter); }

/* Top bar */
.top {
  background: var(--sky);
  padding-top: env(safe-area-inset-top, 0px);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark svg { width: 34px; height: 34px; flex: none; }
.mark span { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.top-call { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.top-call:hover { text-decoration: underline; }

/* Hero */
.hero { background: var(--sky); position: relative; padding-block: 0; }
.hero .wrap { padding-block: clamp(28px, 6vw, 72px) 0; display: grid; gap: 22px; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.025em;
  max-width: 13ch;
}
.lede { font-size: clamp(1.15rem, 2.4vw, 1.3rem); max-width: 40ch; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 22px; border-radius: 12px;
  font: 700 1.1rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--porch); color: var(--ink); border: 2px solid var(--porch); }
.btn-primary:hover { background: var(--porch-deep); border-color: var(--porch-deep); }
.btn-quiet { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-quiet:hover { background: rgba(23, 34, 45, 0.06); }
.promise { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 1rem; padding-bottom: 8px; }
.promise span { display: inline-flex; align-items: center; gap: 8px; }
.promise svg { width: 18px; height: 18px; color: var(--ridge); flex: none; }
.ridges { display: block; width: 100%; height: clamp(90px, 14vw, 190px); margin-top: clamp(8px, 3vw, 24px); }

/* Sections */
main section { padding-block: clamp(44px, 7vw, 80px); }
main section + section { border-top: 1px solid var(--line); }
main .hero + section { border-top: 0; padding-top: clamp(24px, 4vw, 48px); }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; max-width: var(--measure); }
.section-head p { color: var(--muted); }

/* What I fix */
.fixes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 26px 40px; }
.fixes li { display: grid; gap: 4px; align-content: start; padding-left: 18px; border-left: 3px solid var(--mist); min-width: 0; }
.fixes p { color: var(--muted); }

/* Pricing */
.pricing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; align-items: start; }
.price-from { display: grid; gap: 6px; }
.price-lead { font-weight: 700; color: var(--muted); font-size: 1.05rem; }
.price-big { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -0.02em; color: var(--ridge); font-variant-numeric: tabular-nums; }
.price-copy { display: grid; gap: 14px; max-width: 46ch; }
.price-copy ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.fees { display: grid; gap: 12px; min-width: 0; }
.fees h3 { margin-bottom: 2px; }
.fees h3.next { margin-top: 22px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
th, td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--muted); font-size: .95rem; }
td:last-child, th:last-child { text-align: right; padding-left: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
td small { display: block; color: var(--muted); font-size: .92rem; }
.fees-note { color: var(--muted); font-size: 1rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 32px; counter-reset: step; }
@media (min-width: 560px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { counter-increment: step; display: grid; gap: 6px; align-content: start; min-width: 0; }
.steps li::before {
  content: counter(step);
  font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sky); color: var(--ridge);
  margin-bottom: 6px;
}
.steps p { color: var(--muted); }

/* About */
.about-grid { display: grid; gap: 22px 56px; grid-template-areas: "head" "photo" "text"; }
.about-grid > h2 { grid-area: head; }
.about-photo { grid-area: photo; display: block; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: var(--sky); }
.about { grid-area: text; display: grid; gap: 18px; max-width: var(--measure); align-content: start; }
@media (min-width: 860px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); grid-template-rows: auto 1fr; grid-template-areas: "head photo" "text photo"; align-items: start; }
}
.about p + p { margin-top: 0; }

/* Area */
.towns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; max-width: 900px; }
.towns li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 1rem; }
.towns li.home { background: var(--sky); border-color: var(--mist); font-weight: 700; }
.area-note { margin-top: 18px; color: var(--muted); }

/* Questions */
.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 26px 40px; }
.faq > div { display: grid; gap: 4px; align-content: start; min-width: 0; }
.faq p { color: var(--muted); }

/* Contact */
.contact { background: var(--ridge); color: #fff; }
main section.contact + section, main section + section.contact { border-top: 0; }
.contact h2 { color: #fff; }
.contact .section-head p { color: #d6e2ec; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 28px 40px; align-items: start; }
.contact-item { display: grid; gap: 4px; min-width: 0; align-content: start; }
.contact-item .label { color: #c3d4e2; font-size: 1rem; }
.contact-item a, .contact-item strong { color: #fff; font-size: clamp(1.2rem, 2.6vw, 1.4rem); font-weight: 700; overflow-wrap: anywhere; }
.contact-item a { text-decoration-color: rgba(255,255,255,.45); }
.contact-item p { color: #d6e2ec; font-size: 1rem; }
.contact a:focus-visible { outline-color: var(--porch); }
.contact .actions { margin-top: 30px; }
.contact .btn-quiet { color: #fff; border-color: #fff; }
.contact .btn-quiet:hover { background: rgba(255,255,255,.1); }

/* Footer */
footer { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: baseline; }
footer .site-credit { display: block; margin-top: 10px; font-size: .9rem; }
.social { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 18px; }
.social a { padding-block: 11px; }

/* Thumb-sized links: text links get a taller touch area (about 44px) without moving anything */
main p a, .reviews figcaption a { padding-block: 11px; }
.site-credit a { padding-block: 13px; }
.mark { min-height: 44px; }
.contact-item a { padding-block: 7px; margin-block: -3px; }
.reviews-link a { font-weight: 700; }

/* Main menu buttons */
.top .wrap { flex-wrap: wrap; row-gap: 12px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.main-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 2px solid var(--ridge); color: var(--ridge); background: transparent;
  font: 700 1.05rem/1.2 var(--body); text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.main-nav a:hover { background: rgba(47, 85, 118, 0.12); }
.main-nav a[aria-current="page"] { background: var(--ridge); color: #fff; }
.main-nav a:focus-visible { outline: 3px solid var(--ridge); outline-offset: 3px; }

/* Inner page headers */
.hero.inner .wrap { padding-block: clamp(20px, 4vw, 44px) 0; }
.hero.inner h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: none; }
.hero.inner .ridges { height: clamp(60px, 9vw, 120px); }

/* Home: pages overview */
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.pages a {
  display: grid; gap: 6px; height: 100%; padding: 22px; border: 2px solid var(--line); border-radius: 16px;
  background: #fff; color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.pages a:hover { border-color: var(--ridge); background: var(--sky); }
.pages h3 { font-size: 1.35rem; color: var(--ridge); }
.pages p { color: var(--muted); }
.pages .go { font-weight: 700; color: var(--ridge); margin-top: 4px; }

/* About page without its own section heading */
.about-grid.nohead { grid-template-areas: "photo" "text"; }
@media (min-width: 860px) {
  .about-grid.nohead { grid-template-rows: auto; grid-template-areas: "text photo"; }
}

/* Home: recent posts */
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.posts a { display: grid; gap: 6px; align-content: start; height: 100%; color: var(--ink); text-decoration: none; }
.posts picture { display: block; }
.posts img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: var(--sky); margin-bottom: 8px; }
.posts a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.post-meta { color: var(--muted); font-size: .95rem; font-weight: 700; }
.posts p { color: var(--muted); }
.posts .go { font-weight: 700; color: var(--ridge); margin-top: 2px; }
.posts-follow { margin-top: 28px; color: var(--muted); }

/* Home: reviews */
.reviews { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.reviews li { min-width: 0; }
.reviews figure { margin: 0; height: 100%; display: grid; gap: 14px; align-content: start; padding: 24px; border: 2px solid var(--line); border-radius: 16px; background: #fff; }
.stars { color: var(--porch-deep); font-size: 1.2rem; letter-spacing: 3px; line-height: 1; }
.reviews blockquote { margin: 0; }
.reviews figcaption { display: grid; gap: 2px; }
.reviews figcaption strong { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.reviews figcaption span { color: var(--muted); font-size: .95rem; }
/* Reviews as a rotating row (reviews.js adds .is-carousel; without it the grid above stays) */
.reviews.is-carousel { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; padding: 3px; margin: -3px; }
.reviews.is-carousel::-webkit-scrollbar { display: none; }
.reviews.is-carousel li { flex: 0 0 100%; scroll-snap-align: start; }
@media (min-width: 860px) {
  .reviews.is-carousel li { flex-basis: calc((100% - 24px) / 2); }
}
.reviews.is-carousel:focus-visible { outline: 3px solid var(--ridge); outline-offset: 4px; border-radius: 16px; }
.rv-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; }
.rv-btn { font: inherit; font-weight: 700; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; min-width: 48px; min-height: 48px; padding: 0 16px; cursor: pointer; line-height: 1; }
.rv-btn:not(.rv-toggle) { font-size: 1.6rem; }
.rv-btn:hover { background: var(--line); }
.rv-btn:focus-visible { outline: 3px solid var(--ridge); outline-offset: 3px; }
.reviews figcaption strong a { color: inherit; text-decoration-thickness: 1px; }
.about-review { margin-block: 14px 24px; }
.about-review + .reviews-link { margin-bottom: 28px; }
.quote-lead { margin-top: 28px; font-weight: 700; }
.reviews-more { margin-top: 28px; color: var(--muted); }
.reviews-more a { font-weight: 700; }
.reviews-more .sep { margin-inline: 10px; }
@media (max-width: 640px) {
  .reviews-more .sep { display: none; }
  .reviews-more .leave { display: block; margin-top: 8px; }
}

/* Phone call bar */
.callbar { display: none; }
@media (max-width: 640px) {
  .top-call { display: none; }
  .main-nav { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .main-nav a { padding-inline: 6px; font-size: 1rem; white-space: normal; text-align: center; }
  .pricing { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 100%; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .callbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(247, 249, 250, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(6px);
  }
  .callbar .btn { min-height: 50px; padding: 10px 12px; }
  /* callbar.js moves the bar away while the hero's own Call and Text buttons are on screen */
  .callbar { transition: transform .2s ease; }
  .callbar.is-away { transform: translateY(110%); }
  .social > span { flex-basis: 100%; }
  /* Recent posts: one swipeable row instead of three tall cards; the next card peeks in from the right */
  .posts {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
  }
  .posts::-webkit-scrollbar { display: none; }
  .posts li { flex: 0 0 82%; scroll-snap-align: start; min-width: 0; }
}
/* Narrow phones: the menu says "About" so all three buttons stay on one line */
@media (max-width: 429px) {
  .nav-extra { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .callbar { transition: none; }
  .reviews.is-carousel { scroll-behavior: auto; }
}
