/* F&G Fencing & Gates — graphite + white + orange accent */
:root {
  --ink: #22262a;
  --graphite: #2e3338;
  --graphite-deep: #24282c;
  --panel: #33383d;
  --line: rgba(255,255,255,.10);
  --snow: #f7f8f8;
  --mist: #c7cdd2;
  --orange: #ff8c3a;
  --orange-deep: #f07a24;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--graphite);
  color: var(--snow);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 22px; }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(36,40,44,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--snow); }
.brand-slats { display: flex; flex-direction: column; gap: 3px; }
.brand-slats i { display: block; height: 5px; width: 26px; border-radius: 2px; background: var(--orange); }
.brand-slats i:nth-child(2), .brand-slats i:nth-child(4) { width: 19px; }
.brand-desc { align-self: flex-end; padding-bottom: 4px; }
.brand-mark { font-weight: 900; font-size: 26px; letter-spacing: -1px; }
.brand-mark em { font-style: normal; color: var(--orange); }
.brand-mark.small { font-size: 22px; }
.brand-desc { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--mist); }
.head-nav { display: flex; gap: 22px; margin-left: auto; }
.head-nav a { color: var(--mist); text-decoration: none; font-size: 15px; font-weight: 500; }
.head-nav a:hover { color: var(--snow); }
.head-call { white-space: nowrap; }

/* buttons */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  border-radius: 999px; padding: 14px 28px; font-size: 16px;
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--orange); color: #241505; }
.btn-primary:hover { background: var(--orange-deep); }
.btn-ghost { border: 1.5px solid var(--line); color: var(--snow); }
.btn-ghost:hover { border-color: rgba(255,255,255,.3); }

/* hero */
.hero { position: relative; min-height: 88vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-media, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(36,40,44,.45) 0%, rgba(36,40,44,.55) 55%, rgba(36,40,44,.96) 100%);
}
.hero-inner { position: relative; padding-bottom: 88px; padding-top: 140px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 4px; color: var(--orange); margin-bottom: 18px; }
h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.06; max-width: 13ch; }
.lede { font-size: 19px; color: var(--mist); max-width: 56ch; margin-top: 22px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.trust-strip { display: flex; gap: 26px; flex-wrap: wrap; list-style: none; margin-top: 38px; }
.trust-strip li { font-size: 14px; font-weight: 600; color: var(--mist); display: flex; align-items: center; gap: 9px; }
.trust-strip li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

/* product marquee — speed + skew react to scroll velocity (house effect) */
.mq { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; background: var(--graphite-deep); }
.mq .track { display: flex; width: max-content; will-change: transform; backface-visibility: hidden; }
.mq .set { display: flex; gap: 48px; padding-right: 48px; }
.mq .set span { white-space: nowrap; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: 15px; color: var(--mist); }
.mq .set span:nth-child(odd) { color: var(--orange); }
@media (prefers-reduced-motion: reduce) { .mq .track { transform: none !important; } }

/* why-card icons — self-draw on scroll-in, then each plays its move */
.why-icon { width: 46px; height: 46px; margin-bottom: 18px; }
.why-icon path, .why-icon rect { fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.has-js .why-icon path, .has-js .why-icon rect { stroke-dasharray: 1; stroke-dashoffset: 1; }
.has-js .why-card.is-in .why-icon path,
.has-js .why-card.is-in .why-icon rect { animation: iconDraw .9s cubic-bezier(.65,0,.35,1) .2s forwards; }
.has-js .why-card.is-in .why-icon path:nth-child(2) { animation-delay: .45s; }
.has-js .why-card.is-in .why-icon path:nth-child(3) { animation-delay: .65s; }
.has-js .why-card.is-in .why-icon path:nth-child(n+4) { animation-delay: .85s; }
@keyframes iconDraw { to { stroke-dashoffset: 0; } }

/* brush: paints — swings from the handle after drawing in */
.icon-brush { transform-origin: 78% 22%; }
.has-js .why-card.is-in .icon-brush { animation: brushPaint 1.7s ease-in-out 1.3s 2; }
@keyframes brushPaint {
  0%, 100% { transform: rotate(0deg); }
  22% { transform: rotate(-16deg) translateY(1.5px); }
  50% { transform: rotate(9deg); }
  76% { transform: rotate(-10deg) translateY(1px); }
}

/* grain: board outlines, grain lines flow in one by one, then a soft pop */
.has-js .why-card.is-in .icon-grain path:nth-child(2) { animation-delay: .7s; }
.has-js .why-card.is-in .icon-grain path:nth-child(3) { animation-delay: .95s; }
.has-js .why-card.is-in .icon-grain path:nth-child(4) { animation-delay: 1.2s; }
.has-js .why-card.is-in .icon-grain { animation: grainPop .5s ease-out 2s 1; }
@keyframes grainPop {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.09) rotate(-2deg); }
}

