/* TrueScale CAD — "drawn in brass": a dark atelier where the drawing is the jewel.
   Obsidian ground, ivory text, brass foil. Bodoni Moda (thick and thin, like line weights) for display,
   Alexandria for text in both scripts, Aref Ruqaa for the Arabic foil line. */
:root {
  --bg: #070605; --bg-2: #0d0b09; --bg-3: #15120e;
  --ink: #f1ebde; --dim: #a59c8a; --faint: #877e6f;
  --line: rgba(241, 235, 222, .1); --line-2: rgba(241, 235, 222, .2);
  --brass: #caa665; --brass-hi: #f6e7b8; --brass-lo: #8a6a35;
  --foil: linear-gradient(105deg, #8a6a35 0%, #f6e7b8 34%, #caa665 58%, #7d5f30 100%);
  --didone: "Bodoni Moda", Didot, "Times New Roman", serif;
  --display: var(--didone);
  --text: "Alexandria", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 5vw, 76px); --maxw: 1360px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
html[lang="ar"] { --display: var(--text); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); font: 300 16px/1.75 var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
/* light from above, and a fine grain so the black reads as a material */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(110% 65% at 72% -8%, rgba(202, 166, 101, .13), transparent 62%), radial-gradient(70% 45% at -5% 105%, rgba(202, 166, 101, .06), transparent 70%); }
body::after { content: ""; position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); }
h1, h2, h3, p, ol, ul, dl, dd, figure, table { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brass); color: #171208; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; inset-inline-start: 12px; top: -70px; z-index: 80; background: var(--brass); color: #171208; padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 12px; }
.num, .num small { font-family: var(--didone); }
.foil { background: var(--foil) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 28px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink); font: 400 14.5px/1 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; transition: border-color .35s, color .35s, background-position .9s var(--ease), box-shadow .4s; }
.btn:hover { border-color: var(--brass); color: var(--brass-hi); }
.btn-foil { border-color: transparent; color: #171208; font-weight: 500; background: var(--foil) 0 0 / 210% 100%;
  box-shadow: inset 0 0 0 1px rgba(246, 231, 184, .3), 0 12px 34px -14px rgba(202, 166, 101, .6); }
