/* =========================================================
   URBEX — project case studies
   ========================================================= */

/* ---------- hero with 3D massing model ---------- */
.phero { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h)); max-height: 1200px; padding-top: 40px; padding-bottom: 56px; }
.phero .giant { font-size: clamp(64px, 8.4vw, 136px); }
.hmeta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line); }
.hmeta div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.hmeta div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.hmeta b { display: block; margin-top: 8px; font-weight: 400; font-size: 15px; line-height: 1.4; }

.m3d { display: block; width: 100%; height: auto; overflow: visible; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; stroke-linejoin: round; outline: none; }
.m3d:active { cursor: grabbing; }
.m3d:focus-visible { outline: 1px dashed var(--draft-hi); outline-offset: 8px; }
.m3d .lb { font: 400 10px 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.m3d .ld { fill: none; stroke: rgba(237, 232, 224, .55); stroke-width: .8; }
.m3d-ui { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; color: var(--mute); }
.m3d-ui div { display: flex; gap: 6px; }
.m3d-b { min-width: 44px; height: 40px; padding: 0 12px; border: 0; border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--bone); font-size: 13px; cursor: pointer; transition: background-color 150ms ease, transform 160ms var(--ease-out); }
.m3d-b:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .m3d-b:hover { background: rgba(237, 232, 224, .1); } }

/* edges trace themselves, then faces fill in */
.draw polygon { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; animation: drawln 1500ms var(--ease-in-out) both, fillin 700ms var(--ease-out) both; }
.draw polygon.nd { stroke-dasharray: 3 5; stroke-dashoffset: 0; fill-opacity: 1; animation: fadeonly 800ms var(--ease-out) 200ms both !important; }
.draw .lbs { animation: fin 600ms var(--ease-out) 2000ms both; }
polygon.nd { stroke-dasharray: 3 5; }
@keyframes drawln { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { fill-opacity: 1; } }
@keyframes fadeonly { from { opacity: 0; } }

/* ---------- copy blocks ---------- */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 80px; margin-top: 56px; }
.two h3 { margin: 0 0 14px; font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.two p { margin: 0; font-size: 17px; line-height: 1.7; color: var(--mute); }
.note { display: inline-flex; gap: 10px; align-items: center; margin-top: 28px; padding: 10px 14px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); font-size: 14px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }

/* ---------- facade: render / technical elevation ---------- */
.fz { position: relative; margin-top: 48px; aspect-ratio: 1448 / 1000; border-radius: 2px; overflow: hidden; background: #fff; }
.fz__layer { position: absolute; inset: 0; opacity: 1; filter: blur(0); transform: scale(1); transition: opacity 500ms var(--ease-out), filter 500ms var(--ease-out), transform 900ms var(--ease-out); }
.fz__layer.is-off { opacity: 0; filter: blur(10px); transform: scale(1.03); pointer-events: none; }
.fz__layer > img { width: 100%; height: 100%; object-fit: cover; }
.fz__layer--plan { background: #fff; padding: 4% 8%; color: #141413; }
.fz__layer--plan svg, .fz__layer--plan img { width: 100%; height: 100%; object-fit: contain; }
.dim { position: relative; display: flex; margin-top: 22px; border-top: 1px solid rgba(20, 20, 19, .55); color: var(--mute-on-paper); }
.dim span { position: relative; flex: 1; text-align: center; padding-top: 10px; }
.dim span::before { content: ""; position: absolute; left: 0; top: -6px; width: 1px; height: 11px; background: rgba(20, 20, 19, .55); }
.dim span:last-child::after { content: ""; position: absolute; right: 0; top: -6px; width: 1px; height: 11px; background: rgba(20, 20, 19, .55); }

/* ---------- plan explorer ---------- */
.ex { display: grid; grid-template-columns: 400px 1fr; gap: 40px; margin-top: 56px; align-items: start; }
.sheet { position: relative; border-radius: 2px; background: #161615; box-shadow: inset 0 0 0 1px var(--line); padding: 20px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.vp { position: relative; overflow: hidden; border-radius: 2px; aspect-ratio: 242.1 / 631.5; }
.pz { position: absolute; inset: 0; color: #E9E4DC; transition: transform 700ms var(--ease-in-out), opacity 400ms var(--ease-out), filter 400ms var(--ease-out); }
.pz.is-off { opacity: 0; filter: blur(8px); pointer-events: none; }
.pz svg, .pz img { width: 100%; height: auto; }
.pin { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.pin .p { width: 26px; height: 26px; border-radius: 50%; background: rgba(17, 17, 16, .88); box-shadow: inset 0 0 0 1px var(--bone); color: var(--bone); font-family: 'IBM Plex Mono', monospace; font-size: 11px; display: grid; place-items: center; transition: transform 300ms var(--ease-out), background-color 200ms ease, box-shadow 200ms ease; }
.pin .lbl { position: absolute; left: 38px; top: 50%; padding: 5px 9px; border-radius: 2px; background: rgba(17, 17, 16, .9); white-space: nowrap; font-size: 12px; color: var(--bone); opacity: 0; transform: translateY(-50%) scale(.97); transform-origin: 0 50%; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); pointer-events: none; }
.pin:hover .lbl, .pin:focus-visible .lbl { opacity: 1; transform: translateY(-50%) scale(1); }
.pin:active .p { transform: scale(.9); }
.pin.is-on .p { background: var(--red); color: #fff; box-shadow: 0 0 0 8px rgba(200, 22, 30, .25); }
.pz.is-zoomed .pin .p { transform: scale(.62); }
.pz.is-zoomed .pin .lbl, .pz.is-zoomed .pin:hover .lbl { transform: translateY(-50%) scale(.62); }
.reset { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 2px; background: rgba(237, 232, 224, .08); color: var(--bone); font-size: 12px; cursor: pointer; transition: background-color 150ms ease, opacity 200ms ease, transform 160ms var(--ease-out); }
.reset:active { transform: scale(.96); }
.reset[disabled] { opacity: .35; cursor: default; }
.cota-b { position: relative; margin-top: 16px; height: 12px; border-left: 1px solid var(--draft-hi); border-right: 1px solid var(--draft-hi); }
.cota-b::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1px; background: var(--draft-hi); }
.cota-b span { position: absolute; left: 50%; top: -2px; transform: translateX(-50%); padding: 0 10px; background: #161615; color: var(--mute); font-size: 10px; }
.view { position: sticky; top: 110px; }
.vstack { position: relative; aspect-ratio: 16 / 11; border-radius: 2px; overflow: hidden; background: var(--ink-3); }
.vimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(10px); transform: scale(1.04); transition: opacity 500ms var(--ease-out), filter 500ms var(--ease-out), transform 900ms var(--ease-out); }
.vimg.is-on { opacity: 1; filter: blur(0); transform: scale(1); }
.view__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-top: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.view__head h3 { margin: 0; font-size: 34px; font-weight: 300; letter-spacing: -.02em; }
.view p { margin: 18px 0 0; color: var(--mute); font-size: 16px; line-height: 1.65; max-width: 640px; min-height: 52px; }
.rooms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.rooms .chip { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- construction section ---------- */
.cgrid { display: grid; grid-template-columns: 8fr 4fr; gap: 40px; margin-top: 56px; align-items: start; }
.cimg { position: relative; border-radius: 2px; overflow: hidden; background: #161615; box-shadow: inset 0 0 0 1px var(--line); }
.plot svg, .plot img { width: 100%; height: auto; }
.plot-scan { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.plot-scan::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--red); box-shadow: 0 0 18px 2px rgba(200, 22, 30, .55); }
.mk { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 1px var(--bone); color: var(--bone); font-family: 'IBM Plex Mono', monospace; font-size: 11px; display: grid; place-items: center; transition: transform 300ms var(--ease-out), background-color 200ms ease, box-shadow 300ms ease; pointer-events: none; }
.mk.is-on { background: var(--red); color: #fff; transform: scale(1.25); box-shadow: 0 0 0 10px rgba(200, 22, 30, .22); }
.cl { position: relative; display: flex; gap: 16px; width: 100%; text-align: left; padding: 18px 0 18px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--mute); cursor: pointer; transition: color 200ms ease; }
.cl::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; background: var(--red); transform: scaleY(0); transform-origin: 50% 0; transition: transform 300ms var(--ease-out); }
.cl.is-on::before { transform: scaleY(1); }
.cl:hover, .cl.is-on { color: var(--bone); }
.cl .n { font-family: 'IBM Plex Mono', monospace; font-size: 12px; padding-top: 3px; width: 22px; flex: none; }
.cl.is-on .n { color: var(--red-hi); }
.cl b { display: block; font-weight: 400; font-size: 16px; margin-bottom: 4px; color: var(--bone); }
.cl small { font-size: 14px; line-height: 1.55; }

/* ---------- plan set with magnifier ---------- */
.set { display: grid; grid-template-columns: 300px 1fr; gap: 32px; margin-top: 56px; align-items: start; }
.tabs { display: flex; flex-direction: column; }
.tab { display: flex; gap: 14px; align-items: center; width: 100%; padding: 12px; border: 0; border-radius: 2px; background: transparent; color: var(--ink-on-paper); text-align: left; cursor: pointer; transition: background-color 200ms ease, transform 160ms var(--ease-out); }
.tab:active { transform: scale(.98); }
.tab__th { width: 84px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(20, 20, 19, .12), 0 6px 14px rgba(20, 20, 19, .12); overflow: hidden; background: #fff; transition: transform 300ms var(--ease-out); }
.tab__th img { width: 100%; height: auto; }
.tab .cd { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .1em; color: var(--mute-on-paper); }
.tab .nm { display: block; font-size: 15px; font-weight: 500; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) { .tab:hover { background: rgba(20, 20, 19, .05); } .tab:hover .tab__th { transform: rotate(-2deg) translateY(-2px); } }
.tab[aria-pressed="true"] { background: var(--ink-on-paper); color: var(--paper); }
.tab[aria-pressed="true"] .cd { color: #B5AFA6; }
.viewer { position: relative; border-radius: 2px; background: #fff; box-shadow: 0 1px 0 rgba(20, 20, 19, .06), 0 30px 60px rgba(20, 20, 19, .18); overflow: hidden; aspect-ratio: 1132.2 / 702.9; }
@media (hover: hover) and (pointer: fine) { .viewer { cursor: none; } }
.viewer .sv { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; filter: blur(8px); transition: opacity 450ms var(--ease-out), filter 450ms var(--ease-out); }
.viewer .sv.is-on { opacity: 1; filter: blur(0); }
.loupe { position: absolute; left: 0; top: 0; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; overflow: hidden; pointer-events: none; background: #fff; box-shadow: 0 0 0 1px rgba(20, 20, 19, .35), 0 0 0 6px rgba(255, 255, 255, .65), 0 20px 50px rgba(20, 20, 19, .35); opacity: 0; transition: opacity 200ms ease; }
.loupe.is-on { opacity: 1; }
.loupe img { position: absolute; left: 0; top: 0; max-width: none; height: auto; }
.loupe::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: linear-gradient(var(--red), var(--red)) center / 100% 1px no-repeat, linear-gradient(var(--red), var(--red)) center / 1px 100% no-repeat; }
.v-hint { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 2px; background: rgba(20, 20, 19, .82); color: var(--paper); pointer-events: none; transition: opacity 200ms ease; }
.viewer:hover .v-hint { opacity: 0; }
.set__cap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 20px; align-items: baseline; }
.set__cap .code { font-size: 44px; font-weight: 300; line-height: 1; }

/* ---------- gallery + lightbox ---------- */
.gal { columns: 3; column-gap: 20px; margin-top: 56px; }
.gi { display: block; width: 100%; margin: 0 0 20px; padding: 0; border: 0; background: transparent; cursor: zoom-in; break-inside: avoid; text-align: left; color: var(--bone); transition: transform 160ms var(--ease-out); }
.gi:active { transform: scale(.985); }
.gi .ph img { height: auto; transition: transform 900ms var(--ease-out); }
.gi .zm { position: absolute; right: 12px; bottom: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: var(--bone); color: var(--ink); display: grid; place-items: center; opacity: 0; transform: scale(.9); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .gi:hover .ph img { transform: scale(1.04); } .gi:hover .zm { opacity: 1; transform: scale(1); } }
.gi .cap { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px 0; font-size: 14px; color: var(--mute); }
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 9, .96); display: flex; flex-direction: column; padding: 24px 32px; transition: opacity 250ms var(--ease-out); }
.lb[hidden] { display: none; }
@starting-style { .lb { opacity: 0; } }
.lb__stage { position: relative; flex: 1; min-height: 0; transition: transform 250ms var(--ease-out); }
@starting-style { .lb__stage { transform: scale(.96); } }
.lb__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; filter: blur(8px); transition: opacity 300ms var(--ease-out), filter 300ms var(--ease-out); }
.lb__stage img.is-on { opacity: 1; filter: blur(0); }
.lb__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lb__bar:first-child { padding-bottom: 16px; }
.lb__bar:last-child { padding-top: 16px; }
.circ { width: 52px; height: 52px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(237, 232, 224, .3); background: transparent; color: var(--bone); cursor: pointer; display: grid; place-items: center; transition: background-color 150ms ease, transform 160ms var(--ease-out); }
.circ:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .circ:hover { background: rgba(237, 232, 224, .12); } }

/* ---------- materials, data sheet ---------- */
.mats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 56px; }
.mats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.mat { border-radius: 2px; overflow: hidden; background: var(--paper-2); transition: transform 300ms var(--ease-out), box-shadow 300ms ease; }
.mat__sw { position: relative; height: 170px; overflow: hidden; }
.mat__sw::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .18) 50%, transparent 60%); transform: translateX(-100%); transition: transform 700ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .mat:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(20, 20, 19, .12); } .mat:hover .mat__sw::after { transform: translateX(100%); } }
.mat > div:last-child { padding: 18px 18px 22px; }
.mat b { display: block; font-weight: 400; font-size: 16px; margin-bottom: 6px; }
.mat span { font-size: 14px; color: var(--mute-on-paper); line-height: 1.5; }
.ficha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; margin: 48px 0 0; }
.fr { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.fr dt { color: var(--mute); }
.fr dd { margin: 0; font-size: 16px; line-height: 1.5; }

.next { position: relative; display: block; height: 560px; overflow: hidden; text-decoration: none; background: #141413; }
.next > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .next:hover > img { transform: scale(1.04); } }
.next__sc { position: absolute; inset: 0; background: rgba(10, 10, 9, .55); }
.next__c { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.next .giant { font-size: clamp(56px, 9vw, 150px); }

/* ---------- Río Negro: drawings built in the page ---------- */
.pl { display: grid; grid-template-columns: 8fr 4fr; gap: 40px; margin-top: 56px; align-items: start; }
.plan { width: 100%; height: auto; display: block; background: #F6F3EE; border-radius: 2px; box-shadow: 0 1px 0 rgba(20, 20, 19, .06), 0 24px 50px rgba(20, 20, 19, .12); }
.plan .t { font: 400 7.5px 'IBM Plex Mono', monospace; letter-spacing: .05em; text-transform: uppercase; fill: #141413; pointer-events: none; }
.plan .tm { font: 400 6.5px 'IBM Plex Mono', monospace; fill: #5E5A54; pointer-events: none; }
.plan .rr { fill: transparent; cursor: pointer; transition: fill 200ms ease; }
.plan .rr:hover { fill: rgba(200, 22, 30, .06); }
.plan .rr.is-on { fill: rgba(200, 22, 30, .13); stroke: #C8161E; stroke-width: 1.4; }
.info { position: sticky; top: 110px; padding: 28px; border-radius: 2px; background: var(--paper-2); }
.info h3 { margin: 6px 0 0; font-weight: 300; font-size: 36px; letter-spacing: -.02em; line-height: 1.05; }
.info__dm { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; border-top: 1px solid rgba(20, 20, 19, .16); }
.info__dm div { padding: 14px 0 0; }
.info__dm div + div { padding-left: 16px; border-left: 1px solid rgba(20, 20, 19, .16); }
.info__dm b { display: block; margin-top: 6px; font-weight: 300; font-size: 26px; }
.info p { margin: 20px 0 0; font-size: 16px; line-height: 1.6; color: var(--mute-on-paper); min-height: 52px; }
.info .chips .chip { min-height: 36px; padding: 0 12px; font-size: 13px; }
.tot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; border-top: 1px solid rgba(20, 20, 19, .2); }
.tot div { padding: 16px 16px 0 0; }
.tot div + div { padding-left: 16px; border-left: 1px solid rgba(20, 20, 19, .2); }
.tot b { display: block; margin-top: 8px; font-weight: 300; font-size: 30px; }
.sol { display: grid; grid-template-columns: 8fr 4fr; gap: 40px; margin-top: 56px; align-items: start; }
.cut { width: 100%; height: auto; display: block; border-radius: 2px; background: #161615; box-shadow: inset 0 0 0 1px var(--line); }
.cut .t { font: 400 9px 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; fill: var(--bone); }
.cut .tm { font: 400 8px 'IBM Plex Mono', monospace; fill: var(--mute); }
.cut .ray { transition: opacity 300ms var(--ease-out); }
.cut .ray.is-off { opacity: .12; }
.sol__i h3 { margin: 28px 0 0; font-weight: 300; font-size: 34px; letter-spacing: -.02em; line-height: 1.1; }
.sol__i p { margin: 14px 0 0; color: var(--mute); font-size: 16px; line-height: 1.65; }
.facts-list { margin-top: 28px; border-top: 1px solid var(--line); }
.facts-list div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

@supports (animation-timeline: view()) {
  .gi .ph { animation: rv linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  .cimg { view-timeline-name: --plot; }
  .plot { animation: plotwipe linear both; animation-timeline: --plot; animation-range: entry 30% contain 35%; }
  .plot-scan { animation: plotscan linear both; animation-timeline: --plot; animation-range: entry 30% contain 35%; }
  .mk { animation: fadeonly linear both; animation-timeline: --plot; }
}
@keyframes plotwipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes plotscan { 0% { opacity: 1; transform: translateX(-100%); } 90% { opacity: 1; } 100% { opacity: 0; transform: translateX(0); } }

@media (max-width: 900px) {
  .phero, .two, .ex, .cgrid, .set, .pl, .sol, .ficha { grid-template-columns: 1fr; gap: 40px; }
  .phero { min-height: 0; padding-top: 40px; }
  .sheet { max-width: 400px; }
  .view, .info { position: relative; top: 0; }
  .tabs { flex-direction: row; overflow-x: auto; gap: 8px; }
  .tab { flex: none; width: auto; }
  .loupe, .v-hint { display: none; }
  .gal { columns: 1; }
  .mats, .mats--6, .tot { grid-template-columns: 1fr 1fr; }
  .tot div:nth-child(3) { padding-left: 0; border-left: 0; }
  .fr { grid-template-columns: 1fr; gap: 4px; }
  .lb { padding: 16px; }
  .seg button { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .draw polygon { stroke-dashoffset: 0; fill-opacity: 1; }
  .pz, .vimg, .fz__layer { transform: none !important; filter: none !important; }
  .loupe { display: none; }
}
