/* Shipshape Handyman: styles
   Colors and type live in the :root block below. */

:root {
  --navy: #0a1f36;
  --navy-deep: #001329;      /* matches the logo */
  --ink: #0f2238;
  --muted: #4b5a6b;
  --paper: #fbf8f2;          /* warm white */
  --paper-alt: #f3eee4;
  --card: #fffdf9;
  --line: #e1d9ca;
  --teal: #0e716c;           /* restrained accent */
  --teal-soft: #e3f1ee;
  --teal-on-navy: #7fd0c6;
  --error: #b42318;
  --ph-bg: #fff2c4;
  --ph-line: #b77d00;

  --font-head: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --wrap: 1120px;
  --gutter: 20px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-stretch: 87.5%;
  color: var(--navy);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--paper); }

main:focus { outline: none; }

/* Placeholders + preview notice ----------------------------------- */
.ph {
  background: var(--ph-bg);
  outline: 2px dashed var(--ph-line);
  outline-offset: 1px;
  border-radius: 3px;
  padding: 0 3px;
  color: #5c3d00;
  font-weight: 600;
}

/* Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px 20px;
  min-height: 48px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--navy); color: var(--paper); }
.btn-primary:hover { background: var(--teal); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-lg { font-size: 1.0625rem; padding: 14px 24px; min-height: 54px; }
.btn-sm { padding: 8px 14px; min-height: 44px; font-size: 0.95rem; }
.btn-block { width: 100%; }

/* Header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 242, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(6px);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: var(--header-h);
}
.brand { display: block; flex: none; border-radius: 4px; }
.brand img { width: 240px; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 10px 12px; border-radius: 6px;
  color: var(--ink); font-weight: 600; text-decoration: none; font-size: 0.97rem;
}
.site-nav a:hover { color: var(--teal); }
.site-nav a.is-active { color: var(--teal); box-shadow: inset 0 -2px 0 var(--teal); border-radius: 0; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.label-short { display: none; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 520px) {
  :root { --header-h: 60px; --gutter: 16px; }
  .brand img { width: 148px; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .header-actions .btn-sm { padding: 8px 12px; }
}

/* Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: clamp(40px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
  color: var(--teal);
}
.hero-grid {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 4.9rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.02;
}
.accent-word {
  background-image: linear-gradient(var(--teal), var(--teal));
  background-repeat: no-repeat;
  background-size: 100% 0.14em;
  background-position: 0 92%;
  padding-bottom: 0.04em;
}
.lede {
  color: var(--ink);
  font-size: clamp(1.1rem, 2.1vw, 1.3rem);
  max-width: 36em;
  margin: 22px 0 30px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 18px;
  opacity: 0.35;
}

/* "Log card": a tidy ruled checklist */
.log-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 24px 24px 10px;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(10, 31, 54, 0.04), 0 12px 32px -18px rgba(10, 31, 54, 0.25);
}
.log-card h2 {
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 0; }
.step-num {
  flex: none;
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--navy);
  font-family: var(--font-head); font-weight: 800; font-size: 0.9rem;
  color: var(--navy);
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .cta-row .btn { width: 100%; }
}

/* Sections -------------------------------------------------------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#work:not([hidden]) + #about { border-top: 0; padding-top: 0; }
.section-head { max-width: 40em; margin-bottom: 36px; }
.section h2 { font-size: clamp(2rem, 4.4vw, 2.85rem); font-weight: 800; }
.section-intro { margin-top: 14px; color: var(--muted); font-size: 1.1rem; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 2px; background: currentColor;
}

/* Services */
.service-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.service {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.service h3 {
  font-size: 1.3rem; font-weight: 800;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 2px solid var(--navy);
}
.service ul { list-style: none; margin: 0; padding: 0; }
.service li {
  position: relative; padding: 0 0 0 28px;
}
.service li::before {
  content: ""; position: absolute; left: 2px; top: 0.85em;
  width: 13px; height: 7px;
  border-left: 2.5px solid var(--teal); border-bottom: 2.5px solid var(--teal);
  transform: rotate(-45deg);
}
@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .service-grid { grid-template-columns: 1fr; } }

