/* Datum, an architecture and interior studio. One stylesheet for English (ltr)
   and Arabic (rtl): logical properties carry the mirroring, and [dir="rtl"]
   rules only change the Arabic face and a few text treatments. */

:root {
  --bone: #F1EEE7;
  --bone-2: #E7E3D9;
  --paper: #FAF8F3;
  --ink: #1A1A17;
  --ink-2: #2C2A24;
  --slate: #6C685E;
  --clay: #A85638;
  --clay-deep: #8C4329;
  --clay-bright: #CC7350; /* clay accent for dark surfaces, keeps AA contrast */
  --line: rgba(26,26,23,0.14);
  --line-2: rgba(26,26,23,0.07);
  --line-dark: rgba(241,238,231,0.16);
  --line-dark-2: rgba(241,238,231,0.08);
  --display: "Syne", ui-sans-serif, system-ui, sans-serif;
  --sans: "Albert Sans", ui-sans-serif, system-ui, sans-serif;
  --ar: "IBM Plex Sans Arabic", "Albert Sans", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(20px, 5vw, 70px);
  --gut: clamp(54px, 9vw, 150px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--bone); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
[dir="rtl"] body { font-family: var(--ar); line-height: 1.9; }
body.noscroll { overflow: hidden; }

img { display: block; max-width: 100%; }
picture { display: contents; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--clay); color: var(--bone); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.02em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--ar); letter-spacing: 0; font-weight: 700; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--gut); }
/* these two start flush (padding-top:0), so anchor jumps clear the fixed nav */
#work, #capabilities { scroll-margin-block-start: 90px; }

.kicker { display: inline-flex; align-items: center; gap: .7em; font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .04em; color: var(--clay-deep); }
.kicker::before { content: ""; width: 26px; height: 2px; background: currentColor; }
[dir="rtl"] .kicker { font-family: var(--ar); letter-spacing: 0; text-transform: none; font-size: .94rem; }

.display { font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.12; padding-block-end: .04em; }
[dir="rtl"] .display { line-height: 1.3; }
.lat { direction: ltr; unicode-bidi: isolate; }
.num { direction: ltr; unicode-bidi: isolate; font-feature-settings: "tnum" 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; font-family: var(--sans); font-weight: 600; font-size: .9rem; padding: .9em 1.6em; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 0; transition: background .35s var(--ease), color .35s var(--ease); }
[dir="rtl"] .btn { font-family: var(--ar); }
.btn:hover { background: var(--clay); border-color: var(--clay); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
html.js .reveal.d2 { transition-delay: .1s; }
html.js .reveal.d3 { transition-delay: .2s; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------------------------------------------------------------- nav */
.nav { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 60; display: flex; align-items: center; gap: 18px; padding: 18px var(--pad); background: var(--bone); border-block-end: 1px solid transparent; transition: padding .4s var(--ease), border-color .4s var(--ease); }
.nav.scrolled { padding-block: 12px; border-block-end-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .mark { width: 26px; height: 26px; flex: none; color: var(--clay); }
.brand .mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; }
.nav-end { margin-inline-start: auto; display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.nav-links { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.nav-links a { font-size: .92rem; font-weight: 500; color: var(--ink); transition: color .3s; }
.nav-links a:hover { color: var(--clay); }
.nav-links .btn { font-size: .82rem; padding: .65em 1.2em; color: var(--paper); }
.nav-links .btn:hover { color: var(--paper); }
.lang { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lang .globe { width: 16px; height: 16px; }
.lang .globe svg { width: 100%; height: 100%; display: block; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 0; background: transparent; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform .4s var(--ease), opacity .3s; }
body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------- hero */
.hero { padding-block-start: clamp(96px, 13vh, 150px); }
.hero-head { display: grid; grid-template-columns: 1.7fr 1fr; gap: 30px; align-items: end; padding-block-end: clamp(28px, 4vw, 46px); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.7rem); line-height: 1.07; font-weight: 800; padding-block-end: .06em; }
.hero h1 .clay { color: var(--clay); }
.hero-meta { font-size: 1.02rem; color: var(--slate); max-width: 34ch; }
.hero-meta .loc { display: block; color: var(--ink); font-weight: 600; margin-block-end: 6px; }
.hero-img { width: 100%; aspect-ratio: 21 / 9; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .hero-img { aspect-ratio: 4 / 3; } }

/* ---------------------------------------------------------------- approach */
.approach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.approach-copy .display { margin-block: 18px 0; max-width: 16ch; }
.approach-copy p { color: var(--slate); margin-block: 1.2em 0; max-width: 48ch; }
.approach-copy p.lead { color: var(--ink); font-size: 1.16rem; line-height: 1.5; }
.approach-img { aspect-ratio: 5 / 6; overflow: hidden; }
.approach-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- work / portfolio */
.work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-block-end: clamp(26px, 3.5vw, 40px); }
.work-head .display { margin-block-start: 14px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: clamp(26px, 4vw, 44px); border-block-end: 1px solid var(--line); padding-block-end: 18px; }
.filter { font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--slate); background: transparent; border: 0; padding: .4em .2em; position: relative; transition: color .3s; }
[dir="rtl"] .filter { font-family: var(--ar); }
.filter::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -19px; height: 2px; width: 100%; background: var(--clay); transform: scaleX(0); transform-origin: inline-start; transition: transform .4s var(--ease); }
.filter:hover { color: var(--ink); }
.filter.active { color: var(--ink); }
.filter.active::after { transform: scaleX(1); }
.filter .c { color: var(--slate); font-weight: 400; font-feature-settings: "tnum" 1; }

.projects { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2.6vw, 40px) clamp(20px, 2.6vw, 40px); }
.project { cursor: pointer; display: flex; flex-direction: column; transition: opacity .4s var(--ease); }
.project.hide { display: none; }
.project-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bone-2); position: relative; }
.project-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.project:hover .project-photo img { transform: scale(1.04); }
.project-photo .view { position: absolute; inset-block-end: 0; inset-inline-end: 0; background: var(--ink); color: var(--paper); font-size: .78rem; font-weight: 600; letter-spacing: .04em; padding: .7em 1.1em; transform: translateY(100%); transition: transform .4s var(--ease); }
.project:hover .project-photo .view, .project:focus-visible .project-photo .view { transform: none; }
.project:focus-visible { outline: 2px solid var(--clay); outline-offset: 4px; }
.project-info { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-block-start: 16px; }
.project-info h3 { font-size: 1.5rem; font-weight: 700; }
.project-info .yr { font-size: .9rem; color: var(--slate); font-feature-settings: "tnum" 1; }
.project-sub { display: flex; gap: 10px; align-items: center; margin-block-start: 6px; font-size: .9rem; color: var(--slate); }
.project-sub .type { color: var(--clay-deep); font-weight: 600; }
.project-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--slate); }
.project-data { display: none; }

