/* ===================== Fonts & tokens ===================== */
:root {
  --bg: #f4f0e8;          /* warm cream */
  --bg-2: #efe9df;
  --ink: #211c18;         /* deep warm brown-black */
  --muted: #8a7f72;       /* muted taupe */
  --line: #ddd4c6;        /* hairline */
  --accent: #6b5844;      /* earthy brown */
  --overlay: linear-gradient(to bottom, rgba(22,16,11,0.30) 0%, rgba(22,16,11,0.20) 40%, rgba(22,16,11,0.55) 100%);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
body.loaded { opacity: 1; }
body.leaving { opacity: 0; }
html[lang="ar"] body { font-family: var(--arabic); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

/* paper grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================== Top bar ===================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 44px;
  position: relative;
  z-index: 10;
}
.site-name {
  font-size: 1.45rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 500;
  transition: opacity 0.3s;
}
.site-name:hover { opacity: 0.6; }
html[lang="ar"] .site-name { letter-spacing: 0; font-size: 1.75rem; }
.lang-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  padding: 7px 15px;
  cursor: pointer;
  border-radius: 100px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s;
}
.lang-toggle:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ===================== Landing (index) ===================== */
.landing {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.landing-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 18%;  /* keep faces/heads visible when cropped on wide screens */
  transform: scale(1.08);
  animation: kenburns 22s ease-out forwards;
  z-index: 0;
}
@keyframes kenburns {
  from { transform: scale(1.16); }
  to   { transform: scale(1.0); }
}
.landing::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--overlay);
  z-index: 1;
}
.landing .topbar { z-index: 5; }
.landing .topbar .site-name,
.landing .topbar .lang-toggle { color: #f6f1e8; }
.landing .lang-toggle { border-color: rgba(246,241,232,0.45); }
.landing .lang-toggle:hover { background: #f6f1e8; color: var(--ink); }

.landing-center {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;            /* horizontally centered */
  justify-content: flex-end;      /* ...near the bottom */
  text-align: center;
  color: #f7f2e9;
  padding: 0 24px clamp(64px, 12vh, 130px);
}
.landing-name {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 1.2rem;
  text-shadow: 0 2px 40px rgba(0,0,0,0.45);
  opacity: 0;
  animation: nameIn 1.6s var(--ease) 0.3s forwards;
}
@keyframes nameIn {
  from { opacity: 0; letter-spacing: 0.32em; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; letter-spacing: 0.16em; transform: translateY(0); filter: blur(0); }
}
html[lang="ar"] .landing-name {
  text-transform: none;
  letter-spacing: 0;
  animation-name: nameInAr; /* no letter-spacing — preserves Arabic joining */
}
@keyframes nameInAr {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.landing-sub {
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(247,242,233,0.78);
  margin: 0 0 6vh;
  opacity: 0;
  animation: fadeUp 1.4s var(--ease) 0.7s forwards;
}
html[lang="ar"] .landing-sub { letter-spacing: 0.1em; text-transform: none; }

.enter-options {
  display: flex;
  gap: clamp(0px, 6vw, 90px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.enter-link {
  position: relative;
  font-size: clamp(1rem, 2.1vw, 1.4rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 14px clamp(18px, 4vw, 40px);
  opacity: 0;
  animation: fadeUp 1.3s var(--ease) forwards;
}
.enter-link:nth-child(1) { animation-delay: 1s; }
.enter-link:nth-child(2) { animation-delay: 1.2s; }
.enter-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 0; height: 1px;
  background: #f7f2e9;
  transform: translateX(-50%);
  transition: width 0.45s var(--ease);
}
.enter-link:hover::after { width: 64%; }
html[lang="ar"] .enter-link { letter-spacing: 0.04em; text-transform: none; font-size: clamp(1.15rem, 2.4vw, 1.7rem); }

/* clear call-to-action button on the landing */
.enter-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 40px;
  border: 1px solid rgba(247,242,233,0.75);
  border-radius: 100px;
  color: #f7f2e9;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: clamp(0.92rem, 1.5vw, 1.1rem);
  background: rgba(20,14,9,0.12);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  animation: fadeUp 1.3s var(--ease) 1s forwards, ctaPulse 2.8s ease-in-out 2.6s 2;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), gap 0.4s var(--ease), border-color 0.4s;
  cursor: pointer;
}
html[lang="ar"] .enter-cta { letter-spacing: 0.02em; text-transform: none; font-size: clamp(1.05rem, 1.9vw, 1.28rem); }
.enter-cta:hover {
  background: #f7f2e9;
  color: var(--ink);
  border-color: #f7f2e9;
  gap: 20px;
}
.enter-cta .cta-arrow { transition: transform 0.4s var(--ease); font-size: 1.1em; line-height: 1; }
.enter-cta:hover .cta-arrow { transform: translateX(4px); }
html[lang="ar"] .enter-cta:hover .cta-arrow { transform: translateX(-4px); }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247,242,233,0); }
  50% { box-shadow: 0 0 0 10px rgba(247,242,233,0.10); }
}

