/* ==========================================================================
   ART BY MAHEEN — stylesheet
   Theme: warm white & gold, drawn from gallery-wall paper and gilt frames.
   Signature moment: an orbiting arc of paintings behind a center avatar,
   echoing the sunburst-through-canopy motif in the artist's own work.
   ========================================================================== */

/* still crescent moon cursors, used until the animated one takes over (see .moon) */
:root {
  --cursor-moon: url("../assets/cursors/moon.png") 15 7, default;
  --cursor-moon-active: url("../assets/cursors/moon-active.png") 15 7, pointer;
}
@supports (cursor: -webkit-image-set(url("../assets/cursors/moon.png") 1x) 15 7, default) {
  :root {   /* sharper on high resolution screens */
    --cursor-moon: -webkit-image-set(url("../assets/cursors/moon.png") 1x, url("../assets/cursors/moon@2x.png") 2x) 15 7, default;
    --cursor-moon-active: -webkit-image-set(url("../assets/cursors/moon-active.png") 1x, url("../assets/cursors/moon-active@2x.png") 2x) 15 7, pointer;
  }
}

:root {
  /* --- color --- */
  --bg:         #fbf9f4;   /* page background, warm gallery white     */
  --panel:      #f4efe3;   /* section panel background                */
  --panel-2:    #ece3cd;   /* card / raised surface                   */
  --line:       rgba(36, 31, 24, 0.12);
  --text:       #241f18;   /* primary text, warm near-black           */
  --text-soft:  #6b6455;   /* muted / secondary text                  */
  --gold:       #b7862e;   /* base gold — icons, borders, eyebrows    */
  --gold-deep:  #8c6a1e;   /* deeper gold — text needing more contrast */
  --gold-pale:  #efe1be;   /* pale gold — subtle fills / badges       */
  --bg-rgb:     251, 249, 244;
  --ink-rgb:    36, 31, 24;

  /* --- type --- */
  --font-display: "Bodoni Moda", "Didot", serif;
  --font-body: "Albert Sans", "Segoe UI", sans-serif;
  --font-mono: var(--font-body);

  /* --- layout --- */
  --max: 1280px;
  --pad: clamp(1.25rem, 4vw, 4rem);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* --- light-dependent surfaces --- */
  --on-gold:      #ffffff;
  --glow-top:     #ffffff;
  --ceiling:      #ffffff;
  --ceiling-glow: rgba(255, 255, 255, 0.65);
  --shadow-rgb:   36, 31, 24;
  --shadow-a:     0.42;
  --film-edge:    transparent;

  /* --- the gallery wall --- */
  --wall: radial-gradient(90% 70% at 50% 0%, #f8f3e9 0%, rgba(248,243,233,0) 70%), linear-gradient(180deg, #efe8da, #e5dbc7);
  --rail-hi: #d8bd83;
  --rail-lo: #a98a4c;
  --cable: rgba(36, 31, 24, 0.38);
  --lamp: rgba(255, 233, 186, 0.34);
  --lamp-mid: rgba(255, 233, 186, 0.10);
  --plaque: #fffdf8;
  --mat-color: #f7f2e7;
  --bevel: 0 0 0 1px rgba(60, 42, 10, 0.45), 0 0 0 3px #fffdf8, 0 0 0 4px rgba(176, 135, 52, 0.85);
  --moulding: url("../assets/frames/gilt.webp");
  --canvas-light: linear-gradient(115deg, rgba(255, 255, 255, 0.07), transparent 36%);

  color-scheme: light;
}

/* After dark: the same rooms with the lights down */
:root[data-theme="dark"] {
  --bg:         #12100c;
  --panel:      #1a1711;
  --panel-2:    #26211a;
  --line:       rgba(243, 234, 216, 0.14);
  --text:       #f2eadb;
  --text-soft:  #aca28e;
  --gold:       #c99a3f;
  --gold-deep:  #e3bc66;
  --gold-pale:  #3b301b;
  --bg-rgb:     18, 16, 12;
  --ink-rgb:    242, 234, 219;

  --on-gold:      #1c1506;
  --glow-top:     #2a2318;
  --ceiling:      rgba(255, 226, 170, 0.75);
  --ceiling-glow: rgba(255, 208, 135, 0.16);
  --shadow-rgb:   0, 0, 0;
  --shadow-a:     0.8;
  --film-edge:    rgba(255, 255, 255, 0.10);

  --wall: radial-gradient(120% 90% at 50% 120%, #000000 0%, rgba(0,0,0,0) 60%), linear-gradient(180deg, #0f0d0a, #17130e);
  --rail-hi: #8a7040;
  --rail-lo: #4d3d20;
  --cable: rgba(255, 235, 200, 0.28);
  --lamp: rgba(255, 216, 150, 0.30);
  --lamp-mid: rgba(255, 196, 110, 0.09);
  --plaque: #201b14;
  --mat-color: #16120d;
  --bevel: 0 0 0 1px #000, 0 0 0 3px #2b241a, 0 0 0 4px rgba(214, 174, 92, 0.8);
  --canvas-light: linear-gradient(180deg, rgba(255, 232, 190, 0.10), transparent 42%, rgba(0, 0, 0, 0.16));

  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; transition: background-color 0.4s ease; }
html.is-viewing { background-color: #2f2c27; }   /* the scrollbar's strip dims with the preview */
html[data-theme="dark"].is-viewing { background-color: #0e0c09; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: var(--cursor-moon);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; cursor: var(--cursor-moon-active); }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: var(--cursor-moon-active); }
h1, h2, h3, h4, blockquote, p { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1rem;
  display: block;
}
.wall-hint { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 0.9rem; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
}
.section-head { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); margin-bottom: 3.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.05rem 2.2rem;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.45s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.btn--solid { background: linear-gradient(135deg, #cfa24a, var(--gold) 55%, #a9781f); color: var(--on-gold); box-shadow: 0 10px 24px -10px rgba(183,134,46,0.55); }
.btn--solid:hover { background: linear-gradient(135deg, #d9b05c, #c0902f 55%, #b5852a); transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); transform: translateY(-2px); }

/* ---------- scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   INTRO
   There is no wall to lift: the paintings and text live in the hero from the
   first frame and are simply held back by html.is-intro. Only the name, the
   progress line and the burst of light sit in this overlay.
   ========================================================================== */
.intro { display: none; }
html.is-intro .intro {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 990;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2.4vh, 1.6rem);
  overflow: hidden;
  pointer-events: none;
}
.intro__glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 150vmax; height: 150vmax;
  margin: -75vmax 0 0 -75vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(245, 214, 150, 0.62) 0%,
    rgba(214, 170, 90, 0.26) 34%,
    rgba(183, 134, 46, 0.07) 58%,
    rgba(183, 134, 46, 0) 72%);
  opacity: 0;
  will-change: transform, opacity;
}
.intro__mark {
  position: relative;
  width: min(72vw, 620px);
  opacity: 0;
  will-change: transform;
}
.intro__logo { display: block; width: 100%; height: auto; }

.intro__rule {
  position: relative;
  width: clamp(140px, 18vw, 240px);
  height: 1px;
  background: var(--line);
  opacity: 0;
}
.intro__rule span {
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

/* everything the intro brings in, held back until Motion reveals it */
html.is-intro .nav__logo-text,
html.is-intro .nav__links > a,
html.is-intro .theme-toggle,
html.is-intro .nav__burger,
html.is-intro .hero__script,
html.is-intro .hero__avatar,
html.is-intro .hero__center-role,
html.is-intro .hero__tagline .eyebrow,
html.is-intro .hero__title-word > span,
html.is-intro .hero__actions,
html.is-intro .scroll-cue { opacity: 0; }
html.is-intro .reel-tile__film { pointer-events: none; }

/* hero title words rise out of a mask during the intro */
.hero__title-word {
  display: inline-block;
  overflow: hidden;
  padding: 0.06em 0.08em 0.16em;
  margin: -0.06em -0.08em -0.16em;
}
.hero__title-word > span { display: inline-block; }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--pad);
  background: linear-gradient(to bottom, rgba(var(--bg-rgb),0.85), rgba(var(--bg-rgb),0));
  transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(var(--bg-rgb), 0.94);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;

  border-bottom: none;
  /* or */
  /* border-bottom: 1px solid transparent; */
}
.nav__logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__links { display: flex; align-items: center; gap: 2.2rem; margin-left: auto; }
.nav__links a {
  position: relative;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  transition: color 0.3s ease;
  padding-bottom: 4px;
}
.nav__links a span { position: relative; }
.nav__links a span::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover span::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 0.55rem 1.2rem;
  color: var(--text) !important;
}
.nav__cta:hover { border-color: var(--gold); }
.nav__cta span::after { display: none; }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.nav__burger i { width: 22px; height: 1.5px; background: var(--text); display: block; transition: transform 0.3s ease, opacity 0.3s ease; }
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(78vw, 320px);
  background: var(--panel);
  z-index: 99;
  display: flex; flex-direction: column;
  padding: 6rem 2rem 2rem;
  gap: 1.6rem;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
  border-left: 1px solid var(--line);
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu a { font-family: var(--font-display); font-size: 1.4rem; color: var(--text); }

/* ==========================================================================
   HERO — orbiting arc of paintings around a center mark
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(6.5rem, 14vh, 9.5rem);
  padding-bottom: 3rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 50% 8%, rgba(183,134,46,0.06), transparent 70%),
    var(--bg);
}

.hero__script {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.2rem, 15vw, 9rem);
  color: rgba(var(--ink-rgb), 0.045);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.orbit-stage {
  position: relative;
  width: 100%;
  max-width: 1150px;
  height: clamp(280px, min(44vw, 62vh), 480px);
  margin-top: 0.5rem;
  z-index: 1;
  contain: layout;          /* isolate the reels' repaints from the page */
}



/* A tile is one CELL OF FILM: black film base, sprocket holes top & bottom,
   the painting in the middle. Laid end-to-end along a tilted ellipse they
   read as a diagonal film reel. Every transform is written by JS. */
.reel-tile {
  position: absolute;
  left: 50%; top: 50%;
  /* drawn at double size; JS shows it at half (see TILE_DRAW) */
  width: calc(2 * clamp(72px, min(8.6vw, 15vh), 122px));
  aspect-ratio: 1 / 1;
  opacity: 0;
  pointer-events: none;              /* only the tilted film itself can be touched */
  will-change: transform, opacity;
}
.reel-tile__film {
  position: absolute;
  inset: 0;
  background: #15120f;
  border-radius: 4px;
  padding: 26px 10px;                /* room for the sprocket strips */
  box-shadow: 0 36px 68px -32px rgba(var(--shadow-rgb),0.45), 0 0 0 2px var(--film-edge);
  cursor: var(--cursor-moon-active);
  pointer-events: auto;
  transition: box-shadow 0.4s ease;
}
.reel-tile__film::before,
.reel-tile__film::after {            /* the perforations */
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 26px;
  background-image: repeating-linear-gradient(to right, #efece4 0 12px, transparent 12px 28px);
  background-size: 28px 14px;
  background-repeat: repeat-x;
  background-position: center;
  pointer-events: none;
}
.reel-tile__film::before { top: 0; }
.reel-tile__film::after  { bottom: 0; }

.reel-tile__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1px;
}

/* round canvases stay round, sitting on the black film */
.reel-tile__img.is-round {
  width: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  clip-path: circle(48.5%);
}

.orbit-stage.is-hovering .reel-tile:not(.is-active) {
  /* dim (compositor) instead of blurring 23 tiles at once (paint spike) */
  opacity: 0.32 !important;
}
.reel-tile.is-active {
  opacity: 1 !important;
  z-index: 70 !important;
}
.reel-tile.is-active .reel-tile__film {
  box-shadow: 0 52px 92px -28px rgba(36,31,24,0.45), 0 0 0 6px var(--gold);
}
.reel-tile__tag {
  position: absolute;
  left: 50%;
  bottom: -3.7rem;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 1.24rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.reel-tile.is-active .reel-tile__tag { opacity: 1; }

/* soft scrim: keeps the centred text perfectly readable as the reels pass */
.orbit-scrim {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  height: 60%;
  aspect-ratio: 1.55;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  background: radial-gradient(closest-side,
    rgba(var(--bg-rgb), 0.95) 0%,
    rgba(var(--bg-rgb), 0.88) 42%,
    rgba(var(--bg-rgb), 0.55) 70%,
    rgba(var(--bg-rgb), 0)   100%);
}
body.intro-done .orbit-scrim { opacity: 1; }

/* the centred text always sits ABOVE the reels — it never gets disturbed */
.hero__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  pointer-events: none;
}
.hero__avatar {
  width: clamp(104px, 8.4vw, 132px);
  height: clamp(104px, 8.4vw, 132px);
  padding: 3px;
  border-radius: 50%;
  background: var(--mat-color);        /* a solid disc, so the film can't show through */
  box-shadow: 0 16px 32px -12px rgba(183,134,46,0.55), 0 2px 6px rgba(0,0,0,0.18);
}
.hero__avatar img { display: block; width: 100%; height: 100%; }
.hero__center-name { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text); margin-top: 0.5rem; }
.hero__center-role { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-soft); margin-top: 0.55rem; padding: 0.22rem 0.75rem; border-radius: 999px; background: rgba(var(--bg-rgb), 0.86); white-space: nowrap; }

