/* ==========================================================================
   Gateways — the front door every Lindley domain lands on.
   Concept A: the building section (daylight drawing, interactive)
   Concept B: the sequence (night, scroll-told)
   ========================================================================== */

/* ---------- shared drawing styles ---------- */
.bldg{width:100%;height:auto;overflow:visible;
  --ink:#1C2024;--lead:#8A9096;--load:#E4E6E2;--hatch:#C9CDCB;--sky:transparent;--slab:#1C2024;
  --fire:#0A14C8;--fire-flow:#6F7BFF;--sys:#E11F1F;--dev-fill:#FFFFFF;--halo:#F1F2EF;--lbl:#1C2024}
.bldg .sky{fill:var(--sky)}
.bldg .hatch{stroke:var(--hatch);stroke-width:1.2}
.bldg .slab-fill{fill:var(--slab)}
.bldg path{fill:none;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.bldg .s-heavy{stroke:var(--ink);stroke-width:2.2}
.bldg .s-mid{stroke:var(--ink);stroke-width:1.4}
.bldg .s-thin{stroke:var(--lead);stroke-width:1}
.bldg .s-load{stroke:var(--lead);stroke-width:.9;fill:var(--load)}
.bldg .f-pipe-heavy{stroke:var(--fire);stroke-width:3.4}
.bldg .f-pipe{stroke:var(--fire);stroke-width:2.1}
.bldg .f-head{stroke:var(--fire);stroke-width:2.2}
.bldg .f-flow,.bldg .f-flow-head{stroke:var(--fire-flow);stroke-width:2.4;stroke-dasharray:3 24;opacity:0}
.bldg .a-dev{stroke:var(--sys);stroke-width:1.8;fill:var(--dev-fill)}
.bldg .a-box{stroke:var(--sys);stroke-width:1.2;fill:var(--dev-fill);stroke-dasharray:.006 .006}
.bldg .a-wire{stroke:var(--sys);stroke-width:1.1;opacity:.38}
.bldg .a-beam{stroke:var(--sys);stroke-width:1.4;stroke-dasharray:.008 .008;opacity:.8}
.bldg .a-signal{stroke:var(--sys);stroke-width:1.4;stroke-dasharray:.008 .01}
.bldg .a-wire-run,.bldg .a-signal-run{stroke:var(--sys);stroke-width:2.6;stroke-dasharray:2 46;opacity:0;fill:none}
.bldg .a-signal-run{stroke-dasharray:8 70}
.bldg .led{fill:var(--sys);opacity:0}
.bldg .lbl-in{font:600 17px/1 "Archivo",sans-serif;font-stretch:96%;fill:var(--lbl)}
.bldg .lbl-in.sm{font-weight:450;font-size:14px;fill:var(--lead)}
.bldg .hit path{stroke:transparent;stroke-width:28;fill:none;pointer-events:stroke;cursor:pointer;vector-effect:none}
.bldg .hit rect{fill:transparent;pointer-events:all;cursor:pointer}
.bldg .layer{transition:opacity .45s cubic-bezier(.2,.7,.1,1)}

/* labels */
.bldg .labels{opacity:0;transition:opacity .35s ease;pointer-events:none}
.bldg .lbl text{font:600 17px/1 "Archivo",sans-serif;font-stretch:94%;fill:var(--lbl);paint-order:stroke;stroke:var(--halo);stroke-width:6px;stroke-linejoin:round}
.bldg .leader{stroke-width:1;vector-effect:non-scaling-stroke}
.bldg .fire-l .leader{stroke:var(--fire)} .bldg .fire-l .lead-dot{fill:var(--fire)}
.bldg .sys-l .leader{stroke:var(--sys)} .bldg .sys-l .lead-dot{fill:var(--sys)}

/* plotting — the one orchestrated load moment */
@media (prefers-reduced-motion:no-preference){
  .plotting .bldg .layer path[pathLength]{stroke-dasharray:1 1;stroke-dashoffset:1;animation:plot var(--dur,1.5s) cubic-bezier(.45,.05,.2,1) var(--dl,0s) forwards}
  .plotting .bldg .shell{--dur:1.6s}
  .plotting .bldg .fire{--dur:1.3s;--dl:1.05s}
  .plotting .bldg .sys{--dur:1.1s;--dl:1.85s}
  .plotting .bldg .a-box,.plotting .bldg .a-beam,.plotting .bldg .a-signal{animation:fadein .8s ease 2.6s forwards!important;stroke-dashoffset:0!important;opacity:0}
  .plotting .bldg .a-beam{stroke-dasharray:.008 .008!important}
  .plotting .bldg .a-signal{stroke-dasharray:.008 .01!important}
  .plotting .bldg .a-box{stroke-dasharray:.006 .006!important}
  .plotting .bldg .s-load{fill-opacity:0;animation:plot 1.6s ease forwards,fillin .8s ease 1.2s forwards}
  .plotting .bldg .a-dev{fill-opacity:0}
  .plotting .bldg .slab-fill,.plotting .bldg .soil,.plotting .bldg .lbl-in{opacity:0;animation:fadein .9s ease .8s forwards}
}
@keyframes plot{to{stroke-dashoffset:0}}
@keyframes fadein{to{opacity:1}}
@keyframes fillin{to{fill-opacity:1}}

/* ambient life, after plotting */
@media (prefers-reduced-motion:no-preference){
  .live .bldg .f-flow{opacity:.9;animation:flow 1.7s linear infinite}
  .live .bldg .a-wire-run{opacity:.9;animation:run 2.6s linear infinite}
  .live .bldg .a-signal-run{opacity:1;animation:runsig 2.4s linear infinite}
  .live .bldg .led{animation:blink 3.2s ease-in-out infinite;animation-delay:calc(var(--i) * .55s)}
  .paused .bldg *{animation-play-state:paused!important}
}
@keyframes flow{to{stroke-dashoffset:-27}}
@keyframes run{to{stroke-dashoffset:-48}}
@keyframes runsig{to{stroke-dashoffset:-78}}
@keyframes blink{0%,70%,100%{opacity:0}78%{opacity:1}}

/* ==========================================================================
   CONCEPT A — the building section
   ========================================================================== */
.gw-a{background:var(--vellum)}
.gw-top{position:relative;z-index:5;border-bottom:1px solid var(--rule);background:var(--vellum)}
.gw-top .wrap{display:flex;align-items:center;gap:1.5rem;min-height:4.25rem;width:min(100% - 2*var(--gutter),1600px)}
.gw-top .pair{display:flex;align-items:center;gap:1.1rem}
.gw-top .pair img.fire-logo{height:2.6rem;width:auto}
.gw-top .pair img.sys-logo{height:1.8rem;width:auto}
.gw-top .pair .sep{width:1px;height:2.2rem;background:var(--rule)}
.gw-top nav{margin-left:auto;display:flex;gap:.25rem;align-items:center}
.gw-top nav a{padding:.5rem .7rem;font-family:var(--f-display);font-weight:560;font-size:.95rem;text-decoration:none;border-radius:3px}
.gw-top nav a:hover{background:var(--rule-soft)}
.gw-top .tel{font-family:var(--f-display);font-weight:660;text-decoration:none;display:flex;flex-direction:column;line-height:1.15;margin-left:.75rem;padding-left:1.25rem;border-left:1px solid var(--rule)}
.gw-top .tel small{font-family:var(--f-body);font-weight:500;font-size:.72rem;color:var(--pencil)}
@media (max-width:900px){.gw-top nav a:not(.keep){display:none}.gw-top .tel{display:none}}
@media (max-width:520px){.gw-top .pair img.fire-logo{height:2.2rem}.gw-top .pair img.sys-logo{height:1.45rem}}

.stage{position:relative;margin-inline:auto;width:min(100%,calc((100svh - 4.25rem) * 1600 / 1050));aspect-ratio:1600/1050;container-type:inline-size}
.stage .bldg{position:absolute;inset:0;width:100%;height:100%}
.stage .bldg{--halo:var(--vellum)}
.stage-intro{position:absolute;left:3.2%;right:3.2%;top:3.4%;z-index:2;display:grid;grid-template-columns:1.2fr 1fr;column-gap:4cqi;align-items:end}
.stage-intro h1{font-size:clamp(2rem,4.3cqi,4.6rem);line-height:.98;margin:0;font-stretch:114%;grid-row:1 / span 2}
.stage-intro p{font-size:clamp(.95rem,1.22cqi,1.2rem);line-height:1.45;color:var(--graphite);margin:0;max-width:34em}
.stage-intro .hint{display:inline-flex;align-items:center;gap:.5rem;margin-top:1em;font-size:clamp(.8rem,1cqi,.95rem);color:var(--pencil)}
.stage-intro .hint i{width:.55rem;height:.55rem;border-radius:50%;border:1.5px solid var(--pencil);display:inline-block;position:relative}
.stage-intro .hint i::after{content:"";position:absolute;inset:-6px;border-radius:50%;border:1px solid var(--pencil);opacity:0;animation:ping 2.4s ease-out infinite}
@keyframes ping{0%{transform:scale(.4);opacity:.8}100%{transform:scale(1.4);opacity:0}}

.stage-paths{position:absolute;left:37.5%;right:1.6%;top:81.6%;bottom:1.8%;display:grid;grid-template-columns:1fr 1fr;gap:1.2cqi;z-index:3}
.gpath{--pc:var(--graphite);position:relative;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;align-content:center;column-gap:1.4cqi;row-gap:.3cqi;padding:1.1cqi 1.5cqi;background:var(--sheet);border:1px solid var(--rule);text-decoration:none;color:var(--graphite);border-radius:3px;box-shadow:0 14px 34px -24px rgba(28,32,36,.55);transition:transform .3s cubic-bezier(.2,.7,.1,1),box-shadow .3s,border-color .3s}
.gpath.f{--pc:var(--fire)} .gpath.s{--pc:var(--sys)}
.gpath .logo{grid-row:1 / span 2;align-self:center;display:flex;align-items:center}
.gpath.f .logo img{height:clamp(2.2rem,4.2cqi,4.2rem);width:auto}
.gpath.s .logo{background:#000;padding:.9cqi 1cqi;border-radius:2px}
.gpath.s .logo img{height:clamp(1.2rem,2.1cqi,2.1rem);width:auto}
.gpath b{font-family:var(--f-display);font-weight:660;font-size:clamp(1rem,1.45cqi,1.5rem);font-stretch:104%;line-height:1.1;align-self:end}
.gpath span{font-size:clamp(.8rem,1.02cqi,1rem);color:var(--pencil);line-height:1.35;align-self:start}
.gpath span em{display:block;margin-top:.35em;font-style:normal;font-family:var(--f-display);font-weight:640;color:var(--pc)}
.gpath.s span em{color:var(--sys-ink)}
.gpath:hover,.gpath:focus-visible,.gpath.on{transform:translateY(-3px);box-shadow:0 22px 44px -24px rgba(28,32,36,.6);border-color:var(--pc)}
.gpath:focus-visible{outline:2px solid var(--pc);outline-offset:3px}

/* focus states driven by hover on the drawing or the cards */
.stage[data-focus="fire"] #sys,.stage[data-focus="systems"] #fire{opacity:.12}
.stage[data-focus="fire"] #shell,.stage[data-focus="systems"] #shell{opacity:.55}
.stage[data-focus="fire"] #labels-fire,.stage[data-focus="systems"] #labels-sys{opacity:1}
.stage[data-focus="fire"] .f-pipe-heavy{stroke-width:4.2}
.stage[data-focus="fire"] .f-pipe,.stage[data-focus="fire"] .f-head{stroke-width:2.6}
.stage[data-focus="systems"] .a-dev{stroke-width:2.3}
.stage[data-focus="systems"] .a-wire{opacity:1;stroke-width:1.5}
.stage[data-focus] .stage-intro{opacity:.35;transition:opacity .4s}
.stage .stage-intro{transition:opacity .4s}

.stage.zoom-fire .bldg,.stage.zoom-systems .bldg{transition:transform .7s cubic-bezier(.7,0,.2,1)}
.stage.zoom-fire .bldg{transform:scale(1.25);transform-origin:27% 50%}
.stage.zoom-systems .bldg{transform:scale(1.25);transform-origin:40% 55%}

.gw-help{text-align:center;padding:1.4rem var(--gutter) 1.8rem;margin:0 auto;max-width:none;font-size:.98rem;color:var(--pencil);border-top:1px solid var(--rule)}
.gw-help a{font-family:var(--f-display);font-weight:660;color:var(--graphite);text-decoration:none;border-bottom:1.5px solid currentColor}
.gw-more{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem 2rem;padding:0 var(--gutter) 2.5rem;font-size:.95rem}
.gw-more a{text-decoration:none;font-weight:550;color:var(--pencil)}
.gw-more a:hover{color:var(--graphite);text-decoration:underline}

/* small screens: stack */
@media (max-width:820px){
  .stage{width:100%;aspect-ratio:auto;container-type:normal;display:flex;flex-direction:column}
  .stage .bldg{position:relative;inset:auto;height:auto;order:2;margin:.5rem 0 1rem}
  .stage-intro{position:relative;left:auto;right:auto;top:auto;width:auto;padding:2rem var(--gutter) .5rem;order:1;display:block}
  .stage-intro p{margin-top:1rem}
  .stage-intro h1{font-size:clamp(2.1rem,9vw,3rem)}
  .stage-intro p{font-size:1.02rem}
  .stage-intro .hint{display:none}
  .stage-paths{position:relative;inset:auto;order:3;grid-template-columns:1fr;gap:.75rem;padding:0 var(--gutter) 1.5rem}
  .gpath{grid-template-columns:auto 1fr;column-gap:1rem;padding:1rem 1.1rem}
  .gpath.f .logo img{height:2.9rem}
  .gpath.s .logo{padding:.6rem .7rem}.gpath.s .logo img{height:1.4rem}
  .gpath b{font-size:1.1rem} .gpath span{font-size:.9rem}
  .bldg .labels{display:none}
}


