:root {
  --black: #0a0a0a;
  --ink: #141414;
  --white: #ffffff;
  --grey-100: #f4f4f5;
  --grey-300: #d4d4d8;
  --grey-500: #8a8a8e;
  --grey-700: #3f3f46;
  --chrome: linear-gradient(180deg,#f2f2f2 0%,#c9c9c9 49%,#9a9a9a 51%,#e6e6e6 100%);
  --silver: #b8b8bd;
  --maxw: 1200px;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --radius: 6px;
  --display: "Anton", Impact, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Guard against any element pushing past the viewport so both side gutters
     stay equal on every screen. `clip` (not `hidden`) keeps the sticky header working. */
  overflow-x: clip;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; letter-spacing: .01em; text-transform: uppercase; margin: 0; overflow-wrap: break-word; }
h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.label { font-family: var(--body); font-weight: 700; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--silver); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--body); font-weight: 700; font-size: .95rem; padding: .85rem 1.6rem; border-radius: var(--radius); border: 2px solid var(--black); cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease; }
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { border-color: var(--white); }

/* Chrome accent text + triangle motif */
.chrome-text { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tri { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--silver); display: inline-block; }

/* Header / nav */
#site-header { position: sticky; top: 0; z-index: 50; background: var(--black); color: var(--white); border-bottom: 1px solid #1f1f1f; }
.nav { display: flex; align-items: center; justify-content: space-between; padding-block: .9rem; }
.nav-logo img { height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { font-size: .9rem; font-weight: 600; letter-spacing: .02em; color: var(--grey-300); transition: color .15s; }
.nav-links a:hover { color: var(--white); }
.nav-call { font-variant-numeric: tabular-nums; }
.nav-quote { color: var(--black) !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--white); transition: .2s; }
@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 1rem; background: var(--black); padding: 1.5rem var(--pad); transform: translateY(-120%); transition: transform .25s ease; }
  .nav-links.open { transform: none; }
}

/* Hero */
.hero { position: relative; background: var(--black); color: var(--white); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: url("../images/aluminum-glass-privacy-railing-balcony-edmonton.jpg") center/cover no-repeat; opacity: .62; filter: grayscale(.35) contrast(1.05); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.3), rgba(10,10,10,.72)); }
.hero-inner { position: relative; z-index: 1; padding-block: clamp(4.5rem, 14vw, 9rem); max-width: 60rem; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--grey-300); max-width: 38rem; margin-top: 1.25rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.hero .reveal { animation: heroIn .7s ease backwards; opacity: 1; transform: none; }
.hero .label.reveal { animation-delay: .05s; }
.hero h1.reveal { animation-delay: .15s; }
.hero .hero-sub.reveal { animation-delay: .3s; }
.hero .hero-cta.reveal { animation-delay: .45s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* Trust strip */
.trust { background: var(--ink); color: var(--white); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.trust-grid > div { padding: 1.6rem 1rem; border-right: 1px solid #262626; }
.trust-grid > div:last-child { border-right: 0; }
.trust-grid strong { display: block; font-family: var(--display); font-size: 1.6rem; }
.trust-grid span { font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--silver); }
@media (max-width: 700px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } .trust-grid > div:nth-child(2) { border-right: 0; } }

/* Service cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.card { background: var(--white); border: 1px solid var(--grey-300); border-radius: var(--radius); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,.14); }
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.card-body { padding: 1.3rem 1.4rem 1.6rem; }
.card-body h3 { margin-bottom: .5rem; }
@media (max-width: 880px) { .cards { grid-template-columns: 1fr; } }

/* Process steps */
.steps-section { background: var(--grey-100); }
.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.steps li { background: var(--white); border-radius: var(--radius); padding: 1.6rem; border-top: 3px solid var(--black); }
.steps .tri { margin-bottom: .8rem; }
.steps h3 { margin-bottom: .4rem; }

/* Why Riteway */
.why-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.why-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.why-list li { display: flex; align-items: baseline; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--grey-300); }
.why-photo img { border-radius: var(--radius); object-fit: cover; width: 100%; aspect-ratio: 4/5; }
@media (max-width: 880px) { .steps, .why-grid { grid-template-columns: 1fr; } }

/* Gallery — uniform responsive grid (Peak RailBlazers–inspired) */
.gallery-section { background: var(--black); color: var(--white); }
.gallery-intro { max-width: 46rem; margin-top: 1rem; color: var(--grey-300); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 2.5rem; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.g-item { position: relative; display: block; padding: 0; margin: 0; border: 0; background: #131313; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.g-item img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.12); transition: filter .35s ease, transform .55s ease; }
.g-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,.5), transparent 45%); opacity: 0; transition: opacity .3s ease; }
.g-item:hover img, .g-item:focus-visible img { filter: none; transform: scale(1.06); }
.g-item:hover::after, .g-item:focus-visible::after { opacity: 1; }
.g-item:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