/* Gallery */
.gallery {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.gallery figure {
  margin: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: 14px 16px 16px; font-size: 0.98rem; }

/* About + area */
.about-grid {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
}
.about-copy p { font-size: 1.1rem; max-width: 34em; }
.about-copy h2 { margin-bottom: 20px; }
.guarantee {
  margin-top: 24px;
  padding: 4px 18px;
  background: var(--teal-soft);
  border-radius: var(--radius);
  max-width: 34em;
}
.about-copy .guarantee .promise {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 34px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--navy);
}
.promise + .promise { border-top: 1px solid rgba(14, 113, 108, 0.22); }
.promise::before,
.hero-promise::before {
  content: ""; position: absolute; left: 0; top: 17px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.promise strong { display: block; font-family: var(--font-head); font-stretch: 87.5%; font-size: 1.1rem; margin-bottom: 2px; }

.hero-promise {
  position: relative;
  margin: 18px 0 0;
  padding-left: 30px;
  font-weight: 600;
  color: var(--navy);
}
.hero-promise::before { top: 0.18em; }

/* Instagram links (About + footer) */
.ig-link a, a.icon-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; text-decoration: none;
  min-height: 44px;
}
.ig-link a:hover span:not(.sr-only), a.icon-link:hover span { text-decoration: underline; }
.footer-contact a.icon-link { min-height: 32px; }
.ig-icon { width: 20px; height: 20px; flex: none; }
.about-copy .ig-link { margin: 18px 0 0; }
.footer-contact .ig-link a { min-height: 32px; }

.area-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 24px;
}
.area-card h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 800; margin-bottom: 16px;
}
.anchor-icon { width: 22px; height: 22px; color: var(--teal); flex: none; }
.town-list {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
}
.town-list li {
  padding: 8px 0 8px 18px; position: relative;
  border-bottom: 1px dashed var(--line);
  font-weight: 600;
}
.town-list li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  transform: translateY(-50%);
}
.area-note { color: var(--muted); margin: 0; font-size: 0.98rem; }

