html { -webkit-text-size-adjust: 100% }
body { margin: 0 }
img { max-width: 100% }
[hidden] { display: none !important }
.admin-bar .bar { top: 32px }
@media (max-width: 782px) { .admin-bar .bar { top: 46px } }
@media (max-width: 600px) { .admin-bar .bar { top: 0 } }

html { -webkit-text-size-adjust: 100%; color-scheme: light }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px) }
body { margin: 0 }
[hidden] { display: none !important }

/* Layout: site photographs lead. Thin lowercase wordmark as on the site netting, hairline rules, slash-separated labels, one 12-column grid. */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --mute: #6b6b6b;
  --rule: #000000;
  --faint: #e6e6e6;
  --veil: rgba(0, 0, 0, .92);
  --on-veil: #ffffff;
  --display: "Jost", "IBM Plex Sans Arabic", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "IBM Plex Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #000000; --ink: #ffffff; --mute: #9a9a9a; --rule: #ffffff; --faint: #242424; color-scheme: dark }
}
:root[data-theme="dark"] { --paper: #000000; --ink: #ffffff; --mute: #9a9a9a; --rule: #ffffff; --faint: #242424; color-scheme: dark }

* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper) }
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)) }
.label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase }
.mute { color: var(--mute) }

/* Header */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--paper); border-bottom: 1px solid var(--rule) }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; padding-block: 14px }
.mark { font-family: var(--display); font-weight: 300; font-size: 1.2rem; letter-spacing: .08em; line-height: 1; text-transform: uppercase }
main > #gbc { margin-top: 0 }
.nav { display: flex; gap: 24px; flex-wrap: wrap; align-items: center }
.nav a { position: relative; padding-block: 4px }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .25s ease }
.nav a:hover::after { transform: scaleX(1) }
.clock { font-variant-numeric: tabular-nums }
.progress { height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left }

/* Hero */
.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 24px 48px; padding-block: clamp(32px, 5vw, 72px) 0; align-items: stretch }
.hero-text { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-width: 0 }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 200; font-size: clamp(4rem, 13.5vw, 12.5rem); line-height: .86; letter-spacing: -.02em; text-transform: lowercase }
.hero h1 .line { display: block; overflow: hidden; padding-block: .12em .08em; margin-block: -.12em -.08em }
.hero h1 .ch { display: inline-block; animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms); transition: font-weight .35s ease }
@keyframes rise { from { transform: translateY(115%) rotate(6deg) } to { transform: none } }

