/* Hors les Murs — shared styles (collage identity: ivory paper, Bodoni italic, Jost, five collage colours) */

@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodoni-moda-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url("fonts/bodoni-moda-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* Brand palette, as in the logo and business plan */
  --ink: #141414;
  --paper: #F4EEE2;      /* ivory page */
  --card: #FFFDF8;       /* lighter sheet */
  --wall: #EAE1CF;       /* mat behind artworks */
  --line: #DCD2BF;
  --muted: #6B6458;
  --vermilion: #D7362A;
  --cobalt: #1F4FA3;
  --gold: #E0A526;
  --teal: #1E8A7A;
  --pink: #E86A9A;
  --vermilion-text: #B8301F;  /* red for small text: passes WCAG AA on ivory */
  --gold-text: #9C6E10;       /* gold for large numerals */

  /* motion tokens: one set of curves and durations for the whole site */
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-pop: cubic-bezier(.2,1.35,.35,1);
  --t-fast: .2s;
  --t-med: .45s;
  --t-slow: .8s;

  /* legacy names used in page styles */
  --magenta: var(--vermilion);
  --sun: var(--gold);
  --emerald: var(--teal);
  --coral: var(--pink);

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;   /* headings, always italic */
  --display: "Jost", "Futura", "Avenir Next", Arial, sans-serif;  /* labels and buttons */
  --text: "Jost", "Futura", "Avenir Next", Arial, sans-serif;     /* body */

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.7rem;
  --step-3: clamp(2.2rem, 4.4vw, 3rem);

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 66ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: clip;
}
[hidden] { display: none !important; }
main { overflow-x: clip; }  /* the floating paper scraps may drift past the screen edge; never allow sideways scrolling */
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--vermilion); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
button { font: inherit; color: inherit; }

/* Body copy is fully justified, with hyphenation to avoid rivers */
p, .prose, .justify {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

h1, h2, h3, .serif { font-family: var(--serif); font-style: italic; font-weight: 500; line-height: 1.08; letter-spacing: 0; margin: 0; }
h2 { font-size: var(--step-3); }
h3 { font-size: 1.35rem; }

/* Section heading with a torn-paper square, as in the business plan */
.mark-h { display: flex; align-items: flex-start; gap: 14px; }
.mark-h { scroll-margin-top: 100px; }
.mark-h::before { content: ""; flex: 0 0 auto; width: 0.82em; height: 0.82em; margin-top: 0.12em; background: url("scraps/sq-vermilion.svg") center / contain no-repeat; }
.mark-h.c-cobalt::before { background-image: url("scraps/sq-cobalt.svg"); }
.mark-h.c-gold::before { background-image: url("scraps/sq-gold.svg"); }
.mark-h.c-teal::before { background-image: url("scraps/sq-teal.svg"); }
.mark-h.c-pink::before { background-image: url("scraps/sq-pink.svg"); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Header */
.header-bar { position: sticky; top: 0; z-index: 50; background: rgba(244, 238, 226, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: box-shadow var(--t-med) var(--ease-out); }
.header-bar.scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 24px -20px rgba(20,20,20,.35); }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  max-width: 1180px; margin: 0 auto;
}
.main-nav { display: flex; align-items: center; gap: 0; }
.main-nav a { text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 0.9rem; padding: 6px 7px; position: relative; white-space: nowrap; }
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 2px; height: 2px; background: var(--vermilion); transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease-out); }
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after, .main-nav a[aria-current="true"]::after { transform: scaleX(1); }
.btn.small { padding: 7px 16px; font-size: 0.88rem; }
.main-nav .nav-partner { display: none; }
.menu-btn { display: none; border: 1px solid var(--ink); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: var(--display); font-weight: 500; font-size: 0.85rem; }
@media (max-width: 1180px) {
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 18px; background: var(--paper); box-shadow: 0 18px 30px -24px rgba(20,20,20,.45); border-top: 1px solid var(--line); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .menu-btn { display: inline-block; }
  .main-nav .nav-partner { display: block; color: var(--vermilion-text); border-bottom: 0; }
  .header-tools .partner-link { display: none; }
}
.logo-link { display: block; line-height: 0; flex-shrink: 0; }
.logo-link img { height: 58px; width: auto; }
.header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-tools .partner-link { white-space: nowrap; }
.lang-toggle { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-toggle button {
  border: 0; background: transparent; padding: 4px 11px; cursor: pointer;
  font-family: var(--display); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.06em;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 500; font-size: 0.98rem; letter-spacing: 0.02em;
  padding: 12px 24px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
}
.btn { transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-fast) var(--ease-out); }
.btn:hover { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 26px 0 40px; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; justify-content: space-between; }
.site-footer .foot-contact, .site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer .foot-links a { text-decoration: none; color: var(--ink); }
.site-footer .foot-links a:hover { color: var(--vermilion-text); }
.site-footer img { height: 34px; width: auto; }