/* tape: baseline extends, tick marks pop up left to right */
.has-js .why-card.is-in .icon-tape path:nth-child(1) { animation-duration: .6s; }
.has-js .why-card.is-in .icon-tape path:nth-child(2) { animation-delay: .7s; animation-duration: .3s; }
.has-js .why-card.is-in .icon-tape path:nth-child(3) { animation-delay: .85s; animation-duration: .3s; }
.has-js .why-card.is-in .icon-tape path:nth-child(4) { animation-delay: 1s; animation-duration: .3s; }
.has-js .why-card.is-in .icon-tape path:nth-child(5) { animation-delay: 1.15s; animation-duration: .3s; }
.has-js .why-card.is-in .icon-tape path:nth-child(6) { animation-delay: 1.3s; animation-duration: .3s; }

@media (prefers-reduced-motion: reduce) {
  .has-js .why-icon path, .has-js .why-icon rect { stroke-dashoffset: 0; animation: none !important; }
  .has-js .why-card.is-in .why-icon { animation: none !important; }
}

/* swash underline — draws itself on scroll-in (house effect) */
.swash-head h2 { margin: 0 auto; }
.swash { display: block; width: min(280px, 64%); margin: 10px auto 0; overflow: visible; }
.swash path { fill: none; stroke: var(--orange); stroke-width: 3.4; stroke-linecap: round; }
.has-js .swash path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.has-js .swash-head.is-in .swash path { animation: swashDraw .9s cubic-bezier(.65,0,.35,1) .3s forwards; }
@keyframes swashDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .has-js .swash path { stroke-dashoffset: 0; animation: none; } }

/* sections */
.section { padding: 96px 0; }
.section-alt { background: var(--graphite-deep); }
h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; letter-spacing: -1px; line-height: 1.15; max-width: 24ch; }
.section-lede { color: var(--mist); max-width: 60ch; margin-top: 14px; font-size: 17px; }

/* why cards */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.why-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
}
.why-card h3 { font-size: 20px; margin-bottom: 10px; }
.why-card p { color: var(--mist); font-size: 15.5px; }

/* range cards */
.range-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.gate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 44px; }
.range-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.range-img { aspect-ratio: 16/10; overflow: hidden; }
.range-img-product { background: #eceff1; }
.range-img-product img { object-fit: contain; padding: 8%; }
.range-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
@media (hover:hover) and (pointer:fine) {
  .range-card:hover .range-img img { transform: scale(1.04); }
}
.range-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.range-body h3 { font-size: 20px; }
.range-body p { color: var(--mist); font-size: 15px; flex: 1; }
.price { color: var(--orange); font-weight: 800; font-size: 15px; letter-spacing: .3px; }

/* swatches */
.swatch-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 40px; }
.swatch { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; color: var(--mist);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px 10px 10px; }
.swatch span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); display: block; }
.swatch-wood { background: repeating-linear-gradient(105deg, #7a4d2b 0 5px, #8f5c34 5px 9px, #6e421f 9px 13px); }

/* real work gallery — compact, tagged, view-more */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 250px; gap: 16px; margin-top: 44px; }
.work-tile { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; }
.work-tile.tall { grid-row: span 2; }
.work-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.work-tile figcaption {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  width: fit-content; max-width: calc(100% - 24px);
  background: rgba(24,28,32,.88); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px;
  font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--snow);
}
@media (hover:hover) and (pointer:fine) {
  .work-tile:hover img { transform: scale(1.04); }
}
/* compact: extras hidden until View more (JS-gated so no-JS shows all) */
.has-js .work-grid:not(.open) .work-extra { display: none; }
.work-more-row { text-align: center; margin-top: 26px; }
.has-js .work-grid.open ~ .work-more-row, html:not(.has-js) .work-more-row { display: none; }
@media (max-width: 860px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .work-tile figcaption { font-size: 12px; padding: 6px 12px; }
}

/* price example */
.price-example { margin-top: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pe-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 28px; border-bottom: 1px solid var(--line); }
.pe-row:last-child { border-bottom: none; }
.pe-row span { color: var(--mist); font-size: 16px; }
.pe-row strong { font-size: 17px; white-space: nowrap; }
.fineprint { color: var(--mist); font-size: 14px; margin-top: 18px; }

/* steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; counter-reset: step; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.step-n {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,140,58,.15); border: 1.5px solid var(--orange);
  color: var(--orange); font-weight: 800; font-size: 18px; margin-bottom: 18px;
}
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { color: var(--mist); font-size: 15px; }

/* final cta */
.cta-final { text-align: center; padding: 110px 0; }
.cta-final h2 { margin: 0 auto; }
.cta-final .section-lede { margin-left: auto; margin-right: auto; }
.cta-final .cta-row { justify-content: center; }

/* footer */
.site-footer { background: var(--graphite-deep); border-top: 1px solid var(--line); padding: 44px 0; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-line { color: var(--mist); font-size: 14px; margin-top: 6px; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--mist); font-size: 14px; text-decoration: none; }
.foot-links a:hover { color: var(--snow); }

/* reveal animation — hidden state ONLY when JS is present (has-js), so
   content can never strand invisible without scripts. Failsafe in app.js. */
.has-js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.has-js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* mobile */
@media (max-width: 860px) {
  .head-nav { display: none; }
  .why-grid, .range-grid, .steps { grid-template-columns: 1fr; }
  .gate-grid { grid-template-columns: 1fr; }
  .hero { min-height: 92vh; }
  .hero-inner { padding-bottom: 64px; }
  .section { padding: 68px 0; }
  .pe-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .pe-row strong { white-space: normal; }
}
