/*
Theme Name: Arch Structa
Author: Arch Structa
Description: Minimal black and white one-page theme for Arch Structa, a construction, renovation and interior group in Kuwait. Includes an interactive frame model, site photo gallery, facade design carousel, photo viewer, an About section, a project drawing viewer, a Structures page of interactive models, and an Arabic version with right-to-left layout.
Version: 11.44.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arch-structa
*/

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 } }

/* 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 }
.nav { display: flex; gap: 24px; flex-wrap: wrap; align-items: center }
.nav a { position: relative; padding-block: 4px }
/* Your land: a three-step form beside a live drawing */
#land + #house3d { margin-top: 0; border-top: 1px solid var(--faint) }
.lsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-self: end }
.lsteps li { border-top: 1px solid var(--faint); padding-top: 8px; color: var(--mute) }
.lsteps li b { font-weight: 500; margin-inline-end: 6px }
.lsteps li[aria-current], .lsteps li.done { border-top-color: var(--ink); color: var(--ink) }
.lwgrid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 32px; align-items: start }
.lwpanel { display: grid; gap: 16px }
.lwstep { display: grid; gap: 14px }
.lwstep[hidden] { display: none }
.lwstep h3 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1 }
.lwstep p { margin: 0; line-height: 1.7 }
#land .ctrl button, .lwfile span { border: 1px solid var(--rule); padding: 8px 12px; cursor: pointer }
#land .ctrl button:disabled { opacity: .35; cursor: default }
#land .ctrl button.go { background: var(--ink); color: var(--paper) }
.lwfile { display: inline-flex } .lwfile input { position: absolute; width: 1px; height: 1px; opacity: 0 } .lwfile input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px } .lwfile span:hover { background: var(--ink); color: var(--paper) }
.lwtable { max-height: 250px; overflow: auto; border: 1px solid var(--faint) }
.lwtable table { border-collapse: collapse; width: 100%; min-width: 420px; color: var(--ink) }
.lwtable th, .lwtable td { padding: 0; border-bottom: 1px solid var(--faint); text-align: start }
.lwtable th { padding: 8px 6px; color: var(--mute); font-weight: 400; position: sticky; top: 0; background: var(--paper) }
.lwtable input { width: 100%; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; padding: 8px 6px; font-variant-numeric: tabular-nums; -moz-appearance: textfield }
.lwtable input:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px }
.lwtable button { border: 0; background: none; color: inherit; font: inherit; padding: 8px 10px; cursor: pointer }
.lwtable tr.bad td { background: rgba(255, 255, 255, .12) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
#lwStage { aspect-ratio: 4 / 3 }
#lwMsg:empty, #lwWarn:empty, #lwNote:empty { display: none }
.lwnav { margin-top: 4px }
@media (max-width: 860px) { .lwgrid { grid-template-columns: 1fr } .lsteps { grid-template-columns: repeat(2, 1fr) } #lwStage { aspect-ratio: auto; height: 96vw; min-height: 320px; max-height: 520px } }
/* menu: one button in the bar opens a panel that lists every section */
#sndBtn { 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: 8px }
#sndBtn i { width: 0; height: 0; border-block: 5px solid transparent; border-inline-end: 8px solid currentColor }
#sndBtn[aria-pressed="true"] { background: var(--ink); color: var(--paper) }
@media (max-width: 520px) { #sndBtn span { display: none } }
#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 } }
@media (max-width: 1500px) { .nav { gap: 6px 15px } .top { gap: 8px 14px } }
.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(3.1rem, 11vw, 10.2rem); line-height: .9; letter-spacing: -.01em; text-transform: uppercase; width: max-content; max-width: 100%; position: relative }
.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 }
/* STRUCTA is built, not typed: each letter is lowered in on a line, stands as an outline, then fills from the bottom like a pour, and empties again */
.hero h1 .line.b { overflow: visible; position: relative; margin-top: .02em }
.hero h1 .line.b .ch { position: relative; color: transparent; -webkit-text-stroke: 1.2px var(--ink); background: linear-gradient(var(--ink), var(--ink)) bottom / 100% 0% no-repeat; -webkit-background-clip: text; background-clip: text; animation: wdrop .95s cubic-bezier(.2, .9, .25, 1.12) both, wpour 10s ease-in-out infinite; animation-delay: calc(.45s + var(--k) * 130ms), calc(1.7s + var(--k) * 280ms) }
.hero h1 .line.b .ch::before { content: ""; position: absolute; left: 50%; bottom: 88%; width: 1px; height: 60vh; background: var(--ink); opacity: .55; transform-origin: top; animation: wrope 1.7s ease both; animation-delay: calc(.45s + var(--k) * 130ms); pointer-events: none }
.hero h1 .line.b .ch::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: .1em; height: 1px; background: var(--ink); transform: scaleX(0); animation: wseat 10s ease-in-out infinite; animation-delay: calc(1.7s + var(--k) * 280ms) }
.hero h1 .line.b::after { content: ""; position: absolute; top: .06em; bottom: .02em; left: 0; width: 2px; background: #ffffff; mix-blend-mode: difference; animation: wscan 7s cubic-bezier(.6, 0, .4, 1) 2.4s infinite; pointer-events: none }
.hero h1::after { content: var(--lbl, "STRUCTA  ·  7 MEMBERS  ·  POURED IN SEQUENCE"); display: block; margin-top: .9em; padding-top: .7em; border-top: 1px solid var(--ink); font-family: var(--mono); font-size: .66rem; font-weight: 400; letter-spacing: .14em; line-height: 1; white-space: nowrap; overflow: hidden; background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 14.2857%) top / 100% 6px no-repeat; transform-origin: left; animation: wdim 1.4s cubic-bezier(.6, 0, .2, 1) 1.6s both }
:root[lang="ar"] .hero h1::after { transform-origin: right; text-align: left }
/* once the letters have landed the script takes over: drag to lift, move across to pour, click to re-seat */
.hero h1 .line.b.live .ch { animation: none; cursor: grab; user-select: none; -webkit-user-select: none; will-change: transform; transition: font-weight .35s ease }
.hero h1 .line.b.live .ch.held { cursor: grabbing }
.hero h1 .line.b.live .ch::before { animation: none; transform: scaleY(var(--r, 0)); opacity: .55; transition: transform .28s ease }
.hero h1 .line.b.live .ch::after { animation: none; transform: scaleX(var(--s, 0)); transition: transform .3s ease }
.hero h1 .line.b.live::after { animation: none; left: var(--sx, 0%); opacity: var(--so, 0); transition: opacity .3s ease }
/* the engineer's hard hat, drawn in line, resting on the first letter */
.helmet { position: absolute; left: -.03em; top: -.2em; width: .72em; height: auto; overflow: visible; transform-origin: 50% 100%; transform: rotate(-9deg); animation: hatdrop 1s cubic-bezier(.3, 1.4, .5, 1) 1.5s both; cursor: pointer; z-index: 3; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1) }
.helmet:hover, .helmet.up { transform: translateY(-.16em) rotate(7deg) }
.helmet .hs { fill: var(--paper); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round }
.helmet .hl { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round }
.helmet .hd { fill: var(--ink) }
.helmet .hk { fill: var(--ink) }
.helmet .hr { fill: none; stroke: var(--ink); stroke-width: 8; stroke-linecap: butt }
.helmet .hr2 { fill: none; stroke: var(--paper); stroke-width: 4.6; stroke-dasharray: 5 5; stroke-linecap: butt }
.helmet .ht { font-family: var(--mono); font-size: 15px; font-weight: 500; font-style: italic; fill: var(--ink); letter-spacing: 0 }
@keyframes hatdrop { from { transform: translateY(-1.4em) rotate(-40deg); opacity: 0 } 60% { opacity: 1 } to { transform: rotate(-9deg) } }
@media (prefers-reduced-motion: reduce) { .helmet { animation: none; transition: none } }
@keyframes wdrop { from { transform: translateY(-135%); opacity: 0 } 60% { opacity: 1 } }
@keyframes wrope { 0% { transform: scaleY(1); opacity: 0 } 15%, 55% { transform: scaleY(1); opacity: .55 } 100% { transform: scaleY(0); opacity: .55 } }
@keyframes wpour { 0% { background-size: 100% 0% } 16%, 58% { background-size: 100% 100% } 76%, 100% { background-size: 100% 0% } }
@keyframes wseat { 0%, 100% { transform: scaleX(0) } 6%, 14% { transform: scaleX(1) } 22% { transform: scaleX(0) } }
@keyframes wscan { 0% { left: 0; opacity: 0 } 6% { opacity: 1 } 46% { left: 100%; opacity: 1 } 50%, 100% { left: 100%; opacity: 0 } }
@keyframes wdim { from { clip-path: inset(0 100% 0 0) } to { clip-path: inset(0 0 0 0) } }
@media (prefers-reduced-motion: reduce) { .hero h1 .line.b .ch { background-size: 100% 100% } .hero h1 .line.b .ch::before, .hero h1 .line.b::after { display: none } }
@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 }
@media (max-width: 600px) { .stage .detail-cap { top: 26px; right: auto; left: 10px; text-align: left } }
.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) }
#house3d .gallery .shot:nth-child(even) { margin-top: 0 }
#house3d .frame { aspect-ratio: 1 / 1; border-color: var(--faint) }
#house3d .frame img { filter: grayscale(1) }
@media (max-width: 860px) { #n3Stage, #tcStage, #cmStage, #ppStage, #rfStage, #hmStage, #plStage { aspect-ratio: auto; height: 100vw; min-height: 340px; max-height: 560px } }
.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 }
.reach { margin: clamp(28px, 4vw, 48px) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--rule) }
.reach > div { padding-block: 18px; border-bottom: 1px solid var(--rule) }
.reach dd { margin: 6px 0 0 }
.reach a { font-family: var(--display); font-weight: 300; font-size: clamp(1.35rem, 3vw, 2.4rem); line-height: 1.15; overflow-wrap: anywhere; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px }
.reach a:hover { font-weight: 400 }
:root[lang="ar"] .reach dd { text-align: right }
@media (max-width: 700px) { .reach { grid-template-columns: 1fr } }
.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 } }
/* Lighting sections: three 2D details with dimensions */
.lsec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px }
@media (max-width: 1300px) { .lsec { grid-template-columns: 1fr 1fr } }
.lsec svg { width: 100%; height: auto; border: 1px solid var(--faint); background: #000000; font-family: var(--mono); direction: ltr }
.lsec text { fill: #ffffff; font-size: 10px; letter-spacing: .04em } .lsec .tt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em } .lsec .sb { fill: #9a9a9a; font-size: 9px; text-transform: uppercase; letter-spacing: .1em }
.lsec .st { fill: #cfcfcf; stroke: #ffffff } .lsec .pl { fill: #6a6a6a; stroke: #ffffff } .lsec .pl2 { stroke: #ffffff; fill: none } .lsec .jt { stroke: rgba(0,0,0,.45); fill: none } .lsec .gap { fill: #000000; stroke: #ffffff }
.lsec .pf { fill: #1c1c1c; stroke: #ffffff } .lsec .fn { fill: #2a2a2a; stroke: #ffffff } .lsec .pv { fill: #4a4a4a; stroke: #ffffff } .lsec .so { fill: #1a1a1a; stroke: #3a3a3a } .lsec .gr { fill: #333333; stroke: #ffffff; stroke-dasharray: 2 3 } .lsec .cb { fill: none; stroke: #ffffff; stroke-dasharray: 4 3 }
.lsec .dm path { stroke: #ffffff; stroke-width: .8; fill: none } .lsec .nt path { stroke: #9a9a9a; stroke-width: .7; fill: none } .lsec .nt circle { fill: #ffffff } .lsec .nt text { fill: #cfcfcf; font-size: 9px }
@media (max-width: 900px) { .lsec { grid-template-columns: 1fr } }
.lsbig svg { width: 100%; height: auto; border: 1px solid var(--faint); background: #000000; font-family: var(--mono); direction: ltr; display: block }
.lsbig text { fill: #ffffff; font-size: 11px; letter-spacing: .03em } .lsbig .sm { font-size: 9.5px; fill: #cfcfcf } .lsbig .lm { fill: rgb(255,169,87) }
.lsbig .dm { stroke: #ffffff; stroke-width: .8; fill: none } .lsbig .lv { stroke: #6a6a6a; stroke-width: .6; stroke-dasharray: 4 4; fill: none }
.lstab { border-collapse: collapse; width: 100%; min-width: 640px } .lstab th, .lstab td { text-align: start; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--faint); white-space: nowrap } .lstab th { color: var(--mute); font-weight: 400 } .lstab td:last-child { white-space: normal }