/* Hero motion: drifting site-netting mesh, photo unveil and parallax, a plane crossing, staggered text */
.hero { position: relative; overflow: clip }
.hero > * { position: relative; z-index: 1 }
#net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent) }
.hero .shot .frame { animation: unveil 1.5s cubic-bezier(.7, 0, .2, 1) .35s both }
@keyframes unveil { from { clip-path: inset(0 0 100% 0) } to { clip-path: inset(0) } }
.hero .shot .frame img, .hero .shot:hover .frame img { transform: translateY(var(--py, 0px)) scale(1.14); transition: none; animation: settle 2.2s cubic-bezier(.2, .7, .2, 1) .35s both }
@keyframes settle { from { scale: 1.25 } to { scale: 1 } }
.hero-low > *, .hero .cap { animation: up .9s ease both }
.hero-low > p { animation-delay: .9s }
.hero-low > dl { animation-delay: 1.1s }
.hero .cap { animation-delay: 1.6s }
@keyframes up { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }
/* Frame model: a rotatable wireframe of a concrete house frame */
.model { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 380px; min-width: 0; animation: up .9s ease 1.3s both }
.stage { position: relative; flex: 1; min-height: 290px; border: 1px solid var(--faint) }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y }
.stage canvas:active { cursor: grabbing }
.stage canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px }
.stage .hint { position: absolute; left: 10px; top: 8px; pointer-events: none }
.ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.ctrl button { border: 1px solid var(--rule); padding: 6px 10px; min-width: 32px }
.ctrl button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
.stepper { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px }
#fNum { min-width: 9ch; text-align: center }
#mRead { flex-basis: 100%; font-variant-numeric: tabular-nums }
.stage { min-height: 340px }
.stage .detail-cap { position: absolute; right: 10px; top: 8px; pointer-events: none; text-align: right }
.zoom { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px }
.zoom button { width: 32px; height: 32px; border: 1px solid var(--rule); background: var(--paper); text-align: center }
.zoom button:hover, .segm button:hover { background: var(--ink); color: var(--paper) }
.plot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.plot label { display: grid; gap: 4px; min-width: 0 }
.plot label > span:first-child { color: var(--mute) }
.plot .unit { display: flex; align-items: center; border: 1px solid var(--rule); min-width: 0 }
.plot input { width: 100%; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 8px; font-variant-numeric: tabular-nums; -moz-appearance: textfield }
.plot input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px }
.plot i { font-style: normal; padding-inline: 2px 8px; color: var(--mute) }
.segm { display: inline-flex; flex-wrap: wrap }
.segm button + button { border-inline-start: 0 }
.ctrl .rd { flex-basis: 100%; font-variant-numeric: tabular-nums }
@media (min-width: 861px) { .hero > .shot { display: flex; flex-direction: column } .hero > .shot .frame { flex: 1; aspect-ratio: auto; min-height: 0 } }
.hero .plane { position: absolute; z-index: 2; width: 22px; height: 22px; left: -5%; top: 40%; rotate: 72deg; color: var(--ink); pointer-events: none; animation: fly 22s linear 2s infinite }
@keyframes fly { from { left: -5%; top: 40% } 60%, to { left: 105%; top: 2% } }
.hero p { margin: 0; font-size: clamp(1.15rem, 2vw, 1.6rem); line-height: 1.3; max-width: 24ch; text-wrap: balance }
.hero dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px }
.hero dt { color: var(--mute) }
.hero dd { margin: 0 }
.hero-low { display: flex; flex-direction: column; gap: 28px }

/* Photos */
.shot { display: block; width: 100%; text-align: left; min-width: 0 }
.frame { display: block; border: 1px solid var(--rule); overflow: hidden; aspect-ratio: 9 / 16; max-width: 100%; background: var(--faint) }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease }
.shot:hover .frame img { transform: scale(1.03) }
.cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px }

/* Ticker */
.ticker { border-block: 1px solid var(--rule); overflow: hidden; margin-top: clamp(40px, 6vw, 80px) }
.ticker div { display: flex; gap: 28px; width: max-content; padding-block: 12px; animation: slide 50s linear infinite }
.ticker span { white-space: nowrap }
@keyframes slide { to { transform: translateX(-50%) } }

/* Sections */
section { padding-block: clamp(56px, 8vw, 120px) 0 }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; margin-bottom: clamp(28px, 4vw, 56px) }
.head h2 { margin: 0; font: inherit }

/* Gallery: four site photographs, alternating drop */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px }
.gallery .shot:nth-child(even) { margin-top: clamp(24px, 5vw, 72px) }

/* About the engineer */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: 32px 48px; align-items: start }
.about-text { display: flex; flex-direction: column; gap: 28px; min-width: 0 }
.about h3 { margin: 0; font-family: var(--display); font-weight: 200; font-size: clamp(2.8rem, 6.4vw, 5.4rem); line-height: .92; letter-spacing: -.01em; text-transform: lowercase }
.about h3 { text-transform: uppercase; font-size: clamp(2.2rem, 4.8vw, 4.2rem); line-height: 1; letter-spacing: .01em; position: relative; padding-bottom: 20px }
.about h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--ink); transform-origin: left }
#about.pre h3:not(.in)::after { transform: scaleX(0) }
#about h3.in::after { animation: grow 1.2s cubic-bezier(.7, 0, .2, 1) .5s both }
@keyframes grow { from { transform: scaleX(0) } to { transform: none } }
.about h3 .line { display: block; white-space: nowrap; overflow: hidden; padding-block: .12em .1em; margin-block: -.12em -.1em }

