/* =========================================================================
   Matas — fine art portfolio
   Soft Structuralism: silver-grey field, massive wide display type,
   floating works with soft diffused shadows, one electric-blue accent.
   ========================================================================= */

:root {
  --bg:        #f1f1ef;
  --bg-tint:   #e9e9e6;
  --ink:       #161616;
  --muted:     #6f6f6c;
  --faint:     #9b9b97;
  --line:      rgba(22, 22, 22, 0.12);
  --line-soft: rgba(22, 22, 22, 0.07);
  --accent:    #4300ff;
  --accent-12: rgba(67, 0, 255, 0.12);
  --paper:     #fbfbfa;

  /* deep electric blue used full-bleed on the home page */
  --blue:      #4300ff;
  --blue-deep: #2e00c4;
  --outline:   #ececec;   /* near-white text outline, matches original */

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;

  --shadow-rest:  0 18px 40px -28px rgba(20, 20, 35, 0.45);
  --shadow-lift:  0 50px 90px -40px rgba(20, 20, 40, 0.55);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 72px);
}

/* ----- reset ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ----- home: deep-blue field, white type ------------------------------- */
body.theme-blue {
  background: var(--blue);
  color: #fff;
}
body.theme-blue ::selection { background: #fff; color: var(--blue); }

/* subtle paper grain over the whole field */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* ----- layout helpers -------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.4vw, 26px) var(--gutter);
  color: var(--ink);
}
body.theme-blue .site-head { color: #fff; }

/* home only: top bar is hidden until you scroll past the hero, then it
   slides in as a translucent bar */
.site-head.autohide {
  transform: translateY(-115%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease), opacity 0.4s var(--ease), background 0.4s var(--ease);
}
.site-head.autohide.shown {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  background: rgba(38, 0, 175, 0.94);   /* solid enough that white nav always reads, even over the white section */
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
/* keep the brand + nav white whenever the bar is shown */
.site-head.autohide.shown, .site-head.autohide.shown .brand .dot { color: #fff; }
.autohide-sentinel { display: block; width: 1px; height: 1px; }
@media (prefers-reduced-motion: reduce) {
  .site-head.autohide { transition: opacity 0.2s linear; }
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.brand .dot { color: var(--accent); }
body.theme-blue .brand .dot { color: #fff; }

.nav { display: flex; gap: clamp(18px, 2.4vw, 40px); }
.nav a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding-block: 4px;
  color: inherit;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .muted-link { opacity: 0.6; }

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

/* =========================================================================
   Home — hero
   ========================================================================= */
/* outlined display type — transparent fill + stroke, as in the original */
.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--outline);
  text-stroke: 1.5px var(--outline);
  paint-order: stroke fill;
}
@supports not ((-webkit-text-stroke: 1px #000) or (text-stroke: 1px #000)) {
  .outline { color: #fff; }   /* graceful fallback */
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: clamp(110px, 14vh, 180px);
  padding-bottom: clamp(40px, 7vh, 80px);
}
.hero .wrap { width: 100%; }

.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 64px); }
.hero-role {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 112%;
  font-size: clamp(13px, 1.3vw, 17px);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 clamp(14px, 2vw, 26px);
}
.hero-mark {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 118%;
  line-height: 0.82;
  letter-spacing: -0.012em;
  font-size: clamp(64px, 16.5vw, 260px);
  margin: 0;
  white-space: nowrap;
}
.hero-mark .dot,
.section-title .dot {
  -webkit-text-fill-color: #fff;
  color: #fff;
  -webkit-text-stroke-width: 0;
  text-stroke: 0;
}

/* name above, nav + description below */
.hero-foot {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 0.7fr);
  gap: clamp(28px, 6vw, 90px);
  align-items: end;
  margin-top: clamp(28px, 5vw, 70px);
}
.hero-nav { display: flex; flex-direction: column; gap: 10px; font-size: clamp(15px, 1.4vw, 18px); }
.hero-nav a {
  position: relative; width: max-content;
  font-style: italic;
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 8px 18px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.hero-nav a:hover, .hero-nav a:focus-visible {
  background: #fff; border-color: #fff; color: var(--blue);
}

.hero-lede {
  font-size: clamp(14px, 1.15vw, 16px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  max-width: 42ch;
  margin: 0;
}
.hero-lede .accent { color: #fff; font-weight: 600; }

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.scroll-cue .line {
  width: 46px; height: 1px; background: #fff; opacity: 0.6;
  transform-origin: left;
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue { 0%,100%{ transform: scaleX(0.4);} 50%{ transform: scaleX(1);} }

/* =========================================================================
   Home — full-screen infinite 3D gallery
   ========================================================================= */
.gallery-page {
  height: 100svh;
  overflow: hidden;
  background: #000;
  color: #fff;
  cursor: grab;
}
.gallery-page:active { cursor: grabbing; }
.gallery-page::after { opacity: 0; }   /* drop the paper grain over the gallery */
/* the canvas lives INSIDE .gallery-overlay (not a fixed sibling) so that the
   headline's mix-blend-mode shares one stacking context with it — CSS
   blending only composites within a single stacking context, so a sibling
   .gallery-root under <body> would never be visible to the blend at all */
.gallery-root {
  position: absolute; inset: 0; z-index: 0;
  touch-action: none;
  pointer-events: auto;
}
.gallery-root #gl { display: block; width: 100%; height: 100%; }

.gallery-overlay {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none;
}
.gallery-overlay a { pointer-events: auto; }
/* the original hero layout, reused as the overlay so positioning is unchanged */
.gallery-overlay .hero { position: relative; z-index: 1; min-height: 100svh; }

/* small text links (catalogue + contact) */
.g-catalogue {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-stretch: 108%;
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 12px; color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 4px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.g-catalogue span { transition: transform 0.3s var(--ease); }
.g-catalogue:hover, .g-catalogue:focus-visible { color: #fff; border-color: #fff; }
.g-catalogue:hover span { transform: translateX(4px); }

.g-links { margin-top: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.g-contact-mobile { display: none; }

/* the contact link sits where the nav buttons were — undo the button styling */
.hero-nav .g-catalogue {
  border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0 0 4px; font-style: normal; width: max-content;
}
.hero-nav .g-catalogue:hover, .hero-nav .g-catalogue:focus-visible {
  background: transparent; color: #fff; border-color: #fff;
}

/* the big Matas inverts against paintings passing behind it (template's
   exclusion blend); eyebrow, lede and links stay untouched */
.gallery-overlay .hero-mark { mix-blend-mode: exclusion; }

/* desktop: slightly heavier outline on the big Matas */
@media (min-width: 901px) {
  .gallery-overlay .hero-mark { -webkit-text-stroke-width: 2px; text-stroke-width: 2px; }
}

/* mobile: quieter eyebrow; nav buttons gone (space kept); contact joins the links */
@media (max-width: 640px) {
  .gallery-overlay .hero-role { font-size: 10px; letter-spacing: 0.24em; opacity: 0.85; }
  .g-contact-desktop { visibility: hidden; }
  .g-contact-mobile { display: inline-flex; }
  /* smaller so the links read as a footnote to the lede, not louder than it */
  .gallery-overlay .g-catalogue { font-size: 10px; letter-spacing: 0.1em; gap: 6px; }
  .gallery-overlay .g-links { gap: 10px; }
}

.g-fallback { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: #fff; padding: 24px; }
.g-fallback h1 { font-family: var(--display); font-weight: 900; font-size: clamp(48px, 12vw, 140px); margin: 0; }
.g-fallback .dot { color: var(--accent); }
.g-fallback a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .gallery-page { cursor: default; }
}

/* =========================================================================
   Home — selected works mosaic
   ========================================================================= */
.works {
  padding-block: clamp(48px, 8vh, 120px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
/* fine-art mosaic sits on its own white band */
.section-light {
  background: #ffffff;
  color: var(--ink);
  border-top: none;
}
.section-light .section-title.outline { -webkit-text-stroke-color: rgba(20, 20, 20, 0.88); text-stroke-color: rgba(20, 20, 20, 0.88); }
.section-light .section-title .dot { -webkit-text-fill-color: var(--accent); color: var(--accent); -webkit-text-stroke-width: 0; }
.section-light .section-link { color: var(--ink); border-bottom-color: rgba(20, 20, 20, 0.3); }
.section-light .section-link:hover { border-bottom-color: var(--ink); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(28px, 4vw, 56px);
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 122%;
  font-size: clamp(34px, 6vw, 92px);
  letter-spacing: -0.015em;
  line-height: 0.9;
  margin: 0;
}
.works-lead {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 104%;
  font-size: clamp(18px, 2.4vw, 34px);
  line-height: 1.16;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  max-width: 24ch;
  margin: 0 0 clamp(34px, 5vw, 64px);
}
.section-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 0.04em;
  color: #fff;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.4s var(--ease);
  align-self: flex-end;
}
.section-link:hover { border-bottom-color: #fff; }
.section-link .arrow {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}
.section-link:hover .arrow { transform: translate(3px, -3px); background: #fff; color: var(--blue); }

/* masonry — full paintings, never cropped */
/* flex-column masonry: full pictures, and a hover that expands cleanly
   (CSS multicol used to clip the scaled tile, so we use real columns) */
.mosaic {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 1.6vw, 24px);
}
.mcol {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 24px);
}
.tile {
  position: relative;
  display: block;
  background: rgba(0, 0, 0, 0.12);
  transform-origin: center;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
  will-change: transform;
}
.tile img {
  width: 100%;
  height: auto;            /* full picture, natural aspect ratio */
  display: block;
}
.tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; justify-content: flex-end; align-items: end;
  padding: 16px 16px 14px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.tile figcaption .num { font-family: var(--display); font-weight: 700; font-stretch: 110%; }
/* the whole work grows from its fixed size: it expands, it does not zoom-crop */
.tile:hover { transform: scale(1.06); z-index: 5; box-shadow: 0 40px 80px -30px rgba(0,0,0,0.55); }
.tile:hover figcaption { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .mosaic { flex-direction: column; }
  .mcol { width: 100%; }
}

/* =========================================================================
   Projects — home sideways scroller + projects page
   ========================================================================= */
.projects-block { padding-block: clamp(60px, 10vh, 140px); border-top: 1px solid rgba(255, 255, 255, 0.18); }
.projects-sub { margin: 14px 0 0; font-size: clamp(14px, 1.2vw, 17px); color: rgba(255, 255, 255, 0.62); max-width: 44ch; }

/* horizontal scroller (edge-to-edge, snaps, drag or wheel) */
.proj-scroller {
  margin-top: clamp(28px, 4vw, 52px);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 22px var(--gutter) 22px;   /* room so hovered cards don't clip at the top */
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.proj-scroller.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.proj-scroller::-webkit-scrollbar { height: 4px; }
.proj-scroller::-webkit-scrollbar-track { background: rgba(255,255,255,0.08); }
.proj-scroller::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }
.proj-track { display: inline-flex; gap: clamp(14px, 1.6vw, 22px); padding-right: var(--gutter); }

.proj-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: clamp(238px, 25vw, 320px);
  height: clamp(310px, 32vw, 420px);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(18px, 1.7vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: linear-gradient(158deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  color: #fff;
  position: relative; overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.proj-card:hover, .proj-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.45);
  background: linear-gradient(158deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  outline: none;
}
.proj-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.proj-n { font-family: var(--display); font-weight: 700; font-stretch: 110%; }
.proj-mid { flex: 1; display: grid; place-items: center; overflow: hidden; }
.proj-ghost {
  font-family: var(--display); font-weight: 900; font-stretch: 118%;
  font-size: clamp(42px, 5.5vw, 76px);
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.16);
  white-space: nowrap; transition: -webkit-text-stroke-color 0.4s var(--ease);
}
.proj-card:hover .proj-ghost { -webkit-text-stroke-color: rgba(255,255,255,0.32); }
.proj-title { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(20px, 2vw, 28px); margin: 0 0 8px; }
.proj-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,0.55); }
.proj-status { color: rgba(255,255,255,0.85); }

.proj-card-end {
  background: #fff; color: var(--blue); border-color: #fff;
  align-items: flex-start; text-decoration: none;
}
.proj-card-end:hover { transform: translateY(-6px); background: #fff; }
.proj-end-label { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.0; }
.proj-end-arrow { font-size: 30px; line-height: 1; }

.proj-hint { margin: 16px 0 0; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.42); }

/* projects page */
.projects-page { padding-top: clamp(120px, 16vh, 180px); padding-bottom: clamp(60px, 10vh, 120px); }
.pp-eyebrow { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin: 0 0 14px; }
.pp-title { font-family: var(--display); font-weight: 900; font-stretch: 122%; font-size: clamp(58px, 14vw, 200px); line-height: 0.84; letter-spacing: -0.02em; margin: 0; }
.pp-title .dot { -webkit-text-fill-color: #fff; color: #fff; -webkit-text-stroke-width: 0; }
.pp-lead { margin: clamp(22px, 3vw, 32px) 0 0; max-width: 56ch; font-size: clamp(15px, 1.5vw, 18px); line-height: 1.6; color: rgba(255,255,255,0.85); }

.pp-list { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid rgba(255,255,255,0.16); }
.pp-row {
  display: grid;
  grid-template-columns: 54px 1.5fr 1.1fr 70px 1fr;
  gap: clamp(12px, 2vw, 28px); align-items: center;
  padding: clamp(20px, 2.2vw, 32px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  transition: padding-left 0.45s var(--ease), background 0.4s var(--ease);
}
.pp-row:hover { padding-left: 14px; background: linear-gradient(to right, rgba(255,255,255,0.05), transparent); }
.pp-row-n { font-family: var(--display); font-weight: 700; color: rgba(255,255,255,0.5); font-size: 14px; }
.pp-row-title { font-family: var(--display); font-weight: 800; font-stretch: 106%; font-size: clamp(20px, 2.2vw, 32px); }
.pp-row-cat { color: rgba(255,255,255,0.7); font-size: 14px; }
.pp-row-year { color: rgba(255,255,255,0.5); font-size: 14px; }
.pp-row-status { justify-self: end; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.6); }

@media (max-width: 760px) {
  .pp-row { grid-template-columns: 40px 1fr auto; row-gap: 4px; }
  .pp-row-cat { grid-column: 2; color: rgba(255,255,255,0.6); }
  .pp-row-year { display: none; }
  .pp-row-status { grid-column: 2 / 4; justify-self: start; }
}

/* =========================================================================
   Art gallery
   ========================================================================= */
.gallery-intro {
  padding-top: clamp(120px, 18vh, 240px);
  padding-bottom: clamp(40px, 8vh, 96px);
}
.gallery-intro h1 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(60px, 15vw, 220px);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
}
.gallery-intro h1 .dot { color: var(--accent); }
.gallery-intro .sub {
  margin-top: 28px;
  max-width: 52ch;
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--muted);
  line-height: 1.6;
}
.gallery-count {
  display: flex; gap: 28px; flex-wrap: wrap;
  margin-top: 34px;
  font-size: 13px; color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.gallery-count b { color: var(--ink); font-weight: 600; }

.piece {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 90px);
  align-items: center;
  padding-block: clamp(56px, 9vh, 130px);
  border-top: 1px solid var(--line-soft);
}
.piece:nth-child(even) .piece-media { order: 2; }
.piece-media {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
  background: var(--bg-tint);
  transform-origin: center;
  transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease);
  will-change: transform;
}
.piece-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* the whole painting grows from its fixed size on hover, it does not zoom-crop */
.piece-media:hover { transform: scale(1.05); z-index: 2; box-shadow: var(--shadow-lift); }
/* click target to open the full-size lightbox */
.piece-zoom {
  position: absolute; inset: 0; z-index: 3;
  border: 0; padding: 0; margin: 0; background: transparent;
  cursor: zoom-in; -webkit-appearance: none; appearance: none;
}
.piece-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(10, 6, 40, 0.86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; transform: scale(0.96); transition: transform 0.45s var(--ease); }
.lightbox.open .lightbox-figure { transform: scale(1); }
.lightbox-img {
  max-width: 100%; max-height: 82vh;
  width: auto; height: auto; object-fit: contain;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.7);
  cursor: default;
}
.lightbox-cap { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.lightbox-close {
  position: absolute; top: clamp(14px, 2vw, 26px); right: clamp(14px, 2vw, 30px);
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.06);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,0.16); transform: rotate(90deg); }
body.lb-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-figure { transition: none; }
}

.piece-num {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(40px, 6vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.piece-num .slash { color: var(--accent); }
.piece-body { font-size: clamp(14.5px, 1.2vw, 16px); line-height: 1.62; color: #2c2c2a; margin: 22px 0 0; }
.piece-tech { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 14px 0 0; }

.spec {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 26px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.spec dt { color: var(--faint); letter-spacing: 0.04em; }
.spec dd { margin: 0; color: var(--ink); font-weight: 500; }
.price { font-family: var(--display); font-weight: 700; font-stretch: 110%; }
.price.sold { color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-stretch: 100%; }
.price.avail { color: var(--accent); }
a.price.avail { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.price.avail:hover { text-decoration-thickness: 2px; }

/* =========================================================================
   Footer
   ========================================================================= */
.foot {
  border-top: 1px solid var(--line);
  padding-block: clamp(60px, 10vh, 140px);
}
body.theme-blue .foot { border-top-color: rgba(255, 255, 255, 0.18); }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: end;
}
.foot-cta { font-family: var(--display); font-weight: 800; font-stretch: 118%; line-height: 0.9; letter-spacing: -0.015em; margin: 0; }
.foot-cta a { font-size: clamp(34px, 7vw, 96px); display: inline-block; transition: color 0.4s var(--ease); }
.foot-cta a:hover { color: var(--accent); }
body.theme-blue .foot-cta a:hover { color: #fff; opacity: 0.7; }
.foot-meta { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
body.theme-blue .foot-meta { color: rgba(255, 255, 255, 0.75); }
.foot-meta a:hover { color: var(--accent); }
body.theme-blue .foot-meta a:hover { color: #fff; }
.foot-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: clamp(40px, 7vw, 90px);
  font-size: 12px; color: var(--faint);
  letter-spacing: 0.02em;
}
body.theme-blue .foot-bottom { color: rgba(255, 255, 255, 0.55); }

/* =========================================================================
   Constantine-style motion & line devices  (home / theme-blue)
   ========================================================================= */

/* --- thin rule that draws in --- */
.rule {
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
}
.rule.in, .in .rule { transform: scaleX(1); }
body:not(.theme-blue) .rule { background: var(--line); }

/* ruler with tick marks (top of hero) */
.ruler {
  position: relative;
  height: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  background-image: repeating-linear-gradient(
    to right, rgba(255,255,255,0.28) 0 1px, transparent 1px 56px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1.3s var(--ease);
}
.ruler.in, .in .ruler { transform: scaleX(1); }

/* small mono labels with corner-arrow glyphs */
.tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.tag .g { font-size: 13px; opacity: 0.8; }
body:not(.theme-blue) .tag { color: var(--faint); }

/* --- word-by-word reveal (the signature) --- */
[data-words] { --wstep: 0.045s; }
[data-words] .w { display: inline-block; overflow: hidden; vertical-align: top; }
[data-words] .wi {
  display: inline-block;
  color: rgba(255, 255, 255, 0.22);
  transform: translateY(0.05em);
  transition: color 0.55s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * var(--wstep));
}
[data-words].in .wi { color: #fff; transform: none; }
[data-words] .wi.dim { color: rgba(255, 255, 255, 0.4); }
[data-words].in .wi.dim { color: rgba(255, 255, 255, 0.5); }   /* two-tone accent words stay quieter */
body:not(.theme-blue) [data-words] .wi { color: rgba(20,20,20,0.18); }
body:not(.theme-blue) [data-words].in .wi { color: var(--ink); }
body:not(.theme-blue) [data-words].in .wi.dim { color: rgba(20,20,20,0.4); }

/* --- corner-bracket image frame --- */
.framed { position: relative; }
.framed .brk {
  position: absolute;
  width: 16px; height: 16px;
  border: 1.5px solid currentColor;
  opacity: 0.9;
  transition: transform 0.7s var(--ease) 0.15s, opacity 0.5s var(--ease);
}
.framed .brk.tl { top: -10px; left: -10px;  border-right: 0; border-bottom: 0; transform: translate(8px, 8px); }
.framed .brk.tr { top: -10px; right: -10px; border-left: 0;  border-bottom: 0; transform: translate(-8px, 8px); }
.framed .brk.bl { bottom: -10px; left: -10px;  border-right: 0; border-top: 0; transform: translate(8px, -8px); }
.framed .brk.br { bottom: -10px; right: -10px; border-left: 0;  border-top: 0; transform: translate(-8px, -8px); }
.framed.in .brk, .in .framed .brk { transform: none; }

/* clip-reveal for images */
.clip { clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--ease); }
.clip img { transform: scale(1.08); transition: transform 1.2s var(--ease); }
.clip.in, .in .clip { clip-path: inset(0 0 0 0); }
.clip.in img, .in .clip img { transform: scale(1); }

/* rotating circular badge */
.badge {
  width: 116px; height: 116px;
  position: relative;
  animation: spin 18s linear infinite;
}
.badge svg { width: 100%; height: 100%; }
.badge text { fill: rgba(255,255,255,0.78); font-size: 9.4px; letter-spacing: 3.1px; text-transform: uppercase; font-family: var(--body); }
.badge .core {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  display: grid; place-items: center;
}
.badge .core::after { content: "↗"; font-size: 13px; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* marquee strip */
.marquee {
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  overflow: hidden;
  padding-block: clamp(14px, 2vw, 22px);
}
.marquee-track {
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
  animation: marq 32s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 110%;
  font-size: clamp(20px, 3vw, 40px);
  letter-spacing: 0.01em;
  padding-inline: 0.5em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.85);
}
.marquee-track .solid { color: #fff; -webkit-text-stroke: 0; }
.marquee-track .star { -webkit-text-stroke: 0; color: rgba(255,255,255,0.6); }
@keyframes marq { to { transform: translateX(-50%); } }

/* statement section */
.statement { padding-block: clamp(80px, 14vh, 200px); border-top: 1px solid rgba(255,255,255,0.18); }
.statement-head {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 110%;
  font-size: clamp(26px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-align: center;
  max-width: 18ch;
  margin: 0 auto;
}

/* =========================================================================
   Scroll reveal
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(34px); filter: blur(6px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* load animation for hero */
.load { opacity: 0; transform: translateY(28px); }
.loaded .load { animation: rise 1.1s var(--ease) forwards; }
.loaded .load.l1 { animation-delay: 0.05s; }
.loaded .load.l2 { animation-delay: 0.18s; }
.loaded .load.l3 { animation-delay: 0.30s; }
.loaded .load.l4 { animation-delay: 0.42s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .hero-foot { grid-template-columns: 1fr; align-items: start; gap: 26px; }
  .piece { grid-template-columns: 1fr; gap: 26px; }
  .piece:nth-child(even) .piece-media { order: 0; }
  .foot-grid { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 560px) {
  .nav { gap: 16px; }
  .nav .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .load { opacity: 1; transform: none; }
}