.hero__tagline { position: relative; z-index: 2; text-align: center; margin-top: clamp(0.75rem, 4vw, 2rem); padding: 0 var(--pad); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.01em;
}
.hero__title em { font-style: italic; color: var(--gold-deep); }
.hero__actions { margin-top: 1.9rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  right: var(--pad);
  bottom: 1.6rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
}
.scroll-cue__label {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.scroll-cue__arrow { animation: arrow-fade 1.8s ease-in-out infinite; color: var(--gold); }
@keyframes arrow-fade {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* On laptop-height windows the whole hero, big X, title and buttons included,
   fits on one screen: the spacing and title follow the window's height. */
@media (max-height: 880px) and (min-width: 701px) {
  .hero { padding-top: clamp(5.6rem, 13vh, 9.5rem); padding-bottom: 1rem; }
  .orbit-stage { height: clamp(280px, min(44vw, 60vh), 480px); }
  .hero__tagline { margin-top: 0.35rem; }
  .hero__tagline .eyebrow { margin-bottom: 0.5rem; }
  .hero__title { font-size: clamp(2.2rem, 8vh, 4.6rem); }
  .hero__actions { margin-top: clamp(0.55rem, 1.5vh, 1.4rem); }
  .hero__actions .btn { padding: 0.72rem 2rem; }
}

@media (max-width: 700px) {
  .hero__script { display: none; }
  /* the desktop-sized scrim would wash out every painting on a phone */
  .orbit-scrim { top: 62%; width: 270px; height: 150px; }
}

/* ==========================================================================
   THE GALLERY WALL
   Framed canvases on cables from two brass rails. By day the wall is warm
   plaster; after dark it falls away and each painting gets its own lamp.
   ========================================================================== */
.gallery {
  --row-h: clamp(150px, 26vh, 270px);
  --fw: clamp(9px, 0.78vw, 13px);      /* moulding width */
  --mat: clamp(11px, 1.05vw, 18px);    /* the mat around the canvas */
  position: relative;
  padding: 5.25rem 0 3rem;
  background: var(--wall);
  overflow: hidden;
}
.gallery .section-head { margin-bottom: 1.75rem; }

.wall { display: flex; flex-direction: column; gap: 0.25rem; }
.wall.is-waiting .piece__art { opacity: 0; }

.wall__row {
  position: relative;
  overflow: hidden;
  padding-bottom: 2.3rem;              /* room for the label under each piece */
  cursor: var(--cursor-moon-active);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.wall__row::before {                   /* the rail */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(180deg, var(--rail-hi), var(--rail-lo));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}
.wall__track { display: flex; align-items: flex-start; width: max-content; will-change: transform; }

/* The opening cut in the mat, used by every frame on the site. It is sized from
   the painting's own proportions, so nothing is ever stretched or cropped. */
.frame-opening {
  position: relative;
  display: block;
  width: min(100%, calc(100% * var(--ar, 1)));
  aspect-ratio: var(--ar, 1);
  box-shadow: var(--bevel);
  overflow: hidden;
}
.frame-opening.is-round { border-radius: 50%; }
.frame-opening img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.05);              /* trims the photographed canvas edge */
  pointer-events: none;
}

/* --- one hanging piece --- */
.piece {
  position: relative;
  flex: 0 0 auto;
  margin-right: clamp(2rem, 3.6vw, 3.75rem);
  padding-top: 24px;
  transform: rotate(calc(var(--sway, 0) * 1deg));
  transform-origin: 50% 0;             /* swings from the rail */
  outline: none;
}
.piece::before {                       /* the cable */
  content: "";
  position: absolute;
  left: 50%; top: 0;
  width: 1px;
  height: 26px;
  background: var(--cable);
}
.piece__light {                        /* the lamp's pool of light on the wall */
  position: absolute;
  left: 50%; top: 0;
  width: calc(var(--row-h) * 2.3);
  height: calc(var(--row-h) * 1.5);
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse 50% 82% at 50% 0%, var(--lamp) 0%, var(--lamp-mid) 42%, transparent 72%);
}
.piece__art { position: relative; }

