/* Applewood Roofing & Sheet Metal — design system v2.
   Sora (display) + Inter (body), deep navy + signal red, layered imagery,
   reveal-on-scroll, no frameworks, no trackers. */
:root {
  --navy: #0c2a50; --navy-2: #11365f; --navy-dark: #071c38; --ink: #15202b;
  --red: #d31632; --red-dark: #a90d26;
  --muted: #5c6b7c; --line: #e4e9ef; --bg: #ffffff; --bg-alt: #f3f6fa;
  --max: 1160px; --r: 14px;
  --shadow-lg: 0 24px 60px -18px rgba(7, 28, 56, .35);
  --shadow-sm: 0 8px 24px -10px rgba(7, 28, 56, .22);
  --ff-display: "Sora", -apple-system, sans-serif;
  --ff-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font: 16.5px/1.7 var(--ff-body); color: var(--ink); background: var(--bg);
       -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--navy); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

::selection { background: var(--red); color: #fff; }

/* ---------- header ---------- */
header { position: fixed; top: 0; left: 0; right: 0; z-index: 90;
         background: linear-gradient(180deg, rgba(7,28,56,.92), rgba(7,28,56,.78));
         backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
         transition: background .3s, box-shadow .3s; }
header.scrolled { background: rgba(7,28,56,.97); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.nav { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none;
         font-family: var(--ff-display); font-weight: 700; letter-spacing: .2px; font-size: 16.5px; }
.brand .mark { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent;
               border-bottom: 21px solid var(--red); filter: drop-shadow(0 2px 6px rgba(211,22,50,.5)); }
.brand small { display: block; font-family: var(--ff-body); font-weight: 500; font-size: 10.5px;
               letter-spacing: .22em; text-transform: uppercase; color: #93a8c2; }
.brand img { height: 36px; width: auto; display: block; }
footer .fbrand img { height: 30px; width: auto; }
.nav .links { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav .links a { color: rgba(255,255,255,.82); text-decoration: none; padding: 9px 14px; border-radius: 8px;
                font-size: 14px; font-weight: 600; letter-spacing: .01em; transition: color .2s, background .2s; }
.nav .links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav .links a.active { color: #fff; box-shadow: inset 0 -2px 0 var(--red); border-radius: 8px 8px 0 0; }
.nav .cta { background: var(--red); color: #fff !important; margin-left: 10px; box-shadow: 0 6px 18px -6px rgba(211,22,50,.6); }
.nav .cta:hover { background: var(--red-dark) !important; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav .links { display: none; position: absolute; top: 74px; left: 0; right: 0;
                background: var(--navy-dark); flex-direction: column; align-items: stretch;
                padding: 12px 18px 20px; gap: 4px; box-shadow: 0 30px 40px rgba(0,0,0,.4); }
  .nav .links.open { display: flex; }
  .nav .links a.active { box-shadow: inset 3px 0 0 var(--red); border-radius: 8px; }
  .nav .cta { margin-left: 0; text-align: center; }
}

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; min-height: 92vh; display: flex; align-items: center;
        background: var(--navy-dark); overflow: hidden; }
.hero.short { min-height: 480px; }
.hero img.bg, .hero video.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero video.bg { opacity: 0; transition: opacity 1.2s ease; }
.hero video.bg.playing { opacity: 1; }
.hero .scrim { position: absolute; inset: 0;
  background: linear-gradient(78deg, rgba(7,28,56,.94) 0%, rgba(7,28,56,.78) 38%, rgba(7,28,56,.25) 72%, rgba(7,28,56,.45) 100%),
              linear-gradient(0deg, rgba(7,28,56,.85) 0%, transparent 30%); }
.hero .inner { position: relative; padding: 150px 0 120px; max-width: 760px; }
.hero.short .inner { padding: 130px 0 70px; }
.kicker { display: flex; align-items: center; gap: 12px; color: #ff8a9c; font-weight: 700;
          letter-spacing: .18em; text-transform: uppercase; font-size: 12.5px; font-family: var(--ff-body); }
.kicker::before { content: ""; width: 44px; height: 3px; background: var(--red); flex-shrink: 0; }
section .kicker { color: var(--red); }
.hero h1 { font-family: var(--ff-display); font-size: clamp(38px, 5.6vw, 66px); line-height: 1.04;
           letter-spacing: -.02em; margin: 18px 0 20px; font-weight: 800; }
.hero p.sub { font-size: clamp(17px, 1.6vw, 20px); color: #c9d7e8; margin-bottom: 34px; max-width: 560px; }
.hero .trust { position: absolute; left: 0; right: 0; bottom: 0;
               background: rgba(7,28,56,.55); backdrop-filter: blur(8px);
               border-top: 1px solid rgba(255,255,255,.12); }
.hero .trust .wrap { display: flex; gap: 10px 38px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.hero .trust span { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
                    color: #b9c9dd; display: flex; align-items: center; gap: 9px; }
.hero .trust span::before { content: ""; width: 7px; height: 7px; background: var(--red); transform: rotate(45deg); }
/* Mobile: the absolute strip overlapped the hero CTAs — flow it below the content instead */
@media (max-width: 640px) {
  .hero { flex-direction: column; justify-content: center; align-items: stretch; }
  .hero .inner { padding: 120px 0 48px; }
  .hero .trust { position: static; margin-top: auto; }
  .hero .trust .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .hero .trust span { font-size: 11.5px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 30px; border-radius: 10px;
       font-weight: 700; text-decoration: none; font-size: 15px; border: 0; cursor: pointer;
       font-family: var(--ff-body); letter-spacing: .01em; transition: transform .2s, box-shadow .2s, background .2s; }
.btn::after { content: "→"; font-weight: 400; transition: transform .25s; }
.btn:hover::after { transform: translateX(4px); }
.btn.no-arrow::after { content: none; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 14px 30px -10px rgba(211,22,50,.55); }
.btn.red:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn.ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.35);
             margin-left: 12px; backdrop-filter: blur(4px); }
.btn.ghost:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.btn.navy { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn.navy:hover { background: var(--navy-2); transform: translateY(-2px); }
@media (max-width: 600px) { .btn.ghost { margin-left: 0; margin-top: 10px; } }

/* ---------- sections ---------- */
section { padding: 104px 0; }
section.alt { background: var(--bg-alt); }
section.tight { padding: 72px 0; }
h2 { font-family: var(--ff-display); font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12;
     letter-spacing: -.015em; margin: 14px 0 18px; color: var(--navy); font-weight: 800; }
.lead { font-size: 17.5px; color: var(--muted); max-width: 740px; }
.lead + .lead { margin-top: 14px; }
.center { text-align: center; }
.center .kicker { justify-content: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* split layouts with framed imagery */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.flip > .media { order: 2; }
.split .media { position: relative; }
.split .media::before { content: ""; position: absolute; inset: 26px -26px -26px 26px;
                        background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
                        border-radius: var(--r); opacity: .1; }
.split.flip .media::before { inset: 26px 26px -26px -26px; }
.split .media::after { content: ""; position: absolute; top: -14px; left: -14px; width: 64px; height: 64px;
                       border-top: 4px solid var(--red); border-left: 4px solid var(--red); border-radius: 4px 0 0 0; }
.split.flip .media::after { left: auto; right: -14px; border-left: 0; border-right: 4px solid var(--red);
                            border-radius: 0 4px 0 0; }
.split .media img, .split .media video { position: relative; border-radius: var(--r); box-shadow: var(--shadow-lg);
                    width: 100%; height: 420px; object-fit: cover; display: block; }
.split .media video { background: var(--navy-dark); }

/* "Real footage" chip over section videos — pulsing dot signals it's our own footage */
.vid-chip { position: absolute; z-index: 2; left: 16px; bottom: 16px; display: inline-flex; align-items: center;
  gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: #fff; background: rgba(11, 26, 42, .58); backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%); border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: none; }
.vid-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: chip-pulse 2.2s ease-out infinite; }
@keyframes chip-pulse {
  0% { box-shadow: 0 0 0 0 rgba(211, 22, 50, .55); }
  70% { box-shadow: 0 0 0 9px rgba(211, 22, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 22, 50, 0); }
}
@media (prefers-reduced-motion: reduce) { .vid-chip i { animation: none; } }

/* Scroll-driven entrance for split media (CSS animation-timeline — progressive enhancement,
   Chromium 115+; other browsers keep the JS reveal on the text column) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .split .media { animation: media-rise linear both; animation-timeline: view();
      animation-range: entry 0% entry 70%; }
  }
}
@keyframes media-rise {
  from { transform: scale(.94) translateY(26px); opacity: .35; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split.flip > .media { order: 0; }
  .split .media img, .split .media video { height: 280px; }
}

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; margin-top: 44px; }
.card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r);
        padding: 30px 26px 26px; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 100%; height: 4px;
                background: var(--red); transition: right .3s; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-sm); border-color: transparent; }
.card:hover::before { right: 0; }
.card h3 { font-family: var(--ff-display); color: var(--navy); font-size: 17.5px; margin-bottom: 9px;
           font-weight: 700; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 14.8px; line-height: 1.65; }
.card .ico { width: 50px; height: 50px; border-radius: 12px; background: linear-gradient(135deg, #fdeef1, #fbdde2);
             color: var(--red); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.card .ico svg { width: 25px; height: 25px; }

/* stats band */
.band { background: linear-gradient(110deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-2) 100%);
        color: #fff; padding: 78px 0; }
.band .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; text-align: center; }
.band .n { font-family: var(--ff-display); font-size: clamp(40px, 5vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.band .n em { color: var(--red); font-style: normal; }
.band .l { color: #93a8c2; font-weight: 600; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
@media (max-width: 640px) { .band .stats { grid-template-columns: 1fr; gap: 36px; } }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 44px; }
.gallery figure { position: relative; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery img { width: 100%; height: 300px; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 56px 20px 18px;
                      background: linear-gradient(0deg, rgba(7,28,56,.92) 0%, rgba(7,28,56,.55) 55%, transparent 100%);
                      color: #fff; font-family: var(--ff-display); font-weight: 700; font-size: 17px; }
.gallery figcaption span { display: block; font-family: var(--ff-body); font-weight: 500; color: #aebfd4; font-size: 13px; margin-top: 2px; }

/* affiliation / partner logos (real marks recovered from the previous site) */
.logos-marquee { overflow: hidden; margin-top: 44px; padding: 8px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.logos-track { display: flex; gap: 22px; width: max-content; animation: marquee 36s linear infinite; }
.logos-marquee:hover .logos-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.logo-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; flex-shrink: 0;
             width: 210px; height: 116px; display: flex; align-items: center; justify-content: center;
             padding: 10px 16px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.logo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); border-color: transparent; }
.logo-card img { max-height: 94px; max-width: 176px; width: auto; height: auto; object-fit: contain;
                 filter: grayscale(1); opacity: .75; transition: filter .35s, opacity .35s; }
.logo-card:hover img { filter: none; opacity: 1; }
.logos-grid { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 34px; }
.logos-grid .logo-card { width: 176px; height: 96px; padding: 8px 12px; }
.logos-grid .logo-card img { max-height: 78px; max-width: 150px; }
/* compact marquee — fits narrow containers (contact sidebar), ~3 cards visible */
.logos-marquee.compact { margin-top: 10px; }
.logos-marquee.compact .logos-track { gap: 14px; }
.logos-marquee.compact .logo-card { width: 132px; height: 84px; padding: 8px 10px; }
.logos-marquee.compact .logo-card img { max-height: 66px; max-width: 112px; }
/* Mobile: cards scale to the viewport so the strip reads the same as desktop */
@media (max-width: 640px) {
  .logos-track { gap: 12px; }
  .logo-card { width: clamp(104px, 30vw, 150px); height: 78px; padding: 8px 12px; }
  .logo-card img { max-height: 60px; max-width: 100%; }
  .logos-marquee.compact .logo-card { width: clamp(96px, 27vw, 132px); height: 72px; }
  .logos-marquee.compact .logo-card img { max-height: 54px; }
}
/* Reduced-motion fallback: a tidy fluid grid instead of the animated strip.
   The duplicate set carries an inline display:contents, so hiding it needs !important. */
@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: auto; }
  .logos-track .dup { display: none !important; }
  .logo-card, .logos-marquee.compact .logo-card { width: auto; }
  .logos-marquee { -webkit-mask-image: none; mask-image: none; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 880px) {
  .logos-track { grid-template-columns: repeat(6, 1fr); }
}

/* scroll progress bar */
#scrollbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--red); z-index: 120; }

/* cross-document view transitions (Chrome 126+; progressive enhancement) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-old(root) { animation-duration: .22s; }
::view-transition-new(root) { animation-duration: .22s; }

h1, h2, h3 { text-wrap: balance; }
.lead, p { text-wrap: pretty; }

.badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.badge { background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 700;
         font-size: 13px; border-radius: 999px; padding: 9px 18px; letter-spacing: .03em;
         display: inline-flex; align-items: center; gap: 8px; }
.badge::before { content: ""; width: 7px; height: 7px; background: var(--red); transform: rotate(45deg); }

/* emergency CTA band */
.cta-band { position: relative; background: linear-gradient(100deg, var(--navy-dark) 0%, var(--navy) 70%);
            color: #fff; padding: 84px 0; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; top: -60px; right: -80px; width: 380px; height: 380px;
                    background: var(--red); opacity: .12; transform: rotate(45deg); border-radius: 60px; }
.cta-band .wrap { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; position: relative; }
.cta-band h2 { color: #fff; margin: 10px 0 8px; }
.cta-band p { color: #b9c9dd; max-width: 520px; }
.cta-band .phone { margin-left: auto; text-align: right; }
.cta-band .phone a.number { font-family: var(--ff-display); font-size: clamp(28px, 3.4vw, 44px); font-weight: 800;
                            color: #fff; text-decoration: none; letter-spacing: -.01em; display: block; }
.cta-band .phone a.number:hover { color: #ff8a9c; }
.cta-band .phone .tag { color: var(--red); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: 12.5px; }
@media (max-width: 880px) { .cta-band .phone { margin-left: 0; text-align: left; } }

/* ---------- forms ---------- */
form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { form .row { grid-template-columns: 1fr; } }
label { display: block; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
        margin: 18px 0 7px; color: var(--navy); }
input, textarea, select { width: 100%; padding: 14px 16px; border: 1.5px solid #ccd6e0; border-radius: 10px;
                          font: inherit; font-size: 15px; background: #fff; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(12,42,80,.1); }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; background: #fdeef1;
         border: 1px solid #f6cdd4; border-radius: 10px; padding: 14px 16px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); }
.check span { font-size: 14.5px; color: #7c2231; }
.check label { display: inline; margin: 0; text-transform: none; letter-spacing: 0; font-size: 14.5px; }
.form-note { margin-top: 16px; font-size: 14.5px; }
.form-note.ok { color: #1b7c39; font-weight: 600; }
.form-note.err { color: var(--red); font-weight: 600; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.contact-aside { min-width: 0; }   /* grid child: let the logo marquee clip instead of stretching the column */
.contact-aside h2 { font-size: 21px; margin-top: 0; }
.contact-aside .blockx { padding: 24px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; background: #fff; }
.contact-aside .blockx.urgent { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); border: 0; color: #fff; }
.contact-aside .blockx.urgent h2 { color: #fff; }
.contact-aside .blockx.urgent p { color: #b9c9dd; }
.contact-aside .blockx.urgent a { color: #ff8a9c; font-weight: 700; }

/* ---------- footer ---------- */
footer { background: var(--navy-dark); color: #b9c9dd; padding: 70px 0 30px; }
footer .cols { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.2fr; gap: 44px; }
@media (max-width: 880px) { footer .cols { grid-template-columns: 1fr 1fr; gap: 34px; } }
footer h4 { color: #fff; font-family: var(--ff-display); font-size: 13px; text-transform: uppercase;
            letter-spacing: .14em; margin-bottom: 16px; font-weight: 700; }
footer a { color: #b9c9dd; text-decoration: none; display: block; padding: 4px 0; font-size: 14.5px; transition: color .2s; }
footer a:hover { color: #fff; }
footer p { font-size: 14.5px; line-height: 1.7; }
footer .fbrand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--ff-display);
                 font-weight: 700; font-size: 17px; margin-bottom: 14px; }
footer .fbrand .mark { width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent;
                       border-bottom: 19px solid var(--red); }
footer .legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 48px; padding-top: 22px;
                font-size: 13px; color: #7e92aa; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
/* Mobile footer: brand block full width, link columns side by side, centered legal */
@media (max-width: 640px) {
  footer { padding: 54px 0 26px; }
  footer .cols { grid-template-columns: 1fr 1fr; gap: 30px 22px; }
  footer .cols > div:first-child { grid-column: 1 / -1; }
  footer a { padding: 6px 0; }
  footer .legal { margin-top: 36px; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}

/* Address → maps link: inherits surrounding text colour, subtle affordance */
a.map-link { display: inline; color: inherit; text-decoration: none;
             border-bottom: 1px dotted currentColor; transition: color .2s, border-color .2s; }
a.map-link:hover { color: var(--red); border-bottom-style: solid; }
footer a.map-link { padding: 0; }
footer a.map-link:hover { color: #fff; }

/* prose (legal pages) */
.prose { max-width: 820px; }
.prose h1 { font-family: var(--ff-display); color: var(--navy); margin-bottom: 20px; letter-spacing: -.015em; }
.prose p, .prose li { color: #33424f; margin-bottom: 13px; }
.prose ul { padding-left: 22px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .gallery img, .btn, .card { transition: none; }
}