/* ---------------------------------------------------------------- capabilities */
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap { background: var(--bone); padding: clamp(28px, 3.5vw, 48px); }
.cap .ix { font-family: var(--display); font-weight: 700; color: var(--clay-deep); font-size: .9rem; }
.cap h3 { font-size: 1.6rem; margin-block: 14px 12px; font-weight: 700; }
.cap p { color: var(--slate); font-size: .98rem; margin: 0; max-width: 42ch; }

/* ---------------------------------------------------------------- band */
.band { background: var(--ink); color: var(--paper); position: relative; isolation: isolate; overflow: hidden; }
.band .bg { position: absolute; inset: 0; z-index: -2; opacity: .13; }
.band .bg img { width: 100%; height: 100%; object-fit: cover; }
.band .wrap { padding-block: clamp(70px, 11vw, 150px); }
.band-text { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 4vw, 3.1rem); line-height: 1.12; max-width: 20ch; letter-spacing: -.02em; }
[dir="rtl"] .band-text { font-family: var(--ar); letter-spacing: 0; line-height: 1.35; }
.band-text .clay { color: var(--clay-bright); }
.band-sign { margin-block-start: 26px; color: rgba(241,238,231,.6); font-size: .95rem; }

/* ---------------------------------------------------------------- enquiry */
.enquiry-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(36px, 6vw, 84px); align-items: start; }
.enquiry-intro p { color: var(--slate); margin-block-start: 16px; max-width: 40ch; }
.enquiry-intro .contact { margin-block-start: 28px; display: grid; gap: 6px; }
.enquiry-intro .contact a, .enquiry-intro .contact span { color: var(--ink); font-weight: 500; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea { font: inherit; font-size: .96rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; padding: .8em .9em; width: 100%; transition: border-color .3s, box-shadow .3s; }
[dir="rtl"] .field input, [dir="rtl"] .field select, [dir="rtl"] .field textarea { font-family: var(--ar); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(168,86,56,.14); }
.field textarea { resize: vertical; min-height: 96px; }
.field.invalid input, .field.invalid select { border-color: var(--clay-deep); }
.field .err { color: var(--clay-deep); font-size: .8rem; min-height: 1em; }
.form .btn { grid-column: 1 / -1; }
.form-note { grid-column: 1 / -1; font-size: .9rem; color: var(--slate); margin: 0; }
.form-note.alert { color: var(--clay-deep); }

/* ---------------------------------------------------------------- footer */
.footer { background: var(--ink); color: var(--paper); padding-block: clamp(56px, 7vw, 88px) 30px; }
.footer-top { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: clamp(30px, 5vw, 70px); }
.footer .brand-name { color: var(--paper); }
.footer-blurb { color: rgba(241,238,231,.62); margin: 18px 0 20px; max-width: 38ch; }
.socials { display: flex; gap: 12px; }
.socials a { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-dark); color: var(--paper); transition: background .3s, color .3s, border-color .3s; }
.socials a:hover { background: var(--clay); color: var(--paper); border-color: var(--clay); }
.socials svg { width: 18px; height: 18px; }
.footer-col .col-h { display: block; font-family: var(--sans); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--clay-bright); margin: 0 0 16px; font-weight: 700; }
[dir="rtl"] .footer-col .col-h { font-family: var(--ar); letter-spacing: 0; text-transform: none; font-size: .96rem; }
.footer-col a, .footer-col span { display: block; color: rgba(241,238,231,.74); font-size: .94rem; padding-block: 5px; transition: color .3s; }
.footer-col a:hover { color: var(--paper); }
.footer-base { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block-start: clamp(40px, 6vw, 64px); padding-block-start: 24px; border-block-start: 1px solid var(--line-dark); font-size: .84rem; color: rgba(241,238,231,.55); }
.credit { display: inline-flex; align-items: center; gap: 12px; }
.credit-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: rgba(241,238,231,.6); }
[dir="rtl"] .credit-label { letter-spacing: 0; text-transform: none; font-size: .9rem; font-family: var(--ar); }
.wlogo { display: inline-flex; align-items: center; gap: 11px; opacity: .9; transition: opacity .4s var(--ease); }
.wlogo:hover { opacity: 1; }
.wlogo-mark { height: 38px; width: auto; display: block; }
.wlogo-word { height: 26px; width: auto; display: block; }

