/* Ghita ELATTAFI — web portfolio. Same identity as the booklet:
   brick, light Poppins display, League Spartan caps, DM Mono text. Phone first.
   Written with "start / end" instead of "left / right" wherever it matters, so Arabic mirrors by itself. */

:root {
  color-scheme: light;
  --brick: #812C29;
  --rose: #B4826F;      /* large numerals and tints */
  --rose-t: #9A6753;    /* the same rose, deep enough to read as small text on white */
  --rose-l: #E8C6BA;
  --ink: #1E1B1A;
  --grey: #746D6A;
  --paper: #FFFFFF;
  --plate: #F6EFEB;     /* a quiet plate while an image arrives */
  --hair: rgba(129, 44, 41, .22);
  --arabic: 'IBM Plex Sans Arabic', 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  --caps: 'League Spartan', 'Futura', var(--arabic);
  --light: 'Poppins', var(--arabic);
  --mono: 'DM Mono', ui-monospace, 'Menlo', var(--arabic);
  --pad: max(clamp(20px, 5vw, 72px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --gap: clamp(46px, 8vw, 110px);   /* space between the blocks of a project */
  --sec: clamp(70px, 12vh, 140px);  /* space under a home section */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --dir: 1;                          /* 1 left-to-right, -1 right-to-left: for the few movements that have a side */
}
[dir="rtl"] { --dir: -1; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { font-family: var(--mono); font-size: 14px; line-height: 1.7; color: var(--ink); background: var(--paper); overflow-x: hidden; overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
@media (min-width: 1280px) { body { font-size: 15px; } }
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3 { font: inherit; }
ul { list-style: none; }
p { text-wrap: pretty; }
::selection { background: var(--brick); color: #fff; }
.contact ::selection, .pro-head ::selection, .hero-block ::selection, .menu ::selection { background: #fff; color: var(--brick); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
#app:focus, .viewer:focus, .menu:focus { outline: none; }

.sc { font-size: 11px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; }
.num { font-family: var(--light); font-weight: 200; letter-spacing: -.02em; line-height: 1; color: var(--rose); }

.skip { position: fixed; z-index: 80; inset-inline-start: var(--pad); top: 10px; padding: 10px 14px; background: var(--brick); color: #fff; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* a small link with an underline that draws itself */
.cta { display: inline-block; color: var(--brick); padding: 10px 0; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 100% 1px no-repeat; transition: background-size .6s var(--ease), color .3s; }
.cta:hover, .cta:focus-visible { background-size: 34% 1px; }
[dir="rtl"] .cta { background-position: 100% calc(100% - 4px); }

/* ───────── top bar ───────── */
.nav { position: fixed; z-index: 40; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); padding: calc(8px + env(safe-area-inset-top, 0px)) var(--pad) 8px; color: #fff; transition: transform .5s var(--ease), background .4s, color .4s; }
.nav a, .nav button { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; padding: 12px 0; white-space: nowrap; }
.nav .nav-name { margin-inline-end: auto; transition: opacity .4s; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav nav a, .langs a { position: relative; }
.nav nav a::after, .langs a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.nav nav a:hover::after, .nav nav a:focus-visible::after, .langs a:hover::after, .langs a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.langs { display: flex; gap: 12px; }
.langs a { opacity: .62; transition: opacity .3s; letter-spacing: .1em; }
.langs a:hover, .langs a[aria-current] { opacity: 1; }
.langs a[lang="ar"] { font-size: 14px; line-height: 1; letter-spacing: 0; }
.menu-btn { display: none; }
.nav.solid { background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--brick); }
.nav.away:not(:focus-within) { transform: translateY(-110%); }
body.at-home .nav:not(.solid) .nav-name { opacity: 0; pointer-events: none; }
/* phones: the links move into the menu */
@media (max-width: 720px) {
  .nav nav, .nav .langs { display: none; }
  .menu-btn { display: block; }
}
.hero::before, .p-hero::before { content: ''; position: absolute; z-index: 1; inset: 0 0 auto; height: 130px; background: linear-gradient(rgba(20, 12, 10, .42), rgba(20, 12, 10, 0)); pointer-events: none; }
.hero-block, .hero-cue { z-index: 2; }

/* ───────── menu (phones): a brick sheet, like the page transitions ───────── */
.menu { position: fixed; z-index: 50; inset: 0; background: var(--brick); color: #fff; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top, 0px)) var(--pad) calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateY(-101%); visibility: hidden; transition: transform .75s var(--ease-io), visibility 0s .75s; overflow-y: auto; }
.menu.open { transform: none; visibility: visible; transition: transform .75s var(--ease-io); }
.menu-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--rose-l); }
.menu-top button { padding: 12px 0; color: #fff; }
.menu-links { margin-block: auto; display: grid; gap: 4px; padding-block: 30px; }
.menu-links a { display: flex; align-items: baseline; gap: 18px; padding: 8px 0; font-family: var(--light); font-weight: 300; font-size: clamp(34px, 11vw, 60px); line-height: 1.12; letter-spacing: -.02em; opacity: 0; transform: translateY(22px); transition: opacity .5s, transform .7s var(--ease); }
.menu-links a i { font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .1em; color: var(--rose-l); }
.menu.open .menu-links a { opacity: 1; transform: none; transition-delay: calc(.3s + var(--i) * .06s); }
.menu-langs { display: flex; gap: 26px; font-size: 13px; }
.menu-langs a { padding: 10px 0; color: var(--rose-l); }
.menu-langs a[aria-current] { color: #fff; background: linear-gradient(currentColor, currentColor) 0 calc(100% - 6px) / 100% 1px no-repeat; }
.menu-langs a[lang="ar"] { font-size: 15px; }

/* ───────── the brick block (intro + page transitions) ───────── */
.curtain { position: fixed; z-index: 60; inset: 0; background: var(--brick); color: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 6px; padding: var(--pad); transform: translateY(101%); pointer-events: none; will-change: transform, clip-path; }
.curtain.on { pointer-events: auto; }
.curtain-n { font-family: var(--light); font-weight: 200; font-size: clamp(64px, 16vw, 180px); line-height: .9; color: var(--rose-l); letter-spacing: -.03em; }
.curtain-t { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }

/* ───────── reveals ───────── */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
/* the wrapper is what gets observed, so the clip sits on the image inside it */
.unveil { display: block; overflow: hidden; background: var(--plate); }
.unveil > img { width: 100%; clip-path: inset(0 0 100% 0); transform: scale(1.14); transition: clip-path 1.25s var(--ease-io), transform 1.9s var(--ease); transition-delay: var(--d, 0s); }
.unveil.in > img { clip-path: inset(0); transform: none; }
.now, .now > img { transition: none !important; }   /* already seen: no replay when coming back */

/* images that open in the viewer */
.zoom { display: block; cursor: zoom-in; }
.zoom.unveil { width: 100%; }

/* ───────── home: hero ───────── */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #2a2725; }
.hero-img { position: absolute; inset: -6% 0; will-change: transform; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; transform: scale(1.16); transition: transform 2.6s var(--ease); }
.hero.in .hero-img img { transform: none; }
/* a little film grain keeps the enlarged photograph crisp on big screens */
.hero-img::after { content: ''; position: absolute; inset: 0; opacity: .16; mix-blend-mode: overlay; pointer-events: none; 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.1 -.1'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero-block { position: absolute; inset-inline-start: 0; top: clamp(84px, 13vh, 150px); width: fit-content; min-width: min(78vw, 420px); max-width: 94vw; background: var(--brick); color: #fff; padding-block: clamp(26px, 4.6vw, 46px) clamp(22px, 3.4vw, 36px); padding-inline: var(--pad) clamp(30px, 6vw, 88px); }
.hero-block h1 { font-family: var(--light); font-weight: 300; font-size: clamp(44px, 9.4vw, 96px); line-height: 1; letter-spacing: -.025em; margin-block: clamp(22px, 5vw, 60px) clamp(18px, 3vw, 34px); margin-inline-start: -.04em; }
.hero-block h1 span { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero-block h1 i { display: block; font-style: normal; transform: translateY(112%); transition: transform 1.1s var(--ease); }
.hero-block .sc { display: block; opacity: 0; transition: opacity .9s .5s; }
.hero-block .sc.dim { color: var(--rose-l); }
.hero.in .hero-block h1 i { transform: none; }
.hero.in .hero-block h1 span:nth-child(2) i { transition-delay: .09s; }
.hero.in .hero-block .sc { opacity: 1; }
.hero-cue { position: absolute; inset-inline-start: var(--pad); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); color: #fff; display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity 1s 1.1s; }
.hero.in .hero-cue { opacity: 1; }
body.scrolled .hero.in .hero-cue { opacity: 0; transition: opacity .5s; }
.hero-cue::before { content: ''; width: 1px; height: 34px; background: #fff; transform-origin: top; animation: cue 2.2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ───────── home: statement ───────── */
.statement { padding: clamp(90px, 17vh, 190px) var(--pad) clamp(70px, 13vh, 150px); }
.statement p { font-family: var(--light); font-weight: 300; font-size: clamp(26px, 4.7vw, 62px); line-height: 1.22; letter-spacing: -.02em; max-width: 19em; color: var(--rose-l); text-wrap: balance; }
.statement p span { transition: color .5s; }
.statement p span.lit { color: var(--brick); }
.statement .sc { display: block; margin-top: clamp(28px, 4vw, 48px); color: var(--rose-t); }

/* ───────── home: works ───────── */
.works { padding: 0 var(--pad) var(--sec); }
.sec-head { display: flex; justify-content: space-between; gap: 20px; color: var(--rose-t); padding-bottom: clamp(18px, 3vw, 34px); }
.row { position: relative; display: grid; grid-template-columns: clamp(34px, 5vw, 70px) 1fr auto; align-items: baseline; column-gap: 12px; padding: clamp(8px, 1.5vw, 16px) 0; }
.row .n { font-size: 12px; font-weight: 500; color: var(--rose-t); }
.row .t { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: clamp(30px, 7.2vw, 104px); line-height: 1; color: var(--brick); letter-spacing: .005em; padding-top: .12em; }
.row .m { text-align: end; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); line-height: 1.6; }
.row .m b { display: block; font-weight: 500; color: var(--brick); }
.row .th { display: none; }
.row:focus-visible { outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .works.hovering .row { opacity: .28; transition: opacity .5s, transform .7s var(--ease); }
  .works.hovering .row:hover { opacity: 1; transform: translateX(calc(var(--dir) * clamp(8px, 1.6vw, 26px))); }
}
/* touch: each work becomes a card with its image */
@media (hover: none), (max-width: 720px) {
  .row { grid-template-columns: 34px 1fr; row-gap: 10px; padding: 0 0 34px; }
  .row .th { display: block; grid-column: 1 / -1; aspect-ratio: 16 / 10; overflow: hidden; }
  .row .th img { width: 100%; height: 100%; object-fit: cover; }
  .row .m { grid-column: 2; text-align: start; }
  .row .t { font-size: clamp(30px, 9vw, 54px); }
  .row:active .th img { transform: scale(1.03); transition: transform .5s var(--ease); }
}

/* cursor-following preview */
.peek { position: fixed; z-index: 30; left: 0; top: 0; width: clamp(240px, 26vw, 420px); aspect-ratio: 16 / 10; pointer-events: none; overflow: hidden; clip-path: inset(50% 50% 50% 50%); transition: clip-path .6s var(--ease-io); will-change: transform; background: var(--rose-l); }
.peek.on { clip-path: inset(0); }
.peek img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: transform .9s var(--ease); }
.peek.on img { transform: none; }
@media (hover: none), (max-width: 720px) { .peek { display: none; } }

/* ───────── home: one project in focus ───────── */
.feature { padding: 0 var(--pad) var(--sec); display: grid; gap: clamp(22px, 4vw, 44px); }
.feature-img { margin-inline: calc(var(--pad) * -1); }
.feature-img img { aspect-ratio: 16 / 10; object-fit: cover; }
.feature-txt { display: grid; gap: 14px; justify-items: start; align-content: end; }
.feature-txt .sc { color: var(--rose-t); }
.feature-txt h2 { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: clamp(34px, 6vw, 84px); line-height: .96; color: var(--brick); padding-top: .12em; }
.feature-txt p { max-width: 46ch; }
.feature-txt .meta { color: var(--grey); letter-spacing: .1em; }
@media (min-width: 860px) {
  .feature { grid-template-columns: minmax(0, 7.4fr) minmax(280px, 4.6fr); column-gap: clamp(36px, 5vw, 80px); align-items: end; }
  .feature-img { margin-inline: calc(var(--pad) * -1) 0; }
  .feature-img img { aspect-ratio: 3 / 2; }
  .feature-txt .cta { padding-bottom: 4px; }   /* its line sits exactly on the foot of the image */
}

/* ───────── home: practice ───────── */
.practice { padding: 0 var(--pad) var(--sec); }
.practice .lead, .approach .lead { font-family: var(--light); font-weight: 300; font-size: clamp(22px, 3.3vw, 46px); line-height: 1.26; letter-spacing: -.018em; color: var(--brick); max-width: 18em; text-wrap: balance; }
.practice .lead { max-width: 21em; margin-bottom: clamp(30px, 5vw, 70px); }
.trio { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 30px); margin-bottom: clamp(26px, 4vw, 50px); }
.trio a { display: block; }
.trio a:first-child { grid-column: 1 / -1; }
.trio img { aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.4s var(--ease), clip-path 1.25s var(--ease-io); }
.trio a:first-child img { aspect-ratio: 16 / 10; }
.trio a:hover .unveil.in > img { transform: scale(1.04); }
.trio .cap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-top: 10px; }
.trio .cap b { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: 15px; color: var(--brick); padding-top: .2em; }
.trio .cap i { font-style: normal; font-size: 11px; letter-spacing: .06em; color: var(--grey); }
/* wide screens: three sizes, all standing on the same line, captions on one row */
@media (min-width: 860px) {
  .trio { grid-template-columns: 5fr 4fr 3fr; align-items: end; }
  .trio a:first-child { grid-column: auto; }
  .trio a:first-child img { aspect-ratio: 4 / 3; }
  .trio a:nth-child(3) img { aspect-ratio: 4 / 5; }
  .trio .cap { flex-wrap: nowrap; white-space: nowrap; }
}

/* ───────── home: photography strip ───────── */
.photos { padding: 0 0 var(--sec); overflow: hidden; }
.photos .sec-head { padding-inline: var(--pad); }
.belt { display: flex; gap: clamp(10px, 1.4vw, 20px); width: max-content; will-change: transform; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.belt:active { cursor: grabbing; }
.belt img { height: clamp(220px, 44vh, 460px); width: auto; max-width: none; flex: none; -webkit-user-drag: none; filter: grayscale(1); background: var(--plate); }

/* ───────── home: approach ───────── */
.approach { padding: 0 var(--pad) clamp(80px, 14vh, 160px); display: grid; gap: clamp(28px, 5vw, 70px); }
.approach .cols { display: grid; gap: clamp(26px, 4vw, 60px); }
.approach .lbl { color: var(--rose-t); margin-bottom: 12px; }
.approach li { padding: 3px 0; }
.approach .por { max-width: 300px; }
@media (min-width: 860px) {
  .approach { grid-template-columns: minmax(220px, 28%) 1fr; column-gap: clamp(40px, 7vw, 120px); align-items: start; }
  .approach .por { grid-row: 1 / span 2; max-width: 400px; }
  .approach .lead { grid-column: 2; margin-top: -.2em; }   /* the top of the letters meets the top of the portrait */
  .approach .cols { grid-column: 2; grid-template-columns: 1fr 1fr; max-width: 900px; }
}

/* ───────── footer / contact: the closing page, a brick field beside a photograph (as the site opens) ───────── */
.contact { background: var(--brick); color: #fff; display: grid; }
.contact-main { display: flex; flex-direction: column; min-width: 0; padding: clamp(60px, 11vh, 130px) var(--pad) calc(26px + env(safe-area-inset-bottom, 0px)); }
.contact .sc { color: var(--rose-l); }
.invite { font-family: var(--light); font-weight: 300; font-size: clamp(48px, 8.6vw, 128px); white-space: nowrap; line-height: 1; letter-spacing: -.035em; margin: clamp(18px, 3vw, 36px) 0 clamp(14px, 2vw, 28px); margin-inline-start: -.04em; }
.invite span { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.invite i { display: block; font-style: normal; transform: translateY(112%); transition: transform 1.2s var(--ease); }
.invite span:nth-child(2) i { transition-delay: .09s; }
.invite.in i { transform: none; }
.mail-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px clamp(18px, 3vw, 40px); margin-bottom: clamp(44px, 8vw, 100px); }
.mail { font-family: var(--light); font-weight: 300; font-size: clamp(20px, 2.9vw, 40px); letter-spacing: -.02em; line-height: 1.2; padding-bottom: .1em; color: var(--rose-l); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: color .4s; overflow-wrap: anywhere; }
.mail:hover, .mail:focus-visible { color: #fff; }
.copy { padding: 8px 0; transition: color .3s; }
.copy:hover, .copy.done { color: #fff; }
.contact .grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: auto; }
.contact .grid > div { line-height: 1.9; }
.contact .grid a { display: block; width: max-content; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.contact .grid a:hover, .contact .grid a:focus-visible { background-size: 100% 1px; }
.contact .grid .sc { display: block; margin-bottom: 10px; }
.clock { display: block; color: var(--rose-l); font-variant-numeric: tabular-nums; }
.contact .end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; white-space: nowrap; margin-top: clamp(44px, 7vw, 90px); color: var(--rose-l); }
.contact .end a { padding: 8px 0; margin: -8px 0; transition: color .3s; }
.contact .end a:hover, .foot-langs a[aria-current] { color: #fff; }
.foot-langs { display: flex; gap: 18px; }
.foot-langs a[lang="ar"] { font-size: 13px; letter-spacing: 0; }
/* the photograph: above the block on a phone, beside it on a wide screen */
.contact-photo { position: relative; order: -1; height: 46svh; min-height: 260px; overflow: hidden; background: #2a2725; }
.contact-photo .unveil { position: absolute; inset: 0; background: none; }
.contact-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: grayscale(1); }
.contact-photo .over { clip-path: inset(100% 0 0 0); }
.contact-photo .over:not([src]) { visibility: hidden; }
@media (min-width: 860px) {
  .contact.has-photo { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); min-height: min(92svh, 900px); }
  .contact-photo { order: 0; height: auto; }
}

/* ───────── project page ───────── */
.p-hero { position: relative; height: 92svh; min-height: 520px; overflow: hidden; background: #2a2725; color: #fff; }
.p-hero .img { position: absolute; inset: -8% 0; will-change: transform; }
.p-hero .img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 2.4s var(--ease); }
.p-hero.in .img img { transform: none; }
.p-hero::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(rgba(20, 12, 10, 0), rgba(20, 12, 10, .62)); }
.p-hero .meta { position: absolute; z-index: 2; left: var(--pad); right: var(--pad); bottom: clamp(22px, 4vw, 48px); display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.p-hero .meta .sc { opacity: 0; transition: opacity .9s .5s; }
.p-hero.in .meta .sc { opacity: 1; }
.p-hero h1 { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: clamp(40px, 9.5vw, 148px); line-height: .92; letter-spacing: .005em; margin-top: 12px; overflow: hidden; text-wrap: balance; }
.p-hero h1 i { display: block; font-style: normal; transform: translateY(105%); transition: transform 1.15s .15s var(--ease); padding-top: .12em; }
.p-hero.in h1 i { transform: none; }
.p-hero .num { font-size: clamp(54px, 11vw, 170px); color: #fff; opacity: 0; transform: translateY(18px); transition: opacity 1s .35s, transform 1.2s .35s var(--ease); }
.p-hero.in .num { opacity: .9; transform: none; }
.p-intro { display: grid; gap: 30px; padding: clamp(50px, 9vw, 120px) var(--pad); }
.p-intro .facts { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; justify-content: start; }
.p-intro .facts dt { color: var(--rose-t); margin-bottom: 4px; font-size: 10px; }
.p-intro .txt { max-width: 62ch; }
@media (min-width: 860px) {
  .p-intro { grid-template-columns: minmax(180px, 26%) 1fr; }
  .p-intro .facts { grid-template-columns: 1fr; gap: 16px; }
}
.blk { padding: 0 var(--pad) var(--gap); }
.blk.wide { padding-inline: 0; }
.blk figcaption, .cap { font-size: 11px; letter-spacing: .06em; color: var(--grey); margin-top: 12px; }
.blk.wide figcaption { padding-inline: var(--pad); }
/* drawings sit on white and always fit the screen: never wider than the column, never taller than the window */
.blk.narrow figure, .blk.pair figure { width: min(100%, calc(84svh * var(--ar, 1.45))); }
.blk.pair { display: grid; gap: clamp(30px, 4vw, 60px); align-items: start; }
.blk.text { display: grid; gap: 14px 30px; }
.blk.text .sc { color: var(--rose-t); }
.blk.text p { max-width: 62ch; }
/* One grid for the whole project page: a narrow column for labels, then the column where paragraphs, drawings
   and captions all start on the same line. */
@media (min-width: 860px) {
  .blk.pair { grid-template-columns: 1fr 1fr; }
  .blk.text { grid-template-columns: minmax(180px, 26%) 1fr; }
  .blk.narrow figure { margin-inline-start: calc(max(180px, 26%) + 30px); width: min(100% - max(180px, 26%) - 30px, calc(84svh * var(--ar, 1.45))); }
  .blk.wide figcaption { padding-inline-start: calc(var(--pad) + max(180px, (100% - 2 * var(--pad)) * .26) + 30px); }
}

/* quote over image */
.quote { position: relative; min-height: 86svh; display: flex; align-items: flex-end; overflow: hidden; color: #fff; margin-bottom: var(--gap); background: #2a2725; }
.quote .img { position: absolute; inset: -8% 0; will-change: transform; }
.quote .img img { width: 100%; height: 100%; object-fit: cover; }
.quote::after { content: ''; position: absolute; inset: 30% 0 0; background: linear-gradient(rgba(20, 12, 10, 0), rgba(20, 12, 10, .7)); }
.quote p { position: relative; z-index: 2; font-family: var(--light); font-weight: 300; font-size: clamp(24px, 4.2vw, 58px); line-height: 1.22; letter-spacing: -.02em; max-width: 18em; padding: var(--pad); text-wrap: balance; }

/* ribbon: drawings slide sideways while you scroll down */
.ribbon { position: relative; margin-bottom: var(--gap); }
.ribbon .stick { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.ribbon .head { display: flex; justify-content: space-between; color: var(--rose-t); padding: 0 var(--pad) clamp(16px, 3vh, 34px); }
.ribbon .track { display: flex; gap: clamp(30px, 6vw, 110px); padding-inline: var(--pad); width: max-content; will-change: transform; }
.ribbon figure { flex: none; }
.ribbon figure img { height: clamp(150px, 46vh, 470px); width: auto; max-width: none; }
.ribbon .bar { margin: clamp(18px, 3vh, 34px) var(--pad) 0; height: 1px; background: var(--hair); }
.ribbon .bar i { display: block; height: 1px; background: var(--brick); width: 100%; transform-origin: left; transform: scaleX(0); }
/* touch: swipe sideways instead */
.ribbon.swipe .stick { position: static; height: auto; }
.ribbon.swipe .track { overflow-x: auto; width: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ribbon.swipe .track::-webkit-scrollbar { display: none; }
.ribbon.swipe figure { scroll-snap-align: start; }
.ribbon.swipe figure img { height: 34vh; }
.ribbon.swipe .bar { display: none; }

/* next project */
.next { position: relative; display: block; height: 78svh; min-height: 420px; overflow: hidden; color: #fff; background: var(--brick); }
.next .img { position: absolute; inset: 0; opacity: .5; transition: opacity .8s, transform 1.6s var(--ease); }
.next .img img { width: 100%; height: 100%; object-fit: cover; }
.next:hover .img, .next:focus-visible .img { opacity: .78; transform: scale(1.05); }
.next:focus-visible { outline-offset: -6px; }
.next .in { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(22px, 4vw, 48px); display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.next h2 { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: clamp(34px, 8vw, 120px); line-height: .92; margin-top: 12px; padding-top: .12em; text-wrap: balance; }
.next .num { font-size: clamp(48px, 10vw, 150px); color: #fff; transition: transform 1.2s var(--ease); }
.next:hover .num { transform: translateX(calc(var(--dir) * -10px)); }

/* professional gallery */
.pro-head { padding: clamp(110px, 20vh, 200px) var(--pad) clamp(40px, 7vw, 90px); background: var(--brick); color: #fff; }
.pro-head .num { font-size: clamp(64px, 14vw, 190px); color: var(--rose-l); display: block; }
.pro-head h1 { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: clamp(38px, 8.6vw, 130px); line-height: .92; margin: 18px 0 16px; padding-top: .12em; }
.pro-head p { color: var(--rose-l); max-width: 52ch; }
.gallery { padding: clamp(40px, 7vw, 100px) var(--pad); display: grid; gap: clamp(34px, 5vw, 80px) clamp(20px, 3vw, 50px); }
.gallery figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; }
.gallery figcaption b { font-family: var(--caps); font-weight: 700; text-transform: uppercase; font-size: 15px; color: var(--brick); padding-top: .2em; }
.gallery figcaption span { font-size: 11px; letter-spacing: .06em; color: var(--grey); text-align: end; }
/* wide screens: one image across, then two side by side standing on the same line, and so on */
@media (min-width: 860px) {
  .gallery { grid-template-columns: 1fr 1fr; align-items: end; }
  .gallery figure:nth-child(3n+1) { grid-column: 1 / -1; }
}

/* ───────── viewer ───────── */
.viewer { position: fixed; z-index: 70; inset: 0; background: #fff; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; }
.viewer.on { opacity: 1; visibility: visible; transition: opacity .35s; }
.viewer-top, .viewer-bot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: calc(8px + env(safe-area-inset-top, 0px)) var(--pad) 8px; color: var(--brick); }
.viewer-bot { padding: 8px var(--pad) calc(10px + env(safe-area-inset-bottom, 0px)); align-items: flex-start; }
.viewer-n { color: var(--rose-t); font-variant-numeric: tabular-nums; }
.viewer button { padding: 12px 0; }
.viewer-nav { display: flex; gap: clamp(18px, 3vw, 34px); flex: none; }
.viewer.single .viewer-nav, .viewer.single .viewer-n { visibility: hidden; }
.viewer-cap { font-size: 11px; letter-spacing: .06em; color: var(--grey); padding: 12px 0; min-height: 1em; }
.viewer-in { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 4px 16px; cursor: zoom-in; overscroll-behavior: contain; }
.viewer-in img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transform: scale(.985); transition: opacity .45s, transform .7s var(--ease); }
.viewer-in img.ready { opacity: 1; transform: none; }
.viewer.mono .viewer-in img { filter: grayscale(1); }
.viewer.zoom .viewer-in { cursor: zoom-out; }
.viewer.zoom .viewer-in img { max-width: none; max-height: none; }

/* ───────── a wrong address: an empty plot ───────── */
.lost { min-height: 100svh; background: var(--brick); color: #fff; padding: clamp(96px, 16vh, 170px) var(--pad) clamp(40px, 7vw, 90px); display: grid; gap: clamp(28px, 5vw, 60px); align-content: space-between; }
.plot { width: min(100%, 640px); height: auto; fill: none; stroke: var(--rose-l); stroke-width: 1.2; overflow: visible; }
.plot .edge { stroke-dasharray: 9 7; stroke-dashoffset: 1500; opacity: 0; transition: stroke-dashoffset 2.4s var(--ease), opacity .6s; }
.plot .pegs { fill: var(--brick); }
.plot .north path { fill: var(--rose-l); stroke: none; }
.plot .pegs, .plot .north, .plot .bar { opacity: 0; transition: opacity .9s .9s; }
.lost.in .plot .edge { stroke-dashoffset: 0; opacity: 1; }
.lost.in .plot .pegs, .lost.in .plot .north, .lost.in .plot .bar { opacity: 1; }
.lost-txt { display: grid; gap: 14px; justify-items: start; }
.lost-txt .sc { color: var(--rose-l); }
.lost-txt h1 { font-family: var(--light); font-weight: 300; font-size: clamp(34px, 6.4vw, 96px); line-height: 1.04; letter-spacing: -.03em; max-width: 12em; text-wrap: balance; }
.lost-txt p { color: var(--rose-l); }
.lost-txt .cta { color: #fff; }

/* ───────── small pleasures ───────── */
/* the lens over drawings */
.loupe { position: fixed; z-index: 35; left: 0; top: 0; width: clamp(150px, 15vw, 210px); aspect-ratio: 1; border-radius: 50%; pointer-events: none; background-color: #fff; background-repeat: no-repeat; box-shadow: 0 0 0 1px var(--brick), 0 0 0 5px #fff, 0 18px 50px rgba(30, 27, 26, .25); opacity: 0; scale: .7; transition: opacity .25s, scale .4s var(--ease); will-change: transform; }
.loupe.on { opacity: 1; scale: 1; }
@media (hover: hover) and (pointer: fine) { .blk.narrow .zoom, .blk.pair .zoom { cursor: crosshair; } }
/* key G: the construction lines of the page */
.guides { position: fixed; z-index: 45; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(180, 130, 111, .2) 27px 28px); }
.guides.on { opacity: 1; }
.guides i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rose); }
.g-m1 { inset-inline-start: var(--pad); }
.g-m2 { inset-inline-end: var(--pad); }
.g-c1 { inset-inline-start: calc(var(--pad) + max(180px, (100% - 2 * var(--pad)) * .26)); }
.g-c2 { inset-inline-start: calc(var(--pad) + max(180px, (100% - 2 * var(--pad)) * .26) + 30px); }
@media (max-width: 859px) { .g-c1, .g-c2 { display: none; } }
.g-note { position: absolute; inset-inline-start: var(--pad); bottom: 14px; background: var(--brick); color: #fff; padding: 6px 10px; }
/* typing "ksar": drawings as white lines on brick */
.blk .zoom, .ribbon .zoom { transition: background-color .7s; }
.blk.narrow .zoom img, .blk.pair .zoom img, .ribbon .zoom img { transition: clip-path 1.25s var(--ease-io), transform 1.9s var(--ease), filter .7s; }
body.blueprint .blk.narrow .zoom, body.blueprint .blk.pair .zoom, body.blueprint .ribbon .zoom { background-color: var(--brick); }
body.blueprint .blk.narrow .zoom img, body.blueprint .blk.pair .zoom img, body.blueprint .ribbon .zoom img { filter: grayscale(1) invert(1) contrast(1.25); mix-blend-mode: screen; }
/* the address is copied: stamped */
.stamp { align-self: center; border: 1px solid currentColor; outline: 1px solid currentColor; outline-offset: 2px; padding: 5px 10px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--rose-l); rotate: -5deg; animation: stamp 2.8s var(--ease) both; }
@keyframes stamp { 0% { opacity: 0; scale: 1.8; } 7% { opacity: 1; scale: 1; } 86% { opacity: 1; } 100% { opacity: 0; } }
/* five taps on the © line: the wordmark of the booklet */
.wordmark { position: fixed; z-index: 65; inset: 0; background: var(--brick); color: #fff; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: var(--pad); opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.wordmark.on { opacity: 1; visibility: visible; transition: opacity .5s; }
.wordmark b { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: clamp(64px, 17vw, 260px); line-height: .9; letter-spacing: -.055em; translate: 0 24%; transition: translate 1s var(--ease); }
.wordmark.on b { translate: 0 0; }
.wordmark .sc { color: var(--rose-l); padding-bottom: .6em; }

/* ───────── Arabic: right to left ─────────
   The page mirrors by itself. What follows is what an Arabic face needs: no letter spacing (the letters join),
   more line height, a slightly larger text; and the strips that move sideways keep their own direction. */
[lang="ar"] body { font-family: var(--arabic); font-size: 16px; line-height: 1.95; }
[lang="ar"] * { letter-spacing: 0 !important; }
[lang="ar"] .sc, [lang="ar"] .nav a, [lang="ar"] .nav button, [lang="ar"] .curtain-t { font-size: 13px; }
[lang="ar"] .hero-block h1, [lang="ar"] .statement p, [lang="ar"] .lead, [lang="ar"] .quote p, [lang="ar"] .menu-links a { line-height: 1.5; }
[lang="ar"] .hero-block h1 { font-size: clamp(40px, 8.4vw, 88px); }
[lang="ar"] .hero-block h1 span { padding-bottom: .22em; margin-bottom: -.22em; }
[lang="ar"] .row .t, [lang="ar"] .feature-txt h2, [lang="ar"] .next h2, [lang="ar"] .pro-head h1, [lang="ar"] .p-hero h1 { line-height: 1.3; }
[lang="ar"] .p-hero h1 i { padding-bottom: .16em; }
[lang="ar"] .blk figcaption, [lang="ar"] .cap, [lang="ar"] .viewer-cap, [lang="ar"] .row .m, [lang="ar"] .gallery figcaption span, [lang="ar"] .trio .cap i { font-size: 13px; }
[lang="ar"] .trio .cap b, [lang="ar"] .gallery figcaption b { font-size: 17px; }
[dir="rtl"] .mail-row { justify-content: flex-start; }
[lang="ar"] .invite { line-height: 1.4; font-size: clamp(48px, 9vw, 130px); }
[lang="ar"] .invite span { padding-bottom: .3em; margin-bottom: -.3em; }
[dir="rtl"] .contact .grid a { background-position: 100% 100%; }
[dir="rtl"] .photos { direction: ltr; }
[dir="rtl"] .photos .sec-head { direction: rtl; }
[dir="rtl"] .ribbon .stick { direction: ltr; }
[dir="rtl"] .ribbon .head, [dir="rtl"] .ribbon figcaption { direction: rtl; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
  .rv { opacity: 1; transform: none; }
  .unveil > img, .hero-img img, .p-hero .img img { transform: none; clip-path: none; }
}

/* ───────── printing: the page becomes a drawing sheet with its title block ───────── */
#sheet { display: none; }
@media print {
  @page { margin: 10mm; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 9pt; }
  /* The title block heads the document, on the first sheet. (Tried and dropped: fixing it to the foot of every
     page, where browsers push it onto the next page over the drawings; and closing the document with it, where
     it ended up alone on a last page.) */
  #sheet { display: block; margin-bottom: 6mm; }
  .nav, .curtain, .peek, .viewer, .menu, .hero-cue, .skip, .loupe, .guides, .wordmark, .next, .contact { display: none !important; }
  .rv, .invite i { opacity: 1 !important; transform: none !important; }
  .unveil > img { clip-path: none !important; transform: none !important; }
  .hero, .p-hero, .quote { height: 110mm; min-height: 0; break-inside: avoid; }
  .hero-img, .p-hero .img, .quote .img { inset: 0; transform: none !important; }
  .hero-img img, .p-hero .img img { transform: none !important; }
  .hero-block h1 i, .p-hero h1 i { transform: none !important; }
  .hero-block .sc, .p-hero .meta .sc, .p-hero .num { opacity: 1 !important; transform: none !important; }
  .statement p span { color: var(--brick) !important; }
  .ribbon { height: auto !important; }
  .ribbon .stick { position: static; height: auto; }
  .ribbon .track { transform: none !important; width: auto; flex-wrap: wrap; gap: 8mm; }
  .ribbon figure img { height: 38mm; }
  .ribbon .bar, .ribbon .head span:last-child { display: none; }
  figure, .row, .trio a { break-inside: avoid; }
  .photos { display: none; }
  .cartouche { display: grid; grid-template-columns: 2.4fr 1.6fr 2.6fr 1.7fr .8fr 1.1fr .8fr 1.2fr; border: .3mm solid var(--ink); font-size: 7pt; line-height: 1.35; color: var(--ink); }
  .cartouche > div { padding: 2.2mm 2.6mm; border-inline-start: .3mm solid var(--ink); display: grid; align-content: space-between; gap: 2mm; min-height: 17mm; }
  .cartouche > div:first-child { border-inline-start: 0; }
  .cartouche i { font-style: normal; font-size: 5.6pt; letter-spacing: .14em; text-transform: uppercase; color: var(--rose-t); }
  .cartouche .c-name { align-content: start; gap: .6mm; }
  .cartouche .c-name b { font-family: var(--caps); font-weight: 700; font-size: 10pt; text-transform: uppercase; color: var(--brick); margin-bottom: 1mm; }
}
