:root {
  --ink: #102c2d;
  --deep: #0d3031;
  --sand: #f3ecdd;
  --paper: #fffdf8;
  --gold: #c69748;
  --coral: #d5684e;
  --line: rgba(16, 44, 45, .18);
  --display: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  --latin: "DM Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
}
body[dir="ltr"] { font-family: var(--latin); }
body[dir="rtl"] { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  z-index: 100;
  inset-inline-start: 18px;
  top: 12px;
  padding: 10px 16px;
  color: white;
  background: var(--deep);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  height: 94px;
  padding: 0 clamp(22px, 5vw, 80px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { justify-self: start; display: flex; align-items: center; gap: 12px; }
body[dir="ltr"] .brand { justify-self: start; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.brand span { display: grid; line-height: 1.25; }
.brand strong { font-size: .88rem; font-weight: 600; }
.brand small { font: 500 .63rem/1.4 var(--latin); letter-spacing: .15em; color: #627071; }
nav { display: flex; gap: clamp(20px, 3vw, 48px); font-size: .84rem; }
nav a { position: relative; }
nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: -7px; height: 1px; background: var(--coral); transform: scaleX(0); transition: transform .25s ease; }
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }
.language { justify-self: end; width: 46px; height: 34px; border-radius: 99px; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; font: 600 .75rem var(--latin); transition: .2s ease; }
.language:hover { color: var(--paper); background: var(--ink); }
.language:focus-visible, nav a:focus-visible, .button:focus-visible, footer a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 4px;
}

.hero { min-height: calc(100vh - 94px); display: grid; grid-template-columns: minmax(390px, 43%) 1fr; }
.hero-copy { padding: clamp(56px, 8vw, 130px) clamp(26px, 6vw, 100px); display: flex; flex-direction: column; justify-content: center; background: var(--sand); }
.eyebrow { margin: 0 0 25px; color: var(--coral); font-size: .72rem; font-weight: 600; letter-spacing: .08em; }
.hero h1, .story h2, .contact h2 { margin: 0; font-weight: 500; letter-spacing: -.035em; line-height: 1.35; }
body[dir="rtl"] .hero h1,
body[dir="rtl"] .story h2,
body[dir="rtl"] .contact h2 { letter-spacing: -.018em; line-height: 1.45; }
.hero h1 { font-size: clamp(3rem, 5.6vw, 6.6rem); }
.intro { max-width: 580px; margin: 30px 0 0; color: #405657; font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 2; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 26px; margin-top: 36px; }
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 0 24px; border-radius: 999px; font-size: .82rem; font-weight: 600; transition: transform .2s ease, background .2s ease, color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
body[dir="rtl"] .button svg { transform: rotate(180deg); }
.button-primary { color: white; background: var(--deep); }
.button-text { padding-inline: 2px; }
.button-text svg { width: 19px; }
.button-text .fill { fill: currentColor; stroke: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 54px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); }
.stats div { display: grid; }
.stats dt { font: 500 clamp(1.3rem, 2vw, 1.8rem) var(--latin); }
.stats dd { margin: 3px 0 0; color: #647475; font-size: .72rem; }
.hero-art { min-height: 620px; padding: clamp(24px, 4vw, 68px); position: relative; overflow: hidden; display: grid; place-items: center; background: #07191a; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(5, 27, 28, .6)); pointer-events: none; }
.artwork-crop { position: relative; overflow: hidden; aspect-ratio: 1.38; background: #07191a; }
.artwork-crop img { --art-zoom: 1; display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--crop-y, 0)) scale(var(--art-zoom)); transform-origin: top center; transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.artwork-crop.top-slice img { height: auto; object-fit: initial; }
.artwork-crop.contain { background: #e8e2d8; }
.artwork-crop.contain img { object-fit: contain; }
.artwork-crop.poster-crop { aspect-ratio: var(--art-ratio, 1); background: #d8d2c8; }
.artwork-crop.poster-crop img { height: auto; object-fit: initial; --crop-y: calc(-1 * var(--crop-top, 8%)); }
.artwork-crop-hero { width: 100%; max-width: 980px; box-shadow: 0 30px 80px rgba(0, 0, 0, .28); }
.hero-art:hover .artwork-crop img { --art-zoom: 1.02; }
.art-caption { position: absolute; z-index: 1; bottom: 28px; inset-inline: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; color: white; font-size: .78rem; }
#featured-art-meta { direction: ltr; unicode-bidi: isolate; }

.story { padding: clamp(90px, 12vw, 180px) clamp(24px, 7vw, 110px); display: grid; grid-template-columns: .3fr 1.15fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: start; }
.section-number { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font: 500 .75rem var(--latin); }
.story h2 { font-size: clamp(2.3rem, 4.6vw, 5.2rem); }
.story-copy { padding-top: 54px; color: #496061; font-size: clamp(1rem, 1.25vw, 1.15rem); }
.story-copy p { margin-top: 0; }
.story-copy a { display: inline-block; margin-top: 22px; color: var(--ink); font: 600 .82rem var(--latin); border-bottom: 1px solid currentColor; }

.portfolio { padding: clamp(90px, 11vw, 170px) clamp(24px, 7vw, 110px); background: #f6f0e5; }
.portfolio-heading { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(36px, 8vw, 120px); align-items: end; padding-bottom: 55px; border-bottom: 1px solid var(--line); }
.portfolio-heading h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5.8rem); font-weight: 500; letter-spacing: -.055em; line-height: 1.35; }
.portfolio-heading > p { max-width: 420px; margin: 0; color: #617172; }
.artwork-grid { margin-top: 60px; columns: 3 300px; column-gap: clamp(24px, 3vw, 46px); }
.artwork-card { width: 100%; margin: 0 0 clamp(42px, 5vw, 72px); padding: 0; border: 0; color: inherit; background: transparent; text-align: start; cursor: pointer; break-inside: avoid; }
.artwork-card .artwork-crop { box-shadow: 0 22px 55px rgba(16, 44, 45, .13); }
.artwork-card:hover .artwork-crop img, .artwork-card:focus-visible .artwork-crop img { --art-zoom: 1.025; }
.artwork-card:focus-visible { outline: 2px solid var(--coral); outline-offset: 8px; }
.artwork-info { padding-top: 20px; display: grid; gap: 7px; align-items: start; }
.artwork-info h3 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2.3rem); font-weight: 500; }
.artwork-info .latin-title { margin: 0; color: #667576; font: 500 .74rem var(--latin); letter-spacing: .08em; text-transform: uppercase; }
body[dir="ltr"] .artwork-info .latin-title { display: none; }
.artwork-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.artwork-detail {
  min-width: 0;
  padding: 10px 11px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(16, 44, 45, .13);
  border-radius: 10px;
  background: rgba(255, 253, 248, .64);
}
.artwork-detail small { color: #7a8989; font-size: .68rem; line-height: 1.4; }
.artwork-detail strong {
  min-width: 0;
  color: var(--ink);
  font: 600 .78rem/1.55 var(--latin);
  overflow-wrap: anywhere;
}
.artwork-detail.artwork-price strong { color: var(--coral); }

.art-dialog { width: min(1180px, calc(100% - 36px)); max-height: calc(100dvh - 36px); padding: 0; border: 0; color: var(--ink); background: var(--paper); box-shadow: 0 40px 120px rgba(0,0,0,.42); overflow: auto; }
.art-dialog::backdrop { background: rgba(5, 24, 25, .82); backdrop-filter: blur(8px); }
.art-dialog[open] { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr); }
.dialog-close { position: fixed; z-index: 2; inset-inline-end: max(28px, calc((100vw - min(1180px, calc(100% - 36px))) / 2 + 16px)); top: 28px; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: white; background: rgba(13,48,49,.72); cursor: pointer; font: 300 1.7rem/1 var(--latin); }
.dialog-artwork { margin: clamp(26px, 4vw, 56px); align-self: start; }
.dialog-copy { padding: clamp(62px, 7vw, 105px) clamp(30px, 6vw, 88px) clamp(52px, 7vw, 100px); border-inline-start: 1px solid var(--line); }
.dialog-copy h2 { margin: 0; font-size: clamp(2.6rem, 5vw, 5.2rem); font-weight: 500; line-height: 1.25; letter-spacing: -.06em; }
.dialog-meta { margin: 22px 0 42px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dialog-meta .artwork-detail { padding: 12px 14px; background: #f6f0e5; }
.dialog-meta .artwork-detail small { font-family: var(--display); }
.dialog-meta .artwork-detail strong { font-size: .9rem; }
.dialog-description { color: #415758; font-size: 1rem; line-height: 2.1; }
.dialog-description p { margin: 0 0 1.25em; }
.dialog-description:empty { display: none; }

.visual-note { margin-inline: clamp(24px, 7vw, 110px); display: flex; align-items: center; gap: 28px; color: var(--gold); }
.visual-note p { margin: 0; white-space: nowrap; font-size: .75rem; letter-spacing: .08em; }
.visual-note-line { height: 1px; flex: 1; background: var(--line); }

.contact { margin-top: clamp(90px, 12vw, 180px); padding: clamp(80px, 10vw, 150px) clamp(24px, 9vw, 150px); color: white; background: var(--deep); position: relative; overflow: hidden; }
.contact::before { content: "A"; position: absolute; inset-inline-end: -3vw; top: -30%; color: rgba(255,255,255,.035); font: 500 min(42vw, 680px)/1 var(--latin); pointer-events: none; }
.contact .eyebrow { color: #e1b66e; }
.contact h2 { max-width: 900px; font-size: clamp(2.7rem, 6vw, 6.8rem); }
.button-light { margin-top: 42px; color: var(--deep); background: white; }

footer { padding: 36px clamp(24px, 7vw, 110px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: #657576; font-size: .72rem; }
.footer-brand { color: var(--ink); font: 600 .8rem var(--latin); letter-spacing: .18em; }
.footer-brand span { color: var(--gold); }
footer p { margin: 0; font-family: var(--latin); }
footer a { justify-self: end; }

.reveal { opacity: 0; transform: translateY(16px); animation: reveal .75s ease forwards; }
.hero-art { animation-delay: .14s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { animation: none; opacity: 1; transform: none; } * { transition: none !important; } }

/* Tablet: a two-row header, two-column gallery and comfortable touch targets. */
@media (min-width: 641px) and (max-width: 1024px) {
  .site-header {
    height: auto;
    min-height: 112px;
    padding: 14px 32px 12px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 24px;
  }
  .site-header nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: clamp(36px, 8vw, 76px);
    min-height: 40px;
    align-items: center;
  }
  .language { grid-column: 2; grid-row: 1; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-copy { min-height: 610px; padding: 84px clamp(48px, 10vw, 110px); }
  .hero-art { min-height: 68vh; padding: 48px clamp(42px, 9vw, 90px); }
  .story { grid-template-columns: auto 1fr; padding-inline: clamp(42px, 8vw, 84px); }
  .story-copy { grid-column: 2; padding-top: 0; max-width: 620px; }
  .portfolio { padding-inline: clamp(36px, 7vw, 72px); }
  .portfolio-heading { grid-template-columns: 1.25fr .75fr; gap: 46px; }
  .artwork-grid { columns: 2 280px; column-gap: 34px; }
  .art-dialog[open] { grid-template-columns: minmax(280px, .9fr) minmax(330px, 1.1fr); }
  .dialog-artwork { margin: 30px; }
  .dialog-copy { padding: 70px 42px 64px; }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; padding-top: 72px; padding-bottom: 66px; }
  .hero h1 { font-size: clamp(3rem, 14vw, 5.3rem); }
  .hero-art { min-height: 72vh; order: 2; }
  .story { grid-template-columns: auto 1fr; }
  .story-copy { grid-column: 2; padding-top: 0; }
  .portfolio-heading { grid-template-columns: 1fr; }
  .art-dialog[open] { grid-template-columns: 1fr; }
  .dialog-copy { border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* Mobile: compact top identity, persistent thumb-friendly navigation and one-column art. */
@media (max-width: 640px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .site-header {
    height: 72px;
    padding: 0 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    background: var(--paper);
    backdrop-filter: none;
  }
  .site-header nav {
    position: fixed;
    z-index: 12;
    inset-inline: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    height: 58px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 18px;
    color: white;
    background: rgba(7,25,26,.94);
    box-shadow: 0 16px 42px rgba(7,25,26,.3);
    backdrop-filter: blur(16px);
  }
  .site-header nav a {
    min-width: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: .76rem;
    line-height: 1.2;
  }
  .site-header nav a:active { background: rgba(255,255,255,.12); }
  .site-header nav a::after { display: none; }
  .brand img { width: 42px; height: 42px; }
  .brand strong { font-size: .8rem; }
  .brand small { display: none; }
  .language { width: 44px; height: 36px; }
  .hero-copy { padding-inline: 22px; }
  .hero h1 { font-size: clamp(2.65rem, 13vw, 4.2rem); line-height: 1.3; }
  .eyebrow { line-height: 1.7; }
  .intro { margin-top: 22px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .button-text { width: auto; align-self: center; }
  .stats { margin-top: 38px; }
  .stats dt { font-size: 1.2rem; }
  .hero-art { min-height: auto; padding: 28px 14px 78px; }
  .artwork-crop-hero { max-height: 68vh; }
  .art-caption { inset-inline: 20px; bottom: 30px; gap: 16px; }
  .story { display: block; }
  .section-number { margin-bottom: 42px; }
  .story-copy { margin-top: 34px; }
  .portfolio { padding-inline: 20px; }
  .artwork-grid { columns: 1; margin-top: 42px; }
  .artwork-card { margin-bottom: 48px; }
  .artwork-info { padding-top: 16px; }
  .artwork-info h3 { font-size: 1.55rem; }
  .artwork-details { gap: 6px; }
  .artwork-detail { padding: 9px 8px; }
  .artwork-detail small { font-size: .66rem; }
  .artwork-detail strong { font-size: .74rem; }
  .portfolio-heading { padding-bottom: 38px; }
  .art-dialog { width: 100vw; max-width: none; max-height: none; min-height: 100dvh; height: 100dvh; margin: 0; }
  .art-dialog[open] { display: block; }
  .dialog-artwork { margin: 0; aspect-ratio: 1 / 1; }
  .dialog-copy { padding: 38px 22px calc(54px + env(safe-area-inset-bottom)); }
  .dialog-copy h2 { font-size: clamp(2.25rem, 12vw, 3.7rem); }
  .dialog-meta { grid-template-columns: 1fr; gap: 7px; }
  .dialog-meta .artwork-detail { grid-template-columns: 72px 1fr; align-items: baseline; }
  .dialog-close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    inset-inline-end: 14px;
    width: 48px;
    height: 48px;
    background: rgba(13,48,49,.9);
  }
  .visual-note { gap: 15px; }
  .visual-note p { white-space: normal; text-align: center; }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none; }
}

@media (max-width: 380px) {
  .brand strong { font-size: .72rem; }
  .stats { gap: 6px; }
  .stats dd { font-size: .65rem; }
  .hero-copy { padding-inline: 18px; }
  .portfolio { padding-inline: 16px; }
}
