/* ==========================================================================
   Bronia Gardner Artist
   Direction: The Exhibition Wall Label
   Cream wall, sage-grey label stock, work hung with air around it.
   ========================================================================== */

/* --- Faces ---------------------------------------------------------------- */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-italic-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/ebgaramond-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('../fonts/ebgaramond-italic-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* The wall, and the things on it */
  --wall:        #F7F5F0;
  --wall-deep:   #EFEBE2;
  --stock:       #E7E3D8;  /* label card */
  --ink:         #262A25;
  --ink-soft:    #5C6058;
  --ink-faint:   #686C62;  /* 4.7:1 on the wall — label metadata is small, so it has to clear AA */
  --sage:        #6E7C68;
  --sage-deep:   #47523F;
  --rule:        #D5D0C3;
  --rule-fine:   #E2DED3;

  --measure: 63ch;

  /* One spacing rhythm, used everywhere */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;
  --s10: 10rem;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --page: 78rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Browser surfaces (these ship with the design, not the browser) ------- */

::selection { background: #D9E0D2; color: var(--ink); }
:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
  border-radius: 1px;
}
html { scrollbar-color: var(--rule) var(--wall); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--wall); }
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 3px solid var(--wall);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* --- Type ----------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.14;
  text-wrap: balance;
  margin: 0;
}

.display {
  font-size: clamp(2.1rem, 5.2vw, 3.9rem);
  letter-spacing: -0.03em;
}
.h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
.h3 { font-size: clamp(1.15rem, 1.6vw, 1.3rem); letter-spacing: -0.01em; }

p { margin: 0 0 var(--s5); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.15rem, 1.9vw, 1.36rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 54ch;
}

/* The one expressive note: work titles are set in Garamond italic,
   the way a gallery sets a title on a label. */
.title-work {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* Label metadata: small, tracked, the printed card beside the work */
.meta {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.link {
  color: var(--sage-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--sage-deep) 40%, transparent);
  transition: text-decoration-color 0.25s var(--ease), color 0.25s var(--ease);
}
.link:hover { text-decoration-color: var(--sage-deep); }

/* --- Shell ---------------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--wall);
  padding: var(--s3) var(--s5);
  z-index: 100;
}
.skip:focus { left: var(--s4); top: var(--s4); }

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
/* Narrow sections keep the page's own left edge rather than centring, so a
   text block and a hang start on the same line down the whole site. */
.wrap--narrow > * { max-width: 46rem; }

/* --- Header --------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--wall) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.masthead[data-scrolled='true'] { border-bottom-color: var(--rule-fine); }

.masthead__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s5);
  padding-block: var(--s5);
}

.wordmark {
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  margin-top: 0.35em;
  font-weight: 400;
}

.nav { display: flex; gap: clamp(0.9rem, 2vw, 1.9rem); align-items: baseline; }
.nav a {
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 0.35em;
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
  .nav a:hover::after { transform: scaleX(1); }
}
.nav a[aria-current='page'] { color: var(--ink); }
.nav a[aria-current='page']::after { transform: scaleX(1); background: var(--sage); }

.nav__toggle { display: none; }

@media (max-width: 56rem) {
  .masthead__inner { align-items: center; }
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: none;
    border: 0;
    padding: 0.4rem 0;
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
  }
  .nav__toggle svg { width: 15px; height: 11px; }
  .nav__toggle svg line { transition: transform 0.4s var(--ease); }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--wall);
    flex-direction: column;
    justify-content: center;
    gap: var(--s5);
    padding: var(--gutter);
    font-size: 1.3rem;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.5s var(--ease), visibility 0.5s;
  }
  .nav a { font-size: 1.05rem; letter-spacing: 0.06em; }
  body[data-nav='open'] .nav { transform: translateY(0); visibility: visible; }
  body[data-nav='open'] { overflow: hidden; }
}

/* --- The hang: a work and its label --------------------------------------- */

.plate {
  display: block;
  width: 100%;
  height: auto;
  background: var(--wall-deep);
  /* Her grounds are nearly the colour of the wall. A hairline and a real
     shadow (offset + blur) are what make a piece read as hung, not printed on. */
  box-shadow:
    0 1px 1px rgba(38, 42, 37, 0.05),
    0 18px 40px -22px rgba(38, 42, 37, 0.38);
  outline: 1px solid var(--rule-fine);
  outline-offset: -1px;
}

.label { margin-top: var(--s4); }
.label__rule {
  height: 1px;
  background: var(--rule);
  margin-bottom: var(--s3);
  transform-origin: left;
}
.label__title {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.28rem;
  line-height: 1.25;
  margin: 0 0 0.35em;
}
.label__meta {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.label__note {
  margin: var(--s3) 0 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
  max-width: 42ch;
  line-height: 1.6;
}

/* --- The wall: the gallery grid ------------------------------------------- */

.hang {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
  row-gap: clamp(3.5rem, 8vw, 7rem);
  align-items: end;
}

/* Works are hung at their own scale, the way a real hang varies */
.hang > *:nth-child(4n + 1) { align-self: start; }
.hang > *:nth-child(3n) figure { padding-inline: clamp(0rem, 4vw, 3rem); }

figure { margin: 0; }

/* --- Sections ------------------------------------------------------------- */

.section { padding-block: clamp(4rem, 10vw, var(--s10)); }
.section--tight { padding-block: clamp(3rem, 6vw, var(--s8)); }
.section + .section { padding-top: 0; }

.section__head { margin-bottom: clamp(2.5rem, 5vw, var(--s8)); }
.section__head h2 { margin-bottom: var(--s4); }

/* More space above a heading than below it */
h2 + p, h3 + p { margin-top: var(--s4); }

.rule {
  height: 1px;
  background: var(--rule-fine);
  border: 0;
  margin: 0;
}

/* --- Home hero: one work, hung, with the label beside it ------------------ */

.hero {
  padding-block: clamp(3rem, 7vw, var(--s9)) clamp(3.5rem, 8vw, var(--s9));
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(15rem, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 60rem) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s6); }
}
.hero__statement {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  line-height: 1.32;
  letter-spacing: -0.005em;
  margin: 0 0 var(--s5);
  max-width: 22ch;
  text-wrap: balance;
}