/* ---------- Artists (shared by the home page, the artist pages and the partner area) ---------- */
/* Monogram: shown while an artist has no portrait */
.monogram { --c: var(--vermilion); position: relative; width: 100%; height: 100%; background: var(--wall); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.monogram .mono-sq { position: absolute; width: 46%; aspect-ratio: 1; right: 9%; top: 9%; background: var(--c); transform: rotate(-7deg); clip-path: polygon(2% 4%, 18% 0, 35% 3%, 52% 0, 70% 4%, 88% 1%, 100% 6%, 97% 24%, 100% 45%, 96% 66%, 100% 86%, 95% 100%, 74% 96%, 53% 100%, 33% 97%, 13% 100%, 0 95%, 3% 74%, 0 52%, 4% 31%, 0 12%); opacity: .92; }
.monogram .mono-l { position: relative; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 2.3rem; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.monogram.large .mono-l { font-size: clamp(5rem, 13vw, 9rem); }

/* Previous / next artist */
.artist-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.artist-pager:empty { display: none; }
.pg { --c: var(--vermilion); display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; padding: 18px 20px; background: transparent; border: 0; border-top: 2px solid var(--ink); color: var(--ink); position: relative; }
.pg.next { text-align: right; align-items: flex-end; }
.pg::before { content: ""; position: absolute; top: -2px; height: 2px; width: 0; background: var(--c); transition: width var(--t-med) var(--ease-out); }
.pg.prev::before { left: 0; } .pg.next::before { right: 0; }
.pg:hover::before { width: 100%; }
.pg-k { font-family: var(--display); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pg-n { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.6rem; line-height: 1.1; }

/* Photo placeholder, in the work's own proportions */
.ph-canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 78%; max-height: 78%; display: flex; align-items: flex-end; justify-content: flex-start;
  background: linear-gradient(135deg, #FBF7EF, #EFE6D5); box-shadow: 0 1px 1px rgba(20,20,20,.15), 0 8px 12px -4px rgba(20,20,20,.2); }
.ph-canvas span { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--muted); padding: 10px 12px; line-height: 1.2; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; font-size: 1.4rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--wall); }

/* Main menu: "Artists" drop-down */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font-family: var(--display); font-weight: 500; font-size: 0.9rem; padding: 6px 7px; white-space: nowrap; color: var(--ink); position: relative; }
.nav-drop-btn::after { content: ""; position: absolute; left: 7px; right: 24px; bottom: 2px; height: 2px; background: var(--vermilion); transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease-out); }
.nav-drop-btn:hover::after, .nav-drop.open .nav-drop-btn::after, .nav-drop-btn[aria-current="true"]::after { transform: scaleX(1); }
.nav-drop-btn svg { transition: transform var(--t-med) var(--ease-out); }
.nav-drop.open .nav-drop-btn svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; left: -14px; top: calc(100% + 10px); z-index: 60; width: 320px; padding: 10px; background: var(--card);
  box-shadow: 0 24px 50px -24px rgba(20,20,20,.45), 0 0 0 1px var(--line); border-top: 3px solid var(--ink);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
}
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 14px; }  /* keeps the menu open while the pointer moves down */
.nav-drop.open .nav-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.main-nav .nav-menu a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; text-decoration: none; border-radius: 3px; }
.main-nav .nav-menu a::after { display: none; }
.main-nav .nav-menu a:hover, .main-nav .nav-menu a:focus-visible { background: var(--paper); color: var(--ink); }
.na-sq { width: 26px; height: 26px; background: var(--c, var(--vermilion)); transform: rotate(-6deg); clip-path: polygon(2% 4%, 18% 0, 35% 3%, 52% 0, 70% 4%, 88% 1%, 100% 6%, 97% 24%, 100% 45%, 96% 66%, 100% 86%, 95% 100%, 74% 96%, 53% 100%, 33% 97%, 13% 100%, 0 95%, 3% 74%, 0 52%, 4% 31%, 0 12%); transition: transform var(--t-med) var(--ease-pop); }
.main-nav .nav-menu a:hover .na-sq { transform: rotate(6deg) scale(1.08); }
.na-t { display: flex; flex-direction: column; line-height: 1.2; }
.na-t b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.3rem; }
.na-t small { font-family: var(--text); font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.main-nav .nav-menu a.nav-all { display: block; margin-top: 6px; padding: 12px 10px 6px; border-top: 1px solid var(--line); border-radius: 0; font-size: 0.88rem; }
.main-nav .nav-menu a.nav-all:hover { background: none; color: var(--vermilion-text); }
@media (max-width: 1180px) {
  .nav-drop { border-bottom: 1px solid var(--line); }
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 0; font-size: 1.05rem; }
  .nav-drop-btn::after { display: none; }
  .nav-menu { position: static; width: auto; padding: 0 0 10px 6px; box-shadow: none; border: 0; background: none; display: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .nav-menu::before { display: none; }
  .nav-drop.open .nav-menu { display: block; }
  .main-nav .nav-menu a { padding: 8px 0; border-bottom: 0; font-size: 1rem; grid-template-columns: 24px minmax(0, 1fr); }
  .na-sq { width: 20px; height: 20px; }
  .na-t b { font-size: 1.2rem; }
  .main-nav .nav-menu a.nav-all { border-top: 0; padding: 8px 0; margin: 0; color: var(--vermilion-text); }
}

/* Programme: one card per exhibition */
.programme { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.prog-card { --c: var(--vermilion); position: relative; }
.prog-card > a, .prog-card > div { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); background: var(--card); box-shadow: 0 1px 0 var(--line); transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out); }
.prog-card > a:hover { transform: translateY(-5px); box-shadow: 0 26px 40px -28px rgba(20,20,20,.55); color: var(--ink); }
.pc-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wall); }
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.prog-card > a:hover .pc-media img { transform: scale(1.05); }
.pc-media .monogram .mono-l { font-size: clamp(2.6rem, 4.6vw, 3.8rem); }
.pc-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; flex: 1; border-top: 4px solid var(--c); }
.pc-kick { font-family: var(--display); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--vermilion-text); }
.pc-name { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.6rem; line-height: 1.1; }
.pc-venue { font-size: 0.9rem; color: var(--muted); }
.pc-link { margin-top: auto; padding-top: 12px; font-family: var(--display); font-weight: 500; font-size: 0.9rem; }
.pc-link span { display: inline-block; transition: transform var(--t-med) var(--ease-out); }
.prog-card > a:hover .pc-link span { transform: translateX(5px); }
.prog-card.tba > div { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.prog-card.tba .pc-media { background: transparent; display: flex; align-items: center; justify-content: center; }
.prog-card.tba .pc-media::before { content: "?"; font-family: var(--serif); font-style: italic; font-size: 3.4rem; color: var(--line); }
.prog-card.tba .pc-body { border-top: 1.5px dashed var(--line); }
.prog-card.tba .pc-kick { color: var(--muted); }
.prog-card.tba .pc-name { color: var(--muted); font-size: 1.35rem; }
@media (max-width: 1020px) { .programme { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .programme { gap: 12px; } .pc-body { padding: 12px 12px 14px; } .pc-name { font-size: 1.3rem; } .pc-kick { font-size: 0.66rem; letter-spacing: 0.1em; } .pc-venue { font-size: 0.8rem; } }

/* Language visibility: elements carry data-lang="fr" or "en" */
html[lang="fr"] [data-lang="en"], html[lang="en"] [data-lang="fr"] { display: none !important; }

@media (max-width: 520px) {
  .logo-link img { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Living scraps (assets/scraps.js) ---------- */
.scrap-cluster { display: block; aspect-ratio: 240 / 220; pointer-events: none; }
.scrap-cluster.scraps { position: relative; }
.sc-piece { position: absolute; display: block; will-change: translate, rotate; rotate: calc(var(--tilt, 0) * var(--k, 1) * 14deg); }
.sc-piece img { display: block; width: 100%; height: auto; transform: rotate(var(--r)); }
.scraps-live .scrap-cluster .sc-piece img { opacity: 0; }
.scraps-live .scrap-cluster.in .sc-piece img { animation: sc-out .9s var(--ease-pop) var(--d) both, sc-bob var(--bob, 6s) ease-in-out calc(var(--d) + 1s) infinite alternate; }
@keyframes sc-out {
  from { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(calc(var(--r) - 45deg)) scale(.3); }
  30% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--r)); }
}
@keyframes sc-bob { from { transform: rotate(var(--r)); } to { transform: translateY(-11%) rotate(calc(var(--r) + 6deg)); } }

/* Scrolling makes every coloured square swing a little (--tilt is set while scrolling, then springs back to 0) */
.scraps-live .scrap { rotate: calc(var(--tilt, 0) * var(--k, 1) * 14deg); }
.scraps-live .mark-h::before { rotate: calc(var(--tilt, 0) * 16deg); }
.scraps-live .mono-sq { rotate: calc(var(--tilt, 0) * 10deg); animation: mono-float 7s ease-in-out infinite alternate; }
.scraps-live .na-sq { rotate: calc(var(--tilt, 0) * 18deg); }
@keyframes mono-float { to { translate: 4% -5%; } }

/* Section squares pop in when their heading comes into view (pages that run motion.js) */
@media (prefers-reduced-motion: no-preference) {
  .motion .mark-h::before { transform: scale(0) rotate(-40deg); transition: transform .7s var(--ease-pop); }
  .motion .mark-h.in::before { transform: none; }
}

/* Legal links row in every footer, and placeholders still to fill in before launch */
.ph { background: rgba(215, 54, 42, .1); color: var(--vermilion-text); padding: 0 4px; border-radius: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-footer .foot-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; flex-basis: 100%; font-size: .8rem; }
.site-footer .foot-legal a { color: var(--muted); }
.site-footer .foot-legal a:hover { color: var(--vermilion-text); }
.site-footer .soon-legal { margin: 0; text-align: left; hyphens: manual; line-height: 1.6; color: var(--muted); }