/* divider between the two options */
.enter-divider {
  width: 1px; height: 46px;
  background: rgba(247,242,233,0.35);
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.1s forwards;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* scroll cue */
.scroll-cue {
  display: none; /* single-screen hero; CTA sits at the bottom instead */
  position: absolute; left: 50%; bottom: 26px; z-index: 5;
  transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1px solid rgba(247,242,233,0.5);
  border-radius: 20px;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.8s forwards;
}
.scroll-cue::before {
  content: ""; position: absolute; left: 50%; top: 7px;
  width: 3px; height: 7px; border-radius: 3px;
  background: rgba(247,242,233,0.8);
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot { 0%,100%{ transform: translate(-50%,0); opacity: 1;} 50%{ transform: translate(-50%,9px); opacity: 0.2;} }

/* ===================== Reveal on scroll ===================== */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===================== Gallery grid ===================== */
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 14px 44px 110px; }
.gallery-head { text-align: center; margin: 40px 0 64px; }
.gallery-title {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0;
}
html[lang="ar"] .gallery-title { letter-spacing: 0; text-transform: none; }
.gallery-head .rule {
  width: 54px; height: 1px; background: var(--accent);
  margin: 20px auto 0; opacity: 0.5;
}

/* ===================== Album / carousel ===================== */
.album {
  position: relative;
  direction: ltr;            /* keep slide math & arrow sides consistent in RTL */
  margin: 8px 0 0;
}
.car-viewport { overflow: hidden; width: 100%; }
.car-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 46px);
  will-change: transform;
  transition: transform 0.7s var(--ease);
}
.car-slide {
  flex: 0 0 auto;
  height: clamp(300px, 60vh, 600px);
  opacity: 0.4;
  transform: scale(0.84);
  transform-origin: center;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
  cursor: pointer;
}
.car-slide.active { opacity: 1; transform: scale(1); }
.car-slide .frame {
  display: block;
  height: 100%;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 18px 44px rgba(40,30,20,0.16);
  transition: box-shadow 0.6s var(--ease);
}
.car-slide.active .frame { box-shadow: 0 36px 80px rgba(40,30,20,0.30); }
.car-slide img { height: 100%; width: auto; display: block; }

.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(244,240,232,0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(40,30,20,0.14);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.car-arrow:hover { background: var(--ink); color: var(--bg); }
.car-arrow.prev { left: clamp(6px, 2vw, 24px); }
.car-arrow.next { right: clamp(6px, 2vw, 24px); }
.car-arrow:hover.prev { transform: translateY(-50%) translateX(-3px); }
.car-arrow:hover.next { transform: translateY(-50%) translateX(3px); }

.album-meta { text-align: center; margin: 34px auto 0; min-height: 96px; }
.album-meta .a-title {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  transition: opacity 0.4s var(--ease);
}
.album-meta .a-sub {
  color: var(--muted);
  letter-spacing: 0.06em;
  font-size: 1.02rem;
  margin: 8px 0 16px;
}
.album-meta .a-link {
  display: inline-block;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.84rem;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: border-color 0.3s var(--ease);
}
html[lang="ar"] .album-meta .a-link { letter-spacing: 0; text-transform: none; font-size: 1.02rem; }
.album-meta .a-link:hover { border-color: var(--accent); }

.album-dots { display: flex; gap: 11px; justify-content: center; margin-top: 30px; }
.album-dots button {
  width: 9px; height: 9px; padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  transition: background 0.3s, width 0.3s var(--ease), border-radius 0.3s;
}
.album-dots button.on { background: var(--accent); width: 26px; border-radius: 5px; }

@media (max-width: 640px) {
  .car-arrow { width: 44px; height: 44px; font-size: 1.5rem; }
  .car-slide { height: clamp(240px, 46vh, 420px); }
}

/* ===================== Mobile: vertical scrolling stack ===================== */
.stack { display: flex; flex-direction: column; gap: 56px; max-width: 560px; margin: 0 auto; }
.stack-item { display: block; }
.stack-item .frame {
  overflow: hidden;
  border-radius: 5px;
  background: var(--bg-2);
  box-shadow: 0 18px 44px rgba(40,30,20,0.16);
}
.stack-item img { width: 100%; height: auto; display: block; }
.stack-cap { text-align: center; margin-top: 16px; }
.stack-cap .s-title { font-size: 1.6rem; font-style: italic; line-height: 1.2; }
.stack-cap .s-meta { color: var(--muted); font-size: 0.98rem; letter-spacing: 0.04em; margin-top: 3px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 64px 44px;
}
.card { display: block; cursor: pointer; }
.card-img-wrap {
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
  aspect-ratio: 1 / 1;          /* uniform thumbnail size for every painting */
  box-shadow: 0 18px 40px rgba(40,30,20,0.10);
}
.card-img-wrap::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(22,16,11,0);
  transition: background 0.5s var(--ease);
}
.card:hover .card-img-wrap::after { background: rgba(22,16,11,0.10); }
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;            /* fill the square frame; full work shown on the artwork page */
  object-position: center;
  transition: transform 0.9s var(--ease);
}
.card:hover img { transform: scale(1.05); }
.card-caption { margin-top: 18px; text-align: center; }
.card-caption .c-title {
  font-size: 1.5rem; font-style: italic; line-height: 1.2;
  transition: color 0.3s;
}
.card:hover .c-title { color: var(--accent); }
.card-caption .c-meta { color: var(--muted); font-size: 0.95rem; letter-spacing: 0.05em; margin-top: 3px; }

