/* AWR warm roof 3D build explainer */
.wr3d {
  --wr3d-red: #c8102e;
  --wr3d-ink: #0f1115;
  --wr3d-ink-2: #161a21;
  --wr3d-line: rgba(255, 255, 255, 0.12);
  --wr3d-muted: rgba(255, 255, 255, 0.72);
  --wr3d-top: 0px; /* height of a sticky site header, if any */
  --wr3d-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  background: var(--wr3d-ink);
  color: #fff;
  font-family: var(--wr3d-font, inherit);
  isolation: isolate;
}
.wr3d *, .wr3d *::before, .wr3d *::after { box-sizing: border-box; }

.wr3d__skip {
  position: absolute; left: 1rem; top: 1rem; z-index: 5;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: #fff; color: var(--wr3d-ink); font-weight: 700; text-decoration: none;
  clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.wr3d.is-3d .wr3d__skip:focus { clip-path: none; width: auto; height: auto; outline: 3px solid var(--wr3d-red); outline-offset: 2px; }
.wr3d:not(.is-3d) .wr3d__skip { display: none; }

.wr3d__eyebrow {
  margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ff6b80; display: flex; align-items: center; gap: 0.6rem;
}
.wr3d__eyebrow::before { content: ""; width: 1.6rem; height: 2px; background: var(--wr3d-red); }
.wr3d__title {
  margin: 0 0 1.25rem; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800;
}
.wr3d__steps { list-style: none; margin: 0; padding: 0; }
.wr3d__num {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; color: var(--wr3d-muted);
  font-variant-numeric: tabular-nums;
}
.wr3d__num::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--wr3d-red); }
.wr3d__step h3 { margin: 0.4rem 0 0.45rem; font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem); line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; }
.wr3d__step p { margin: 0; color: var(--wr3d-muted); font-size: 1rem; line-height: 1.55; max-width: 38ch; }
.wr3d__note {
  margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--wr3d-line);
  font-size: 0.875rem; line-height: 1.5; color: var(--wr3d-muted);
}
.wr3d__note strong { color: #fff; }
.wr3d__bar { display: none; }
.wr3d__stage { display: none; }

/* ---------- static list (default, reduced motion, no WebGL) ---------- */
.wr3d:not(.is-3d) .wr3d__sticky { max-width: 72rem; margin: 0 auto; padding: clamp(3rem, 6vw, 6rem) 1.25rem; }
.wr3d:not(.is-3d) .wr3d__steps { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.wr3d:not(.is-3d) .wr3d__step {
  padding: 1.25rem 1.25rem 1.4rem; border-radius: 14px;
  background: var(--wr3d-ink-2); border: 1px solid var(--wr3d-line);
  border-top: 3px solid var(--wr3d-red);
}
@media (min-width: 720px) { .wr3d:not(.is-3d) .wr3d__steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .wr3d:not(.is-3d) .wr3d__steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 3D scroll mode ---------- */
.wr3d.is-3d { height: 500vh; }
.wr3d.is-3d .wr3d__sticky {
  position: sticky; top: var(--wr3d-top);
  height: calc(100vh - var(--wr3d-top));
  height: calc(100svh - var(--wr3d-top));
  overflow: hidden;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.wr3d.is-3d .wr3d__stage {
  display: block; position: relative; min-height: 0;
  background:
    radial-gradient(120% 90% at 50% 38%, #2a3039 0%, #1a1e25 48%, var(--wr3d-ink) 100%);
}
.wr3d.is-3d .wr3d__stage::after { /* loading shimmer until the first frame */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 50%, transparent 70%);
  background-size: 200% 100%; animation: wr3d-shimmer 1.6s linear infinite;
  transition: opacity 0.5s;
}
.wr3d.is-ready .wr3d__stage::after { opacity: 0; animation: none; }
@keyframes wr3d-shimmer { to { background-position: -200% 0; } }
.wr3d__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.7s var(--wr3d-ease); }
.wr3d.is-ready .wr3d__canvas { opacity: 1; }

.wr3d.is-3d .wr3d__panel {
  position: relative; z-index: 2;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15,17,21,.92), var(--wr3d-ink) 40%);
  border-top: 1px solid var(--wr3d-line);
  margin-top: -1px;
}
.wr3d.is-3d .wr3d__eyebrow { margin-bottom: 0.25rem; }
.wr3d.is-3d .wr3d__title { font-size: 1.05rem; margin: 0 0 0.75rem; font-weight: 700; color: var(--wr3d-muted); letter-spacing: 0; }
.wr3d.is-3d .wr3d__steps { display: grid; }
.wr3d.is-3d .wr3d__step {
  grid-area: 1 / 1; opacity: 0; transform: translateY(10px);
  transition: opacity 0.45s var(--wr3d-ease), transform 0.6s var(--wr3d-ease);
  pointer-events: none;
}
.wr3d.is-3d .wr3d__step.is-active { opacity: 1; transform: none; pointer-events: auto; }
.wr3d.is-3d .wr3d__step h3 { margin-top: 0.3rem; }
.wr3d.is-3d .wr3d__bar {
  display: block; margin: 0.9rem 0 0; height: 3px; position: relative; overflow: hidden;
  background: rgba(255,255,255,.16); border-radius: 2px;
}
.wr3d__bar::after { /* gaps between the six steps */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent calc(16.666% - 2px), var(--wr3d-ink) 0 calc(16.666% + 2px), transparent 0 calc(33.333% - 2px), var(--wr3d-ink) 0 calc(33.333% + 2px), transparent 0 calc(50% - 2px), var(--wr3d-ink) 0 calc(50% + 2px), transparent 0 calc(66.666% - 2px), var(--wr3d-ink) 0 calc(66.666% + 2px), transparent 0 calc(83.333% - 2px), var(--wr3d-ink) 0 calc(83.333% + 2px), transparent 0);
}
.wr3d__bar-fill { position: absolute; inset: 0; background: var(--wr3d-red); transform-origin: 0 50%; transform: scaleX(0); }
.wr3d.is-3d .wr3d__note { margin-top: 0.8rem; padding-top: 0.7rem; font-size: 0.8125rem; }

@media (max-width: 380px), (max-height: 700px) {
  .wr3d.is-3d .wr3d__title { display: none; }
  .wr3d.is-3d .wr3d__step p { font-size: 0.9375rem; }
}

@media (min-width: 960px) {
  .wr3d.is-3d .wr3d__sticky { grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 460px); }
  .wr3d.is-3d .wr3d__panel {
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem clamp(2rem, 3vw, 3.5rem);
    border-top: 0; border-left: 1px solid var(--wr3d-line); margin: 0;
    background: var(--wr3d-ink);
  }
  .wr3d.is-3d .wr3d__title { font-size: clamp(1.7rem, 1.1rem + 1.3vw, 2.4rem); color: #fff; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 2rem; }
  .wr3d.is-3d .wr3d__step p { font-size: 1.0625rem; }
  .wr3d.is-3d .wr3d__bar { margin-top: 2rem; }
  .wr3d.is-3d .wr3d__note { margin-top: 1.5rem; padding-top: 1.25rem; font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .wr3d *, .wr3d *::after { transition: none !important; animation: none !important; }
}
