/* adelelsiwi.com — plain white gallery wall, ink-black type, the signature as the masthead.
   Ochre accent is taken from the gold grounds of his paintings. */
:root {
  --paper: #ffffff;
  --ink: #171512;
  --muted: #6e685f;
  --rule: #e7e3db;
  --wash: #f6f3ed;
  --ochre: #a26f17;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --arabic: "IBM Plex Sans Arabic", "Geeza Pro", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ochre); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }
[lang="ar"] { font-family: var(--arabic); }
em { font-style: italic; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* ---------- Masthead ---------- */
.site-header {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.signature svg { width: clamp(128px, 14vw, 188px); height: auto; display: block; transition: color .3s; }
.brand:hover .signature svg { color: var(--ochre); }
.brand-name {
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding-left: 2px;
}
.site-nav { display: flex; gap: clamp(18px, 3vw, 40px); padding-bottom: 2px; }
.site-nav a {
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.site-nav a[aria-current="page"] { border-bottom-color: currentColor; }
/* menu: a little larger and firmer so it reads clearly, especially on the homepage without a masthead */
.site-nav a { font-size: 15px; font-weight: 600; letter-spacing: .14em; color: var(--ink); }
.is-home .site-nav a, .is-home .menu-toggle { font-size: 16px; }
.menu-toggle { font-weight: 600 !important; }
/* over the gold leaf, a soft pale halo keeps the menu legible */
.is-home .site-header:has(~ main .stage.at-start) :is(.site-nav a, .menu-toggle) {
  text-shadow: 0 0 2px rgba(250,245,232,.95), 0 0 10px rgba(250,245,232,.8);
}
.menu-toggle { display: none; }

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; align-items: center; padding-top: 20px; padding-bottom: 28px; }
  .menu-toggle {
    display: block;
    font: inherit;
    font-size: 15px;
    letter-spacing: .16em;
    text-transform: uppercase;
    background: none;
    border: 0;
    color: var(--ink);
    padding: 8px 0;
    cursor: pointer;
  }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
  .site-nav.open { display: flex; }
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}
.site-footer [lang="ar"] { font-size: 17px; }

/* ---------- Shared type ---------- */
.page-title { font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; margin: 0 0 32px; letter-spacing: -.005em; }
h2 { font-weight: 400; font-size: 26px; line-height: 1.2; margin: 56px 0 18px; }
.eyebrow, .years, .crumbs {
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs { margin-bottom: 28px; }
.crumbs a:hover { color: var(--ochre); }
.prose p { margin: 0 0 1.05em; }
.prose { max-width: 40em; }
.more {
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  margin-right: 24px;
}

/* ---------- Home ---------- */
.home {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
}
.home-image img { max-height: calc(100vh - 210px); width: auto; margin-left: auto; }
.lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; margin: 0 0 28px; font-weight: 300; }
.home-caption { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); }
@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; }
  .home-image img { max-height: none; width: 100%; margin: 0; }
}

/* ---------- Captions ---------- */
.work-title { margin: 0 0 6px; }
.work-info p, .featured-caption p, .home-caption p { margin: 0 0 2px; font-size: 16px; color: var(--muted); }
.work-info .work-title, .featured-caption .work-title, .home-caption .work-title { font-size: 17px; color: var(--ink); }
.work-series { margin-top: 12px !important; }
.work-series a, .work-exhibited a { border-bottom: 1px solid var(--rule); }
.work-exhibited { margin-top: 4px !important; color: var(--muted); }

/* ---------- Artwork index ---------- */
.featured {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px);
  justify-content: start;
  gap: 16px clamp(24px, 4vw, 56px);
  align-items: end;
  margin-bottom: 96px;
}
.featured .eyebrow { grid-column: 1 / -1; margin: 0; }
.featured-image img { max-height: 78vh; width: auto; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured-image img { max-height: none; width: 100%; } }