/* Pick a job ------------------------------------------------------ */
.pick-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 0; color: var(--teal); font-weight: 600; font-size: 0.98rem;
}
.pick-hint svg { width: 22px; height: 22px; flex: none; }
.job-pick {
  appearance: none; background: none; border: 0; margin: 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  width: 100%; padding: 6px 0; min-height: 36px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.job-go {
  color: var(--teal); font-weight: 700;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.job-pick:hover, .job-pick:focus-visible { color: var(--teal); }
.job-pick:hover .job-go, .job-pick:focus-visible .job-go { opacity: 1; transform: none; }
@media (hover: none) { .job-go { opacity: 0.5; transform: none; } }

@keyframes fill-flash {
  0%   { background-color: var(--teal-soft); box-shadow: 0 0 0 4px rgba(14, 113, 108, 0.25); }
  100% { background-color: #fff; box-shadow: 0 0 0 0 rgba(14, 113, 108, 0); }
}
.field .just-filled { animation: fill-flash 1.5s ease-out; }

@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Estimate -------------------------------------------------------- */
.estimate { background: var(--navy); color: #e9eef3; }
.estimate h2 { color: var(--paper); }
.estimate .eyebrow { color: var(--teal-on-navy); }
.estimate .section-intro { color: #d3dde7; }
.estimate a { color: var(--teal-on-navy); }
.estimate a:hover { color: #fff; }
.estimate :focus-visible { outline-color: var(--teal-on-navy); }
.estimate-grid {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
}
.tip { color: #c2cfdb; font-size: 0.98rem; }
.call-alt { font-weight: 600; font-size: 1.05rem; }

.estimate-form {
  background: var(--card); color: var(--ink);
  border-radius: 12px;
  padding: clamp(20px, 4vw, 32px);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.5);
}
.estimate-form a { color: var(--teal); }
.estimate-form a:hover { color: var(--navy); }
.estimate-form :focus-visible { outline-color: var(--teal); }
.field { margin-bottom: 20px; }
.field label {
  display: block; font-weight: 700; color: var(--navy); margin-bottom: 6px;
}
.hint { margin: -2px 0 8px; font-size: 0.93rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit; font-size: 1.0625rem; /* 17px+ stops iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #b9b0a0;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 50px;
}
.field textarea { resize: vertical; min-height: 128px; line-height: 1.5; }
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field-error {
  margin: 6px 0 0; color: var(--error); font-weight: 600; font-size: 0.95rem;
}
.field-error::before { content: "! "; }
.form-errors {
  border: 2px solid var(--error); background: #fdf0ee; color: var(--error);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-weight: 600;
}
.form-errors:focus { outline: 3px solid var(--error); outline-offset: 2px; }
.estimate-form .form-errors a { color: var(--error); }
.form-note { margin: 10px 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }

.btn[disabled] { opacity: 0.75; cursor: progress; }
.btn-primary[disabled]:hover { background: var(--navy); }

/* Spam trap field: kept off-screen, never shown to people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.estimate-form { position: relative; }

.send-result {
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
}
.send-result h3 { font-size: 1.3rem; margin-bottom: 8px; }
.send-result p { font-size: 0.98rem; }
.send-result p:last-child { margin-bottom: 0; }
.send-result:focus { outline: 3px solid var(--teal); outline-offset: 2px; }
.send-fail {
  margin-top: 20px;
  border-left-color: var(--error);
  background: #fdf0ee;
}
.send-fail h3 { color: var(--error); }
.send-fail:focus { outline-color: var(--error); }
.send-ok h3::before {
  content: ""; display: inline-block; vertical-align: -3px; margin-right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

@media (max-width: 860px) { .estimate-grid { grid-template-columns: 1fr; gap: 8px; } }

/* Footer ---------------------------------------------------------- */
.site-footer {
  background: var(--navy-deep); color: #c9d4df;
  padding: 44px 0 36px;
  font-size: 0.97rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-inner {
  display: grid; gap: 24px;
  grid-template-columns: auto 1fr;
  align-items: start;
}
.footer-logo { width: 220px; }
.footer-contact { justify-self: end; text-align: right; }
.footer-contact p { margin: 0 0 6px; }
.site-footer a { color: #fff; font-weight: 600; }
.site-footer a:hover { color: var(--teal-on-navy); }
.site-footer :focus-visible { outline-color: var(--teal-on-navy); }
.footer-legal {
  grid-column: 1 / -1; margin: 8px 0 0; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem; color: #9fb0c1;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-contact { justify-self: start; text-align: left; }
  .footer-logo { width: 190px; }
}

/* Phone sticky bar ------------------------------------------------ */
.mobile-cta { display: none; }
@media (max-width: 720px) {
  .mobile-cta {
    display: flex; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(251, 248, 242, 0.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px -18px rgba(10, 31, 54, 0.45);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .mobile-cta.is-shown {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
  }
  .mobile-cta .btn-primary { flex: 1; }
  .mobile-cta .btn-outline { flex: none; padding-left: 16px; padding-right: 16px; }
}

/* Gentle motion --------------------------------------------------- */
.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.motion .reveal.is-visible { opacity: 1; transform: none; }

/* The teal line under "shipshape." draws in once on load */
@keyframes underline-in {
  from { background-size: 0% 0.14em; }
  to   { background-size: 100% 0.14em; }
}
.motion .accent-word { animation: underline-in 0.9s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.service { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
@media (hover: hover) {
  .service:hover {
    transform: translateY(-3px);
    border-color: #d3c9b7;
    box-shadow: 0 16px 30px -20px rgba(10, 31, 54, 0.4);
  }
}
.service:active { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .mobile-cta, .mobile-cta.is-shown { transition: none; }
  .service, .service:hover, .service:active { transform: none; transition: none; }
}

.noscript {
  background: var(--ph-bg); padding: 16px; text-align: center; font-weight: 600;
}
