/* Cardinham's — static art site (minimal) */
:root {
  --wall: #4e534d;
  --ink: #3b3833;
  --muted: #8b857c;
  --line: rgba(59, 56, 51, .14);
  --band: color-mix(in srgb, var(--wall) 94%, #000);
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --cm: 3.6px;              /* pixels per real centimetre on the salon wall */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --red: #b3302a;
}
:root.dark { --ink: #eee8de; --muted: rgba(238, 232, 222, .58); --line: rgba(238, 232, 222, .16); --band: color-mix(in srgb, var(--wall) 88%, #000); }
@media (max-width: 1100px) { :root { --cm: 3px; } }
@media (max-width: 700px)  { :root { --cm: 2.6px; } }
@media (max-width: 420px)  { :root { --cm: 2.3px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 300 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
  transition: background-color .7s ease, color .7s ease;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.small { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

/* ---------- header ---------- */
.site-header { background: var(--band); transition: background-color .7s ease; position: sticky; top: 0; z-index: 20; }
.head-end { display: flex; justify-content: flex-end; align-items: center; gap: 22px; }
.head-walls .sw { width: 16px; height: 16px; }
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 76px; }
.nav { display: flex; gap: 30px; }
.nav a { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.logo { display: block; }
.logo img { height: 17px; width: auto; transition: filter .7s; }
:root.dark .logo img { filter: invert(1) brightness(1.6); }
.logo-text { display: none; font: 400 24px/1 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.logo.fallback img { display: none; } .logo.fallback .logo-text { display: block; }
.menu-btn { display: none; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); padding: 8px 0; }
@media (max-width: 760px) {
  .site-header .wrap { grid-template-columns: 1fr auto; height: 62px; }
  .logo { grid-column: 1; grid-row: 1; } .logo img { height: 14px; }
  .head-end { grid-column: 2; grid-row: 1; gap: 16px; }
  .menu-btn { display: block; }
  .head-walls { gap: 7px; } .head-walls .small { display: none; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--band); flex-direction: column; gap: 0; padding: 4px var(--gutter) 18px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-top: 1px solid var(--line); }
}

/* ---------- footer ---------- */
.site-footer { padding: 120px 0 36px; font-size: 12px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--ink); }

/* ---------- wall colour switcher ---------- */
.walls { display: flex; gap: 10px; align-items: center; }
.walls .small { margin-right: 6px; }
.sw { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); position: relative; transition: transform .3s var(--ease); }
.sw:hover { transform: scale(1.2); }
.sw[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border: 1px solid var(--ink); border-radius: 50%; opacity: .7; }

/* ---------- shared ---------- */
.hung img { width: 100%; height: 100%; object-fit: contain; }
.shadow img { box-shadow: 0 1px 1px rgba(30,24,16,.06), 0 10px 18px -6px rgba(30,24,16,.2), 0 30px 50px -22px rgba(30,24,16,.24); }
:root.dark .shadow img { box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 14px 22px -6px rgba(0,0,0,.4), 0 34px 60px -20px rgba(0,0,0,.5); }
.text-link { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: 5px; transition: border-color .3s; }
.text-link:hover { border-color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.12; }


/* ---------- homepage hero: full-width photo, text on top ---------- */
.hero { position: relative; height: calc(100svh - 76px); min-height: 520px; overflow: hidden; color: #f6f1e8; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 45%; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(22,18,14,.72) 0%, rgba(22,18,14,.38) 32%, rgba(22,18,14,0) 62%); }
.hero-text { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(96px, 14vh, 150px); max-width: 34em; }
.hero-text .small { color: rgba(246,241,232,.82); }
.hero-text h1 { font-size: clamp(44px, 6vw, 92px); margin: 16px 0 20px; color: #f6f1e8; }
.hero-text p { font: 400 clamp(19px, 1.8vw, 25px)/1.45 var(--serif); margin: 0; max-width: 26em; }
.scroll-cue { position: absolute; z-index: 1; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #f6f1e8; }
.scroll-cue .small { color: rgba(246,241,232,.85); }
.scroll-cue i { font-style: normal; font-size: 18px; line-height: 1; }
.scroll-cue:hover .small { color: #fff; }
@media (prefers-reduced-motion: no-preference) { .scroll-cue i { animation: bob 2.4s ease-in-out infinite; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
.collection-note { text-align: center; margin: clamp(56px, 7vw, 100px) var(--gutter) 0; }
.collection-note span { text-transform: none; letter-spacing: .02em; font-size: 13px; }
@media (max-width: 760px) {
  .hero { height: calc(100svh - 62px); min-height: 460px; }
  .hero-img { object-position: 40% 50%; }
  .hero-text { bottom: 96px; }
  .collection-note span { display: block; margin-top: 6px; }
}
html { scroll-behavior: smooth; }
#collection { scroll-margin-top: 90px; }

/* ---------- home: the collection, loosely hung ---------- */
.scatter {
  display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: flex-start;
  gap: clamp(36px, 5vw, 90px) clamp(20px, 3vw, 60px);
  padding: clamp(40px, 7vw, 110px) 0 0;
}
.piece { display: block; position: relative; flex: none; }
.piece img { width: 100%; height: auto; transition: transform .7s var(--ease); }
.piece:hover img { transform: translateY(-5px); }
.piece .t { display: block; margin-top: 14px; font: 400 15px/1.3 var(--serif); color: transparent; transition: color .4s; }
.piece .p { display: block; margin-top: 2px; font-size: 12px; letter-spacing: .04em; color: transparent; transition: color .4s; }
.piece:hover .t, .piece:focus-visible .t, .piece:hover .p, .piece:focus-visible .p { color: var(--muted); }
@media (hover: none) { .piece .t, .piece .p { color: var(--muted); } }
/* Sold: a gallery red dot just under the frame, always visible; the price line reads "Sold" */
.piece.sold .t::before { content: ""; position: absolute; right: 0; margin-top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.piece.sold .p, .piece.reserved .p { font-size: 0; }
.piece.sold .p::after, .piece.reserved .p::after { font-size: 12px; }
.piece.sold .p::after { content: "Sold"; }
.piece.reserved .p::after { content: "Reserved"; }
.scatter { width: calc(100% - 2 * var(--gutter)); max-width: 1400px; margin-left: auto; margin-right: auto; }
.scatter.hung-free { display: block; position: relative; padding: 0; margin-top: clamp(40px, 6vw, 96px); }
.scatter.hung-free .piece { position: absolute; transition: left .6s var(--ease), top .6s var(--ease); }
/* the four sizes — set in index.html */
.piece.s  { width: clamp(120px, 12vw, 200px); }
.piece.m  { width: clamp(160px, 18vw, 300px); }
.piece.l  { width: clamp(210px, 25vw, 420px); }
.piece.xl { width: clamp(260px, 33vw, 560px); }
@media (max-width: 700px) {
  .scatter { gap: 44px 18px; }
  .piece.s { width: 36%; } .piece.m { width: 44%; } .piece.l { width: 72%; } .piece.xl { width: 92%; }
}
.piece img { box-shadow: 0 1px 1px rgba(30,24,16,.06), 0 10px 18px -6px rgba(30,24,16,.2), 0 30px 50px -22px rgba(30,24,16,.24); }
:root.dark .piece img { box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 14px 22px -6px rgba(0,0,0,.4), 0 34px 60px -20px rgba(0,0,0,.5); }

/* ---------- painting page: image left, details right ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: clamp(40px, 6vw, 120px); align-items: center; padding-top: clamp(24px, 4vw, 56px); }
@media (max-width: 900px) { .work { grid-template-columns: 1fr; } }
.stage { position: relative; height: min(70vh, 760px); min-height: 340px; }
.stage .art { position: absolute; transition: all .8s var(--ease); }
.stage .art .hung { width: 100%; height: 100%; }
.stage .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity .6s; }
.stage .furniture { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); color: var(--muted); opacity: 0; transition: opacity .6s; }
.stage.scaled .floor, .stage.scaled .furniture { opacity: 1; }
.stage-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 26px 0 0; }
.stage-tools .right { display: flex; gap: 24px; align-items: center; }
.thumbs { display: flex; gap: 8px; }
.thumbs button { width: 36px; height: 36px; opacity: .45; transition: opacity .3s; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-pressed="true"], .thumbs button:hover { opacity: 1; }
.scale-btn { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.scale-btn:hover, .scale-btn[aria-pressed="true"] { color: var(--ink); }

.work-info { max-width: 420px; }
.work-info .back { display: inline-block; margin-bottom: 40px; }
.work-info .back:hover { color: var(--ink); }
.work-info h1 { font-size: clamp(32px, 3.4vw, 46px); }
.work-info .by { font: italic 400 20px/1.4 var(--serif); color: var(--muted); margin-top: 8px; }
.work-info .details { margin: 28px 0 0; font-size: 14px; line-height: 1.9; color: var(--muted); }
.work-info .details span { display: block; }
.work-info .notes { margin: 22px 0 0; font: 400 16px/1.6 var(--serif); color: var(--muted); }
.work-info .notes p { margin: 0 0 6px; }
.work-info .enquire { margin-top: 36px; display: flex; align-items: baseline; gap: 28px; flex-wrap: wrap; }
.work-info .price { font: 400 19px/1 var(--serif); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-right: 10px; vertical-align: 2px; }
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--line); font: 400 15px/1.3 var(--serif); color: var(--muted); }
.pager a:hover { color: var(--ink); }
.pager a:last-child { text-align: right; }

/* smooth hand-off from the collection to a painting (supporting browsers) */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }

/* ---------- text pages ---------- */
.text-page { max-width: 640px; margin: 0 auto; padding: clamp(56px, 10vh, 120px) 0 0; text-align: center; }
.text-page h1 { font-size: clamp(34px, 4vw, 52px); margin: 18px 0 32px; }
.text-page p { font: 400 clamp(18px, 1.8vw, 21px)/1.6 var(--serif); margin: 0 0 1.1em; }
.text-page .muted { color: var(--muted); }
.text-page .figure { margin: 64px auto 0; max-width: 520px; }
.text-page .figure img { width: 100%; }
.contact-list { margin-top: 40px; display: grid; gap: 22px; }
.contact-list a { font: 400 clamp(22px, 2.6vw, 30px)/1.3 var(--serif); }
.contact-list a:hover { color: var(--muted); }

/* gentle entrance */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(10px); transition: opacity 1.1s ease, transform 1.1s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
}

/* Homepage: the wall-colour switcher fades in once you start scrolling */
:root.has-hero .head-walls { opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s; }
:root.has-hero.scrolled .head-walls { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease, transform .6s ease, visibility 0s; }