.series-row { padding: 28px 0 8px; border-top: 1px solid var(--rule); }
.series-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.series-head h2 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); }
.series-head .view-all { margin-left: auto; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 20px;
  scrollbar-width: thin;
}
.strip .tile { flex: 0 0 auto; scroll-snap-align: start; }
.strip .tile img { height: clamp(170px, 22vw, 260px); width: auto; }
.strip .tile-caption { max-width: 220px; }

/* ---------- Tiles & series grid ---------- */
.tile { display: block; }
.tile img { transition: opacity .25s; background: var(--wash); }
.tile:hover img { opacity: .86; }
.tile-caption { display: block; margin-top: 10px; font-size: 15px; line-height: 1.35; color: var(--muted); }
.tile:hover .tile-caption { color: var(--ochre); }

.series-intro { margin-bottom: 56px; }
.series-intro h1 { font-weight: 400; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05; margin: 0 0 8px; }
.series-intro .years { margin: 0 0 28px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 48px clamp(20px, 3vw, 40px);
  align-items: end;
}
.grid .tile img { width: 100%; height: auto; max-height: 340px; object-fit: contain; object-position: left bottom; background: none; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } }

/* ---------- Single work ---------- */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.work-figure { margin: 0; }
.work-figure img { max-height: calc(100vh - 220px); width: auto; margin: 0 auto; cursor: zoom-in; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.pager a { color: var(--ink); }
.pager a:hover { color: var(--ochre); }
@media (max-width: 820px) {
  .work { grid-template-columns: 1fr; }
  .work-figure img { max-height: none; width: 100%; }
}

/* full-screen view */
.lightbox {
  position: fixed; inset: 0; z-index: 20;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; }

/* ---------- Text pages ---------- */
.text-page { max-width: 760px; }
.portrait { margin: 0 0 40px; max-width: 420px; }
.dated, .biblio { list-style: none; padding: 0; margin: 0; }
.dated li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 17px; }
.dated .year { color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.biblio li { padding: 10px 0 10px 1.4em; text-indent: -1.4em; border-top: 1px solid var(--rule); font-size: 17px; }
.biblio [lang="ar"], .dated [lang="ar"] { font-size: .95em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.toc { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 40px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.toc a { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.plain { list-style: none; padding: 0; margin: 0; columns: 2 260px; column-gap: 40px; }
.plain li { padding: 6px 0; font-size: 17px; break-inside: avoid; }
h2[id] { scroll-margin-top: 24px; }

/* ---------- Exhibitions ---------- */
.exh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px; margin-bottom: 40px; }
.exh-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.exh-meta { display: block; margin-top: 12px; font-size: 16px; color: var(--muted); }
.exh-meta em { color: var(--ink); font-size: 17px; }
.exh-card:hover .exh-meta em { color: var(--ochre); }
.installation { display: grid; gap: clamp(20px, 3vw, 40px); }
.installation figure { margin: 0; }
.installation img { width: 100%; height: auto; }
@media (min-width: 900px) { .installation { grid-template-columns: 1fr 1fr; } .installation figure:first-child { grid-column: 1 / -1; } }

/* ---------- Artwork: featured carousel ---------- */
.carousel { margin-bottom: 88px; }
.carousel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.carousel-nav button {
  font: inherit; font-size: 20px; background: none; border: 1px solid var(--rule); color: var(--ink);
  width: 44px; height: 44px; cursor: pointer; margin-left: 8px;
}
.carousel-nav button:hover { border-color: var(--ink); }
.carousel-track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(24px, 4vw, 56px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 auto; scroll-snap-align: start; }
.slide img { height: min(68vh, 640px); width: auto; }
.slide-caption { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.slide-caption em { color: var(--ink); }
@media (max-width: 600px) { .slide img { height: auto; width: 82vw; } }

/* Artwork carousel drifts on its own; hover right/left to steer */
.carousel-track { scroll-snap-type: none; scroll-behavior: auto; }

/* ---------- Home (site.js drives it) ----------
   One pinned screen. The signature and name never move. The gold leaf gives way to the introduction;
   then paintings rise from the bottom of the screen as you scroll, stay clear for a while, and fade
   as they carry on upwards and out; finally links into the rest of the site. */
.is-home .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 5; max-width: none;
  padding-top: 22px; padding-bottom: 22px; justify-content: flex-end; transition: opacity .6s ease; }
.is-home .site-header .brand { display: none; }
.is-home main { max-width: none; padding: 0; }
.at-sections .site-header { opacity: 0; pointer-events: none; }

.stage { position: relative; height: 800vh; }              /* site.js sets the exact length */
.stage-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--paper); }
.stage-gold {
  position: absolute; inset: 0;
  background: #c9a45c url(/assets/wall-gold.jpg) center / cover no-repeat;
  transition: opacity 1s ease;
}
.stage-gold::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(250,245,232,.4), rgba(250,245,232,0) 110px),
    radial-gradient(ellipse 30% 20% at 50% 50%, rgba(250,245,232,.38), rgba(250,245,232,0) 100%);
}
.stage:not(.at-start) .stage-gold { opacity: 0; }

