/* Torote Fence Co — styles
   Palette taken from the logo: black, white, and the logo's fence green.
   Cedar tones appear only in the fence illustration (the material itself). */
:root {
  --black: #000000;          /* logo background */
  --white: #ffffff;
  --paper: #f6f7f5;
  --mist: #eceeeb;
  --line: #d9ddd8;
  --ink: #1a1d1b;
  --steel: #545e58;
  --green: #3a7030;          /* logo green: buttons, rules, numbers */
  --green-dark: #2e5a26;     /* hover */
  --green-light: #74b863;    /* green on black (text, focus) */
  --on-black: #c9d0cb;       /* body text on black */

  --display: "Montserrat", "Segoe UI", Arial, sans-serif;
  --body: "Barlow", system-ui, sans-serif;

  --wrap: 1120px;
  --gap: clamp(1.25rem, 3vw, 2rem);
  --section: clamp(4rem, 9vw, 7rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 1rem; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--green-light); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--green); color: var(--white); padding: .6rem 1rem; font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Placeholder content: remove the "todo" class (or the element) once real info is in. */
.todo {
  background: #fff3c4;
  color: #5a4300;
  outline: 2px dashed #c99a00;
  outline-offset: 2px;
  padding: .15em .4em;
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  text-decoration: none;
  padding: .85rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, .7); }
.btn-ghost:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-call { background: var(--green); color: var(--white); padding: .55rem 1rem; font-size: .95rem; }
.btn-call:hover { background: var(--green-dark); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--black);
  border-bottom: 1px solid #262b28;
}
.header-inner { display: flex; align-items: center; gap: 2rem; min-height: 5.25rem; }   /* room under the bigger logo */
.brand {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none; color: var(--white);
}
.brand em { font-style: normal; font-weight: 600; color: var(--green-light); }
.brand-lc { text-transform: none; }   /* brand reads TOROTE FENCE Co. */
.brand-mark { width: 62px; height: auto; }   /* laptop: +55%, same total increase as the phone logo */
.brand-mark-3d { display: none; }
.nav { display: flex; gap: 1.5rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; color: var(--on-black); }
.nav a:hover { color: var(--white); }