/* ---------------------------------------------------------------- project detail modal (lightbox) */
.lb { position: fixed; inset: 0; z-index: 95; display: none; }
.lb.open { display: block; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(16,16,14,.8); backdrop-filter: blur(3px); }
.lb-panel { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(880px, 100%); background: var(--paper); overflow-y: auto; box-shadow: -30px 0 70px -40px rgba(0,0,0,.6); transform: translateX(100%); transition: transform .5s var(--ease); }
[dir="rtl"] .lb-panel { inset-inline-end: auto; inset-inline-start: 0; transform: translateX(-100%); }
.lb.open .lb-panel { transform: none; }
.lb-close { position: absolute; inset-block-start: 18px; inset-inline-end: 18px; width: 44px; height: 44px; border-radius: 50%; background: rgba(250,248,243,.92); border: 0; display: grid; place-items: center; color: var(--ink); z-index: 3; }
.lb-close svg { width: 20px; height: 20px; }
.lb-photo { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bone-2); }
.lb-photo img { width: 100%; height: 100%; object-fit: cover; }
.lb-body { padding: clamp(28px, 4vw, 50px); }
.lb-body .type { color: var(--clay); font-weight: 600; font-size: .9rem; }
.lb-body h3 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); margin-block: 8px 0; }
.lb-meta { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(20px, 4vw, 44px); margin-block: 26px 0; border-block-start: 1px solid var(--line); }
.lb-meta .m { padding: 16px 0; border-block-end: 1px solid var(--line-2); }
.lb-meta .m .k { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); }
[dir="rtl"] .lb-meta .m .k { letter-spacing: 0; text-transform: none; }
.lb-meta .m .v { font-weight: 600; margin-block-start: 4px; }
.lb-body .brief { color: var(--slate); margin-block-start: 26px; max-width: 56ch; }
.lb-body .brief p { margin: 0 0 1em; }

/* ---------------------------------------------------------------- modal (enquiry confirm + demo) */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,16,14,.74); }
.modal-card { position: relative; background: var(--paper); max-width: 460px; width: 100%; padding: clamp(30px, 4vw, 46px); text-align: center; }
.modal-card .mark { width: 40px; height: 40px; color: var(--clay); margin: 0 auto 16px; }
.modal-card .mark svg { width: 100%; height: 100%; }
.modal-card h3 { font-size: 1.5rem; }
.modal-card p { color: var(--slate); margin: 12px 0 0; font-size: .98rem; }
.modal-ref { font-size: .86rem; color: var(--slate); margin-block-start: 16px; }
.modal-ref .code { font-family: var(--display); font-weight: 700; color: var(--ink); letter-spacing: .06em; }
.modal-close { margin-block-start: 22px; background: var(--ink); color: var(--paper); border: 0; padding: .8em 2em; font-weight: 600; font-size: .9rem; transition: background .3s; }
.modal-close:hover { background: var(--clay); }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--clay); color: var(--paper); padding: 10px 16px; z-index: 200; }
.skip:focus { inset-inline-start: 12px; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav-toggle { display: flex; }
  .nav-links { position: fixed; inset: 0; z-index: 55; flex-direction: column; justify-content: center; gap: 22px; background: var(--bone); transform: translateX(100%); transition: transform .5s var(--ease); pointer-events: none; }
  [dir="rtl"] .nav-links { transform: translateX(-100%); }
  body.menu-open .nav-links { transform: none; pointer-events: auto; }
  /* overlay is z-index 55 inside the nav, so lift the toggle above it or the
     open menu buries its own close (x). drop the scrolled divider while open. */
  .nav-toggle { position: relative; z-index: 56; }
  body.menu-open .nav { border-block-end-color: transparent; }
  .nav-links a { font-size: 1.3rem; }
  .nav-links .btn { font-size: 1.15rem; }
  .hero-head { grid-template-columns: 1fr; gap: 16px; }
  .approach-grid, .enquiry-grid { grid-template-columns: 1fr; }
  .approach-img { order: -1; aspect-ratio: 4 / 3; }
  .projects { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
}
