/* rosemariecusin.ch — the only stylesheet.
   A quiet gallery wall: the paintings hang whole (never cropped) on the warm white of her
   canvases, the words stay in charcoal, and the one colour is the grey-blue of her lakes. */

@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/CormorantGaramond-Italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/Jost.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --wall: #f3f1ec;          /* the white of her canvases, warmed */
  --wall-2: #e8e4dc;        /* the footer, a shade further from the light */
  --ink: #23262a;           /* charcoal */
  --ink-2: #5a5852;         /* captions, dates — AA on both walls */
  --line: #d3cdc2;
  --lake: #375670;          /* the grey-blue of her lakes: links, focus */
  --shadow: 0 1px 2px rgb(40 34 28 / 0.10), 0 14px 30px -16px rgb(40 34 28 / 0.42);
  --shadow-up: 0 2px 4px rgb(40 34 28 / 0.10), 0 22px 40px -18px rgb(40 34 28 / 0.50);
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --qry-speed: 0.25s;
  --qry-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans); font-feature-settings: 'kern', 'liga';
}
img { max-width: 100%; height: auto; }
a { color: var(--lake); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--lake); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 300; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.75rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.wrap { width: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.5rem 1rem; background: var(--ink); color: var(--wall); }
.skip:focus { top: 1rem; }

/* ── header: the name, the menu, the languages ───────────────────────── */
.top {
  padding: 1.6rem 0 1.4rem;
  display: flex; align-items: baseline; gap: 1rem 2.5rem; flex-wrap: wrap;
}
.brand { font: 500 1.55rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: 0.01em; margin-right: auto; }
.top ul { list-style: none; margin: 0; padding: 0; display: flex; }
.menu ul { gap: 0.4rem 1.9rem; flex-wrap: wrap; }
.menu a { color: var(--ink); text-decoration: none; font-size: 1rem; letter-spacing: 0.02em; padding-block: 0.2rem; }
.menu a[aria-current='page'], .menu a:hover { box-shadow: inset 0 -1px var(--ink); }
.langs ul { gap: 0.15rem; }
.langs { font-size: 0.8rem; letter-spacing: 0.08em; }
.langs a { display: block; padding: 0.2rem 0.4rem; color: var(--ink-2); text-decoration: none; border-radius: 2px; }
.langs a:hover { color: var(--ink); }
.langs a[aria-current='true'] { color: var(--ink); box-shadow: inset 0 -1px var(--ink); }
@media (max-width: 40rem) {
  .top { display: grid; grid-template-columns: 1fr auto; padding-top: 1.2rem; }
  .menu { grid-column: 1 / -1; grid-row: 2; }
  .menu ul { gap: 0.3rem 1.4rem; }
}