/* Structural grid bubbles above each portrait */
.axis { display: flex; flex-direction: column; align-items: center; margin-bottom: 8px }
.axis b { width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 50%; display: grid; place-items: center; font-weight: 500 }
.axis::after { content: ""; width: 1px; height: 30px; background: repeating-linear-gradient(var(--ink) 0 8px, transparent 8px 11px, var(--ink) 11px 13px, transparent 13px 16px) }
#about.pre .portraits:not(.in) .axis { opacity: 0 }
#about .portraits.in .axis { animation: up .6s ease both; animation-delay: calc(var(--n) * 200ms) }

/* Rotating stamp */
.portraits { position: relative }
.badge { position: absolute; left: -124px; bottom: -76px; width: 150px; height: 150px; z-index: 3; pointer-events: none; color: var(--ink); rotate: var(--rot, 0deg); transition: opacity .6s ease 1.5s, scale .9s cubic-bezier(.2, 1.4, .3, 1) 1.5s }
.badge svg { display: block; width: 100%; height: 100% }
.badge text { fill: var(--paper); font-family: var(--mono); font-size: 13px; font-weight: 500 }
#about.pre .portraits:not(.in) .badge { opacity: 0; scale: .4 }

/* Year ruler, marker follows the scroll */
.ruler { margin-top: clamp(124px, 11vw, 140px); --p: 1 }
.ruler .cap { margin: 0 0 16px; font-variant-numeric: tabular-nums }
.ruler .track { position: relative; height: 1px; background: var(--faint) }
.ruler .track::before { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--p)) }
.ruler .mk { position: absolute; top: -5px; left: calc(var(--p) * 100%); width: 11px; height: 11px; margin-left: -5px; background: var(--ink); rotate: 45deg }
.ruler .yrs { display: flex; justify-content: space-between }
.ruler .yrs span { position: relative; padding-top: 16px }
.ruler .yrs span::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 9px; background: var(--ink) }
.ruler .yrs span:first-child::before { left: 0 }
.ruler .yrs span:last-child::before { left: auto; right: 0 }

/* Outlined name band, moves with the scroll */
.bigname { overflow: hidden; margin-top: clamp(32px, 5vw, 64px) }
#bigname { display: flex; gap: .35em; width: max-content; font-family: var(--display); font-weight: 200; font-size: clamp(4rem, 13vw, 11rem); line-height: 1.05; text-transform: uppercase; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px var(--ink); will-change: transform }
#bigname span:nth-child(4n + 1) { color: var(--ink); -webkit-text-stroke: 0 }

/* Pointer ring over the portraits */
#ring { position: fixed; left: 0; top: 0; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: #ffffff; color: #000000; mix-blend-mode: difference; display: grid; place-items: center; pointer-events: none; z-index: 8; scale: 0; transition: scale .3s ease }
#ring.on { scale: 1 }
.about h3 .ch { display: inline-block; white-space: pre; transition: font-weight .35s ease }
/* About motion: runs once the section scrolls into view (#about.pre is set by script, .in on entry) */
#about.pre h3:not(.in) .ch { transform: translateY(125%) rotate(6deg) }
#about h3.in .ch { animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms) }
#about.pre .w { color: var(--mute); transition: color .45s ease }
#about.pre .w.lit { color: var(--ink) }
#about.pre .facts:not(.in) > *, #about.pre .portraits:not(.in) .cap { opacity: 0 }
#about .facts.in > * { animation: up .7s ease both; animation-delay: calc(.5s + var(--r, 0) * 110ms) }
#about.pre .portraits:not(.in) .frame { clip-path: inset(0 0 100% 0) }
#about .portraits.in .frame { animation: unveil 1.3s cubic-bezier(.7, 0, .2, 1) both; animation-delay: calc(.2s + var(--n) * 200ms) }
#about .portraits.in .cap { animation: up .8s ease both; animation-delay: calc(1.1s + var(--n) * 200ms) }
.portraits { perspective: 900px }
.portraits .shot { transform: translateY(var(--sy, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; will-change: transform }
.portraits .shot .frame img, .portraits .shot:hover .frame img { transform: translateY(var(--iy, 0px)) scale(1.14); transition: opacity .5s ease }
.scan { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--on-veil); mix-blend-mode: difference; opacity: 0; pointer-events: none }
#about .portraits.in .scan { animation: scan 2.4s cubic-bezier(.6, 0, .3, 1) both; animation-delay: calc(.9s + var(--n) * 200ms) }
@keyframes scan { 0% { top: 0; opacity: 0 } 10%, 85% { opacity: 1 } 100% { top: 100%; opacity: 0 } }
.about p { margin: 0; max-width: 44ch; font-size: 1.08rem }
.about p + p { margin-top: -12px }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px }
.facts dt { color: var(--mute) }
.facts dd { margin: 0 }
.portraits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-width: 0 }
.portraits .shot:nth-child(2) { margin-top: clamp(16px, 4vw, 56px) }
.flip .frame { position: relative }
.flip .frame .neg { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease }
.flip:hover .frame .neg, .flip:focus-visible .frame .neg { opacity: 1 }