/* Hero */
.hero {
  background: var(--black);
  color: var(--white);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.1rem, 3.5vw, 3.05rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1rem;
}
.subhead {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.25;
  color: var(--green-light);
  max-width: 28ch;
  margin-bottom: 1.25rem;
}
.lede { font-size: clamp(1.15rem, 2vw, 1.3rem); max-width: 32rem; color: var(--on-black); }
.lede-full, .hero-call { display: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-logo { width: 100%; max-width: 380px; justify-self: end; }
.hero-logo-3d { position: relative; aspect-ratio: 1414 / 1333; max-width: 420px; }
.hero-logo-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-logo-3d .logo-fallback { width: 100%; height: 100%; object-fit: contain; }
.hero-logo-3d.ready .logo-fallback { visibility: hidden; }  /* flat logo shows until the 3D one is drawn */

.fence {
  width: 100%;
  height: clamp(240px, 32vw, 440px);
}
.fence .pk {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: rise .45s cubic-bezier(.2, .8, .3, 1) both;
  animation-delay: calc(var(--i) * 14ms + 1800ms);
}
.fence .post { animation: drive .45s cubic-bezier(.3, .7, .4, 1) both; animation-delay: calc(var(--k) * 130ms + 100ms); }
.fence .rail { animation: settle .5s ease-out 1.15s both; }
.fence .dim { animation: fade .4s ease-out 3.3s both; }
.fence .dim line { stroke: #8c958f; stroke-width: 1.5; }
.fence .dim rect { fill: var(--black); }
.fence .dim text { font-family: var(--display); font-weight: 600; font-size: 18px; fill: var(--white); }
.fence .dim .hl { font-size: 24px; font-weight: 700; fill: var(--white); }
.fence .dim .sub { font-family: var(--body); font-weight: 500; font-size: 18px; fill: var(--green-light); }

.fence-wrap { margin-top: clamp(1rem, 3vw, 2rem); }
@keyframes drive { from { opacity: 0; transform: translateY(-70px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes settle { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fence .pk, .fence .post, .fence .rail, .fence .dim { animation: none; }
}

/* Shared */
.section-lede { font-size: 1.2rem; color: var(--steel); max-width: 40rem; margin-bottom: 2.5rem; }

/* Why steel posts */
.why { background: var(--white); padding-block: var(--section); border-top: 6px solid var(--green); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--gap); }
.compare-col { padding: clamp(1.25rem, 3vw, 2rem); border-radius: 6px; }
.compare-col h3 { margin-bottom: 1rem; }
.compare-col ul { list-style: none; margin: 0; padding: 0; }
.compare-col li { position: relative; padding: .55rem 0 .55rem 1.6rem; border-top: 1px solid var(--line); }
.compare-col li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: .7rem; height: .7rem; }
.compare-old { background: var(--mist); color: var(--steel); }
.compare-old li::before { height: 2px; top: 1.3rem; background: #9aa39e; }
.compare-new { background: var(--black); color: var(--white); }
.compare-new h3 { color: var(--green-light); }
.compare-new li { border-top-color: #2a302c; }
.compare-new li::before { background: var(--green); border-radius: 2px; }
.policy { margin-top: var(--gap); padding: clamp(1.25rem, 3vw, 2rem); border-left: 6px solid var(--green); background: var(--mist); border-radius: 0 6px 6px 0; }
.policy h3 { margin-bottom: .6rem; }
.policy p { margin: 0; max-width: 62ch; }

/* Fences */
.fences { background: var(--mist); padding-block: var(--section); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2rem var(--gap); align-items: start; margin-bottom: 4rem; }
.product:last-of-type { margin-bottom: 2rem; }
.product h3, .style h4 { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 700; margin: 0 0 .75rem; letter-spacing: -0.01em; }
.style h4 { font-size: 1.35rem; }
.product p, .style p { color: var(--steel); max-width: 38rem; }
.product-media { display: grid; gap: 1.25rem; }
.product-copy { position: sticky; top: 6rem; }
.dwg-pair { display: grid; gap: 1.25rem; }
.product-3d { margin: 0; }
.product-3d figcaption { font-size: .9rem; color: var(--steel); margin-top: .25rem; }
.fence-3d { position: relative; aspect-ratio: 4 / 3; cursor: grab; touch-action: pan-y; }
.fence-3d:active { cursor: grabbing; }
.fence-3d canvas { display: block; width: 100%; height: 100%; }
.fence-3d .side-label {
  position: absolute; top: .5rem; left: .5rem;
  font-family: var(--display); font-weight: 600; font-size: .95rem;
  background: var(--black); color: var(--white);
  padding: .3rem .65rem; border-radius: 4px;
  opacity: 0; transition: opacity .3s;
}
.fence-3d.ready .side-label { opacity: 1; }
.product-3d:has(.no-webgl) { display: none; }
.product-dwg figcaption { font-family: var(--display); font-weight: 600; font-size: .95rem; margin: .25rem 0 .5rem .25rem; }
.product-photo { margin: 0; }
.product-photo img { width: 100%; border-radius: 6px; }
.product-photo figcaption { font-size: .9rem; color: var(--steel); margin-top: .5rem; }
.product-dwg { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: clamp(.5rem, 2vw, 1.25rem); }
.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 2.5rem var(--gap); }
.style .product-3d { margin: 1.25rem 0 .5rem; }
.style .product-dwg { margin: 1.25rem 0; }
.style .product-dwg + .product-dwg { margin-top: 0; }
/* all panel drawings share one width (890) and one scale, so 6 ft is the same size everywhere */
.style .product-dwg .dwg { width: 100%; height: auto; }
.specs { margin: 1.25rem 0 0; }
.specs div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.specs dt { font-weight: 600; }
.specs dd { margin: 0; justify-self: start; }
.dwg-note { color: var(--steel); font-size: .9rem; margin-top: 2rem; }

/* Technical drawings */
.dwg { width: 100%; height: auto; }
.dwg .dl { stroke: var(--ink); stroke-width: 1.3; }
.dwg .ex { stroke: #8a938e; stroke-width: 1; stroke-dasharray: 3 3; }
.dwg .lb { fill: var(--white); }
.dwg .dt { font-family: var(--display); font-weight: 600; font-size: 19px; fill: var(--ink); }
.dwg .gl { stroke: #5b4634; stroke-width: 2.5; }
.dwg .soil { fill: #efe7dd; }
.dwg .pb { fill: rgba(185, 192, 189, .55); stroke: #6d7672; stroke-width: 1.2; stroke-dasharray: 4 3; }
.dwg .ph { fill: none; stroke: #ffffff; stroke-width: 1.5; stroke-dasharray: 5 4; }
.dwg .ld { stroke: var(--ink); stroke-width: 1.3; }
.dwg .ct { font-family: var(--display); font-weight: 600; font-size: 17px; fill: var(--ink); }
.dwg .kb { fill: rgba(191, 174, 125, .9); stroke: #6b5d3a; stroke-width: 1.3; stroke-dasharray: 6 4; }
.dwg .nb { fill: rgba(255, 255, 255, .85); }
.dwg .nt { font-family: var(--display); font-weight: 600; font-size: 17px; fill: #5b4634; }

/* Gallery */
.gallery { background: var(--black); color: var(--white); padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section); }
.gallery h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; margin-bottom: 1rem; }
.nav a[aria-current="page"] { color: var(--white); text-decoration: underline; text-decoration-color: var(--green-light); text-underline-offset: 6px; }
.gallery-cta { background: var(--mist); padding-block: clamp(3rem, 7vw, 5rem); }
.gallery-cta h2 { margin-bottom: .75rem; }
.gallery-cta p { color: var(--steel); }
.gallery .section-lede { color: var(--on-black); margin-bottom: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter {
  font: 600 .95rem var(--display); color: var(--white);
  background: transparent; border: 1.5px solid #4a524d; border-radius: 999px;
  padding: .5rem 1.1rem; cursor: pointer;
}
.filter[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .75rem; }
.gallery-grid li[hidden] { display: none; }
.g-item { display: block; width: 100%; padding: 0; border: 0; background: #111; border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.g-item img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 94vw; max-height: 82vh; width: auto; height: auto; border-radius: 4px; }
.lightbox figcaption { color: var(--on-black); font-size: .95rem; margin-top: .6rem; text-align: center; }
.lb-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .55); color: var(--white);
  font-size: 2rem; line-height: 1; cursor: pointer;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-close { top: 1.5rem; right: 1rem; transform: none; font-size: 1.7rem; }

/* Process: a real sequence, so it's numbered */
.process { background: var(--white); padding-block: var(--section); }
.steps {
  list-style: none; margin: 0; padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2.5rem var(--gap);
}
.steps li { counter-increment: step; border-top: 4px solid var(--green); padding-top: 1rem; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--display); font-weight: 700; font-size: 2.25rem; line-height: 1;
  color: var(--green);
  margin-bottom: .6rem;
}
.steps h3 { margin-bottom: .5rem; }
.steps p { color: var(--steel); max-width: 36ch; }

/* Trust */
.trust { background: var(--mist); padding-block: var(--section); }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 3rem var(--gap); }
.trust h2 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); }
.facts { margin: 0; max-width: 46rem; }
.facts div { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; justify-self: start; }

/* Service area */
.area { background: var(--white); padding-block: var(--section); }
.area-list {
  list-style: none; margin: 1.5rem 0 2rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .75rem 2.5rem;
}
.area-list li {
  font-family: var(--display); font-weight: 600; font-size: 1.35rem;
  padding: .3rem 0 .3rem .9rem;
  border-left: 4px solid var(--green);
}

/* Quote */
.quote { background: var(--black); color: var(--white); padding-block: var(--section); }
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 3rem var(--gap); align-items: start; }
.quote-intro p { color: var(--on-black); max-width: 32ch; }
.contact-line { margin-bottom: .5rem; color: var(--on-black); }
.contact-line a {
  font-family: var(--display); font-weight: 600; font-size: 1.35rem;
  color: var(--white); text-decoration-color: var(--green-light); text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.quote-intro .hours { margin-top: 1rem; display: inline-block; }
.quote-intro .todo { color: #5a4300; }

.quote-form {
  background: var(--paper); color: var(--ink);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 6px;
  border-top: 6px solid var(--green);
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem;
}
.field { display: grid; gap: .35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.optional { font-weight: 400; color: var(--steel); }
.field input, .field select, .field textarea {
  font: inherit; color: inherit;
  padding: .65rem .75rem;
  border: 1.5px solid #b7c0bc; border-radius: 4px;
  background: var(--white);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--green-light); outline-offset: 0; border-color: var(--green); }
.field input[aria-invalid="true"] { border-color: #b3261e; }
.form-error { grid-column: 1 / -1; color: #b3261e; font-weight: 600; margin: 0; }
.quote-form .btn { margin-top: .5rem; }

/* Footer */
.site-footer { background: var(--black); color: var(--on-black); padding-block: 3rem; font-size: .95rem; border-top: 1px solid #262b28; }
.footer-logo { width: 150px; margin-bottom: 1.25rem; }
.footer-logo .logo-fallback { width: 100%; height: auto; display: block; }
/* footer: the same swaying 3D logo as the top of the page, centred left to right (phones resize it below) */
.footer-logo-3d { position: relative; width: min(420px, 100%); aspect-ratio: 1414 / 1333; margin: 0 auto 1.5rem; }
.footer-logo-3d canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.footer-logo-3d .logo-fallback { width: 100%; height: 100%; object-fit: contain; }
.footer-logo-3d.ready .logo-fallback { visibility: hidden; }
.footer-inner p { margin-bottom: .4rem; }
.site-footer a { color: var(--white); }
.copy { margin-top: 1.25rem; color: #7f8a84; }

/* Mobile call bar */
.mobile-bar { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .header-inner { justify-content: space-between; }
  .quote-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-logo { display: none; }
  .product { grid-template-columns: 1fr; }
  .product-copy { position: static; }
}
@media (max-width: 760px) {
  body { padding-bottom: 3.75rem; }
  .btn-call { display: none; }
  .brand { font-size: 1.28rem; letter-spacing: .04em; gap: .6rem; }   /* brand name two sizes up (was 1rem); slightly tighter so it fits small phones */
  .mobile-bar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 60;
    background: var(--black);
    border-top: 3px solid var(--green);
  }
  .mobile-bar a {
    display: flex; align-items: center; justify-content: center;
    min-height: 3.5rem;
    font-family: var(--display); font-weight: 600; font-size: 1.0625rem;
    color: var(--white); text-decoration: none;
  }
  .mobile-bar a:first-child { background: var(--green); }
  .mobile-bar a + a { border-left: 1px solid #262b28; }
  .quote-form { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: .25rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

/* Phones: drawings render small, so enlarge their labels and use a white halo instead of fixed-size label boxes */
@media (max-width: 760px) {
  .fence { height: 210px; }
  .dwg .lb, .dwg .nb { display: none; }
  .dwg text { paint-order: stroke fill; stroke: #ffffff; stroke-width: 7px; stroke-linejoin: round; }
  .dwg .dt { font-size: 30px; }
  .dwg .ct, .dwg .nt { font-size: 27px; }
  .product-dwg { padding: .35rem; }
}

/* Phones, home page: the round emblem sways in 3D in the header; the brand name stays as plain text (desktop unchanged) */
@media (max-width: 760px) {
  /* phone header: plain 2D logo picture (the 3D swaying emblem was removed here) */
  .home .brand-mark { width: 62px; }   /* phone: 40px laptop logo +15%, +10%, +10%, +10% */
  .header-inner { min-height: 5.25rem; }   /* phone: more room under the bigger logo before the grey line */
}

/* phone: the footer shows the full swaying 3D logo, centred */
@media (max-width: 760px) {
  .footer-logo-3d { width: min(78vw, 320px); }
}

/* Hero, all screens: the first screen is built around the fence going in.
   Copy is short, the fence sits at the bottom of the first screen,
   and each post lands with a thump (strikes, soil puff, cracks, a small jolt). Phones adjust below. */
.hero { display: flex; flex-direction: column; min-height: calc(100svh - 84px); }
.hero .lede-short { font-size: clamp(1.1rem, 1.6vw, 1.25rem); max-width: 42rem; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: .4rem 0;
  list-style: none; padding: 0; margin: 1.25rem 0 0;
  font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--green-light);
}
.hero-trust li + li::before { content: "|"; margin: 0 .7rem; color: #4a524d; }
.hero .fence-wrap { margin-top: auto; padding-top: 1.5rem; }
.fence-wrap.jolt { animation: jolt .14s linear; }
.hero .fence { display: block; height: clamp(240px, min(32vw, 100svh - 84px - 480px), 440px); }
.fence .post { animation: strike .9s linear both; animation-delay: calc((var(--k) - 1) * 250ms + 150ms); }
.fence .rail { animation-delay: 2.6s; }   /* posts on a laptop screen finish ~2.3s, then a 0.3s pause */
.fence .pk { animation-delay: calc(var(--i) * 14ms + 3400ms); }   /* rails finish at 3.1s, then a 0.3s pause */
.fence .dim { animation-delay: 5.1s; }
.fence .crack {
  fill: none; stroke: #0d0906; stroke-width: 2.5; stroke-linecap: round;
  transform-box: fill-box; transform-origin: 50% 0;
  animation: crack .35s ease-out both;
  animation-delay: calc((var(--k) - 1) * 250ms + 420ms);
}
.fence .dust {
  fill: #8a6a4c;
  transform-box: fill-box; transform-origin: center;
  animation: puff .75s ease-out both;
  animation-delay: calc((var(--k) - 1) * 250ms + 420ms);
}

/* Phones: the first screen is built around the fence going in.
   Copy is short, the fence fills the rest of the screen above the bottom bar,
   and each post lands with a thump (strikes, soil puff, cracks, a small jolt). Desktop unchanged. */
@media (max-width: 760px) {
  .hero {
    display: flex; flex-direction: column;
    min-height: calc(100svh - 84px - 3.75rem);
    padding-top: 1.25rem;
  }
  .hero h1 { font-size: clamp(1.5rem, 6.9vw, 1.85rem); margin-bottom: .5rem; }
  .subhead { font-size: 1.15rem; margin-bottom: .6rem; }
  .lede-short { display: block; font-size: 1.05rem; line-height: 1.45; }
  .hero .subhead, .hero .lede-short { text-align: left; margin-inline: 0; }   /* text above the button is left-aligned like the headline */
  .hero .lede-short { max-width: 19rem; }   /* same width as the green line: "fences" drops to the second line */
  .hero-actions { margin-top: 1.1rem; justify-content: center; }
  .hero-actions .btn { padding-block: .7rem; }
  .hero-trust { margin-top: 1rem; font-size: .95rem; justify-content: center; transform: translateY(.75rem); }   /* centred under the button, a little lower */
  .hero-trust li + li::before { margin: 0 .6rem; }
  .hero .fence-wrap { margin-top: auto; padding-top: 0; }
  /* headline stays at the top; the lines under it (green line, paragraph, button, strip) spread evenly
     through the black space above the fence. Short phones have no spare space, so they stay compact. */
  .hero-inner { flex: 1; display: flex; flex-direction: column; padding-bottom: .5rem; }
  .hero-copy { flex: 1; display: flex; flex-direction: column; row-gap: .7rem; }
  .hero-copy > * { margin-block: 0; }
  .hero-copy > :not(h1), .hero-copy::after { margin-top: auto; }
  .hero-copy::after { content: ""; }
  .hero .fence { height: clamp(185px, calc(100svh - 447px), 250px); display: block; }   /* whole fence, posts included, fits above the bottom bar */

  .fence .post { animation-delay: calc(var(--m) * 350ms + 150ms); }
  .fence .rail { animation-delay: 2.05s; }   /* phone posts finish at 1.75s, then a 0.3s pause */
  .fence .pk { animation-delay: calc((var(--i) - 26) * 14ms + 2850ms); }   /* rails finish at 2.55s, then a 0.3s pause */
  .fence .dim { animation-delay: 4.1s; }

  .fence .crack, .fence .dust { animation-delay: calc(var(--m) * 350ms + 420ms); }
}
/* the post falls to the ground, then three hammer strikes sink it the full 3 ft */
@keyframes strike {
  0%   { opacity: 0; transform: translateY(-260px); animation-timing-function: cubic-bezier(.5, 0, 1, 1); }
  30%  { opacity: 1; transform: translateY(-115px); }
  45%  { transform: translateY(-115px); animation-timing-function: cubic-bezier(.6, 0, 1, 1); }
  52%  { transform: translateY(-72px); }
  68%  { transform: translateY(-72px); animation-timing-function: cubic-bezier(.6, 0, 1, 1); }
  75%  { transform: translateY(-34px); }
  91%  { transform: translateY(-34px); animation-timing-function: cubic-bezier(.6, 0, 1, 1); }
  100% { opacity: 1; transform: none; }
}
@keyframes puff {
  0%   { opacity: 0; transform: translate(0, 0) scale(.3); }
  15%  { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.6); }
}
@keyframes crack { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: none; } }
@keyframes jolt {
  0%, 100% { transform: none; }
  30% { transform: translate(-2px, 3px); }
  65% { transform: translate(2px, -1px); }
}
@media (prefers-reduced-motion: reduce) {
  .fence .post, .fence .crack, .fence .dust { animation: none; }
  .fence .dust { opacity: 0; }
}

/* ---- Audit fixes 11/22 ---- */
/* phone numbers never break across lines */
a[href^="tel:"] { white-space: nowrap; }
/* tap targets at least 44px tall for contact links */
.contact-line a, .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .9rem; }
.footer-links span { color: #4a524d; }
/* home page footer: text centred under the centred 3D logo */
.home .footer-inner { text-align: center; }
.home .footer-links { justify-content: center; }
/* 3D fence views: show a still picture of the model until the live 3D view is ready */
.fence-3d { background: center / contain no-repeat; }
.fence-3d[data-fence-3d="picket"] { background-image: url("../assets/3d-picket.webp"); }
.fence-3d[data-fence-3d="hpanel"] { background-image: url("../assets/3d-hpanel.webp"); }
.fence-3d[data-fence-3d="vpanel"] { background-image: url("../assets/3d-vpanel.webp"); }
.fence-3d.ready { background-image: none; }
/* "What you can count on": fill the width on laptops (2 x 2) */
@media (min-width: 861px) {
  .trust-grid > div { grid-column: 1 / -1; }
  .facts { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
}
/* service area: three equal tiles in one row */
.area-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; max-width: 46rem; }
.area-list li { background: var(--mist); border-radius: 0 6px 6px 0; padding: 1rem 1rem 1rem 1.1rem; font-size: clamp(1.1rem, 2.4vw, 1.6rem); }
/* recent job photos */
.jobs { margin-top: clamp(2.5rem, 5vw, 4rem); }
.jobs h3 { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 700; margin: 0 0 1rem; }
.jobs-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.5rem, 1.5vw, 1rem); }
.jobs-row img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: block; }
.jobs-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: .75rem; font-family: var(--display); font-weight: 600; color: var(--ink); text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 5px; }
/* the in-sentence phone link in Service area gets a taller tap area without moving the text */
.area a[href^="tel:"] { padding-block: .7rem; }
@media (min-width: 861px) { .jobs-row img { aspect-ratio: 4 / 3; } }   /* wide, shorter tiles on laptops */

/* ---- Chai the chihuahua: runs, jumps and crawls along the hero fence (js/main.js) ---- */
.hero { position: relative; touch-action: pan-y; }   /* vertical swipes still scroll the page */
.chai { position: absolute; left: 0; top: 0; width: 90px; height: 90px; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s; will-change: transform; }
.chai.on { opacity: 1; }
.chai-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chai-shadow { display: none; }   /* no shadow under Chai */
.chai-poop { position: absolute; left: 0; top: 0; width: 24px; height: 24px; z-index: 2; pointer-events: none; opacity: 0; transform: scale(.4); transform-origin: 50% 100%; transition: opacity .6s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.chai-poop.on { opacity: 1; transform: none; }
.chai-poop .stink path { animation: stink 1.4s ease-in-out infinite; }
.chai-poop .stink path:nth-child(2) { animation-delay: .3s; }
.chai-poop .stink path:nth-child(3) { animation-delay: .6s; }
@keyframes stink { 0% { opacity: 0; transform: translateY(6px); } 50% { opacity: .9; } 100% { opacity: 0; transform: translateY(-6px); } }
.chai-pee path { stroke-dasharray: 7 6; animation: peeflow .35s linear infinite; }
@keyframes peeflow { to { stroke-dashoffset: -13px; } }
.chai-puddle { position: absolute; left: 0; top: 0; width: 30px; height: 6px; border-radius: 50%; background: rgba(242, 209, 75, .85); z-index: 2; pointer-events: none; opacity: 0; transform: scaleX(.2); transition: opacity .6s, transform 1.2s ease-out; }
.chai-puddle.on { opacity: 1; transform: none; }

/* ---------- Fence calculator page (calculator.html) ---------- */
.calc { background: var(--black); color: var(--white); padding-block: clamp(2rem, 5vw, 3.5rem) var(--section); }
.calc-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; margin-bottom: .75rem; }
.calc-lede { font-size: 1.15rem; color: var(--on-black); max-width: 40rem; }
.calc-placeholder { display: inline-block; margin-bottom: 1.5rem; font-size: .95rem; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; margin-top: 1rem; }
.calc-map-col { position: sticky; top: 6.25rem; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; margin-right: .45rem; border-radius: 50%;
  background: var(--green); color: var(--white);
  font-family: var(--display); font-weight: 700; font-size: .9rem; vertical-align: .1em;
}
.calc-address label { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin-bottom: .6rem; }
.addr-row { display: flex; gap: .5rem; }
.addr-row input {
  flex: 1; min-width: 0; font: inherit; color: var(--ink);
  padding: .7rem .8rem; border: 1.5px solid #b7c0bc; border-radius: 4px; background: var(--white);
}
.addr-row input:focus { outline: 3px solid var(--green-light); outline-offset: 0; }
.addr-row .btn { padding-inline: 1.25rem; }
.calc-msg { min-height: 1.5em; margin: .5rem 0; color: var(--on-black); font-size: .95rem; }

.map-shell { position: relative; border-radius: 6px; overflow: hidden; background: #1c201e; border: 1px solid #2c322f; }
.map { width: 100%; height: clamp(420px, calc(100svh - 17rem), 760px); }
.map-shell.is-off .map, .map-shell.is-off .map-tools, .map-shell.is-off .map-total, .map-shell.is-off .map-hint { display: none; }
.map-off { padding: 2rem 1.5rem; color: var(--on-black); }
.map-off a { color: var(--white); }
.map-total {
  position: absolute; top: .75rem; left: .75rem;
  background: rgba(0, 0, 0, .82); color: var(--white);
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
  padding: .35rem .8rem; border-radius: 4px; pointer-events: none;
}
.map-hint {
  position: absolute; left: 50%; top: 4rem; transform: translateX(-50%);
  margin: 0; width: max-content; max-width: calc(100% - 2rem);
  background: var(--green); color: var(--white); font-weight: 600; text-align: center;
  padding: .45rem .9rem; border-radius: 4px; pointer-events: none;
}
.map-hint[hidden] { display: none; }
.map-tools { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; display: flex; gap: .5rem; justify-content: center; }
.tool {
  min-height: 44px; padding: 0 1rem;
  font-family: var(--display); font-weight: 600; font-size: .95rem;
  color: var(--white); background: rgba(0, 0, 0, .82);
  border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 4px; cursor: pointer;
}
.tool:hover { background: var(--black); border-color: var(--white); }
.runs { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.runs[hidden] { display: none; }
.runs li { display: flex; border: 1.5px solid #3a413d; border-radius: 4px; }
.runs li.on { border-color: var(--green-light); }
.runs button { background: none; border: 0; color: var(--white); font: inherit; min-height: 44px; cursor: pointer; }
.run-pick { padding: 0 .75rem; font-weight: 600; }
.run-del { padding: 0 .75rem; font-size: 1.3rem; color: var(--on-black); border-left: 1px solid #3a413d !important; }
.calc-tip { margin-top: .75rem; font-size: .92rem; color: #9aa49e; }

.calc-side { display: grid; gap: 1rem; }
.calc-card { background: var(--paper); color: var(--ink); border-radius: 6px; padding: clamp(1.1rem, 2.5vw, 1.5rem); }
.calc-card h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: 0; }
.len-big { font-family: var(--display); font-weight: 700; font-size: 2rem; margin: 0 0 .5rem; }
.len-src { font-family: var(--body); font-weight: 500; font-size: 1rem; color: var(--steel); }
.manual summary { cursor: pointer; font-weight: 600; color: var(--green-dark); min-height: 44px; display: flex; align-items: center; }
.manual .field { margin-top: .5rem; }
.calc-card fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.calc-card legend { font-weight: 600; font-size: .95rem; margin-bottom: .5rem; padding: 0; }
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.design input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.design span {
  display: flex; flex-direction: column; justify-content: center; min-height: 4.25rem; height: 100%;
  padding: .6rem .7rem; border: 2px solid var(--line); border-radius: 4px; background: var(--white);
  font-family: var(--display); font-weight: 600; font-size: .98rem; line-height: 1.2; cursor: pointer;
}
.design small, .count-l small { display: block; font-family: var(--body); font-weight: 500; font-size: .85rem; color: var(--steel); margin-top: .15rem; }
.design input:checked + span, .seg input:checked + span { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: #eef5ec; }
.design input:focus-visible + span, .seg input:focus-visible + span { outline: 3px solid var(--green-light); outline-offset: 2px; }
.seg { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg label { flex: 1; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: .4rem .7rem; border: 2px solid var(--line); border-radius: 4px; background: var(--white); font-weight: 600; cursor: pointer; }
.wood-only[hidden] { display: none; }
.check { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 500; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--green); }
.counts { display: grid; gap: .5rem; margin: .5rem 0; }
.count { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.count-l { font-weight: 600; }
.stepper { display: flex; align-items: center; border: 1.5px solid #b7c0bc; border-radius: 4px; background: var(--white); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.4rem; color: var(--ink); cursor: pointer; }
.stepper output { min-width: 2rem; text-align: center; font-family: var(--display); font-weight: 700; }
.calc-result { border-top: 6px solid var(--green); }
.price { margin: 0 0 .75rem; color: var(--steel); }
.price.has { color: var(--ink); }
.price-n { display: block; font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.4rem); line-height: 1.1; }
.price-warn { display: block; margin-top: .5rem; color: #b3261e; font-weight: 600; }
.breakdown { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin: 0 0 1rem; font-size: .95rem; }
.breakdown dt { color: var(--steel); }
.breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.calc-small { font-size: .92rem; color: var(--steel); margin-bottom: 0; }
.calc-send { display: grid; gap: .9rem; }
.calc-send .btn { width: 100%; }
.calc-card a { color: var(--green-dark); }

@media (max-width: 860px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .calc-map-col { position: static; }
  .map { height: 60svh; min-height: 340px; }
}
@media (max-width: 420px) {
  .designs { grid-template-columns: 1fr; }
  .design span { min-height: 3.25rem; flex-direction: row; align-items: baseline; gap: .4rem; }
  .design small { margin-top: 0; }
}
.calc-link { color: var(--white); font-weight: 600; text-decoration-color: var(--green-light); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.map-shell.is-off ~ .calc-tip { display: none; }

/* Quote forms: spam trap (hidden from people) and the "sent" confirmation */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-sent { padding: 1.5rem; border: 2px solid var(--green); border-radius: 6px; background: rgba(58, 112, 48, .12); }
.form-sent h3 { font-size: 1.35rem; margin-bottom: .5rem; }
.form-sent p { margin: 0; }
.form-sent:focus { outline: 3px solid var(--green-light); outline-offset: 3px; }
.form-error a { color: inherit; font-weight: 600; }