.identity {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.identity .wall-signature svg { width: min(56vw, 440px); height: auto; display: block; }
.identity h1.wall-name {
  margin: 22px 0 0; white-space: nowrap;
  font-weight: 400; font-size: clamp(22px, 3vw, 44px); line-height: 1;
  letter-spacing: .2em; padding-left: .2em; text-transform: uppercase;
}
.stage.at-start .identity h1.wall-name {
  text-shadow: 0 0 2px rgba(250,245,232,.95), 0 0 10px rgba(250,245,232,.8), 0 0 22px rgba(250,245,232,.5);
}
.stage.at-start .identity .wall-signature svg {
  filter: drop-shadow(0 0 2px rgba(250,245,232,.9)) drop-shadow(0 0 10px rgba(250,245,232,.55));
}

/* text beneath the name: the introduction, then the closing links */
.under > * {
  position: absolute; z-index: 2; left: 50%; top: var(--below-name, calc(50% + 90px));
  transform: translate(-50%, 18px);
  opacity: 0; pointer-events: none; transition: opacity .9s ease, transform .9s ease;
}
.under > .is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.intro { width: min(620px, 80vw); }
.under > .intro.is-fading { transition: none; }   /* follows the scroll exactly (site.js) */
.intro .lede { margin: 0; text-align: center; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.65; font-weight: 300; }
.sections { width: min(1100px, 88vw); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(16px, 2.6vw, 36px); }
.sections a { display: block; padding-top: 14px; border-top: 1px solid var(--ink); }
.sections .sec-title { display: block; font-size: clamp(18px, 1.7vw, 24px); font-weight: 400; letter-spacing: .02em; }
.sections .sec-note { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.sections a:hover .sec-title { color: var(--ochre); }

/* paintings, alternating either side of the name; site.js moves them up and sets their opacity */
.rise { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.frame { position: absolute; top: 0; margin: 0; width: calc(50vw - 340px);
  display: flex; flex-direction: column; opacity: 0; will-change: transform, opacity; }
.frame.is-near { pointer-events: auto; }
.frame img { flex: none; width: auto; height: auto; max-width: 100%; max-height: 64vh;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.12); }
.frame figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.frame figcaption em { color: var(--ink); }
.frame.pos-0 { left: 4vw; align-items: flex-start; }
.frame.pos-1 { right: 5vw; align-items: flex-end; }
.frame.pos-2 { left: 5vw; align-items: flex-start; }
.frame.pos-3 { right: 3vw; align-items: flex-end; }
.frame.pos-4 { left: 5vw; align-items: flex-start; }

.scroll-cue {
  position: absolute; z-index: 2; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 50%; opacity: .6; transition: opacity .6s;
}
.stage:not(.at-start) .scroll-cue { opacity: 0; }

/* a thin strip of the same gold leaf beneath the closing links */
.stage-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: clamp(44px, 9vh, 84px);
  background: #c9a45c url(/assets/wall-gold.jpg) center 60% / cover no-repeat;
  opacity: 0; transform: translateY(100%); transition: opacity 1s ease, transform 1s ease;
}
.at-sections .stage-band { opacity: 1; transform: none; }

/* Phones and narrow screens: there is no room beside the name, so the name sits in a band at the
   top and the paintings, full width, rise up underneath it and fade before they reach it */
@media (max-width: 1080px) {
  .is-home .site-header { padding: 14px var(--gutter); }
  .is-home .site-nav.open { background: var(--paper); padding: 16px var(--gutter) 20px; margin: 0 calc(-1 * var(--gutter));
    width: calc(100% + 2 * var(--gutter)); box-shadow: 0 10px 20px rgba(0,0,0,.06); }
  .identity { top: 0; transform: translateX(-50%); width: 100%; padding: 62px 0 16px; transition: background .6s ease; }
  .stage:not(.at-start) .identity { background: var(--paper); }
  .identity .wall-signature svg { width: min(58vw, 300px); }
  .identity h1.wall-name { font-size: clamp(18px, 5.4vw, 26px); margin-top: 12px; }
  .stage-gold::after { background: linear-gradient(to bottom, rgba(250,245,232,.5), rgba(250,245,232,.15) 45%, rgba(250,245,232,0)); }
  .intro { width: calc(100vw - 2 * var(--gutter)); }
  .intro .lede { font-size: 17px; line-height: 1.6; }
  .sections { width: calc(100vw - 2 * var(--gutter)); grid-template-columns: 1fr 1fr; gap: 22px 18px; }
  .sections a:last-child { grid-column: 1 / -1; }
  .sections .sec-note { font-size: 13px; }
  .frame[class*="pos-"] { left: var(--gutter); right: var(--gutter); width: auto; align-items: center; }
  .frame img { max-height: 52svh; }
  .frame figcaption { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .stage-gold, .under > * { transition: none; } }

.pdf { white-space: nowrap; margin-left: 6px; font-size: 14px; letter-spacing: .04em; border-bottom: 1px solid var(--ochre); color: var(--ochre); }
/* Exhibitions: a show with opening photos carries a strip of them inside the list */
.exh-page { max-width: 980px; }
.dated .has-photos a { border-bottom: 1px solid var(--rule); }
.dated .has-photos a:hover { color: var(--ochre); }
.exh-strip { display: flex; gap: 12px; overflow-x: auto; margin: 14px 0 6px; padding-bottom: 6px; scrollbar-width: thin; }
.exh-strip a { flex: 0 0 auto; border: 0 !important; }
.exh-strip img { height: 150px; width: auto; display: block; }

/* all image rows drift (site.js); no snapping, no visible scrollbar */
.strip, .exh-strip { scroll-snap-type: none; scroll-behavior: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar, .exh-strip::-webkit-scrollbar { display: none; }
.exh-strip img { height: 188px; }   /* 25% larger */

@media (max-width: 600px) {
  .dated li { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; font-size: 16px; }
  .exh-strip img { height: 140px; }
}

/* ---------- Contact ---------- */
.contact form { display: grid; gap: 22px; margin-top: 36px; max-width: 680px; }
.contact label { display: grid; gap: 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact input, .contact textarea {
  font: inherit; font-size: 16px; letter-spacing: normal; text-transform: none; color: var(--ink);
  border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 8px 0; border-radius: 0;
}
.contact textarea { border: 1px solid var(--ink); padding: 12px; resize: vertical; }
.contact input:focus, .contact textarea:focus { outline: none; border-color: var(--ochre); }
.contact .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.contact button {
  justify-self: start; font: inherit; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 0; padding: 14px 28px; cursor: pointer;
}
.contact button:hover { background: var(--ochre); }
.contact .hp { position: absolute; left: -9999px; }
@media (max-width: 600px) { .contact .row2 { grid-template-columns: 1fr; } }