/* Project: a black drawing-set band with a sheet viewer and magnifier. Always dark, like the drawings. */
.project { --paper: #000000; --ink: #ffffff; --mute: #9a9a9a; --rule: #ffffff; --faint: #2a2a2a; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); margin-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(56px, 8vw, 120px) }
.banner { position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; border: 1px solid var(--faint) }
.banner img { display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--by, 0px)) scale(1.05) }
.project.pre .banner:not(.in) { clip-path: inset(0 0 100% 0) }
.project .banner.in { animation: unveil 1.5s cubic-bezier(.7, 0, .2, 1) both }
.pinfo { display: grid; grid-template-columns: 7fr 5fr; gap: 24px 48px; margin-block: clamp(28px, 4vw, 56px); align-items: end }
.pinfo p { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.4rem, 2.8vw, 2.3rem); line-height: 1.15; text-wrap: balance; min-width: 0 }
.ptabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px }
.ptabs button, .pnav button { border: 1px solid var(--rule); padding: 8px 14px; min-width: 40px }
.project button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
.project button:focus-visible, .pstage:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px }
.pstage { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border: 1px solid var(--faint); overflow: hidden; background: var(--paper); cursor: crosshair; touch-action: pan-y }
.pstage img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none }
.pstage { user-select: none; -webkit-user-select: none }
.pstage img.wipe { animation: pwipe .9s cubic-bezier(.7, 0, .2, 1) both }
@keyframes pwipe { from { clip-path: inset(0 100% 0 0) } to { clip-path: inset(0) } }
.pscan { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--ink); opacity: 0; pointer-events: none }
.pscan.go { animation: pscan .9s cubic-bezier(.7, 0, .2, 1) }
@keyframes pscan { 0% { left: 0; opacity: 1 } 90% { opacity: 1 } 100% { left: 100%; opacity: 0 } }
.loupe { position: absolute; left: 0; top: 0; width: 200px; height: 200px; border-radius: 50%; border: 1px solid var(--ink); box-shadow: 0 0 0 1px var(--paper), 0 10px 40px rgba(0, 0, 0, .7); background-color: var(--paper); background-repeat: no-repeat; pointer-events: none; opacity: 0; scale: .6; transition: opacity .2s ease, scale .25s ease }
.loupe.on { opacity: 1; scale: 1 }
.pnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px }
.pnav > span { display: flex; gap: 6px; align-items: center; flex-wrap: wrap }
#pCount { font-variant-numeric: tabular-nums }