.btn-foil:hover { color: #171208; border-color: transparent; background-position: 100% 0; box-shadow: inset 0 0 0 1px rgba(246, 231, 184, .5), 0 16px 44px -12px rgba(202, 166, 101, .8); }

/* ---------- header ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 28px; padding: 20px var(--pad); border-bottom: 1px solid transparent; transition: background .45s, padding .45s var(--ease), border-color .45s; }
.nav.is-solid { padding-block: 11px; background: rgba(7, 6, 5, .8); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.brand { position: relative; display: inline-flex; align-items: center; gap: 13px; text-decoration: none; font: 400 17px/1 var(--text); letter-spacing: .01em; white-space: nowrap; direction: ltr; }
.brand::after { content: ""; position: absolute; inset: -14px -8px; } /* a finger-sized target without making the bar taller */
.brand svg { width: 46px; height: 14px; overflow: visible; }
.brand i { font: italic 500 20px/1 var(--didone); color: var(--brass); }
.nav-links { display: flex; gap: clamp(16px, 2.6vw, 38px); margin-inline: auto; }
.nav-links .ns { display: none; } /* the short names, for a phone (see the 600px rule) */
.nav-links a { position: relative; padding: 8px 0; color: var(--dim); font-size: 14px; text-decoration: none; white-space: nowrap; transition: color .3s; }
.nav-links a::after { content: ""; position: absolute; inset-inline: 0; bottom: 2px; height: 1px; background: var(--foil); transform: scaleX(0); transition: transform .55s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-end { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.lang button { min-width: 44px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 13px; cursor: pointer; transition: color .3s, background .3s; }
.lang button[aria-pressed="true"] { background: rgba(241, 235, 222, .1); color: var(--ink); }
.nav-cta { min-height: 42px; padding: 0 22px; font-size: 14px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); grid-template-rows: 1fr auto; column-gap: clamp(24px, 4vw, 80px);
  max-width: calc(var(--maxw) + 2 * var(--pad)); margin-inline: auto; padding: 112px var(--pad) 0; }
.hero-copy { align-self: center; padding-block: 12px 36px; }
.hero-place { display: flex; align-items: center; gap: 16px; color: var(--brass); font-size: 14px; letter-spacing: .03em; }
.hero-place::before { content: ""; flex: none; width: 46px; height: 1px; background: var(--foil); }
h1 { margin-top: 28px; font: 400 clamp(46px, 6.4vw, 108px)/1.02 var(--display); letter-spacing: -.018em; }
h1 span { display: block; }
h1 .foil { font-style: italic; padding-bottom: .14em; animation: sheen 2.6s var(--ease) .5s both; }
html[lang="ar"] h1 { font-weight: 200; font-size: clamp(38px, 5vw, 84px); line-height: 1.32; letter-spacing: 0; }
html[lang="ar"] h1 .foil { font: 700 1.2em/1.45 "Aref Ruqaa", serif; padding-bottom: .1em; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.lead { max-width: 60ch; margin-top: 30px; color: var(--dim); font-size: clamp(15.5px, 1.18vw, 17.5px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-plan { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; display: grid; justify-items: center; gap: 18px; }
.plan { height: min(58svh, 700px); aspect-ratio: 11490 / 18040; max-width: 100%; filter: drop-shadow(0 0 22px rgba(202, 166, 101, .16)); }
.plan svg { width: 100%; height: 100%; cursor: crosshair; }
.hero-plan figcaption { display: grid; gap: 4px; justify-items: center; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.6; max-width: 46ch; }
.coords { color: var(--dim); direction: ltr; }
.coords b { font: 500 14px/1 var(--didone); color: var(--brass-hi); }
html[dir="rtl"] .coords > span { direction: rtl; display: inline-block; }
.hero-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; border-top: 1px solid var(--line); }
.hero-facts div { display: flex; align-items: baseline; gap: 18px; padding: 24px 0 28px; }
.hero-facts div + div { padding-inline-start: clamp(16px, 2.4vw, 34px); border-inline-start: 1px solid var(--line); }
.hero-facts dt { font-size: clamp(25px, 2.5vw, 38px); line-height: 1; white-space: nowrap; direction: ltr; }
.hero-facts dt small { font-size: .62em; font-style: italic; color: var(--brass); }
.hero-facts dt [lang="ar"] { font: 300 .78em/1 var(--text); }
.hero-facts dd { color: var(--dim); font-size: 13.5px; line-height: 1.5; max-width: 24ch; }

/* the CAD line drawings (inlined SVG, units are millimetres; --u is millimetres per screen pixel, set by app.js) */
.cad svg { --u: 24; direction: ltr; stroke: var(--foil-line, #caa665); }
.cad path, .cad circle { stroke-width: calc(var(--u) * .85px); }
.cad .g-wall *, .cad .g-cut * { stroke-width: calc(var(--u) * 1.7px); }
.cad .g-hid *, .cad .g-thin *, .cad .g-anno *, .cad .g-dim *, .cad .g-grid *, .cad .g-mep *, .cad .g-patt * { stroke-width: calc(var(--u) * .55px); opacity: .7; }
.cad .f { stroke: none; fill: var(--foil-line, #caa665); }
.cad .g-poche .f, .cad .g-fillsoft .f { fill-opacity: .32; }
.cad text { stroke: var(--bg); stroke-width: calc(var(--u) * 4px); paint-order: stroke; fill: #b9ae98; font-family: var(--text); font-weight: 300; }
.cad path:not(.f), .cad circle { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cad .f, .cad text { opacity: 0; }
.cad.is-drawing path:not(.f), .cad.is-drawing circle { animation: draw 1.25s var(--ease) var(--d, 0s) forwards; }
.cad.is-drawing .f, .cad.is-drawing text { animation: appear 1s ease var(--d, 0s) forwards; }
.cad.is-still path:not(.f), .cad.is-still circle { stroke-dashoffset: 0; }
.cad.is-still .f, .cad.is-still text { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* ---------- sections ---------- */
.sec { position: relative; max-width: calc(var(--maxw) + 2 * var(--pad)); margin-inline: auto; padding: clamp(88px, 11vw, 172px) var(--pad) 0; }
.sec-head { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px clamp(24px, 5vw, 96px); align-items: end; padding-bottom: 38px; }
.sec-head::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--brass-hi), var(--brass) 18%, rgba(202, 166, 101, .22) 55%, var(--line)); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.5s var(--ease); }
html[dir="rtl"] .sec-head::after { transform-origin: 100% 50%; background: linear-gradient(270deg, var(--brass-hi), var(--brass) 18%, rgba(202, 166, 101, .22) 55%, var(--line)); }
.sec.is-in .sec-head::after { transform: scaleX(1); }
h2 { font: 400 clamp(38px, 5.1vw, 82px)/1.04 var(--display); letter-spacing: -.012em; }
h3 { font: 400 clamp(23px, 2.3vw, 35px)/1.18 var(--display); }
html[lang="ar"] h2 { font-weight: 200; line-height: 1.38; letter-spacing: 0; }
html[lang="ar"] h3 { font-weight: 300; line-height: 1.5; }
.sec-head p { max-width: 52ch; color: var(--dim); }

/* ---------- sample sheets ---------- */
.job { padding-top: clamp(40px, 5vw, 76px); }
.job + .job { margin-top: clamp(48px, 6vw, 96px); border-top: 1px solid var(--line); }
.job-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 44px; margin-bottom: 28px; }
.job-head > p { flex: 1 1 100%; order: 3; max-width: 70ch; margin: 0; color: var(--dim); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.facts dt { color: var(--faint); font-size: 12.5px; }
.facts dd { font-size: 14.5px; }
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 270px; border: 1px solid var(--line); background: var(--bg-2); }
.stage { grid-area: 1 / 1; position: relative; display: block; width: 100%; aspect-ratio: 1.38; padding: 0; border: 0; overflow: hidden; cursor: zoom-in;
  background: #000 radial-gradient(90% 80% at 50% 0%, rgba(202, 166, 101, .08), transparent 70%); }
/* the print is inverted and laid under a sheet of foil; the highlight follows the pointer (--sheen) */
.plate { --gap: clamp(14px, 2.2vw, 34px); position: absolute; inset: var(--gap) var(--gap) calc(var(--gap) + 22px); display: grid; place-items: center; isolation: isolate; }
.plate img { width: auto; height: auto; max-width: 100%; max-height: 100%; filter: invert(1) grayscale(1) brightness(1.75) contrast(1.1); }
.viewer.color .plate img { filter: none; }   /* redline example: the red notes are the point, so no gray */
.plate::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background: linear-gradient(105deg, #94733c 0%, #caa665 calc(var(--sheen, 38%) - 24%), #fbf0cd var(--sheen, 38%), #caa665 calc(var(--sheen, 38%) + 24%), #94733c 100%); }
.stage-hint { position: absolute; inset-inline-end: 16px; bottom: 14px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(7, 6, 5, .72); color: var(--dim); font-size: 12.5px; line-height: 1.2; transition: color .3s, border-color .3s; }
.stage:hover .stage-hint { color: var(--brass-hi); border-color: var(--brass); }
.tabs { grid-area: 1 / 2; display: flex; flex-direction: column; padding: 10px 0; border-inline-start: 1px solid var(--line); }
.tabs-row { padding: 14px 0 8px; }
.tabs-row + .tabs-row { border-top: 1px solid var(--line); }
.tabs-label { display: block; padding: 0 24px 8px; color: var(--faint); font-size: 12.5px; }
.tabs-set { display: flex; flex-direction: column; }
.tabs button { position: relative; padding: 10px 24px; border: 0; background: none; color: var(--dim); font: 300 15px/1.35 var(--text); text-align: start; cursor: pointer; transition: color .3s, padding .45s var(--ease); }
.tabs button::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 0; height: 1px; background: var(--brass); transition: width .45s var(--ease); }
.tabs button:not([data-i18n]) { font: 500 17px/1.3 var(--didone); letter-spacing: .05em; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--brass-hi); padding-inline-start: 42px; }
.tabs button[aria-pressed="true"]::before { width: 28px; }
.tabs button:focus-visible { outline-offset: -3px; }

/* ---------- services ---------- */
.svc { display: block; width: 100%; }
.svc tbody { display: block; }
.svc tr { display: grid; grid-template-columns: 64px minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 0 clamp(18px, 3vw, 52px); align-items: start; padding: 30px 0 32px; border-bottom: 1px solid var(--line); transition: background .6s; }
.svc tbody tr:hover { background: linear-gradient(90deg, rgba(202, 166, 101, .08), transparent 72%); }
html[dir="rtl"] .svc tbody tr:hover { background: linear-gradient(270deg, rgba(202, 166, 101, .08), transparent 72%); }
.svc td:first-child { font: italic 400 22px/1.45 var(--didone); color: var(--brass); }
.svc th { font: 400 clamp(21px, 2vw, 30px)/1.22 var(--display); text-align: start; }
html[lang="ar"] .svc th { font-weight: 300; line-height: 1.55; }
.svc td { color: var(--dim); font-size: 14.5px; line-height: 1.75; }
.lbl { display: block; margin-bottom: 5px; color: var(--faint); font-size: 12px; }
.gnote { max-width: 80ch; margin-top: 36px; padding-inline-start: 20px; border-inline-start: 1px solid var(--brass); color: var(--dim); font-size: 14px; }

/* ---------- scale check ---------- */
.proof { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 92px); align-items: center; padding-top: clamp(44px, 5.5vw, 84px); }
.proof-num { display: flex; align-items: baseline; gap: .07em; direction: ltr; font-size: clamp(120px, 16vw, 250px); line-height: .86; letter-spacing: -.035em; }
html[dir="rtl"] .proof-num { justify-content: flex-end; }
.proof-num .foil { padding-inline-end: .04em; }
.proof-num small { font-size: .24em; font-style: italic; letter-spacing: 0; color: var(--dim); }
.proof-note { max-width: 36ch; margin-top: 22px; color: var(--dim); }
.scroll { overflow-x: auto; }
.mlbl { display: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { padding: 0 0 13px; padding-inline-end: 18px; border-bottom: 1px solid var(--line-2); color: var(--faint); font-size: 12.5px; font-weight: 300; text-align: start; white-space: nowrap; }
.tbl td { padding: 16px 0; padding-inline-end: 18px; border-bottom: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.tbl td:first-child { font: 500 16px/1.4 var(--didone); letter-spacing: .05em; color: var(--brass); }
.tbl td:nth-child(2) { color: var(--ink); }
.tbl td:last-child { color: var(--brass-hi); }
html[dir="rtl"] .tbl td:nth-child(n+3) { direction: ltr; text-align: right; }
.carry { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px clamp(28px, 5vw, 92px); margin-top: clamp(48px, 6vw, 92px); }
.carry ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.carry li { position: relative; padding: 18px 0; padding-inline-start: 28px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14.5px; }
.carry li::before { content: ""; position: absolute; inset-inline-start: 0; top: 32px; width: 13px; height: 1px; background: var(--brass); transform: rotate(-45deg); } /* the tick that ends a dimension line */

/* ---------- process: five grid bubbles on one line ---------- */
.steps { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: clamp(48px, 6vw, 88px); counter-reset: step; }
.steps::before { content: ""; position: absolute; inset-inline: 0; top: 24px; height: 1px; background: var(--line-2); transform: scaleX(0); transform-origin: 0 50%; transition: transform 2s var(--ease) .25s; }
html[dir="rtl"] .steps::before { transform-origin: 100% 50%; }
.sec.is-in .steps::before { transform: scaleX(1); }
.steps li { position: relative; padding-inline-end: 26px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 49px; height: 49px; border: 1px solid var(--brass); border-radius: 50%; background: var(--bg); color: var(--brass-hi); font: 500 20px/1 var(--didone); }
.steps h3 { margin-top: 26px; font-size: clamp(20px, 1.75vw, 26px); }
.steps p { max-width: 27ch; margin-top: 10px; color: var(--dim); font-size: 14.5px; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 92px); padding-top: clamp(44px, 5.5vw, 84px); }
.contact-big { font: 400 clamp(28px, 3.1vw, 48px)/1.14 var(--display); }
html[lang="ar"] .contact-big { font-weight: 200; line-height: 1.5; }
.contact-small { max-width: 40ch; margin-top: 20px; color: var(--dim); }
.quote { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; }
.quote label { display: grid; gap: 6px; color: var(--faint); font-size: 12.5px; }
.quote .wide { grid-column: 1 / -1; }
.quote input, .quote select, .quote textarea { width: 100%; padding: 9px 0 12px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent; color: var(--ink); font: 300 16px/1.5 var(--text); outline: 0; transition: border-color .3s, box-shadow .3s; }
.quote textarea { resize: vertical; min-height: 96px; }
.quote select option { background: var(--bg-3); color: var(--ink); }
.quote input:focus, .quote select:focus, .quote textarea:focus { border-color: var(--brass); box-shadow: 0 1px 0 var(--brass); }
.quote [aria-invalid="true"] { border-color: #e0705c; box-shadow: 0 1px 0 #e0705c; }
.form-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.form-status { min-height: 1.6em; color: #ecc3b4; font-size: 14px; }

/* ---------- closing line and footer ---------- */
.horizon { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: clamp(64px, 9vw, 132px) auto 0; padding-inline: var(--pad); opacity: .75;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.horizon svg { width: 100%; height: auto; }
.horizon text { display: none; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; max-width: calc(var(--maxw) + 2 * var(--pad)); margin-inline: auto; padding: 26px var(--pad) 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot a { white-space: nowrap; text-decoration-color: rgba(202, 166, 101, .6); text-underline-offset: 3px; transition: color .3s; } /* the two-word company name stays on one line */
.foot a:hover { color: var(--brass-hi); }

/* ---------- full-size view: the sheet as printed ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
.lightbox::backdrop { background: var(--bg); }
.lightbox-bar { position: fixed; top: 14px; inset-inline-end: 14px; z-index: 2; display: flex; gap: 8px; }
.lightbox-bar .btn { min-height: 42px; padding: 0 20px; background: rgba(7, 6, 5, .82); }
.lightbox-zoom[hidden] { display: none; }
.lightbox-bar .lightbox-zoom[aria-pressed="true"] { background: var(--foil); border-color: transparent; color: #171208; }
.lightbox-scroll { width: 100%; height: 100%; overflow: auto; padding: 70px 18px 18px; } /* app.js sizeBig() uses these paddings */
.lightbox-scroll:focus-visible { outline-offset: -3px; }
.lightbox-scroll img { max-width: none; width: 100%; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px rgba(202, 166, 101, .35), 0 30px 80px -20px #000; }

/* ---------- the live model behind the page (scene.js) ---------- */
#scene { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.hero h1 { font-size: clamp(42px, 5.1vw, 88px); }
html[lang="ar"] .hero h1 { font-size: clamp(36px, 4.1vw, 70px); }
/* a shade behind the words, so the model never fights the text */
.hero::before { content: ""; position: absolute; z-index: -1; inset-block: 0; inset-inline-start: calc(50% - 50vw); width: 66vw; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 6, 5, .93), rgba(7, 6, 5, .68) 52%, transparent); }
html[dir="rtl"] .hero::before { background: linear-gradient(270deg, rgba(7, 6, 5, .93), rgba(7, 6, 5, .68) 52%, transparent); }
.hero-facts { background: linear-gradient(180deg, rgba(7, 6, 5, .35), rgba(7, 6, 5, .86)); }
.hud { grid-column: 2; grid-row: 1; align-self: end; justify-self: start; display: grid; gap: 5px; width: min(100%, 390px); margin-bottom: 14px; padding: 10px 16px;
  border: 1px solid var(--line); border-left: 2px solid var(--brass); background: rgba(7, 6, 5, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 400 12.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--dim); direction: ltr; text-align: left; }
.hud p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud b { font-weight: 500; color: var(--brass-hi); }
.hud-cmd span, .hud-xy span { color: var(--brass); }
.hud-xy b { display: inline-block; min-width: 6.4ch; margin-inline-end: 10px; text-align: right; }
html[dir="rtl"] .hud { justify-self: end; } /* the model is not mirrored: the villa, which the panel sits under, is always on its left */
.caret { display: inline-block; width: 7px; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: var(--brass-hi); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* a window on the live model at the head of a section: scene.js changes the model to the band's shot while it scrolls in */
:root { --view-h: max(340px, 76svh); }
/* shown only when scene.js is running to fill it (html.has-scene): without the model a band is an empty gap of most of a screen */
.view { display: none; position: relative; height: var(--view-h); margin-bottom: clamp(40px, 5vw, 76px); pointer-events: none; }
html.has-scene .view { display: block; }
.view::before, .view::after { content: ""; position: absolute; width: 30px; height: 30px; border: 0 solid var(--brass); opacity: .6; } /* the corners of a viewport */
.view::before { top: 0; inset-inline-start: 0; border-top-width: 1px; border-inline-start-width: 1px; }
.view::after { bottom: 0; inset-inline-end: 0; border-bottom-width: 1px; border-inline-end-width: 1px; }
.view-tag { position: absolute; inset-inline-start: 0; bottom: 0; display: flex; align-items: baseline; gap: 14px; max-width: 100%; padding: 9px 18px; border: 1px solid var(--line); border-inline-start: 2px solid var(--brass);
  background: rgba(7, 6, 5, .66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--dim); font-size: 13px; line-height: 1.5; }
.view-tag b { flex: none; font: 500 15px/1.3 var(--didone); letter-spacing: .05em; color: var(--brass-hi); direction: ltr; }
/* a link to the section lands with its heading on screen and the window above it, not on the empty top of the window */
html.has-scene .sec:has(> .view) { scroll-margin-top: calc(min(46svh, 100svh - 330px) - var(--view-h) - clamp(88px, 11vw, 172px)); } /* on a short screen the heading still lands in view */
/* a shade under the heading, which comes up while the model is still bright */
.view + .sec-head::before { content: ""; position: absolute; z-index: -1; inset: -56px calc(50% - 50vw) -28px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(7, 6, 5, .8) 34%, rgba(7, 6, 5, .8) 78%, transparent); }

/* a moving band of the work we draw */
.tape { overflow: hidden; margin-top: clamp(28px, 4vw, 56px); padding-block: 20px; border-block: 1px solid var(--line); background: rgba(7, 6, 5, .55); direction: ltr; }
.tape-run { display: flex; width: max-content; animation: tape 46s linear infinite; }
.tape span { flex: none; white-space: pre; font: 400 clamp(30px, 4.4vw, 62px)/1.15 var(--didone); font-style: italic; color: transparent; -webkit-text-stroke: 1px rgba(202, 166, 101, .6); }
html[lang="ar"] .tape span { font: 200 clamp(26px, 3.6vw, 52px)/1.5 var(--text); color: rgba(202, 166, 101, .62); -webkit-text-stroke: 0; }
@keyframes tape { to { transform: translateX(-50%); } }

/* blocks rise into place the first time they are seen (classes set by app.js) */
.rv { opacity: 0; transform: translateY(38px); transition: opacity 1s var(--ease) calc(var(--i, 0) * 90ms), transform 1.2s var(--ease) calc(var(--i, 0) * 90ms); }
.rv.in { opacity: 1; transform: none; }
.pl .plate { clip-path: inset(0 0 100% 0); transition: clip-path 2.1s var(--ease) .15s; } /* the sheet comes off the plotter: print and foil together, or the bare foil shows as a gold slab */
.pl.in .plate { clip-path: inset(0); }
html.js .sec-head h2 { clip-path: inset(-10% -5% 110% -5%); transform: translateY(.32em); transition: clip-path 1.3s var(--ease), transform 1.3s var(--ease); }
html.js .sec.is-in .sec-head h2 { clip-path: inset(-25% -5% -25% -5%); transform: none; }
html[dir="rtl"] .quote input[dir="ltr"] { text-align: right; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .tabs { grid-area: auto; flex-direction: row; flex-wrap: wrap; padding: 0; border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .stage { grid-area: auto; }
  .tabs-row { display: flex; flex: 1 1 100%; align-items: center; flex-wrap: wrap; padding: 8px 16px; }
  .tabs-label { padding: 0; padding-inline-end: 12px; }
  .tabs-set { flex-direction: row; flex-wrap: wrap; }
  .tabs button, .tabs button[aria-pressed="true"] { padding: 9px 13px; }
  .tabs button::before { inset-inline: 13px; top: auto; bottom: 4px; width: auto; transform: scaleX(0); transition: transform .45s var(--ease); }
  .tabs button[aria-pressed="true"]::before { width: auto; transform: scaleX(1); }
}
@media (max-width: 940px) {
  .nav { flex-wrap: wrap; gap: 6px 16px; padding-block: 14px 8px; }
  .nav.is-solid { padding-block: 9px 4px; }
  .nav-end { margin-inline-start: auto; }
  .nav-links { order: 3; width: 100%; margin: 0; gap: 22px; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  html { scroll-padding-top: 112px; }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; min-height: 0; padding-top: 136px; }
  .hero-plan { grid-column: 1; grid-row: auto; margin-top: 18px; }
  .plan { height: auto; width: min(100%, 440px); }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div + div { padding-inline-start: 0; border-inline-start: 0; border-top: 1px solid var(--line); }
  .hero-facts div { padding-block: 18px; }
  .sec-head, .proof, .carry, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .svc tr { grid-template-columns: 44px minmax(0, 1fr); padding-block: 24px; }
  .svc td:nth-child(n+3) { grid-column: 2; margin-top: 14px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .steps::before { inset: 0 auto 0 24px; width: 1px; height: auto; transform: scaleY(0); transform-origin: 50% 0; }
  html[dir="rtl"] .steps::before { inset: 0 24px 0 auto; transform-origin: 50% 0; }
  .sec.is-in .steps::before { transform: scaleY(1); }
  .steps li { display: grid; grid-template-columns: 49px minmax(0, 1fr); column-gap: 20px; padding-inline-end: 0; }
  .steps li::before { grid-row: 1 / span 2; }
  .steps h3 { margin-top: 8px; }
  .steps p { max-width: none; }
  html[dir="rtl"] .proof-num { justify-content: flex-start; }
}
@media (max-width: 700px) { /* phone: the print takes the full width and the stage follows its height */
  .stage { aspect-ratio: auto; }
  .plate { position: relative; inset: auto; margin: var(--gap) var(--gap) 56px; }
  .plate img { width: 100%; max-height: none; }
  .carry ul, .quote { grid-template-columns: minmax(0, 1fr); }
  /* scale check: five columns do not fit a phone, and the measured sizes are the point, so each row becomes two lines */
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px 14px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .tbl td { padding: 0; border: 0; white-space: normal; }
  .tbl td:nth-child(4) { grid-column: 1 / span 2; }
  .mlbl { display: block; margin-bottom: 3px; color: var(--faint); font-size: 12px; }
  html[dir="rtl"] .mlbl { direction: rtl; }
  .nav-cta { display: none; }
  .btn { padding-inline: 22px; }
}
@media (max-width: 600px) { /* phone: the four section links show their short names and share the width, so none is cut at the edge */
  .nav-links { gap: 10px; justify-content: space-between; }
  .nav-links a { font-size: clamp(12.5px, 3.6vw, 14px); }
  .nav-links .nl { display: none; }
  .nav-links .ns { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sec-head::after, .steps::before { transform: none; }
  .cad path:not(.f), .cad circle { stroke-dashoffset: 0; }
  .cad .f, .cad text { opacity: 1; }
}
@media (max-width: 940px) { /* the model fills the top of the first screen and the words sit under it */
  .hero { padding-top: 55svh; }
  .hero::before { inset-inline-start: calc(50% - 50vw); width: 100vw; background: linear-gradient(180deg, transparent 38svh, rgba(7, 6, 5, .9) 60svh) !important; }
  .hero-copy { display: flex; flex-direction: column; padding-top: 0; }
  .hero-copy .lead { order: 3; margin-top: 30px; }
  .hero-actions { margin-top: 26px; }
  .hud { grid-column: auto; grid-row: auto; position: absolute; left: var(--pad); top: calc(55svh - 44px); width: max-content; max-width: calc(100% - 2 * var(--pad)); margin: 0; padding: 6px 12px; font-size: 11.5px; }
  .hud-xy { display: none; }
  :root { --view-h: max(340px, 62svh); }
}
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } .pl .plate, html.js .sec-head h2 { clip-path: none; transform: none; } }
@media print { .nav, .horizon, #scene, html.has-scene .view, .view + .sec-head::before, body::before, body::after { display: none; } body { background: #fff; color: #000; } } /* the model and its windows are for the screen */