.piece__art::before {                  /* the brass eye the cable clips to */
  content: "";
  position: absolute;
  left: 50%; top: -3px;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  z-index: 3;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbe9b4, #a97f2c 60%, #5c4110);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* A real frame, outside in: moulding (a mitred image), cream mat, then the
   canvas. Sized on the content box, so a painting keeps its true proportions. */
.piece__frame {
  --frame-shadow:
    inset 0 3px 6px -1px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  --wall-shadow:
    0 2px 3px rgba(0, 0, 0, 0.3),
    0 24px 32px -14px rgba(var(--shadow-rgb), var(--shadow-a));
  position: relative;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: var(--row-h);
  height: var(--row-h);
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  box-shadow: var(--frame-shadow), var(--wall-shadow);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.4s ease;
}
.piece__frame::after {                 /* the room's light across the glass */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: var(--canvas-light);
}

/* round canvases sit in a turned gold ring of exactly the same size */
.piece.is-round .piece__frame {
  --frame-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  border: 0;
  border-image: none;
  border-radius: 50%;
  padding: calc(var(--fw) + var(--mat));
  background: conic-gradient(from 205deg, #fff3c9, #c99a3f 10%, #7d5a16 26%, #c9a04c 40%, #fbe6ad 50%, #b98a2c 62%, #6a4b12 78%, #e2bf6e 90%, #fff3c9);
}
.piece.is-round .piece__frame::before { /* the mat, and a fine gold bead at the sight edge */
  content: "";
  position: absolute;
  inset: var(--fw);
  border-radius: 50%;
  background: var(--mat-color);
  box-shadow:
    inset 0 3px 5px -1px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(40, 26, 6, 0.7),
    0 0 0 2px #dcb764;
}
.piece.is-round .piece__frame::after { border-radius: 50%; }

.piece__label {
  position: absolute;
  left: 50%; top: calc(100% - 1rem);   /* a small plaque, overlapping the frame */
  transform: translate(-50%, -5px);
  width: max-content;
  max-width: 230px;
  padding: 0.3rem 0.65rem 0.35rem;
  background: var(--plaque);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: center;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}
.piece__no {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
}
.piece__title { font-family: var(--font-display); font-size: 0.86rem; color: var(--text); }

@media (hover: hover) {
  .wall__row:hover .piece:not(:hover) .piece__frame { opacity: 0.74; }
  .piece:hover .piece__frame {
    transform: scale(1.035);
    box-shadow:
      var(--frame-shadow),
      0 2px 3px rgba(0, 0, 0, 0.3),
      0 34px 44px -16px rgba(var(--shadow-rgb), var(--shadow-a));
  }
  .piece:hover .piece__label { opacity: 1; transform: translate(-50%, 0); }
  .wall__row.is-dragging .piece .piece__frame { opacity: 1; transform: none; }
  .wall__row.is-dragging .piece__label { opacity: 0; }
}
.piece:focus-visible .piece__frame { box-shadow: var(--frame-shadow), 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.piece:focus-visible .piece__label { opacity: 1; transform: translate(-50%, 0); }

.marquee__hint {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-top: 0.5rem;
  padding: 0 var(--pad);
}

/* ==========================================================================
   LIGHT / DARK TOGGLE + THE CIRCLE THAT OPENS THE NEW THEME
   ========================================================================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin-left: 1.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-deep);
  transition: border-color 0.3s ease, transform 0.45s var(--ease), background 0.3s ease;
}
.theme-toggle:hover { border-color: var(--gold); transform: rotate(14deg) scale(1.06); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#ttRays { transform-origin: 12px 12px; transform-box: view-box; }

::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* the switch lays a layer over the page that takes its cursor from html, so the
   moon has to live there too, and the mouse passes through to the page */
html, ::view-transition { cursor: var(--cursor-moon); }
::view-transition { pointer-events: none; }
/* the mouse is on the toggle when this starts, so it stays the clickable moon */
html.is-washing, html.is-washing::view-transition { cursor: var(--cursor-moon-active); }

/* the gold rim and flecks of paint on the edge of the wash */
.theme-wash {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  view-transition-name: theme-wash;
}
::view-transition-group(theme-wash),
::view-transition-new(theme-wash) { animation: none; }
::view-transition-old(theme-wash) { display: none; }

/* ==========================================================================
   THE MOON CURSOR: rocks from the pointer, a star twinkles in its curve, and
   stars fall behind it. It stays on top of the paint wash when the theme changes.
   ========================================================================== */
html.has-moon, html.has-moon *, html.has-moon::view-transition { cursor: none !important; }

.moon-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow: hidden;
  pointer-events: none;
  view-transition-name: moon-cursor;
  --moon-star: #b7862e;
}
:root[data-theme="dark"] .moon-layer { --moon-star: #f6e2aa; }
::view-transition-group(moon-cursor),
::view-transition-new(moon-cursor) { animation: none; }
::view-transition-old(moon-cursor) { display: none; }

.moon {
  position: absolute;
  top: 0; left: 0;
  width: 48px; height: 48px;
  opacity: 0;
  transition: opacity 0.2s ease;
  will-change: transform;
}
.moon.is-on { opacity: 1; }
.moon__rock {
  width: 100%; height: 100%;
  transform-origin: 15px 7px;          /* it hangs from the exact spot of the pointer */
  animation: moon-rock 3.4s ease-in-out infinite;
}
.moon__art {
  display: block;
  width: 100%; height: 100%;
  overflow: visible;
  transform-origin: 15px 7px;
  filter: drop-shadow(0 0 5px rgba(240, 196, 90, 0.55));
  transition: transform 0.3s var(--ease), filter 0.3s ease;
}
.moon.is-over .moon__art {
  transform: scale(1.18);
  filter: brightness(1.12) drop-shadow(0 0 11px rgba(255, 220, 130, 0.95));
}
.moon.is-down .moon__art { transform: scale(0.9); }
.moon__star {
  transform-box: fill-box;
  transform-origin: center;
  animation: moon-twinkle 1.9s ease-in-out infinite;
}
@keyframes moon-rock {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}
@keyframes moon-twinkle {
  0%, 100% { transform: scale(0.55) rotate(0deg); opacity: 0.55; }
  50% { transform: scale(1.15) rotate(45deg); opacity: 1; }
}
.moon-spark {
  position: absolute;
  top: 0; left: 0;
  background: var(--moon-star);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}

/* browsers without View Transitions get a soft cross-fade instead */
.theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after {
  transition: background-color 0.55s ease, color 0.55s ease, border-color 0.55s ease !important;
}

@media (max-width: 860px) {
  .theme-toggle { margin-left: auto; margin-right: 0.75rem; }
}

/* ==========================================================================
   MANTRA — a quiet, full-width statement with a painting cursor trail
   ========================================================================== */
.mantra {
  position: relative;
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem var(--pad);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.mantra__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 6.2vw, 5rem);
  line-height: 1.15;
  color: var(--text);
  max-width: 18ch;
}
.mantra__title em { color: var(--gold-deep); font-style: italic; }
.mantra__hint {
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* the words stay crisp: paintings pass behind them */
.mantra__title, .mantra__hint { position: relative; z-index: 3; }
/* a soft fog around them: paintings melt away as they near the text */
.mantra::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: min(1040px, 124%);
  height: min(400px, 84%);
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(closest-side,
    rgba(var(--bg-rgb), 1) 0%,
    rgba(var(--bg-rgb), 0.98) 54%,
    rgba(var(--bg-rgb), 0.72) 76%,
    rgba(var(--bg-rgb), 0) 100%);
}

/* the trail: small framed canvases that follow the pointer, then slip away */
.image-cursor-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.image-cursor-trail__item {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
}
.trail-card {
  --fw: clamp(6px, 0.5vw, 9px);
  --mat: clamp(7px, 0.65vw, 11px);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: clamp(104px, 10vw, 158px);
  aspect-ratio: 1;
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  opacity: 0;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.24),
    0 24px 34px -14px rgba(var(--shadow-rgb), var(--shadow-a));
  will-change: transform, opacity;
}
.trail-card.is-round {
  border: 0;
  border-image: none;
  border-radius: 50%;
  padding: calc(var(--fw) + var(--mat));
  background: conic-gradient(from 205deg, #fff3c9, #c99a3f 10%, #7d5a16 26%, #c9a04c 40%, #fbe6ad 50%, #b98a2c 62%, #6a4b12 78%, #e2bf6e 90%, #fff3c9);
}

@media (prefers-reduced-motion: reduce) {
  .image-cursor-trail { display: none; }
}
@media (hover: none) {
  .mantra { touch-action: pan-y; }     /* sideways swipes draw; up and down still scrolls */
  .image-cursor-trail__item, .trail-card { user-select: none; -webkit-user-select: none; }
}
@media (max-width: 700px) {
  /* taller, with a smaller fog, so the paintings have room above and below the words */
  .mantra { min-height: 72svh; padding: 3.5rem var(--pad); }
  .mantra::after { width: 118%; height: 36%; }
}

/* ==========================================================================
   THE CATALOGUE — every painting at its true shape, browsable by theme.
   The index stays put on the left while the works scroll past it.
   ========================================================================== */
.collection { padding: 6rem 0 7rem; border-top: 1px solid var(--line); }
.catalogue {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: start;
}
.catalogue__index { position: sticky; top: 6.5rem; }

.catalogue__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  line-height: 1.12;
  color: var(--text);
  letter-spacing: -0.01em;
}
.catalogue__title em { font-style: italic; color: var(--gold-deep); }
.catalogue__count {
  display: block;
  font-style: italic;
  font-size: clamp(5.5rem, 10vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--gold-deep);
  font-variant-numeric: lining-nums tabular-nums;
}

.catalogue__filters {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 2.25rem;
  padding-left: 1.1rem;
  border-left: 1px solid var(--line);
}
.catalogue__mark {
  position: absolute;
  left: -1px; top: 0;
  width: 2px;
  background: var(--gold);
}
.cat-filter {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-soft);
  text-align: left;
  transition: color 0.3s ease, transform 0.45s var(--ease);
}
.cat-filter sup {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
  margin-top: 0.3rem;
  color: var(--gold-deep);
}
.cat-filter:hover { color: var(--text); transform: translateX(4px); }
.cat-filter[aria-pressed="true"] { color: var(--text); font-style: italic; }
.cat-filter:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.catalogue__grid {
  position: relative;
  transition: height 0.6s var(--ease);
}

