/* 3D Roof Visualiser. Maps this page's tokens onto the site design system (css/style.css). */
:root {
  --rv-accent: var(--accent); --rv-accent-hi: var(--sky); --rv-accent-dk: var(--accent-dk);
  --rv-dark: var(--navy-deep); --rv-dark-2: var(--navy); --rv-dark-3: var(--navy-light);
  --rv-bg: var(--rv-bg); --rv-card: #fff; --rv-line: var(--rv-line); --rv-fg: var(--rv-dark); --rv-muted: var(--ink-soft);
  --rv-warn: #8a5300; --rv-steel: #8aa0b4;
  --rv-display: "Fraunces", "Work Sans", serif; --rv-body: "Work Sans", -apple-system, "Segoe UI", sans-serif;
  --rv-radius: 8px; --rv-radius-l: 14px;
}
.rv-section { padding-top: clamp(28px, 4vw, 56px); }
.rv-wrap { position: relative; }
.rv { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .rv { grid-template-columns: minmax(0, 1.25fr) minmax(360px, .8fr); gap: 36px; } .rv-stage-col { position: sticky; top: 92px; } }
.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rv-noscript { background: var(--rv-card); border: 2px solid var(--rv-accent); padding: 16px; border-radius: var(--rv-radius); }

/* stage */
.rv-stage { position: relative; height: 62vh; height: 62svh; min-height: 380px; max-height: 720px; background: linear-gradient(#bcd3e6, #e8eef2); border-radius: var(--rv-radius); overflow: hidden; border: 1px solid var(--rv-line); isolation: isolate; touch-action: pan-y; }
@media (min-width: 980px) { .rv-stage { height: 72vh; height: 72svh; } }
.rv-poster, .rv-poster img, .rv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rv-poster img { object-fit: cover; filter: saturate(.9); }
.rv-canvas { opacity: 0; transition: opacity .6s var(--ease); }
.rv-canvas canvas { display: block; width: 100% !important; height: 100% !important; outline: none; touch-action: none; cursor: grab; }
.rv-canvas canvas:active { cursor: grabbing; }
.rv-stage.is-ready .rv-canvas { opacity: 1; }
.rv-stage.is-ready .rv-poster { opacity: 0; transition: opacity .6s .2s; }
.rv-loader, .rv-fallback { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 24px; background: rgba(22,20,18,.6); color: #fff; z-index: 3; }
.rv-loader p, .rv-fallback p { margin: 0; font-weight: 600; }
.rv-stage.is-loading .rv-loader { display: grid; }
.rv-stage.is-fallback .rv-fallback { display: grid; }
.rv-start { display: none; }
.rv-loader__roof { display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.rv-loader__roof i { width: 8px; background: var(--rv-accent-hi); border-radius: 2px; animation: rvb 1s ease-in-out infinite; height: 14px; }
.rv-loader__roof i:nth-child(2) { animation-delay: .1s; } .rv-loader__roof i:nth-child(3) { animation-delay: .2s; } .rv-loader__roof i:nth-child(4) { animation-delay: .3s; } .rv-loader__roof i:nth-child(5) { animation-delay: .4s; }
@keyframes rvb { 0%, 100% { height: 12px; opacity: .5; } 50% { height: 32px; opacity: 1; } }

.rv-ovl { position: absolute; z-index: 4; }
.rv-ovl--tl { top: 12px; left: 12px; } .rv-ovl--tr { top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.rv-ovl--bl { bottom: 12px; left: 12px; right: 140px; }
.rv-seg { display: inline-flex; background: rgba(22,20,18,.82); backdrop-filter: blur(6px); border-radius: var(--rv-radius); padding: 3px; }
.rv-seg button { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: #ddd7d0; font: 700 .82rem/1 var(--rv-body); border-radius: 3px; cursor: pointer; transition: background .2s, color .2s; }
.rv-seg button.is-on { background: var(--rv-accent); color: #fff; }
.rv-seg button:disabled, .rv-ic:disabled { opacity: .45; cursor: not-allowed; }
.rv-ic { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--rv-radius); background: rgba(22,20,18,.82); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s, transform .2s var(--ease); }
.rv-ic:hover:not(:disabled) { background: var(--rv-dark-3); transform: translateY(-1px); }
.rv-ic.is-on { background: var(--rv-accent); }
.rv-hint { display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 8px 12px; background: rgba(22,20,18,.78); color: #fff; font-size: .78rem; line-height: 1.3; border-radius: 99px; transition: opacity .5s; }
.rv-hint svg { flex: none; }
.rv-stage.is-touched .rv-hint { opacity: 0; pointer-events: none; }
.rv-chip-est { bottom: 12px; right: 12px; text-align: right; border: 0; background: var(--rv-accent); color: #fff; padding: 8px 14px; border-radius: var(--rv-radius); cursor: pointer; font-family: var(--rv-body); line-height: 1.15; box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); }
.rv-chip-est small { display: block; font-size: .68rem; letter-spacing: .08em; opacity: .85; }
.rv-chip-est b { font: 800 1.15rem/1.1 var(--rv-display); letter-spacing: .01em; white-space: nowrap; }
.rv-cap { display: flex; gap: 8px; align-items: flex-start; color: var(--rv-muted); font-size: .82rem; margin: 10px 2px 0; line-height: 1.45; }
.rv-cap svg { flex: none; margin-top: 2px; }

/* panel */
.rv-panel { display: grid; gap: 18px; }
.rv-step, .rv-sum { background: var(--rv-card); border: 1px solid var(--rv-line); border-radius: var(--rv-radius); padding: clamp(16px, 2.4vw, 24px); }
.rv-step h2, .rv-sum h2 { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: .6em; }
.rv-n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--rv-dark); color: #fff; border-radius: 50%; font: 800 1rem/1 var(--rv-display); }
.rv-sub { color: var(--rv-muted); font-size: .92rem; margin: -.2em 0 14px; }
.rv-lbl { display: block; font-weight: 700; font-size: .85rem; margin: 16px 0 8px; }
.rv-help { color: var(--rv-muted); font-size: .85rem; margin: 8px 0 0; }
.rv-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rv-type { display: grid; justify-items: center; gap: 2px; padding: 14px 6px; border: 2px solid var(--rv-line); background: var(--rv-bg); border-radius: var(--rv-radius); cursor: pointer; font-family: var(--rv-body); color: var(--rv-fg); transition: border-color .2s, background .2s, transform .2s var(--ease); min-height: 44px; }
.rv-type:hover { border-color: var(--rv-steel); transform: translateY(-2px); }
.rv-type b { font-size: .95rem; } .rv-type small { color: var(--rv-muted); font-size: .72rem; line-height: 1.2; text-align: center; }
.rv-type__ic { color: var(--rv-dark); }
.rv-type.is-on { border-color: var(--rv-accent); background: #fff; box-shadow: inset 0 -4px 0 var(--rv-accent); }
.rv-type.is-on .rv-type__ic { color: var(--rv-accent); }

.rv-size__top { display: flex; justify-content: space-between; align-items: baseline; font-size: .92rem; }
.rv-size__top b { font: 700 1.6rem/1 var(--rv-display); }
.rv-range { width: 100%; margin: 12px 0; accent-color: var(--rv-accent); height: 32px; cursor: pointer; }
.rv-presets, .rv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-chip { min-height: 40px; padding: 0 14px; border: 2px solid var(--rv-line); background: var(--rv-bg); border-radius: 99px; font: 600 .85rem/1 var(--rv-body); color: var(--rv-fg); cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.rv-chip:hover { border-color: var(--rv-steel); }
.rv-chip.is-on { border-color: var(--rv-accent); background: var(--rv-accent); color: #fff; }

.rv-svcs { display: grid; gap: 8px; }
.rv-svc { display: grid; grid-template-columns: 40px 1fr 24px; gap: 12px; align-items: center; text-align: left; padding: 12px; border: 2px solid var(--rv-line); background: var(--rv-bg); border-radius: var(--rv-radius); cursor: pointer; font-family: var(--rv-body); color: var(--rv-fg); min-height: 56px; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.rv-svc:hover { border-color: var(--rv-steel); transform: translateX(2px); }
.rv-svc__ic { width: 40px; height: 40px; display: grid; place-items: center; background: var(--rv-dark); color: #fff; border-radius: var(--rv-radius); transition: background .2s; }
.rv-svc__t b { display: block; font-size: .95rem; line-height: 1.25; } .rv-svc__t small { display: block; color: var(--rv-muted); font-size: .8rem; line-height: 1.35; }
.rv-svc__t em { display: block; font-style: normal; font-size: .76rem; color: var(--rv-accent-dk); font-weight: 600; margin-top: 2px; } .rv-svc__t em:empty { display: none; }
.rv-svc__chk { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rv-line); display: grid; place-items: center; color: transparent; background: #fff; transition: all .2s; }
.rv-svc.is-on { border-color: var(--rv-accent); background: #fff; }
.rv-svc.is-on .rv-svc__ic { background: var(--rv-accent); }
.rv-svc.is-on .rv-svc__chk { background: var(--rv-accent); border-color: var(--rv-accent); color: #fff; }
.rv-sub-box { margin-top: 14px; padding: 14px; background: var(--rv-bg); border-radius: var(--rv-radius); border-left: 4px solid var(--rv-accent); animation: rvin .3s var(--ease); }
.rv-sub-box .rv-lbl:first-child { margin-top: 0; }
@keyframes rvin { from { opacity: 0; transform: translateY(-6px); } }
.rv-warn { display: flex; gap: 10px; margin: 12px 0 0; font-size: .85rem; color: var(--rv-warn); line-height: 1.45; } .rv-warn svg { flex: none; }

.rv-colours { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.rv-sw { aspect-ratio: 1; min-width: 36px; min-height: 36px; border: 3px solid transparent; border-radius: 50%; padding: 2px; background: transparent; cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.rv-sw span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.rv-sw:hover { transform: scale(1.1); } .rv-sw.is-on { border-color: var(--rv-accent); }
@media (max-width: 420px) { .rv-colours { grid-template-columns: repeat(4, 1fr); } }
.rv-colname { margin: 10px 0 0; font-size: .9rem; }
.rv-extras { display: grid; gap: 8px; }
.rv-tog { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 2px solid var(--rv-line); background: var(--rv-bg); border-radius: var(--rv-radius); cursor: pointer; font-family: var(--rv-body); color: var(--rv-fg); min-height: 52px; }
.rv-tog b { display: block; font-size: .9rem; } .rv-tog small { color: var(--rv-muted); font-size: .78rem; }
.rv-tog__sw { width: 40px; height: 22px; border-radius: 99px; background: #bdb7b0; position: relative; flex: none; transition: background .2s; }
.rv-tog__sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.rv-tog.is-on { border-color: var(--rv-accent); background: #fff; } .rv-tog.is-on .rv-tog__sw { background: var(--rv-accent); } .rv-tog.is-on .rv-tog__sw::after { transform: translateX(18px); }

/* summary */
.rv-sum { border: 2px solid var(--rv-dark); background: var(--rv-dark); color: var(--on-ink); }
.rv-sum h2 { color: #fff; }
.rv-sum__line { color: var(#b6c6d6); font-size: .92rem; margin-bottom: .6em; }
.rv-range-out { font: 800 clamp(2rem, 6vw, 2.9rem)/1.05 var(--rv-display); color: #fff; margin: 0 0 4px; letter-spacing: .01em; }
.rv-per { color: var(#b6c6d6); font-size: .85rem; margin: 0 0 4px; }
.rv-more { display: inline-flex; gap: 6px; align-items: center; margin: 8px 0; background: none; border: 0; color: #fff; font: 600 .88rem var(--rv-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; padding: 0; }
.rv-more svg { transition: transform .25s; } .rv-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.rv-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.rv-list li { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; padding-bottom: 8px; border-bottom: 1px solid var(--rv-dark-3); }
.rv-list .rv-li__t { display: grid; } .rv-list small { color: var(#b6c6d6); }
.rv-fine { font-size: .8rem; color: var(#b6c6d6); }
.rv-note { display: flex; gap: 12px; padding: 14px; margin: 14px 0; background: rgba(29,177,251,.14); border: 1px solid var(--rv-accent); border-radius: var(--rv-radius); }
.rv-note svg { flex: none; color: var(--rv-accent-hi); } .rv-note p { margin: 0; font-size: .88rem; line-height: 1.5; }
.rv-cta { width: 100%; justify-content: center; min-height: 58px; font-size: 1.02rem; margin-bottom: 10px; animation: rvpulse 2.8s 2s ease-out 2; }
@keyframes rvpulse { 0% { box-shadow: 0 0 0 0 rgba(29,177,251,.6); } 70%, 100% { box-shadow: 0 0 0 16px rgba(29,177,251,0); } }

.rv-toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); max-width: min(92vw, 460px); background: var(--rv-dark); color: #fff; padding: 12px 16px; border-radius: var(--rv-radius); border-left: 4px solid var(--rv-accent-hi); font-size: .9rem; opacity: 0; pointer-events: none; transition: all .35s var(--ease); z-index: 250; }
.rv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.rv-how { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 28px; }
.rv-how > div { border-top: 4px solid var(--rv-accent); padding-top: 14px; }
.rv-how b { font: 800 2.4rem/1 var(--rv-display); color: var(--rv-accent); }
.rv-how h3 { font-size: 1.5rem; margin: .2em 0 .3em; } .rv-how p { color: var(--rv-muted); font-size: .95rem; }

/* mobile: the estimate chip stays visible while the panel scrolls */
@media (max-width: 979px) { .rv-stage-col { position: sticky; top: 72px; z-index: 20; background: var(--rv-bg); padding-bottom: 8px; margin: 0 calc(24px * -1); padding-inline: 24px; } .rv-stage { height: 38vh; height: 38svh; min-height: 250px; } .rv-cap { display: none; } .rv-ovl--tr { gap: 4px; } .rv-ic[data-tool=zin], .rv-ic[data-tool=zout] { display: none; } .rv-hint span { display: none; } .rv-hint::after { content: 'Drag to rotate, pinch to zoom'; } .rv-ic { width: 38px; height: 38px; } .rv-seg button { padding: 0 11px; } .rv-ovl--bl { right: 12px; bottom: 62px; } .rv-hint { font-size: .72rem; }  }
@media (prefers-reduced-motion: reduce) { .rv *, .rv-toast { animation: none !important; transition: none !important; } }
/* body overflow-x:hidden would make body a scroll container and break the sticky stage */
body { overflow-x: clip; }
.rv-lede { color: var(--rv-muted); max-width: 62ch; }
.rv-link { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.rv-howsec { background: #fff; }
@media (max-width: 979px) { .rv-panel button, .rv-panel input, .rv-panel a { scroll-margin-top: calc(38svh + 96px); } }
