/* Sami Mohammed Hallab: site styles.
   Elegant gallery: warm ivory walls, charcoal type, the paintings the only colour.
   Type: Cormorant Garamond (headings) + Inter (text), self-hosted in /fonts.
   Mobile first; wider layouts kick in at 48rem and 64rem. */

@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond-variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f3ee;
  --mat: #ebe6de;
  --ink: #1e1c19;
  --muted: #77716a;
  --rule: #ddd6cb;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --gutter: 1.25rem;
  --text-width: 38rem;
  --page-width: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; text-decoration-color: var(--rule); transition: text-decoration-color .2s, color .2s; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 1.25rem; }
h1 { font-size: clamp(2.5rem, 9vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
p { margin: 0 0 1.2rem; }
em { font-style: italic; }
.muted { color: var(--muted); }

/* Small uppercase label used throughout */
.eyebrow, .label {
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 1rem;
}

.wrap { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 2.25rem; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.875rem; }
.group-text { max-width: var(--text-width); color: var(--muted); margin: -1rem 0 2.25rem; }
.back { margin: 0; padding-top: 2rem; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 2rem; padding-top: 1.25rem; padding-bottom: 1.1rem;
}
.site-name { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; letter-spacing: 0.01em; text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Home: opening ---------- */
.hero { display: grid; gap: 2.5rem; padding: 3rem 0 4.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.75rem, 11vw, 4.75rem); line-height: 1; margin-bottom: 1.5rem; }
.hero .lede { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 4.5vw, 1.5rem); line-height: 1.45; color: var(--muted); max-width: 30rem; margin-bottom: 2rem; }
.notice { border-top: 1px solid var(--ink); padding-top: 1rem; max-width: 30rem; }
.notice p { margin: 0; font-size: 0.9375rem; line-height: 1.6; }
.notice strong { font-weight: 600; }
.hero-art { margin: 0; }
.hero-art a { display: block; }
.hero-art figcaption { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted); }
.hero-art figcaption em { font-family: var(--serif); font-size: 1.0625rem; color: var(--ink); }

/* ---------- Matted artwork grid (home + work) ---------- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem 1.5rem; grid-template-columns: 1fr; }
.grid a { text-decoration: none; display: block; }
.mat {
  background: var(--mat); aspect-ratio: 4 / 5;
  display: flex; align-items: center; justify-content: center;
  padding: 9%;
  transition: background .3s;
}
.mat img { max-height: 100%; width: auto; object-fit: contain; box-shadow: 0 6px 18px rgba(30, 28, 25, 0.18); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.grid a:hover .mat img { transform: scale(1.025); }
.caption { margin-top: 0.85rem; }
.caption .title { display: block; font-family: var(--serif); font-size: 1.25rem; font-style: italic; line-height: 1.25; }
.caption .meta { display: block; font-size: 0.8125rem; color: var(--muted); margin-top: 0.15rem; }

/* ---------- Pull quote ---------- */
.quote { text-align: center; padding: 0; margin: 0; }
.quote blockquote { margin: 0 auto; max-width: 42rem; }
.quote blockquote p { font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 6vw, 2.5rem); line-height: 1.3; margin: 0; }
.quote figcaption { margin-top: 1.5rem; }

/* ---------- Photo grid (exhibition photos) ---------- */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.photos figcaption { margin-top: 0.5rem; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }

/* ---------- Text pages ---------- */
.page { padding: 3.5rem 0 3rem; }
.page-intro { max-width: var(--text-width); margin-bottom: 3rem; }
.page-intro p { font-family: var(--serif); font-size: clamp(1.25rem, 4.5vw, 1.5rem); line-height: 1.5; color: var(--muted); }
.prose { max-width: var(--text-width); font-size: 1.0625rem; }
.prose > p:first-child { font-family: var(--serif); font-size: clamp(1.4rem, 5vw, 1.75rem); line-height: 1.45; }
.prose h2 { margin-top: 3.5rem; }
.about-top { display: grid; gap: 2.5rem; align-items: start; }
.portrait { margin: 0; max-width: 24rem; }
.portrait img { width: 100%; }
.portrait figcaption { margin-top: 0.6rem; font-size: 0.8125rem; color: var(--muted); }
.cv { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cv li { display: grid; gap: 0.25rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.cv .when { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cv .what { font-family: var(--serif); font-size: 1.3125rem; line-height: 1.3; }
.cv .where { font-size: 0.9375rem; color: var(--muted); }
.tag { display: inline-block; font-family: var(--sans); font-size: 0.625rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; border: 1px solid currentColor; padding: 0.15rem 0.45rem; margin-left: 0.5rem; vertical-align: 0.2em; }
.email { font-family: var(--serif); font-size: clamp(1.5rem, 6.5vw, 2.75rem); text-decoration-color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Artwork page ---------- */
.artwork { display: grid; gap: 2.5rem; padding: 2.5rem 0 4rem; }
.artwork .mat { aspect-ratio: auto; padding: 7%; }
.artwork .mat img { max-height: 75vh; max-height: 75svh; }
.artwork h1 { font-style: italic; font-size: clamp(2.25rem, 8vw, 3.5rem); }
.zoom-hint { display: none; margin: 0.75rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.js .zoom-hint { display: block; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 2rem; margin: 0 0 2.5rem; padding: 1.25rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.details dt { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.details dd { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; }
.back { font-size: 0.875rem; }

/* ---------- Full-screen viewer (artwork pages) ---------- */
[data-zoom] { cursor: zoom-in; }
.viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(246, 243, 238, 0.98);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  opacity: 0; transition: opacity .3s ease;
}
.viewer.open { opacity: 1; }
.viewer img { max-width: 94vw; max-height: 92vh; max-height: 92svh; width: auto; height: auto; transition: transform .4s cubic-bezier(.2,.7,.2,1); cursor: zoom-in; box-shadow: 0 10px 40px rgba(30,28,25,.2); }
.viewer.zoomed img { transform: scale(2.6); cursor: zoom-out; }
.viewer-close { position: absolute; top: 1rem; right: 1rem; z-index: 2; background: var(--paper); border: 1px solid var(--ink); color: var(--ink); font: 500 0.6875rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; padding: 0.7rem 1rem; cursor: pointer; }

/* ---------- Colour (Sami's palette, taken from the paintings) ---------- */
:root {
  --ultramarine: #2a4bb5; --vermilion: #c8452f; --saffron: #e9b23a;
  --violet: #7b4fb8; --rose: #d9677f; --teal: #2f8f8a;
  --indigo: #1d2350;
  --accent: var(--vermilion);
}
/* Mosaic stripe along the top and bottom of every page */
:root {
  --mosaic: linear-gradient(90deg,
    var(--ultramarine) 0 15%, var(--vermilion) 15% 27%, var(--saffron) 27% 38%,
    var(--violet) 38% 55%, var(--rose) 55% 66%, var(--teal) 66% 82%, #c0521f 82% 100%);
}
.stripe { height: 8px; background: var(--mosaic); }
/* Painted wash behind the opening, drifting slowly like a pour */
.hero-band {
  background-color: var(--paper);
  background-image:
    radial-gradient(45% 55% at 8% 18%, rgba(42, 75, 181, 0.30), transparent 70%),
    radial-gradient(40% 50% at 92% 12%, rgba(200, 69, 47, 0.26), transparent 70%),
    radial-gradient(45% 55% at 85% 95%, rgba(123, 79, 184, 0.28), transparent 70%),
    radial-gradient(40% 45% at 20% 100%, rgba(233, 178, 58, 0.34), transparent 70%),
    radial-gradient(30% 35% at 50% 50%, rgba(217, 103, 127, 0.16), transparent 70%);
  background-size: 160% 160%;
  animation: wash 22s ease-in-out infinite alternate;
}
@keyframes wash { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.hero .eyebrow { color: var(--accent); }
.notice { border-top: 3px solid transparent; border-image: var(--mosaic) 1; }
.tag { color: var(--accent); }
/* Small mosaic bar under section headings */
.section-head h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: 0.7rem; background: var(--mosaic); }
.quote-band .quote blockquote p { font-size: clamp(1.8rem, 7vw, 3rem); }
/* Cards lift a little on hover */
.grid a .mat { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s; }
.grid a:hover .mat { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(30, 28, 25, 0.14); }
/* Closing vermilion band */
.cta-band { background: var(--vermilion); color: var(--paper); text-align: center; padding: 4.5rem 0; }
.cta-band .label { color: rgba(246, 243, 238, 0.8); }
.cta-links { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.4; }
.cta-links a { color: var(--paper); text-decoration-color: rgba(246, 243, 238, 0.5); }
.cta-links a:hover { text-decoration-color: var(--paper); }
.cta-links span { margin: 0 0.6em; opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .hero-band { animation: none; } }
.site-nav a[aria-current="page"] { color: var(--accent); }
.mat { background: var(--tint, var(--mat)); }
/* Full-colour bands */
.quote-band { background: var(--ultramarine); color: var(--paper); }
.quote-band .label { color: rgba(246, 243, 238, 0.75); }
.band-warm { background: #f4e6c9; }
.section.quote-band, .section.band-warm, .quote-band + .section, .band-warm + .section { border-top: 0; }

/* Banner of Sami's own poured paint, fading into the page (About + Statement) */
.pour-banner {
  height: clamp(150px, 24vw, 300px);
  background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
/* Pull the page heading up close to the banner so there is no empty gap */
.pour-banner ~ .wrap .page { padding-top: 1.25rem; }
.banner-credit { margin: -2.25rem 0 0; position: relative; text-align: right; font-size: 0.75rem; color: var(--muted); }
.banner-credit a { text-decoration-color: var(--rule); }

/* ---------- Footer ---------- */
.site-footer { background: var(--indigo); color: rgba(246, 243, 238, 0.75); }
.site-footer a { color: var(--paper); text-decoration-color: rgba(246, 243, 238, 0.4); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 2rem; padding-bottom: 2.5rem; font-size: 0.8125rem; }

/* ---------- Gentle reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .mat img, .viewer img { transition: none; }
}

@media (min-width: 48rem) {
  :root { --gutter: 2.5rem; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .photos { grid-template-columns: repeat(4, 1fr); }
  .section { padding: 6rem 0; }
  .cv li { grid-template-columns: 7rem 1fr; column-gap: 2rem; }
  .cv .when { grid-row: span 2; padding-top: 0.35rem; }
}

@media (min-width: 64rem) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 3.5rem 2.5rem; }
  .hero { grid-template-columns: 1fr 1.05fr; gap: 5rem; padding: 5rem 0 6rem; }
  .about-top { grid-template-columns: 20rem 1fr; gap: 4.5rem; }
  .artwork { grid-template-columns: 1.4fr 1fr; gap: 4.5rem; align-items: start; }
  .artwork .info { position: sticky; top: 2rem; }
}

/* ---------- Homepage enquiry prompt + contact form ---------- */
.notice-link { margin-top: 0.6rem !important; font-size: 0.875rem !important; }
.notice-link a { text-decoration-color: var(--ink); font-weight: 500; }
.contact-intro { max-width: var(--text-width); color: var(--muted); }
.enquiry { max-width: 34rem; margin: 2rem 0 3rem; display: grid; gap: 1.25rem; }
.enquiry .field { display: grid; gap: 0.4rem; }
.enquiry label { font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.enquiry input, .enquiry select, .enquiry textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1px solid var(--rule); border-radius: 0; padding: 0.75rem 0.85rem; width: 100%; box-sizing: border-box;
}
.enquiry textarea { resize: vertical; min-height: 9rem; }
.enquiry input:focus, .enquiry select:focus, .enquiry textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.enquiry button {
  justify-self: start; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper); background: var(--ink); border: 0; padding: 0.95rem 1.6rem; cursor: pointer; transition: background .2s;
}
.enquiry button:hover { background: var(--accent); }
.hp { position: absolute; left: -9999px; }

/* =========================================================
   Design refresh (Nov 2026)
   ========================================================= */

/* Mosaic mark beside the name, echoing the patchwork figures */
.site-name { display: inline-flex; align-items: center; gap: 0.65rem; }
.mark { width: 30px; height: 30px; flex: none; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.site-name:hover .mark { transform: rotate(120deg); }

/* Footer: a strip of poured paint melting into the indigo */
.site-footer {
  background:
    linear-gradient(to bottom, rgba(29, 35, 80, 0.15) 0, var(--indigo) 150px),
    url(../img/pour-detail-in-between.jpg) top center / cover no-repeat,
    var(--indigo);
  background-size: auto, 100% 170px, auto;
}
.site-footer .wrap { padding-top: 5.5rem; }

@media (prefers-reduced-motion: reduce) {
  .site-name:hover .mark { transform: none; }
}

/* =========================================================
   Hero entrance animations (homepage)
   ========================================================= */
@keyframes rise   { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes draw   { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spread { from { clip-path: circle(0% at 50% 55%); transform: scale(1.12); } to { clip-path: circle(75% at 50% 50%); transform: scale(1); } }
@keyframes matIn  { from { opacity: 0; transform: translateY(40px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }

/* Name: each word slides up from behind a mask */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero h1 .w > span { display: inline-block; }
.js .hero h1 .w > span { transform: translateY(110%); animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards; }
.js .hero h1 .w:nth-child(1) > span { animation-delay: .25s; }
.js .hero h1 .w:nth-child(2) > span { animation-delay: .38s; }
.js .hero h1 .w:nth-child(3) > span { animation-delay: .51s; }

.js .hero .eyebrow { opacity: 0; animation: fadeUp .8s ease .1s forwards; }
.js .hero .lede    { opacity: 0; animation: fadeUp .9s ease .85s forwards; }

/* The mosaic line above the enquiry box draws itself across */
.hero .notice { border-top: 0; position: relative; padding-top: calc(1rem + 3px); }
.hero .notice::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--mosaic); transform-origin: left; }
.js .hero .notice::before { transform: scaleX(0); animation: draw 1.1s cubic-bezier(.6,0,.2,1) 1.15s forwards; }
.js .hero .notice p { opacity: 0; animation: fadeUp .7s ease 1.6s forwards; }
.js .hero .notice .notice-link { animation-delay: 1.75s; }

/* Painting: the frame rises, then the painting spreads out from the centre like a pour */
.js .hero-art .mat { opacity: 0; animation: matIn 1s cubic-bezier(.2,.8,.2,1) .35s forwards; }
.js .hero-art .mat img { clip-path: circle(0% at 50% 55%); animation: spread 1.6s cubic-bezier(.6,0,.2,1) .75s forwards; }
.js .hero-art figcaption { opacity: 0; animation: fadeUp .7s ease 1.9s forwards; }

/* Gentle 3D tilt toward the mouse (set by site.js) */
.hero-art a { perspective: 1200px; }
.hero-art .mat { transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .js .hero h1 .w > span, .js .hero .eyebrow, .js .hero .lede, .js .hero .notice::before,
  .js .hero .notice p, .js .hero-art .mat, .js .hero-art .mat img, .js .hero-art figcaption {
    animation: none; opacity: 1; transform: none; clip-path: none;
  }
}

/* =========================================================
   Top-tier layer: page transitions, scroll motion, gallery, cursor
   ========================================================= */

/* ---- Page transitions (Chrome, Edge, Safari 18+) ---- */
@view-transition { navigation: auto; }
html { scrollbar-gutter: stable; }
.site-header { view-transition-name: site-header; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(28px); } }
::view-transition-old(root) { animation: vt-out .32s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: vt-in .6s cubic-bezier(.2,.8,.2,1) .08s both; }
::view-transition-group(art) { animation-duration: .8s; animation-timing-function: cubic-bezier(.2,.8,.2,1); z-index: 5; }
::view-transition-old(art), ::view-transition-new(art) { animation-duration: .8s; }

/* ---- Paintings unveil as they scroll into view ---- */
.js .grid .reveal { opacity: 1; transform: none; transition: none; }
.js .grid .reveal .mat {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.15s cubic-bezier(.7,0,.2,1) var(--d, 0s), transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
}
.js .grid .reveal .mat img { transform: scale(1.22); transition: transform 1.7s cubic-bezier(.2,.8,.2,1) var(--d, 0s); }
.js .grid .reveal .caption { opacity: 0; transform: translateY(14px); transition: opacity .8s ease calc(var(--d, 0s) + .45s), transform .8s cubic-bezier(.2,.8,.2,1) calc(var(--d, 0s) + .45s); }
.js .grid .reveal.in .mat { clip-path: inset(0 0 0 0); }
.js .grid .reveal.in .mat img, .js .grid .reveal.in .caption { transform: none; opacity: 1; }
.js .grid .reveal.done .mat { clip-path: none; }
.js .grid .reveal.done .mat img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.js .grid .reveal.done a:hover .mat img { transform: scale(1.03); }

/* Artwork pages: painting visible at once (it morphs in), details slide in */
.js .artwork .reveal { opacity: 1; transform: none; transition: none; }
.js .artwork .info > * { opacity: 0; transform: translateY(18px); animation: fadeUp .8s cubic-bezier(.2,.8,.2,1) forwards; }
.js .artwork .info > :nth-child(1) { animation-delay: .25s; }
.js .artwork .info > :nth-child(2) { animation-delay: .35s; }
.js .artwork .info > :nth-child(3) { animation-delay: .5s; }
.js .artwork .info > :nth-child(4) { animation-delay: .65s; }

/* Quote: words surface one after another */
.quote .qw { display: inline-block; }
.js .quote .qw { opacity: 0; transform: translateY(.45em); filter: blur(4px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), filter .7s ease; transition-delay: calc(var(--i) * 45ms + .15s); }
.js .quote.in .qw { opacity: 1; transform: none; filter: none; }

/* ---- Work page: a bolder, staggered gallery ---- */
main { counter-reset: piece; }
.grid-gallery li { counter-increment: piece; }
.grid-gallery .caption { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: baseline; }
.grid-gallery .caption::before {
  content: counter(piece, decimal-leading-zero); grid-row: span 2;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.2em; color: var(--muted);
}
@media (min-width: 64rem) {
  .grid-gallery { grid-template-columns: repeat(2, 1fr); gap: 7rem 6rem; }
  .grid-gallery li:nth-child(even) { margin-top: 10rem; }
  .grid-gallery .caption { margin-top: 1.25rem; }
  .grid-gallery .caption .title { font-size: 1.75rem; }
}

/* ---- Custom cursor (mouse only) ---- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--ink); opacity: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--paper);
  transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), margin .35s cubic-bezier(.2,.8,.2,1), opacity .3s, background .3s;
}
.cursor span { opacity: 0; transition: opacity .2s; }
.cursor.on { opacity: 1; }
.cursor.link { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: rgba(30, 28, 25, 0.12); }
.cursor.view { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--vermilion); }
.cursor.view span { opacity: 1; }
.has-cursor .grid a, .has-cursor .hero-art a { cursor: none; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .js .grid .reveal .mat, .js .grid .reveal .mat img, .js .grid .reveal .caption,
  .js .artwork .info > *, .js .quote .qw { clip-path: none; transform: none; opacity: 1; filter: none; animation: none; transition: none; }
}