/* HVAC section */
.hvstage { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border: 1px solid var(--faint); color: var(--ink) }
.hvstage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y }
.hvstage canvas:active { cursor: grabbing }
.hvstage canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px }
.hvstage .hint { position: absolute; left: 10px; top: 8px; pointer-events: none }
.hvsec .zoom button { background: var(--paper); color: var(--ink) }
.hvunits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--faint) }
.hvunits li { display: grid; grid-template-columns: 1fr 1.2fr 1.4fr 1fr 1.3fr .8fr; gap: 6px 14px; padding-block: 9px; border-bottom: 1px solid var(--faint); font-variant-numeric: tabular-nums }
@media (max-width: 860px) { .hvunits li { grid-template-columns: 1fr 1fr 1fr } }

.bim { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: stretch }
.bim .hvstage { aspect-ratio: auto; min-height: 560px }
.bimside { border: 1px solid var(--faint); padding: 14px; min-width: 0 }
.bimside h3 { margin: 0 0 10px; font: inherit }
.bimtitle { font-family: var(--display); font-weight: 300; font-size: 1.9rem; line-height: 1; margin: 0 0 14px; letter-spacing: 0; text-transform: lowercase }
.bimside .facts { gap: 7px 14px } .bimside .facts dd { overflow-wrap: anywhere }
.bimdl { display: block; text-align: center; border: 1px solid var(--rule); padding: 11px; margin-top: 18px }
.bimdl:hover { background: var(--ink); color: var(--paper) }
.bimqty { list-style: none; margin: 0; padding: 0 }
.bimqty li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; padding-block: 7px; border-top: 1px solid var(--faint); font-variant-numeric: tabular-nums }
.bimqty li span:last-child { text-align: end }
/* explicit heights: Safari on iPhone can collapse an aspect-ratio box inside a grid when its only child is absolutely positioned */
@media (max-width: 860px) { .bim { display: block } .bim .hvstage { aspect-ratio: auto; height: 120vw; min-height: 380px; max-height: 600px } .bimside { margin-top: 16px } }

/* Facade carousel: 4:5 slides in a sideways strip */
.facade-intro { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; margin-bottom: clamp(28px, 4vw, 56px); align-items: end }
.facade-intro h3 { grid-column: 1 / span 6; margin: 0; font-family: var(--display); font-weight: 200; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .95; text-transform: lowercase; min-width: 0 }
.facade-intro h3 span { display: block; font-size: .6em; margin-top: .25em }
.facade-intro p { grid-column: 8 / span 5; margin: 0; max-width: 44ch; min-width: 0 }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 380px); gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-color: var(--ink) var(--faint) }
.strip .shot { scroll-snap-align: start }
.strip .frame { aspect-ratio: 4 / 5 }

/* Lightbox */
dialog { border: 0; padding: 0; background: var(--veil); color: var(--on-veil); width: 100vw; height: 100vh; max-width: none; max-height: none }
dialog::backdrop { background: var(--veil) }
.lb { height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) }
.lb-row { display: flex; justify-content: space-between; align-items: center; gap: 16px }
.lb-img { min-height: 0; display: flex; justify-content: center; align-items: center }
.lb-img img { max-width: 100%; max-height: 100%; object-fit: contain }
.lb button { border: 1px solid var(--on-veil); padding: 8px 14px; color: var(--on-veil) }
.lb button:hover { background: var(--on-veil); color: #000000 }
.lb button:focus-visible { outline-color: var(--on-veil) }

/* Process */
.process { display: grid; grid-template-columns: 5fr 7fr; gap: 24px 48px }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s }
.steps button { width: 100%; text-align: left; display: flex; gap: 20px; align-items: baseline; padding-block: 12px; border-bottom: 1px solid var(--faint); font-family: var(--display); font-weight: 300; font-size: clamp(1.4rem, 2.6vw, 2.1rem); text-transform: lowercase; color: var(--mute) }
.steps li:first-child button { border-top: 1px solid var(--faint) }
.steps button::before { counter-increment: s; content: "0" counter(s); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em }
.steps button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--rule) }
.panel { border: 1px solid var(--rule); padding: clamp(20px, 3vw, 40px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 260px; min-width: 0 }
.panel p { margin: 0; font-size: clamp(1.1rem, 1.8vw, 1.45rem); line-height: 1.35; max-width: 34ch; text-wrap: balance }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px }
.meter i { height: 6px; border: 1px solid var(--rule) }
.meter i.on { background: var(--ink) }

