/* Blackland Roofing: scroll-driven 3D story.
   Brand carried over from the original page: Barlow Condensed + Source Sans 3,
   steel blue, galvalume grey, and safety orange reserved for the one action. */
:root {
  --ink: #15232d;
  --ink-deep: #0e181f;
  --galvalume: #eef1f3;
  --muted: #b4c0c8;
  --line: rgba(238, 241, 243, .28);
  --steel: #63b0e0;
  --cta: #e4570f;
  --cta-ink: #fff;
  --ok: #5fcf96;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ink-deep); }
html.locked, html.locked body { overflow: hidden; height: 100%; }
body {
  margin: 0; background: var(--ink-deep); color: var(--galvalume);
  font: 400 18px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; text-wrap: balance; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--steel); outline-offset: 3px; }

/* Stage */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(10, 18, 24, .55) 100%),
    linear-gradient(to top, rgba(10, 18, 24, .72), transparent 34%);
}
.flash { position: fixed; inset: 0; pointer-events: none; background: var(--ink-deep); opacity: 0; transition: opacity .28s ease; }
.flash.on { opacity: 1; }

/* Loader: one number, counting real build steps */
#loader {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center;
  background: var(--ink); transition: opacity .9s ease, visibility .9s;
}
#loader.gone { opacity: 0; visibility: hidden; }
.count { font: 600 clamp(4.5rem, 16vw, 11rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.count-note { color: var(--muted); font-size: 1rem; }

/* Top bar */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  background: linear-gradient(to bottom, rgba(10, 18, 24, .55), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.5rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand svg { width: 30px; height: 30px; flex: none; }
.bar-actions { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.phone { font: 700 1.3rem/1 var(--display); letter-spacing: .04em; text-decoration: none; }
.txt {
  background: none; border: 0; padding: 8px 2px; cursor: pointer; font-weight: 600; font-size: 1rem;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: text-decoration-color .2s;
}
.txt:hover { text-decoration-color: currentColor; }
.btn {
  display: inline-block; border: 2px solid var(--cta); background: var(--cta); color: var(--cta-ink); cursor: pointer; text-decoration: none;
  font: 700 1.3rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 16px 30px;
}
.btn.small { font-size: 1.08rem; padding: 10px 16px; }
.btn.ghost { background: transparent; border-color: var(--galvalume); color: var(--galvalume); }
@media (hover: hover) {
  .btn:hover { filter: brightness(1.1); }
  .btn.ghost:hover { background: var(--galvalume); color: var(--ink); filter: none; }
}

/* Chapter bullets */
.bullets { position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 25; display: grid; gap: 4px; }
.bullets button {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; background: none; border: 0; padding: 7px 0; cursor: pointer;
}
.bullets span { font-weight: 600; font-size: .95rem; opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.bullets i { width: 12px; height: 12px; border: 2px solid var(--galvalume); border-radius: 50%; transition: background .25s, transform .25s; }
.bullets button:hover span, .bullets button:focus-visible span { opacity: 1; transform: none; }
.bullets button[aria-current="true"] i { background: var(--galvalume); transform: scale(1.25); }
.progress { display: none; position: fixed; inset: 0 0 auto; height: 3px; z-index: 31; }
.progress i { display: block; height: 100%; background: var(--galvalume); transform-origin: left; transform: scaleX(0); }

/* Plan-view map: shows where the camera is standing */
.map { position: fixed; left: var(--gutter); bottom: 26px; width: 118px; height: 118px; margin: 0; z-index: 20; opacity: .9; transition: opacity .4s; }
.map svg { width: 100%; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: rgba(14, 24, 31, .5); }
.m-house { fill: var(--galvalume); }
.m-porch { fill: none; stroke: var(--galvalume); stroke-width: 1.4; }
.m-ridge { stroke: var(--ink); stroke-width: 1.2; }
.m-drive { fill: none; stroke: var(--muted); stroke-width: 2.4; opacity: .55; }
.m-dot { fill: var(--cta); }
.m-cone { fill: var(--cta); opacity: .35; }

/* Story */
.ch { position: relative; }
.pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; pointer-events: none; overflow: hidden;
  padding: 90px var(--gutter) 40px; text-align: center;
}
.reveal { position: absolute; opacity: 0; visibility: hidden; will-change: opacity, transform; }
.reveal button, .reveal a, .reveal input, .reveal label { pointer-events: auto; }
.title { inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 70px var(--gutter); }
.title h2 {
  font-size: min(19vh, clamp(4rem, 12.5vw, 13rem)); line-height: .9; max-width: 11em;
  text-shadow: 0 4px 44px rgba(10, 18, 24, .55);
}
.step { font-weight: 600; font-size: 1.15rem; text-shadow: 0 1px 12px rgba(0, 0, 0, .75); }
.hero .reveal { inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 70px var(--gutter) 25vh; }
h1 { font-size: min(21vh, clamp(4.6rem, 14.5vw, 15rem)); line-height: .86; max-width: 9em; text-shadow: 0 6px 60px rgba(10, 18, 24, .5); }
.lead { text-wrap: balance; font-size: clamp(1.1rem, 1.7vw, 1.4rem); max-width: 36em; text-shadow: 0 1px 14px rgba(0, 0, 0, .8); }
.start { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; justify-content: center; }

.copy {
  left: 50%; bottom: clamp(44px, 9vh, 90px); width: min(40em, calc(100vw - 2 * var(--gutter))); transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center;
}
.copy h3 { font-size: clamp(1.9rem, 3.6vw, 3.2rem); line-height: 1; text-shadow: 0 2px 22px rgba(10, 18, 24, .75); }
.copy p { text-wrap: balance; max-width: 34em; text-shadow: 0 1px 12px rgba(0, 0, 0, .85); }

.swatches { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.swatches button {
  pointer-events: auto; width: 96px; padding: 0 0 6px; background: rgba(14, 24, 31, .6); border: 2px solid transparent; cursor: pointer; font-size: .9rem; font-weight: 600;
}
.swatches i { display: block; height: 42px; margin-bottom: 5px; background: var(--c); }
.swatches button[aria-checked="true"] { border-color: var(--galvalume); }

.finale { gap: 14px; }
.finale h3 { font-size: clamp(1.6rem, 2.5vw, 2.4rem); }
.compare { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.compare input { width: min(320px, 48vw); accent-color: var(--galvalume); cursor: ew-resize; }
.finale-cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; }
.tel { font: 700 1.3rem/1 var(--display); letter-spacing: .04em; text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.fine { font-size: .88rem; color: var(--galvalume); }

/* Scroll hint */
.scroll-hint { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; display: grid; justify-items: center; gap: 4px; font-weight: 600; font-size: .95rem; opacity: 0; transition: opacity .4s; pointer-events: none; }
.scroll-hint.on { opacity: 1; }
.scroll-hint i { display: block; width: 2px; height: 30px; background: linear-gradient(var(--galvalume), transparent); }

/* 3D pins */
#pins { position: fixed; inset: 0; z-index: 15; pointer-events: none; overflow: hidden; }
.spot {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 0; background: none; border: 0; cursor: pointer; pointer-events: auto; white-space: nowrap;
  opacity: 0; visibility: hidden; will-change: transform, opacity; margin: -24px 0 0 -24px;
}
.spot .ring { position: relative; width: 48px; height: 48px; flex: none; border: 2px solid var(--galvalume); border-radius: 50%; background: rgba(21, 35, 45, .45); transition: transform .25s, background .25s; }
.spot .ring::after { content: ""; position: absolute; inset: 15px; background: var(--galvalume); border-radius: 50%; }
.spot .tag { font: 700 1.25rem/1 var(--display); letter-spacing: .03em; text-transform: uppercase; background: rgba(21, 35, 45, .78); padding: 7px 10px; }
.spot:hover .ring, .spot:focus-visible .ring { transform: scale(1.15); background: rgba(21, 35, 45, .85); }
.spot.flip { flex-direction: row-reverse; }
.note {
  position: absolute; left: 0; top: 0; width: 230px; margin: -8px 0 0 -115px; padding: 10px 12px; text-align: left; background: rgba(21, 35, 45, .84); border-top: 3px solid var(--galvalume);
  opacity: 0; visibility: hidden; font-size: .96rem; line-height: 1.35; will-change: transform, opacity;
}
.note b { display: block; font: 700 1.35rem/1.05 var(--display); text-transform: uppercase; margin-bottom: 3px; }

/* The object view owns the screen while it is open */
html.in-detail #story, html.in-detail .bar, html.in-detail .bullets, html.in-detail .map, html.in-detail .veil, html.in-detail .callbar, html.in-detail .scroll-hint { opacity: 0; pointer-events: none; }

/* Custom cursor: follows fine pointers only */
.cursor { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid var(--galvalume); border-radius: 50%; pointer-events: none; z-index: 90; opacity: 0; transition: width .2s, height .2s, margin .2s, opacity .3s; }
.cursor.active { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* Dialogs */
dialog { color: var(--galvalume); border: 0; padding: 0; }
dialog::backdrop { background: rgba(14, 24, 31, .55); }
.overlay { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: var(--ink); padding: max(18px, env(safe-area-inset-top)) var(--gutter) 22px; overflow-y: auto; }
.overlay[open] { display: flex; flex-direction: column; gap: 20px; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs { display: flex; gap: clamp(12px, 3vw, 34px); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 8px 0; cursor: pointer; white-space: nowrap; font: 700 clamp(1.25rem, 2.2vw, 1.75rem)/1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--galvalume); box-shadow: inset 0 -3px 0 var(--galvalume); }
.panel { flex: 1; }
.panel.narrow { max-width: 44em; margin-inline: auto; width: 100%; padding-top: 3vh; display: grid; gap: 16px; align-content: start; }
.panel h2 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .95; }
.chapter-list { list-style: none; counter-reset: c; padding: 0; margin: 0; }
.chapter-list li { counter-increment: c; border-bottom: 1px solid var(--line); }
.chapter-list button {
  display: grid; grid-template-columns: 1.3em 1fr; gap: .4em; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; padding: .16em 0;
  font: 700 min(9vh, clamp(2.4rem, 7vw, 5.4rem))/1 var(--display); text-transform: uppercase;
}
.chapter-list button::before { content: counter(c); color: var(--muted); }
.chapter-list button:hover { color: var(--steel); }
.material-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 28px; }
.material-list button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 16px 0; cursor: pointer; }
.material-list b { display: block; font: 700 1.9rem/1 var(--display); text-transform: uppercase; }
.material-list span { color: var(--muted); }
.material-list button:hover b { color: var(--steel); }
.towns { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.towns li { border: 1px solid var(--line); padding: 6px 14px; font-weight: 600; }
.sample { color: var(--muted); }
blockquote { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); font-size: 1.2rem; }
cite { display: block; font-style: normal; font-size: .92rem; color: var(--muted); margin-top: 4px; }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::after { content: "+"; font: 700 1.6rem/1 var(--display); }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: 16px; color: var(--muted); }
.overlay-foot { font-size: .9rem; color: var(--muted); }

.detail { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; background: transparent; }
.detail::backdrop { background: transparent; }
.detail-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: var(--gutter); }
.detail-text { position: absolute; left: var(--gutter); bottom: clamp(30px, 9vh, 90px); max-width: 30em; display: grid; gap: 10px; }
.detail-text h2 { font-size: clamp(3rem, 8vw, 7.4rem); line-height: .9; }
.detail-hint { position: absolute; right: var(--gutter); bottom: 26px; color: var(--muted); }

.drawer { position: fixed; inset: 0 0 0 auto; height: 100%; max-height: none; width: min(480px, 100%); margin: 0; background: var(--ink); overflow-y: auto; }
.drawer form { padding: 22px 26px 34px; display: grid; gap: 14px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer h2 { font-size: 2.6rem; line-height: 1; }
.sub { color: var(--muted); margin-top: -8px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select { font: inherit; color: var(--galvalume); background: var(--ink-deep); border: 1px solid var(--line); padding: 12px; width: 100%; min-width: 0; }
.drawer .btn { width: 100%; text-align: center; }
.done { border-left: 5px solid var(--ok); background: var(--ink-deep); padding: 12px 14px; font-size: .95rem; }
.trust { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-weight: 600; font-size: .96rem; }
.trust li::before { content: "\2713"; color: var(--ok); font-weight: 700; margin-right: 8px; }

.callbar { display: none; position: fixed; inset: auto 0 0; z-index: 35; gap: 10px; background: var(--ink); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.callbar a, .callbar button { flex: 1; text-align: center; padding: 12px 6px; text-decoration: none; cursor: pointer; font: 700 1.15rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.callbar .call { background: var(--cta); color: var(--cta-ink); border: 2px solid var(--cta); }
.callbar .est { background: none; border: 2px solid var(--galvalume); }

@media (max-width: 900px) {
  .map, .bullets { display: none; }
  .progress { display: block; }
  .phone, .bar .btn.small { display: none; }
  .callbar { display: flex; }
  .pin { padding-bottom: 76px; }
  .copy { bottom: 88px; }
  .scroll-hint { bottom: 76px; }
  body { font-size: 17px; }
  .brand { font-size: 1.25rem; }
  .note { width: 170px; margin-left: -85px; font-size: .86rem; }
  .spot .tag { font-size: 1.05rem; }
  .swatches button { width: 62px; font-size: .78rem; }
  .swatches i { height: 30px; }
  .detail-hint { display: none; }
}

/* No WebGL: the story reads as a normal page */
html.nogl #gl, html.nogl #map, html.nogl #loader, html.nogl .scroll-hint, html.nogl .cursor, html.nogl .start, html.nogl .bullets { display: none; }
html.nogl body { background: linear-gradient(170deg, #2b4a44, var(--ink) 40%, #5a4332); background-attachment: fixed; }
html.nogl .pin { position: static; height: auto; display: grid; gap: 24px; padding-block: 12vh; overflow: visible; }
html.nogl .reveal { position: static; opacity: 1; visibility: visible; transform: none; width: auto; }
html.nogl .title h2 { font-size: clamp(3rem, 10vw, 7rem); }
html.nogl .compare { display: none; }