/* ===================== Artwork detail ===================== */
.art { max-width: 1240px; margin: 0 auto; padding: 14px 44px 120px; }
.back-link {
  display: inline-block;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 30px;
  transition: color 0.3s, transform 0.3s var(--ease);
}
html[lang="ar"] .back-link { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.back-link:hover { color: var(--ink); }
.ltr .back-link:hover { transform: translateX(-4px); }

.art-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 72px;
  align-items: start;
}
.art-figure { position: sticky; top: 36px; }
.art-figure img {
  width: 100%;
  box-shadow: 0 30px 70px rgba(40,30,20,0.22);
  cursor: zoom-in;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.art-figure img:hover { box-shadow: 0 38px 90px rgba(40,30,20,0.30); }
.zoom-hint {
  text-align: center; color: var(--muted);
  font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase;
  margin-top: 14px; opacity: 0.7;
}
html[lang="ar"] .zoom-hint { letter-spacing: 0; text-transform: none; }

.art-title {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-style: italic;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.05;
}
.art-specs {
  list-style: none;
  padding: 0;
  margin: 22px 0 38px;
  border-top: 1px solid var(--line);
}
.art-specs li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}
.art-specs .spec-label {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
  align-self: center;
}
html[lang="ar"] .art-specs .spec-label { text-transform: none; letter-spacing: 0; font-size: 0.98rem; }

.section-h {
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  margin: 36px 0 12px;
  font-weight: 500;
  position: relative;
  padding-bottom: 8px;
}
.section-h::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 38px; height: 1px; background: var(--accent); opacity: 0.55;
}
html[lang="ar"] .section-h::after { left: auto; right: 0; }
.prose { font-size: 1.16rem; color: #3a342d; white-space: pre-line; }
.prose.about { font-style: italic; font-size: 1.28rem; color: #2c2620; line-height: 1.7; }

.price-row { margin-top: 40px; font-size: 1.7rem; font-style: italic; }
.price-row .price-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-style: normal;
  display: block;
  margin-bottom: 6px;
}
html[lang="ar"] .price-row .price-label { text-transform: none; letter-spacing: 0; }

.inquire-note { color: var(--muted); margin: 26px 0 18px; font-size: 1.05rem; }
.contact-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.92rem;
  border-radius: 2px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s;
  cursor: pointer;
}
html[lang="ar"] .btn { text-transform: none; letter-spacing: 0; font-size: 1.08rem; }
.btn:hover { transform: translateY(-3px); }
.btn svg { width: 19px; height: 19px; }
.btn-wa { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-wa:hover { background: var(--accent); border-color: var(--accent); }
.btn-email:hover { background: var(--ink); color: var(--bg); }

/* ===================== Lightbox ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(18,13,9,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s var(--ease);
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%; max-height: 92vh;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
  transform: scale(0.96);
  transition: transform 0.5s var(--ease);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 26px; right: 32px;
  color: #f6f1e8; font-size: 2rem; line-height: 1;
  background: none; border: none; cursor: pointer; opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ===================== Empty / coming soon ===================== */
.empty { text-align: center; padding: 18vh 24px; color: var(--muted); }
.empty h2 { font-size: 2.2rem; color: var(--ink); margin-bottom: 10px; font-style: italic; }

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .art-layout { grid-template-columns: 1fr; gap: 40px; }
  .art-figure { position: static; }
  .topbar { padding: 22px 24px; }
  .page-wrap, .art { padding-left: 24px; padding-right: 24px; }
  .enter-options { flex-direction: column; gap: 8px; }
  .enter-divider { width: 46px; height: 1px; }
  .grid { gap: 48px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .landing-bg { animation: none; transform: scale(1); }
  .reveal { opacity: 1; transform: none; }
}
