/* =========================================================================
   SARA NOORANI — Night Ground
   The site sits on the near-black of the night paintings' paper.
   Each artwork's enlarged view floods the screen with its own ground colour.
   ========================================================================= */

:root {
  --bg: #121014;
  --bg-deep: #0b0a0d;
  --ink: #ece6da;
  --ink-dim: #a89f92;
  --accent: #45c5ae;
  --rule: #2a2530;
  --pad: clamp(20px, 5vw, 72px);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* The works' colour halos intentionally bleed past their boxes; clip that
   overflow at the page edge so it never creates horizontal scroll. */
html, body {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 340;
  font-size: 17px;
  line-height: 1.65;
  font-optical-sizing: auto;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent); color: var(--bg-deep); }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute; left: var(--pad); top: -60px;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; font-family: var(--sans); font-size: 14px;
  z-index: 100; transition: top .2s; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  font-family: var(--serif); font-weight: 440;
  font-size: 17px; letter-spacing: .01em; text-decoration: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .4s, transform .4s;
}
.brand.brand-visible { opacity: 1; transform: none; }

.site-nav { display: flex; gap: clamp(14px, 3vw, 30px); }
.site-nav a {
  font-family: var(--sans); font-size: 13.5px; letter-spacing: .01em;
  color: var(--ink-dim); text-decoration: none;
  padding: 6px 2px;
  position: relative;
}
.site-nav a::after {
  content: ''; position: absolute; left: 2px; right: 100%; bottom: 1px;
  height: 1px; background: var(--accent);
  transition: right .3s cubic-bezier(.2,.65,.25,1);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 2px; }

@media (max-width: 559px) {
  .brand { display: none; }
  .site-nav { width: 100%; justify-content: space-between; gap: 8px; }
}

/* ---------- shared section scaffolding ---------- */

.wrap { padding-left: var(--pad); padding-right: var(--pad); max-width: 1280px; margin-inline: auto; }

section { padding-block: clamp(56px, 9vw, 130px); }

.section-head { margin-bottom: clamp(32px, 6vw, 72px); max-width: 46ch; }
.section-head h2 {
  font-weight: 300; font-size: clamp(32px, 6vw, 54px);
  line-height: 1.1; letter-spacing: -.01em;
}
.section-note {
  margin-top: 14px;
  font-style: italic; font-weight: 340;
  color: var(--ink-dim); font-size: clamp(16px, 2vw, 18px);
  max-width: 52ch;
}

/* ---------- section heading reveals (class added by JS; no-JS unaffected) -- */

.sh-init { opacity: 0; transform: translateY(18px); }
.sh-in {
  opacity: 1; transform: none;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.65,.25,1);
}

/* ---------- hero ---------- */

.hero { padding-top: clamp(40px, 7vw, 110px); padding-bottom: 0; }

.hero-head { position: relative; }
.hero-head > .wrap { position: relative; z-index: 1; }
.motes {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
}

/* Load sequence: text rises in order, then the painting's lights come on. */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0; transform: translateY(22px);
    animation: rise 1s var(--d, 0s) cubic-bezier(.2,.65,.25,1) forwards;
  }
  @keyframes rise { to { opacity: 1; transform: none; } }
  .rise-art { opacity: 0; animation: bloom 1.5s .5s ease forwards; }
  @keyframes bloom {
    0%   { opacity: 0; filter: brightness(.25) saturate(.6); }
    55%  { opacity: 1; }
    100% { opacity: 1; filter: none; }
  }
}

.hero h1 {
  font-weight: 290; letter-spacing: -.02em;
  font-size: clamp(42px, 10vw, 104px);
  line-height: 1.02;
  text-wrap: balance;
}

.hero-lede {
  margin-top: clamp(20px, 3.5vw, 34px);
  font-size: clamp(18px, 2.6vw, 23px);
  line-height: 1.55;
  max-width: 38ch;
}