/* Group */
.studio { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px }
.studio .big { grid-column: 1 / span 7; margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.7rem, 3.6vw, 3rem); line-height: 1.12; letter-spacing: -.01em; text-wrap: balance }
.acc { grid-column: 9 / span 4; min-width: 0 }
.acc details { border-bottom: 1px solid var(--faint) }
.acc details:first-child { border-top: 1px solid var(--faint) }
.acc summary { list-style: none; cursor: pointer; padding-block: 14px; display: flex; justify-content: space-between; gap: 12px }
.acc summary::-webkit-details-marker { display: none }
.acc summary::after { content: "+" }
.acc details[open] summary::after { content: "–" }
.acc p { margin: 0 0 16px; color: var(--mute); max-width: 40ch; font-family: var(--body); font-size: .95rem; letter-spacing: 0; text-transform: none }

/* Contact */
.contact { padding-bottom: clamp(56px, 8vw, 120px) }
.contact a.big { display: block; font-family: var(--display); font-weight: 200; font-size: clamp(2.6rem, 11vw, 10rem); line-height: .95; letter-spacing: -.02em; overflow-wrap: anywhere }
.contact a.big:hover { font-weight: 400 }
.contact .row { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; margin-top: 24px }
.contact p { margin: 0; max-width: 48ch }
.copy { border: 1px solid var(--rule); padding: 10px 16px }
.copy:hover { background: var(--ink); color: var(--paper) }
footer { border-top: 1px solid var(--rule); padding-block: 20px 32px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap }

@media (max-width: 860px) {
  .hero, .process, .about, .pinfo { grid-template-columns: 1fr }
  .loupe { width: 150px; height: 150px }
  .nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; white-space: nowrap; scrollbar-width: none }
  .portraits .cap .mute { display: none }
  .badge { left: auto; right: 6px; bottom: -104px; width: 104px; height: 104px }
  .studio .big, .acc, .facade-intro h3, .facade-intro p { grid-column: 1 / -1 }
  .gallery { grid-template-columns: 1fr 1fr; gap: 16px }
  .nav { gap: 16px }
  .clock { display: none }
}
@media (prefers-reduced-motion: reduce) { *, .ticker div { animation: none !important; transition: none !important } html { scroll-behavior: auto } }