/* --- one work --- */
.cat-tile {
  position: absolute;
  left: 0; top: 0;
  width: var(--tile-w, 300px);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: var(--cursor-moon-active);
}
.cat-tile__in { display: block; }
.is-revealing .cat-tile:not(.is-seen) .cat-tile__in { opacity: 0; }

.cat-tile__art {
  --fw: clamp(9px, 0.95vw, 15px);
  --mat: clamp(13px, 2vw, 32px);
  position: relative;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  box-shadow:
    inset 0 3px 7px -1px rgba(0, 0, 0, 0.38),
    0 2px 3px rgba(0, 0, 0, 0.24),
    0 26px 36px -20px rgba(var(--shadow-rgb), var(--shadow-a));
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.cat-tile__art::after {                /* light moving across the glass */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.2), transparent 58%);
  transition: opacity 0.4s ease;
}
.cat-tile__cap { display: block; padding-top: 1.1rem; text-align: center; }
.cat-tile__title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.3s ease;
}
.cat-tile__meta {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
@media (hover: hover) {
  .cat-tile:hover .cat-tile__art {
    box-shadow:
      inset 0 3px 7px -1px rgba(0, 0, 0, 0.38),
      0 2px 3px rgba(0, 0, 0, 0.24),
      0 38px 46px -22px rgba(var(--shadow-rgb), var(--shadow-a));
  }
  .cat-tile:hover .cat-tile__art::after { opacity: 1; }
  .cat-tile:hover .cat-tile__title { color: var(--gold-deep); }
}
.cat-tile:focus-visible { outline: none; }
.cat-tile:focus-visible .cat-tile__art { outline: 2px solid var(--gold); outline-offset: 3px; }

.catalogue__more { display: flex; margin: 3rem auto 0; }
.catalogue__more[hidden] { display: none; }

@media (max-width: 980px) {
  .catalogue { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .catalogue__index { position: static; }
  .catalogue__head { display: flex; align-items: flex-end; gap: 1rem; }
  .catalogue__count { font-size: clamp(4.5rem, 19vw, 6.5rem); }
  .catalogue__filters {
    flex-direction: row;
    gap: 0.5rem;
    margin: 1.5rem calc(var(--pad) * -1) 0;
    padding: 0 var(--pad) 0.25rem;
    border: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .catalogue__filters::-webkit-scrollbar { display: none; }
  .catalogue__mark { display: none; }
  .cat-filter {
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.95rem;
    white-space: nowrap;
  }
  .cat-filter:hover { transform: none; }
  .cat-filter[aria-pressed="true"] { border-color: var(--gold); background: var(--panel); }
  .cat-tile__title { font-size: 0.98rem; }
  .cat-tile__meta { font-size: 0.56rem; letter-spacing: 0.03em; }
}

/* ==========================================================================
   THE EXHIBITION — one framed photograph stays put while the story scrolls
   past it. Each moment wipes the next photo into the frame.
   ========================================================================== */
.exhibit {
  --h: min(calc(100vh - 8.4rem), 700px);
  padding: clamp(4.5rem, 10vh, 7rem) var(--pad) clamp(3rem, 7vh, 5rem);
  background: var(--wall);
  border-top: 1px solid var(--line);
}
.exhibit__head { max-width: 1160px; margin: 0 auto clamp(1.5rem, 4vh, 3rem); }
.exhibit__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--text);
}
.exhibit__title em { font-style: italic; color: var(--gold-deep); }
.exhibit__where {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.exhibit__story {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* the frame that stays */
.exhibit__stage { position: sticky; top: 5.6rem; }
.exhibit__frame {
  --fw: clamp(10px, 0.95vw, 15px);
  --mat: clamp(10px, 1.1vw, 18px);
  box-sizing: border-box;
  height: var(--h);
  aspect-ratio: 3 / 4;
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  box-shadow:
    inset 0 3px 7px -1px rgba(0, 0, 0, 0.38),
    0 2px 3px rgba(0, 0, 0, 0.24),
    0 30px 40px -22px rgba(var(--shadow-rgb), var(--shadow-a));
}
.exhibit__photos {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #16130e;
  box-shadow: var(--bevel);
}
.exhibit__photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;                   /* same 3:4 shape as the photos, so nothing is lost */
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.95s var(--ease);
}
.exhibit__photo:first-child,
.exhibit__photo.is-on { clip-path: inset(0 0 0 0); }

.exhibit__ticks { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.exhibit__ticks span {
  flex: 1;
  height: 2px;
  background: var(--line);
  transition: background 0.5s ease;
}
.exhibit__ticks span.is-on { background: var(--gold); }

/* the story */
.exhibit__moment {
  min-height: 74vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 34rem;
  transition: opacity 0.6s ease;
}
.exhibit__moment:last-child { min-height: max(calc(var(--h) + 1.5rem), calc(2 * (var(--h) + 7.1rem) - 100vh)); }
.exhibit.is-live .exhibit__moment:not(.is-on) { opacity: 0.28; }
.exhibit__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}
.exhibit__moment h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.85rem;
}
.exhibit__moment p {
  font-size: 1.04rem;
  line-height: 1.75;
  color: var(--text-soft);
}
.exhibit__moment p + p { margin-top: 0.8rem; }
.exhibit__thanks {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem !important;
  color: var(--gold-deep) !important;
}
.exhibit__inline { display: none; }

/* phones and narrow windows: each photo sits with its own moment */
@media (max-width: 860px) {
  .exhibit__story { display: block; }
  .exhibit__stage { display: none; }
  .exhibit__moment,
  .exhibit__moment:last-child { min-height: 0; max-width: none; margin-bottom: 3rem; }
  .exhibit__moment:last-child { margin-bottom: 0; }
  .exhibit.is-live .exhibit__moment:not(.is-on) { opacity: 1; }
  .exhibit__inline {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 9px;
    border: 9px solid transparent;
    border-image: var(--moulding) 64 stretch;
    background: var(--mat-color) padding-box;
    box-shadow: 0 22px 30px -18px rgba(var(--shadow-rgb), var(--shadow-a));
  }
  .exhibit__inline img { display: block; width: 100%; height: auto; }
}

/* ==========================================================================
   ABOUT — the studio at night. Always black and gold, in both themes. The whole
   photograph is shown, uncropped, with the words beside it as a balanced pair.
   ========================================================================== */
.about {
  --about-bg: #0e0b08;
  --text: #f2eadb;
  --text-soft: #b8ae9a;
  --gold-deep: #e3bc66;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 500px);
  justify-content: center;
  align-items: center;
  gap: clamp(2.5rem, 5.5vw, 5.5rem);
  min-height: 100vh;
  padding: 5.6rem var(--pad) 2.25rem;
  overflow: hidden;
  background:
    radial-gradient(60% 75% at 30% 50%, rgba(183, 134, 46, 0.12), transparent 70%),
    var(--about-bg);
  color: var(--text);
}

/* the photograph, whole */
.about__photo {
  --size: min(68vh, 40vw, 560px);
  position: relative;
  z-index: 3;
  width: var(--size);
  height: var(--size);
  margin: 0;
  will-change: transform;
}
.about__photo::before {                /* a fine gold line, set off behind the picture */
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 1px solid rgba(227, 188, 102, 0.5);
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.about__photo-in {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9);
}
.about__photo img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.about__photo-in::after {              /* a warm lamp that follows the pointer */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 214, 140, 0.85), transparent 70%);
  transition: opacity 0.6s ease;
}
.about__photo:hover .about__photo-in::after { opacity: 1; }