/* --- Text pages ----------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--s8); margin-bottom: var(--s4); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s6); margin-bottom: var(--s3); }
.prose blockquote {
  margin: var(--s6) 0;
  padding-left: var(--s5);
  border-left: 1px solid var(--sage);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.32rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink);
}
.prose blockquote cite {
  display: block;
  margin-top: var(--s3);
  font-family: 'Archivo', sans-serif;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --- Exhibition list ------------------------------------------------------ */

.cv { margin: 0; }
.cv__year {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--s5);
  padding-block: var(--s5);
  border-top: 1px solid var(--rule-fine);
}
.cv__year:last-child { border-bottom: 1px solid var(--rule-fine); }
.cv__year > dt {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 0.4em;
}
.cv__year > dd { margin: 0; display: grid; gap: var(--s4); }
.cv__item p { margin: 0.25em 0 0; font-size: 0.94rem; color: var(--ink-soft); max-width: 52ch; }
@media (max-width: 40rem) {
  .cv__year { grid-template-columns: 1fr; gap: var(--s3); }
}

/* --- Enquiry form --------------------------------------------------------- */

.form { display: grid; gap: var(--s5); max-width: 34rem; }
.field { display: grid; gap: var(--s2); }
.field label {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.field input,
.field textarea,
.field select {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--wall);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  width: 100%;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--ink-faint); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--sage-deep);
  background: #FBFAF7;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 18%, transparent);
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field--error input,
.field--error textarea { border-color: #9B4A3C; }
.field__error {
  font-size: 0.85rem;
  color: #8A4034;
  margin: 0;
}
.field__error:empty { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--wall);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.9rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    transform 0.16s var(--ease), box-shadow 0.18s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    background: var(--sage-deep);
    border-color: var(--sage-deep);
    box-shadow: 0 6px 18px -8px rgba(38, 42, 37, 0.5);
  }
}
.btn:active { transform: scale(0.98); }
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--ink-faint);
  border-color: var(--ink-faint);
  box-shadow: none;
}
.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--quiet:hover {
  background: transparent;
  color: var(--sage-deep);
  border-color: var(--sage-deep);
  box-shadow: none;
}

.form__status {
  font-size: 0.95rem;
  padding: var(--s4) var(--s5);
  border: 1px solid var(--rule);
  background: var(--stock);
  border-radius: 2px;
}
.form__status[hidden] { display: none; }
.form__status--ok { border-color: var(--sage); }
.form__status--bad { border-color: #B0685C; }

/* --- Contact details ------------------------------------------------------ */

.details { display: grid; gap: var(--s5); margin: 0; }
.details dt {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3em;
}
.details dd { margin: 0; }

/* --- Footer --------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule-fine);
  margin-top: clamp(4rem, 9vw, var(--s9));
  padding-block: var(--s7) var(--s6);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s6);
  margin-bottom: var(--s7);
}
.footer h2 {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: var(--s3);
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  justify-content: space-between;
  align-items: baseline;
  padding-top: var(--s5);
  border-top: 1px solid var(--rule-fine);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.site-credit { margin: 0; }
.site-credit a { text-decoration: underline; text-underline-offset: 0.2em; }

/* --- Motion ---------------------------------------------------------------
   One authored moment, in three parts: the work is uncovered from the bottom
   the way a cloth comes off it, then the label arrives, then its rule draws.
   Everything else on the site is state feedback, not animation.            */

[data-reveal] { opacity: 1; }

.js [data-reveal]:not(.is-in) { opacity: 0; }

.js [data-reveal] { transition: opacity 0.5s var(--ease); }

.js [data-reveal] .plate {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
}
.js [data-reveal].is-in .plate { clip-path: inset(0 0 0 0); }

.js [data-reveal] .label {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease) 0.12s, transform 0.5s var(--ease) 0.12s;
}
.js [data-reveal].is-in .label { opacity: 1; transform: none; }

.js [data-reveal] .label__rule { transform: scaleX(0); }
.js [data-reveal].is-in .label__rule {
  transform: scaleX(1);
  transition: transform 0.6s var(--ease) 0.2s;
}

/* Text blocks have no plate to uncover, so they lift instead. */
.js [data-reveal]:not(:has(.plate)) { transform: translateY(12px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.js [data-reveal]:not(:has(.plate)).is-in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-reveal]:not(.is-in),
  .js [data-reveal]:not(:has(.plate)),
  .js [data-reveal] .label { opacity: 1; transform: none; transition: none; }
  .js [data-reveal] .plate { clip-path: none; transition: none; }
  .js [data-reveal] .label__rule { transform: scaleX(1); transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Utility -------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.stack-sm > * + * { margin-top: var(--s4); }
.stack > * + * { margin-top: var(--s6); }