/* ---------- Arabic version: right-to-left adjustments ---------- */
.ar-only { display: none }
:root[lang="ar"] .ar-only { display: block }
:root[lang="ar"] .en-only { display: none }
#langBtn { font: inherit; color: inherit; background: none; border: 1px solid var(--rule); padding: 5px 10px; cursor: pointer; letter-spacing: 0; font-family: "IBM Plex Sans Arabic", var(--mono); font-size: .8rem; line-height: 1.2 }
#langBtn:hover { background: var(--ink); color: var(--paper) }
:root[lang="ar"] body { letter-spacing: 0 }
:root[lang="ar"] :is(.label, .mono, h1, h2, h3, p, button, summary, dd, dt, span, a) { letter-spacing: 0 }
:root[lang="ar"] .label { font-size: .82rem; font-family: "IBM Plex Sans Arabic", var(--mono) }
:root[lang="ar"] :is(.hero-row p, .hero p, .studio .big, .pinfo p, .panel p, .intro p, .facade-intro p, .about p, .contact p) { line-height: 1.6; font-family: "IBM Plex Sans Arabic", var(--body) }
:root[lang="ar"] :is(.about h3, .facade-intro h3, .steps button, .intro h1) { line-height: 1.35; font-family: "IBM Plex Sans Arabic", var(--display) }
:root[lang="ar"] .about h3 .ar-only { font-weight: 200 }
:root[lang="ar"] .nav a::after, :root[lang="ar"] .about h3::after { transform-origin: right }
:root[lang="ar"] :is(.mark, .hero h1, .contact a.big, .ticker, .ruler, .bigname, .pnav, #pCount, .lb-row, .readout, #mRead, .card output) { direction: ltr }
:root[lang="ar"] :is(.hero h1, .contact a.big) { text-align: right }
:root[lang="ar"] :is(#mRead, .rd, .readout, .card output, #pCount) { direction: rtl; font-family: "IBM Plex Sans Arabic", var(--mono) }
:root[lang="ar"] .frame .tag, :root[lang="ar"] .tag { left: auto; right: 12px }
:root[lang="ar"] .badge { left: auto; right: -124px }
:root[lang="ar"] .acc summary::after { margin-inline-start: 12px }
@media (max-width: 860px) { :root[lang="ar"] .badge { right: auto; left: 6px } }
.top #langBtn { order: 3 }
.top .nav { margin-inline-start: auto }
@media (max-width: 860px) { .top #langBtn { order: 0; margin-inline-start: auto } .top .nav { flex-basis: 100%; margin-inline-start: 0 } }

#gbc.project { margin-top: 0 }
.nav a[aria-current]::after { transform: scaleX(1) }
/* menu: one button in the bar opens a panel that lists every section */
#menuBtn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 1px solid var(--rule); padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 9px }
#menuBtn i { width: 14px; height: 8px; border-block: 1.5px solid currentColor; transition: height .2s ease }
#menuBtn[aria-expanded="true"] { background: var(--ink); color: var(--paper) }
#menuBtn[aria-expanded="true"] i { height: 0 }
.bar { position: sticky }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain; animation: menuIn .28s ease both }
.menu[hidden] { display: none }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px) } }
.menu ol { list-style: none; margin: 0 auto; padding-block: 8px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px }
.menu a { display: flex; align-items: baseline; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--faint, #d8d8d8); text-decoration: none; color: inherit }
.menu .mt { font-family: var(--display); font-weight: 300; font-size: clamp(1.3rem, 2.3vw, 1.9rem); line-height: 1.1; transition: transform .2s ease }
.menu a:hover .mt, .menu a:focus-visible .mt { transform: translateX(8px) }
:root[lang="ar"] .menu a:hover .mt, :root[lang="ar"] .menu a:focus-visible .mt { transform: translateX(-8px) }
.menu a[aria-current] .mt { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px }
@media (max-width: 900px) { .menu ol { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 560px) { .menu ol { grid-template-columns: 1fr } }
.top .nav { flex-basis: auto !important; flex-wrap: nowrap; overflow: visible }
@media (prefers-reduced-motion: reduce) { .menu { animation: none } }
.top #langBtn { order: 3 }
.top .nav { margin-inline-start: auto }
@media (max-width: 860px) { .top #langBtn { order: 0; margin-inline-start: auto } .top .nav { flex-basis: 100%; margin-inline-start: 0 } }

/* C Villa */
main > #cvilla, #cvilla.project { margin-top: 0 }
.cstage { background: #000; color: #fff; border-color: #000 } .cstage .hint { color: rgba(255,255,255,.6) } .cstage .zoom button { color: #fff; border-color: rgba(255,255,255,.5); background: #000 }
.cfit li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 0 } .cfit li.isoff > button:first-child { opacity: .5 } .cfit .csw { display: block; width: 58px; padding: 7px 0; text-align: center; border: 1px solid var(--ink); background: var(--ink); color: var(--paper) } .cfit .csw[aria-checked="false"] { background: none; color: var(--ink); border-color: var(--rule, var(--faint)) }
.call { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--faint) } .call button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 1px solid var(--ink); padding: 8px 12px; cursor: pointer } .cfit button { display: grid; grid-template-columns: 30px 1fr; gap: 10px; width: 100%; padding: 9px 4px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; text-align: start; cursor: pointer } .cfit li span:last-child { text-align: start } .cfit button[aria-pressed="true"] { background: var(--ink); color: var(--paper) } .cfit button[aria-pressed="true"] .mute { color: inherit; opacity: .7 }