/* the name, as large and quiet as a watermark */
.about__ghost {
  position: absolute;
  right: -0.04em;
  top: 0.2em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(6rem, 16vw, 15rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(227, 188, 102, 0.11);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

/* the words */
.about__content { position: relative; z-index: 3; min-width: 0; }
.about__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, min(3.6vw, 7vh), 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: var(--text);
  margin-bottom: 0.9rem;
}
.about__title em { font-style: italic; color: var(--gold-deep); }
.about__line {
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  padding: 0.04em 0.1em 0.14em 0;
  margin-bottom: -0.14em;
}
.about__line > span { display: block; }

.about__text {
  margin-bottom: 0.65rem;
  font-size: clamp(0.84rem, 2.1vh, 0.95rem);
  line-height: 1.62;
  color: var(--text-soft);
}
.about__quote {
  position: relative;
  margin: 1rem 0 1.1rem;
  padding: 0.05rem 0 0.05rem 1.1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vh, 1.22rem);
  line-height: 1.4;
  color: #f3e3bd;
  border: 0;
}
.about__quote::before {                /* a thin gold line, brightest at its centre */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 18%, #f3d48c 50%, var(--gold) 82%, transparent);
}
.about__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem clamp(1.25rem, 2.4vw, 2.25rem);
  margin: 0 0 1.15rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(227, 188, 102, 0.22);
}
.about__facts dt {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-top: 0.2rem;
}
.about__facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: lining-nums;
}
.about__facts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.about .btn { padding: 0.72rem 1.8rem; font-size: 0.68rem; }
.about .btn--solid { color: #1c1506; }

/* held back, ready to play each time the section comes into view */
.about.is-waiting .about__bit,
.about.is-waiting .about__line > span,
.about.is-waiting .about__photo-in { opacity: 0; }
.about.is-waiting .about__photo::before { opacity: 0; }

@media (max-width: 860px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 2.25rem;
    min-height: 0;
    padding: 5.5rem var(--pad) 3.5rem;
  }
  .about__ghost { display: none; }
  .about__photo { --size: min(78vw, 56vh); }
  .about__photo::before { inset: 10px -10px -10px 10px; }
  .about__content { width: 100%; }
  .about__title { font-size: clamp(2.1rem, 9.5vw, 2.8rem); }
  .about__text { font-size: 0.95rem; }
  .about__quote { font-size: 1.15rem; }
}