/* ── home: name, motto, and one painting hung whole ─────────────────── */
.hero { padding: clamp(1.5rem, 5vw, 4rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-text { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.5rem 2rem; margin-bottom: clamp(1.8rem, 4vw, 3.2rem); }
.hero h1 { font-size: clamp(3.1rem, 10vw, 8rem); line-height: 0.92; margin: 0; letter-spacing: -0.02em; grid-row: span 2; }
.role { margin: 0; color: var(--ink-2); letter-spacing: 0.06em; text-align: right; }
.motto { margin: 0; font: italic 400 clamp(1.35rem, 2.4vw, 1.8rem)/1.25 var(--serif); color: var(--ink); text-align: right; }
@media (max-width: 40rem) {
  .hero-text { grid-template-columns: 1fr; }
  .hero h1 { grid-row: auto; margin-bottom: 0.5rem; }
  .role, .motto { text-align: left; }
}
.hang { margin: 0; }
.hang a { display: block; }
.hang img { display: block; width: 100%; box-shadow: var(--shadow); }
.hang figcaption { margin-top: 0.8rem; text-align: right; }
.hang figcaption, .work-caption, .drawing figcaption { font-size: 0.8rem; color: var(--ink-2); letter-spacing: 0.04em; font-variant-numeric: lining-nums tabular-nums; }

section { scroll-margin-top: 1rem; }
.intro, .selection, .recent { padding-block: clamp(2.5rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.lead { font: 400 clamp(1.45rem, 2.4vw, 1.85rem)/1.35 var(--serif); }
.intro-drawing { margin: 0; justify-self: center; max-width: 20rem; }
.intro-drawing img, .drawing img { display: block; box-shadow: var(--shadow); }
@media (max-width: 48rem) { .intro { grid-template-columns: 1fr; } .intro-drawing { max-width: 14rem; justify-self: start; } }
.more { font-size: 0.95rem; letter-spacing: 0.04em; }

/* ── a wall of works: whole paintings in rows of one height ──────────────
   Each item grows with its shape (--ar = width / height, set by build.mjs), so a row's
   paintings share a height and none is cropped; the filler keeps the last row from stretching. */
.wall { --row: 15rem; list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: 2.6rem clamp(1.2rem, 2.6vw, 2.4rem); align-items: flex-start; }
.wall::after { content: ''; flex: 999 1 0; }
@media (min-width: 40rem) { .wall-even::after { display: none; } }   /* a chosen set fills its last row too (the home: 3 + 3); a phone keeps the filler */
.wall > li { flex: var(--ar) 1 calc(var(--ar) * var(--row)); min-width: 0; max-width: calc(var(--ar) * var(--row) * 2); }   /* a lone tall work stays a painting, not a poster */
.wall a { display: block; }
.wall img { display: block; width: 100%; box-shadow: var(--shadow); }
.work-caption { margin: 0.7rem 0 0; }
.wall-large { --row: 17rem; }
@media (max-width: 40rem) { .wall { --row: 8.5rem; gap: 1.8rem 1rem; } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .wall img, .hang img, .poster img { transition: transform var(--qry-speed) var(--qry-ease), box-shadow var(--qry-speed) var(--qry-ease); }
  .wall a:hover img, .hang a:hover img, .poster a:hover img { transform: translateY(-3px); box-shadow: var(--shadow-up); }
}

/* ── inner pages ─────────────────────────────────────────────────────── */
.page { padding: clamp(1.5rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 6rem); }
.page-lead { color: var(--ink-2); max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.artist { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; margin-top: 1.5rem; }
.prose { max-width: 38rem; }
.drawing { margin: 0; max-width: 24rem; }
.drawing figcaption { margin-top: 0.7rem; }
@media (max-width: 48rem) { .artist { grid-template-columns: 1fr; } .drawing { max-width: 16rem; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.5rem; margin: 2rem 0; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.facts dt { font-size: 0.85rem; color: var(--ink-2); letter-spacing: 0.04em; padding-top: 0.1rem; }
.facts dd { margin: 0; }
@media (max-width: 30rem) { .facts { grid-template-columns: 1fr; gap: 0.1rem; } .facts dd { margin-bottom: 0.7rem; } }

/* ── exhibitions ─────────────────────────────────────────────────────── */
.shows { border-top: 1px solid var(--line); padding-top: 1.6rem; margin-top: 1rem; }
.shows > h2 { font-weight: 300; color: var(--ink-2); }
.show { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 1.5rem clamp(2rem, 6vw, 5rem); padding-block: 1.5rem 2.5rem; }
.show + .show { border-top: 1px solid var(--line); }
.show h3 { margin-bottom: 0.2rem; }
.show-dates { margin: 0 0 0.4rem; font-size: 0.9rem; color: var(--lake); letter-spacing: 0.04em; }
.show-kind { color: var(--ink-2); margin-bottom: 0.4rem; }
.show .facts { margin-top: 1.4rem; }
.poster { margin: 0; }
.poster a { display: block; }
.poster img { display: block; box-shadow: var(--shadow); }
@media (max-width: 48rem) { .show { grid-template-columns: 1fr; } .poster { max-width: 15rem; } }
.shows-brief { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 0 clamp(2rem, 5vw, 4rem); }
.shows-brief .show { display: block; padding-block: 0.5rem 1.5rem; }
.shows-brief .show + .show { border-top: 0; }

.lost > div + div { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.lost h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ── footer ──────────────────────────────────────────────────────────── */
.colophon { background: var(--wall-2); padding: 2.6rem 0 2rem; font-size: 0.95rem; }
.colophon-inner { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: end; }
.colophon-name { margin: 0; color: var(--ink-2); }
.colophon-name a { font: 500 1.5rem/1.2 var(--serif); color: var(--ink); text-decoration: none; }
.colophon-motto { margin: 0; font: italic 400 1.35rem/1.3 var(--serif); }
.colophon-small { grid-column: 1 / -1; margin: 0.8rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-2); }
@media (max-width: 40rem) { .colophon-inner { grid-template-columns: 1fr; } }

/* ── the viewer (makeViewer in site.js) ──────────────────────────────── */
.viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #1b1c1e; color: #f3f1ec; }
.viewer::backdrop { background: #1b1c1e; }
.viewer figure { height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; padding: 3.5rem 4.5rem 1.2rem; }
.viewer img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer figcaption { min-height: 1.6em; padding-top: 0.8rem; font-size: 0.85rem; letter-spacing: 0.05em; color: #d8d4cc; font-variant-numeric: tabular-nums; }
.viewer button { position: absolute; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.10); color: #f3f1ec; font: 300 1.7rem/1 var(--sans); cursor: pointer; }
.viewer button:hover { background: rgb(255 255 255 / 0.22); }
.viewer :focus-visible { outline-color: #f3f1ec; }
.viewer .v-close { top: 0.8rem; right: 0.8rem; }
.viewer .v-prev { left: 0.8rem; top: 50%; transform: translateY(-50%); }
.viewer .v-next { right: 0.8rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 40rem) {
  .viewer figure { padding: 3.5rem 0.5rem 4.8rem; }
  .viewer .v-prev, .viewer .v-next { top: auto; bottom: 0.8rem; transform: none; }
}

/* ── print: the words and the works, nothing else ────────────────────── */
@media print {
  body { background: #fff; font-size: 11pt; }
  .skip, .menu, .langs, .viewer, .colophon-small { display: none !important; }
  .wall > li, figure, .show { break-inside: avoid; }
  .wall img, .hang img, .poster img, .drawing img, .intro-drawing img { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* page to page: a cross-fade where the browser can */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
::view-transition-group(root) { animation-duration: var(--qry-speed); animation-timing-function: var(--qry-ease); }