/* The show announcement: a quiet glass card on the night ground. */
#exhibition-note {
  margin-top: clamp(28px, 5vw, 48px);
  display: grid; gap: 4px;
  width: fit-content; max-width: min(60ch, 100%);
  padding: 20px 26px 22px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(130deg,
      color-mix(in srgb, var(--accent) 9%, transparent),
      color-mix(in srgb, var(--ink) 4%, transparent) 55%,
      transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .4s ease;
}
#exhibition-note:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
#exhibition-note .ex-kind {
  font-family: var(--sans); font-size: 12.5px; color: var(--accent);
}
#exhibition-note .ex-title {
  font-size: clamp(20px, 3.4vw, 27px); font-weight: 350;
  text-decoration: none; width: fit-content;
}
#exhibition-note .ex-title em { border-bottom: 1px solid color-mix(in srgb, var(--accent) 65%, transparent); padding-bottom: 2px; }
#exhibition-note .ex-title:hover em { border-bottom-color: var(--accent); }
#exhibition-note .ex-where {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim);
  margin-top: 5px;
}

.hero-art { margin-top: clamp(40px, 7vw, 90px); }
.hero-figure {
  display: block; width: 100%; border: 0; padding: 0;
  background: none; cursor: zoom-in;
}
.hero-figure img { width: 100%; }
.hero-caption {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim);
  text-align: right; padding: 12px var(--pad) 0;
}
.hero-caption em { font-family: var(--serif); font-style: italic; font-size: 13.5px; }

/* ---------- work grids ---------- */

.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 6vw, 72px) clamp(24px, 3.5vw, 48px);
  align-items: start;
}

.work { grid-column: 1 / -1; position: relative; z-index: 0; }

/* Each work casts a soft halo of its own paper colour onto the dark page —
   on hover (desktop) or as it passes mid-screen (touch, via .lit). */
.work::before {
  content: ''; position: absolute; inset: -12% -16%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 45%,
    var(--glow, var(--ground)) 0%, transparent 68%);
  opacity: 0; transition: opacity 1.1s ease;
  pointer-events: none;
}
.work:hover::before, .work.lit::before { opacity: .42; }

/* Uniform gallery wall: the first work of each group runs wide, the rest sit
   in clean two-column rows at one consistent ratio. Thumbnails crop to fit —
   the enlarged view always shows the full painting. */
@media (min-width: 820px) {
  .works { grid-template-columns: 1fr 1fr; }
  .work { grid-column: auto; }
  .work:first-child { grid-column: 1 / -1; }
}

.work-img { overflow: hidden; }
.works .work-img { aspect-ratio: 4 / 5; }
.works .work:first-child .work-img { aspect-ratio: 4 / 3; }
@media (min-width: 820px) {
  .works .work:first-child .work-img { aspect-ratio: 2.2 / 1; }
}

/* Hover / touch-lit: the image breathes wider inside its crop. */
.work-img img {
  transition: transform 1.4s cubic-bezier(.2,.6,.2,1), filter 1.4s ease;
}
.work:hover .work-img img,
.work.lit .work-img img,
.work-btn:focus-visible .work-img img {
  transform: scale(1.05);
  filter: saturate(1.08) brightness(1.05);
}

.work-btn {
  display: block; width: 100%; border: 0; padding: 0;
  background: none; cursor: zoom-in;
}
.work-img { display: block; width: 100%; background: var(--bg-deep); }
.work-img img { width: 100%; height: 100%; object-fit: cover; }

.work-cap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-top: 12px;
}
.work-title {
  font-size: 15.5px; font-weight: 360;
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.work:hover .work-title,
.work-btn:focus-visible ~ .work-cap .work-title { border-bottom-color: var(--ground, var(--accent)); }
.work-year { font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim); }

/* ---------- aurora: slow colour weather drifting behind the galleries ------ */

#work { position: relative; z-index: 0; }
.night-band { position: relative; z-index: 0; }