/* ==========================================================================
   COMMISSION
   ========================================================================== */
.commission {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7rem var(--pad);
  position: relative;
  overflow: hidden;
}
.commission::before {
  content: "";
  position: absolute;
  width: 700px; height: 700px;
  top: -350px; right: -200px;
  background: radial-gradient(circle, rgba(183,134,46,0.12), transparent 65%);
  pointer-events: none;
}
.commission__inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 6rem);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* a real frame on the wall, with the paintings changing slowly inside it */
.commission__wall { margin: 0; }
.commission__frame {
  --fw: clamp(14px, 1.5vw, 22px);
  --mat: clamp(12px, 1.5vw, 22px);
  box-sizing: border-box;
  aspect-ratio: 1;
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  box-shadow:
    inset 0 3px 7px -1px rgba(0, 0, 0, 0.38),
    0 2px 3px rgba(0, 0, 0, 0.24),
    0 34px 44px -24px rgba(var(--shadow-rgb), var(--shadow-a));
}
.commission__canvas {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #16130e;
  box-shadow: var(--bevel);
}
.commission__canvas img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity 1.6s ease, transform 6s var(--ease);
}
.commission__canvas img.is-on { opacity: 1; transform: scale(1.04); }

.commission__content { container-type: inline-size; min-width: 0; }
.commission__content .section-title { margin-bottom: 1.1rem; }
.commission__text { color: var(--text-soft); max-width: 46ch; margin-bottom: 2.2rem; }