/* Lightbox with prev/next + counter */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.93); padding: clamp(1rem, 4vw, 2.5rem); }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 86vh; border-radius: 4px; }
.lightbox-close { position: absolute; top: 1rem; right: 1.5rem; font-size: 2.5rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; line-height: 1; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: 50%; cursor: pointer; transition: background .15s ease; }
.lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-prev { left: clamp(.5rem, 2vw, 1.5rem); }
.lightbox-next { right: clamp(.5rem, 2vw, 1.5rem); }
.lightbox-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: var(--grey-300); font-size: .85rem; margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .lightbox-nav { width: 2.5rem; height: 2.5rem; font-size: 1.8rem; } }

/* Service area */
.area-section { background: var(--grey-100); }
.area-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.area-list li { font-family: var(--display); text-transform: uppercase; font-size: 1.1rem; padding: .5rem 1.1rem; background: var(--white); border: 1px solid var(--grey-300); border-radius: 999px; }

/* Contact + form */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); }
.contact-info { list-style: none; padding: 0; margin-top: 1.5rem; }
.contact-info li { padding: .6rem 0; border-bottom: 1px solid var(--grey-300); }
.contact-info strong { display: block; font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--silver); }
.quote-form { display: grid; gap: 1rem; background: var(--white); padding: 1.8rem; border: 1px solid var(--grey-300); border-radius: var(--radius); }
.quote-form label { display: grid; gap: .35rem; font-weight: 600; font-size: .85rem; }
.quote-form input, .quote-form textarea { font: inherit; padding: .7rem .8rem; border: 1px solid var(--grey-300); border-radius: var(--radius); }
.quote-form input:focus, .quote-form textarea:focus { outline: 2px solid var(--black); outline-offset: 1px; }
.form-status { font-size: .85rem; margin: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

/* Footer */
#site-footer { background: var(--black); color: var(--grey-300); padding-top: 3.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-logo { height: 40px; width: auto; margin-bottom: 1rem; }
#site-footer h4 { font-family: var(--body); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--white); margin: 0 0 .8rem; }
#site-footer a:hover { color: var(--white); }
.footer-social { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.footer-social a { display: inline-flex; border-radius: 50%; transition: transform .15s ease, opacity .15s ease; opacity: .9; }
.footer-social a:hover { transform: translateY(-2px); opacity: 1; }
.footer-social img { display: block; width: 28px; height: 28px; }
.footer-bottom { border-top: 1px solid #1f1f1f; margin-top: 2.5rem; padding-block: 1.4rem; font-size: .8rem; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr; } }

/* Clickable service cards (link to category pages) */
.card-link { display: block; color: inherit; height: 100%; }
.card-cta { display: inline-block; margin-top: .6rem; font-weight: 700; font-size: .9rem; color: var(--black); }
.card:hover .card-cta { text-decoration: underline; }

/* Current-page nav highlight */
.nav-links a.is-current { color: var(--white); }

/* Hero "RITE-WAY" pop — pops on load and replays when scrolled back into view.
   Without JS the word stays fully visible (no .pop class is added). */
.hero h1 .chrome-text { display: inline-block; transform-origin: 50% 60%; }
.js .hero h1 .chrome-text.pop { animation: chromePop .85s cubic-bezier(.2,.75,.25,1.45) both; }
@keyframes chromePop {
  0%   { opacity: 0; transform: scale(.35) translateY(.05em); filter: blur(3px); }
  55%  { opacity: 1; transform: scale(1.14); filter: blur(0); }
  72%  { transform: scale(.97); }
  100% { transform: scale(1); }
}

/* Category gallery pages */
.page-hero .hero-inner { padding-block: clamp(2.75rem, 9vw, 5rem) clamp(4.25rem, 12vw, 6.5rem); max-width: 52rem; }
.crumb { font-size: .85rem; color: var(--grey-300); margin-bottom: 1rem; letter-spacing: .02em; }
.crumb a { color: var(--silver); }
.crumb a:hover { color: var(--white); }
.crumb span { margin: 0 .4rem; color: var(--grey-700); }
/* Scroll-down cue at the bottom of the gallery-page hero */
.scroll-cue { position: absolute; left: 50%; bottom: 1.1rem; transform: translateX(-50%); z-index: 2; display: inline-flex; padding: .6rem; }
.scroll-cue-arrow { display: block; width: 16px; height: 16px; border-right: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(45deg); opacity: .9; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); animation: scrollCueFlash 1.8s ease-in-out infinite; }
@keyframes scrollCueFlash { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

.contact-cta { background: var(--ink); color: var(--white); text-align: center; }
.contact-cta-inner { max-width: 40rem; margin-inline: auto; }
.contact-cta-inner p { color: var(--grey-300); }
.contact-cta .hero-cta { justify-content: center; margin-top: 1.75rem; }

/* Mobile: shorten the "Why Riteway" photo so it doesn't fill the screen */
@media (max-width: 880px) { .why-photo img { aspect-ratio: 16 / 10; } }

/* Scroll reveal — progressive enhancement.
   No-JS / JS-failure: content is fully visible (default below).
   With JS (html.js): elements start hidden and reveal on scroll. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
/* Hero reveals are driven by the heroIn keyframe animation, not the scroll observer. */
.js .hero .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