.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora i {
  position: absolute;
  width: min(58vw, 760px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--a) 0%, transparent 62%);
  opacity: .12;
  animation: drift var(--dur, 55s) ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { top: 3%;  left: -20%; --a: #b42d3a; --dur: 47s; }
.aurora i:nth-child(2) { top: 34%; right: -22%; --a: #1f6a8c; --dur: 63s; animation-direction: alternate-reverse; }
.aurora i:nth-child(3) { top: 66%; left: -16%; --a: #a83679; --dur: 55s; }
.aurora-night i:nth-child(1) { --a: #2fa08a; opacity: .1; }
.aurora-night i:nth-child(2) { --a: #c65f8a; opacity: .09; }
.aurora-night i:nth-child(3) { --a: #46519f; opacity: .1; }
@keyframes drift {
  to { transform: translate(14vw, 9vh) scale(1.28) rotate(20deg); }
}

/* ---------- night band ---------- */

.night-band {
  background: var(--bg-deep);
  margin-top: clamp(56px, 9vw, 130px);
  padding-block: clamp(56px, 9vw, 120px);
}

/* ---------- studio strip ---------- */

.studio { padding-bottom: 0; }
.studio-strip {
  display: flex; gap: clamp(18px, 3vw, 36px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px var(--pad) 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.studio-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
/* One consistent height for the whole shelf; widths follow each photo. */
.studio-img {
  display: block;
  height: clamp(250px, 46vh, 400px);
  width: auto;
  background: var(--bg-deep);
}
.studio-img img { height: 100%; width: auto; }
.studio-cap {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim);
  padding-top: 10px;
}
.studio-hint {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim);
  padding: 6px var(--pad) 0;
}

/* ---------- editions ---------- */

.edition {
  border-top: 1px solid var(--rule);
  padding-block: clamp(36px, 6vw, 64px);
  display: grid; gap: 26px;
}
.edition:last-child { border-bottom: 1px solid var(--rule); }

@media (min-width: 820px) {
  .edition { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .edition-img { grid-column: 1 / 6; }
  .edition-info { grid-column: 7 / 13; position: sticky; top: 96px; }
  .edition:nth-child(even) .edition-img { grid-column: 8 / 13; order: 2; }
  .edition:nth-child(even) .edition-info { grid-column: 1 / 7; }
}

.edition-title { font-size: clamp(24px, 3.6vw, 32px); font-weight: 330; }
.edition-meta {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim);
  margin-top: 10px; max-width: 46ch;
}
.edition-soldout { font-family: var(--sans); font-size: 14px; margin-top: 22px; color: var(--ink-dim); }

.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 14px;
  border: 1px solid color-mix(in srgb, currentColor 70%, transparent);
  border-radius: 2px;
  padding: 12px 22px;
  text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}
.buy-btn { margin-top: 24px; }
.btn:hover, .btn:focus-visible {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

.editions-footnote {
  font-family: var(--sans); font-size: 13px; color: var(--ink-dim);
  margin-top: 28px; max-width: 56ch;
}

/* ---------- instagram ---------- */

.ig-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px) { .ig-grid { grid-template-columns: repeat(4, 1fr); } }
.ig-tile {
  display: block; aspect-ratio: 1; overflow: hidden;
  background: var(--bg-deep);
}
.ig-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease, filter .5s ease;
}
.ig-tile:hover img, .ig-tile:focus-visible img {
  transform: scale(1.04); filter: brightness(1.08);
}
.ig-follow { margin-top: 24px; font-family: var(--sans); font-size: 14px; }

/* ---------- about ---------- */

.about-grid { display: grid; gap: clamp(32px, 5vw, 64px); }
@media (min-width: 820px) {
  .about-grid { grid-template-columns: 5fr 7fr; align-items: start; }
  .about-portrait { position: sticky; top: 96px; }
}
.about-portrait img { width: 100%; }
.about-portrait figcaption {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim); padding-top: 10px;
}
.about-text p { max-width: 58ch; }
.about-text p + p { margin-top: 1.2em; }
.about-ig {
  margin-top: 1.8em; font-family: var(--sans); font-size: 14px;
}

/* ---------- exhibitions ---------- */

.cv-list { list-style: none; }
.cv-list li {
  display: grid; grid-template-columns: 72px 1fr; gap: 16px;
  border-top: 1px solid var(--rule);
  padding-block: 18px;
  font-size: 16px;
}
.cv-list li:last-child { border-bottom: 1px solid var(--rule); }
.cv-year { font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim); padding-top: 3px; }
.cv-what em { font-weight: 380; }
.cv-where { display: block; font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim); margin-top: 3px; }
.cv-note { font-family: var(--sans); font-size: 13px; color: var(--ink-dim); margin-top: 22px; }

/* ---------- contact ---------- */

.contact p.contact-lede { max-width: 52ch; }
.contact-links { margin-top: clamp(28px, 5vw, 44px); display: grid; gap: 14px; }
.contact-links a {
  width: fit-content;
  font-style: italic; font-weight: 340;
  font-size: clamp(22px, 4.5vw, 36px);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-bottom: 3px;
  transition: border-color .25s, color .25s;
}
.contact-links a:hover, .contact-links a:focus-visible { border-bottom-color: var(--accent); color: var(--accent); }

/* ---------- inquiry forms ---------- */

.hp { position: absolute; left: -9999px; top: -9999px; }

.inquiry-form { display: grid; gap: 16px; max-width: 560px; }
.iq-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .iq-row { grid-template-columns: 1fr 1fr; } }