/* a calling card with a fine gold edge, in the colours of the page */
.contact {
  --card: var(--bg);
  --card-text: var(--text);
  --card-soft: var(--text-soft);
  --card-gold: var(--gold-deep);
  --card-line: rgba(183, 134, 46, 0.24);
  padding: 5px;
  background: var(--card);
  border: 1px solid rgba(183, 134, 46, 0.5);
  box-shadow: 0 22px 34px -26px rgba(var(--shadow-rgb), var(--shadow-a));
}
.contact__card { border: 1px solid var(--card-line); }
.contact__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
}
.contact__head p {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.2;
  color: var(--card-text);
}
.contact__head em { color: var(--card-gold); }
.contact__head img { width: 38px; height: 38px; flex: none; }

.contact__row {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  grid-template-areas: "icon how end" "icon value end";
  column-gap: 0.85rem;
  align-items: center;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--card-line);
  overflow: hidden;
}
.contact__row::before {               /* a stroke of gold across the row on hover */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(183, 134, 46, 0.14), rgba(183, 134, 46, 0.02));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease);
}
.contact__row:hover::before,
.contact__row:focus-within::before { transform: scaleX(1); }

.contact__icon {
  grid-area: icon;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(183, 134, 46, 0.45);
  border-radius: 50%;
  color: var(--card-gold);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.contact__row:hover .contact__icon {
  background: var(--card-gold);
  border-color: var(--card-gold);
  color: var(--card);
}
.contact__how {
  grid-area: how;
  position: relative;
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--card-soft);
}
.contact__value {
  grid-area: value;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.9rem, 4.4cqi, 1rem);
  line-height: 1.35;
  color: var(--card-text);
  transition: color 0.3s ease;
}
.contact__value::after {              /* the whole row is the link */
  content: "";
  position: absolute;
  inset: 0;
}
.contact__row:hover .contact__value { color: var(--card-gold); }
.contact__value:focus-visible { outline: none; }
.contact__value:focus-visible::after { outline: 2px solid var(--card-gold); outline-offset: -3px; }

.contact__end {
  grid-area: end;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--card-gold);
}
.contact__arrow { transition: transform 0.4s var(--ease); }
.contact__row:hover .contact__arrow { transform: translateX(5px); }
.contact__copy {
  position: relative;
  z-index: 1;                          /* stays clickable above the row link */
  min-height: 28px;
  padding: 0 0.65rem;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: transparent;
  color: var(--card-soft);
  font-size: 0.72rem;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.contact__copy:hover { color: var(--card-text); border-color: var(--card-gold); }
.contact__copy.is-done { background: var(--card-gold); border-color: var(--card-gold); color: var(--card); }

@container (max-width: 560px) {
  .contact__head { padding: 0.6rem 1rem; }
  .contact__row {
    grid-template-areas: "icon how end" "value value value";
    row-gap: 0.4rem;
    padding: 0.7rem 1rem 0.8rem;
  }
  .contact__arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .contact__row::before, .contact__arrow { transition: none; }
}

.commission__help {
  margin-top: 1.5rem;
  max-width: 52ch;
  color: var(--text-soft);
  font-size: 0.94rem;
}

@media (max-width: 900px) {
  .commission { padding-block: 5rem; }
  .commission__inner { grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
  .commission__content { order: -1; }
  .commission__wall { width: min(100%, 420px); margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .commission__canvas img { transition: none; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { padding: 3.5rem var(--pad) 2rem; max-width: var(--max); margin: 0 auto; }
.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}
.footer__links { flex-wrap: wrap; }
.footer__logo-img { display: block; width: auto; height: 58px; }

/* the logo, in its light and dark versions */
.site-logo--dark { display: none !important; }
:root[data-theme="dark"] .site-logo--light { display: none !important; }
:root[data-theme="dark"] .site-logo--dark { display: block !important; }
.nav__logo-text { display: block; }
.nav__logo-img {
  display: block;
  width: auto;
  height: 54px;
  margin-block: -8px;                  /* a larger logo without a taller navbar */
}
@media (max-width: 860px) {
  .nav__logo-img { height: 46px; margin-block: -5px; }
}
.footer__links, .footer__social { display: flex; gap: 1.6rem; }
.footer__links a, .footer__social a { color: var(--text-soft); font-size: 0.9rem; transition: color 0.3s ease; }
.footer__links a:hover, .footer__social a:hover { color: var(--gold-deep); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.footer__signature { font-style: italic; font-family: var(--font-display); color: var(--gold-deep); font-size: 0.85rem; }

/* ==========================================================================
   LIGHTBOX — a private viewing room. The painting flies here from the wall,
   in the same gold frame, and always fits the stage whole.
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.lightbox.is-open { visibility: visible; opacity: 1; }
.lightbox.has-motion { opacity: 1; transition: none; }  /* Motion runs the show */
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 11, 7, 0.86);
  backdrop-filter: blur(7px);
}
.lightbox__panel {
  position: relative;
  z-index: 2;
  width: min(94vw, 1240px);
  height: min(88vh, 88dvh, 820px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(270px, 25vw, 340px);
}
.lightbox__sheet {                     /* the room itself, behind the painting */
  position: absolute;
  inset: 0;
  background: var(--wall);
  border: 1px solid rgba(183, 134, 46, 0.45);
  border-radius: 3px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
}
.lightbox__image-wrap {
  position: relative;
  z-index: 2;
  min-width: 0; min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 3vw, 2.75rem);
}

/* the frame: moulding, mat, then the painting at its true proportions */
.lightbox__frame {
  --fw: clamp(12px, 1.25vw, 20px);
  --mat: clamp(12px, 1.6vw, 24px);
  position: relative;
  padding: var(--mat);
  border: var(--fw) solid transparent;
  border-image: var(--moulding) 64 stretch;
  background: var(--mat-color) padding-box;
  box-shadow:
    inset 0 4px 8px -1px rgba(0, 0, 0, 0.4),
    0 3px 5px rgba(0, 0, 0, 0.3),
    0 40px 56px -26px rgba(var(--shadow-rgb), var(--shadow-a));
  will-change: transform;
}
.lightbox__frame .frame-opening {
  width: auto;
  aspect-ratio: auto;
  background-size: cover;
  background-position: center;
}
.lightbox__sheen {                     /* a band of light crossing the glass */
  position: absolute;
  top: -10%; bottom: -10%;
  left: 0;
  width: 60%;
  transform: translateX(-140%);
  pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.34) 50%, transparent 82%);
}
.lightbox__frame.is-round {
  border: 0;
  border-image: none;
  border-radius: 50%;
  padding: calc(var(--fw) + var(--mat));
  background: conic-gradient(from 205deg, #fff3c9, #c99a3f 10%, #7d5a16 26%, #c9a04c 40%, #fbe6ad 50%, #b98a2c 62%, #6a4b12 78%, #e2bf6e 90%, #fff3c9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.26),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3),
    0 3px 5px rgba(0, 0, 0, 0.3),
    0 40px 56px -26px rgba(var(--shadow-rgb), var(--shadow-a));
}
.lightbox__frame.is-round::before {
  content: "";
  position: absolute;
  inset: var(--fw);
  border-radius: 50%;
  background: var(--mat-color);
  box-shadow:
    inset 0 4px 7px -1px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(40, 26, 6, 0.7),
    0 0 0 2px #dcb764;
}

/* the details */
.lightbox__meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  min-height: 0;
  overflow-y: auto;
  padding: 3.5rem clamp(1.5rem, 2.4vw, 2.5rem) 2rem;
  border-left: 1px solid rgba(183, 134, 46, 0.3);
}
.lightbox__index {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.lightbox__meta h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.5vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
}
.lightbox__meta p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text-soft);
}
.lightbox__specs {
  margin: 0.6rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(183, 134, 46, 0.3);
  display: grid;
  gap: 0.6rem;
}
.lightbox__specs div { display: flex; justify-content: space-between; gap: 1rem; }
.lightbox__specs dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding-top: 0.2rem;
}
.lightbox__specs dd { margin: 0; font-size: 0.9rem; color: var(--text); text-align: right; }
.lightbox__controls { display: flex; gap: 0.6rem; margin-top: 1.1rem; }

.lightbox__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(183, 134, 46, 0.55);
  color: var(--text); font-size: 0.95rem;
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.lightbox__close:hover { border-color: var(--gold); background: rgba(183, 134, 46, 0.12); transform: rotate(90deg); }
.lightbox__nav {
  width: 46px; height: 46px; border-radius: 50%;
  background: transparent; border: 1px solid rgba(183, 134, 46, 0.55);
  color: var(--text); font-size: 1.35rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.lightbox__nav:hover { border-color: var(--gold); background: rgba(183, 134, 46, 0.12); transform: translateY(-2px); }
.lightbox__close:focus-visible, .lightbox__nav:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-height: 620px) and (min-width: 761px) {
  .lightbox__meta { justify-content: flex-start; gap: 0.5rem; padding-top: 3rem; padding-bottom: 1rem; }
  .lightbox__meta h3 { font-size: 1.5rem; }
  .lightbox__specs { gap: 0.3rem; padding-top: 0.6rem; margin-top: 0.2rem; }
  .lightbox__controls { margin-top: 0.5rem; }
  .lightbox__nav { width: 38px; height: 38px; }
}
@media (max-width: 760px) {
  .lightbox__panel {
    width: 94vw;
    height: 92svh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .lightbox__frame { --fw: 10px; --mat: 10px; }
  .lightbox__meta {
    padding: 1rem 1.25rem 1.1rem;
    gap: 0.4rem;
    border-left: 0;
    border-top: 1px solid rgba(183, 134, 46, 0.3);
  }
  .lightbox__meta h3 { font-size: 1.45rem; }
  .lightbox__meta p { font-size: 0.92rem; }
  .lightbox__specs { margin-top: 0.3rem; padding-top: 0.6rem; gap: 0.3rem; }
  .lightbox__specs dd { font-size: 0.8rem; }
  .lightbox__meta { overflow-y: visible; }
  .lightbox__controls { margin-top: 0.5rem; justify-content: center; }
  .lightbox__nav { width: 40px; height: 40px; }
}

/* ==========================================================================
   RESPONSIVE — NAV
   ========================================================================== */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