.iq-label {
  display: grid; gap: 7px;
  font-family: var(--sans); font-size: 13px; color: var(--ink-dim);
}
.iq-input {
  font-family: var(--sans); font-size: 15px;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 3px;
  padding: 11px 13px;
  transition: border-color .25s;
}
.iq-input:focus { outline: none; border-color: var(--accent); }
.iq-textarea { resize: vertical; min-height: 96px; }
.iq-context { font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim); }
.iq-context em { font-family: var(--serif); color: var(--ink); font-size: 14.5px; }
.iq-status { font-family: var(--sans); font-size: 13px; color: var(--accent); min-height: 1em; margin: -6px 0; }
.iq-send { justify-self: start; cursor: pointer; background: none; color: inherit; }
.iq-done {
  font-style: italic; font-size: 17px; max-width: 40ch;
  padding: 18px 0;
}

.contact-alt {
  margin-top: 34px;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink-dim);
}

/* modal version */
.iq-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 7, 10, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  overflow-y: auto;
}
.iq-card {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #17151b;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 12px;
  padding: 28px 26px 26px;
  color: var(--ink);
}
.iq-card .iq-title {
  font-weight: 330; font-size: 22px; margin-bottom: 18px;
  padding-right: 40px;
}
.iq-close {
  position: absolute; top: 14px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  background: none; color: inherit; cursor: pointer; font-size: 19px;
}
.iq-close:hover { border-color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px var(--pad) 42px;
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between;
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-dim);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg-deep);
  color: #f2ecdf;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: background .5s ease;
}
.lightbox.lb-dark-ink { color: #1c161c; }

.lb-inner { min-height: 100%; display: flex; flex-direction: column; }

.lb-close {
  position: fixed; top: 14px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
  background: none; color: inherit; cursor: pointer;
  font-size: 22px; line-height: 1;
  transition: border-color .2s;
}
.lb-close:hover { border-color: currentColor; }

.lb-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 72px 20px 8px;
}
.lb-figure { display: flex; }
.lb-img {
  max-width: min(92vw, 1000px);
  max-height: 58vh;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
  transition: opacity .18s ease;
}
@media (min-width: 900px) { .lb-img { max-height: 66vh; } }

.lb-panel {
  text-align: center;
  padding: 22px 24px 104px;
  max-width: 640px; margin-inline: auto;
}
.lb-count { font-family: var(--sans); font-size: 12px; opacity: .6; margin-bottom: 10px; }
.lb-title { font-size: clamp(22px, 4vw, 28px); font-weight: 330; }
.lb-title .lb-detail { font-family: var(--sans); font-style: normal; font-size: 13px; opacity: .65; }
.lb-meta, .lb-edition { font-family: var(--sans); font-size: 14px; opacity: .92; margin-top: 8px; }
.lb-note {
  font-style: italic; font-weight: 350;
  font-size: 16px; line-height: 1.6;
  max-width: 46ch; margin: 16px auto 0;
  opacity: .95;
}
.lb-action { margin-top: 22px; }
.lightbox .btn:hover, .lightbox .btn:focus-visible {
  background: none; border-color: currentColor;
  box-shadow: inset 0 0 0 100vmax color-mix(in srgb, currentColor 14%, transparent);
}

.lb-nav {
  position: fixed; bottom: 18px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 18px;
  pointer-events: none;
}
.lb-nav button {
  pointer-events: auto;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
  background: none; color: inherit; cursor: pointer;
  font-size: 20px;
  transition: border-color .2s;
}
.lb-nav button:hover { border-color: currentColor; }
@media (min-width: 900px) {
  .lb-nav { top: 50%; bottom: auto; transform: translateY(-50%); padding: 0 26px; }
}
.lightbox :focus-visible { outline-color: currentColor; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- no js ---------- */

.noscript-note {
  padding: 24px var(--pad); font-family: var(--sans); font-size: 14px; color: var(--ink-dim);
}
