/* ============================================================
   Mary Chirinos — styles
   Cool slate minimalism. The paintings carry the colour; the page is
   cool paper, slate ink, hairlines, and one warm terracotta accent.
   ============================================================ */

/* ---- Fonts (self-hosted, subset) ---- */
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-normal.subset.woff2') format('woff2');
  font-weight: 400 600;      /* variable weight axis */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-italic.subset.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --paper:      #FCFCFC;   /* cool near-white */
  --paper-2:    #EAECF0;   /* slate band */
  --ink:        #1A1D24;   /* cool slate near-black */
  --ink-soft:   #59616E;   /* slate gray */
  --hairline:   #DBDFE7;   /* cool hairline */
  --accent:     #9E4A28;   /* terracotta accent (warm pop against the slate ground) */
  --accent-ink: #7E3B20;
  --night:      #171A21;   /* dark slate */

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --text-base: clamp(1.0625rem, 1rem + 0.32vw, 1.1875rem);
  --h1: clamp(2.6rem, 1.6rem + 4.6vw, 4.4rem);
  --h2: clamp(1.75rem, 1.3rem + 1.7vw, 2.5rem);
  --h3: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --eyebrow: 0.78rem;

  --space: clamp(1rem, 0.7rem + 1.4vw, 1.6rem);
  --section-y: clamp(3.5rem, 2.2rem + 5vw, 7rem);
  --gap: clamp(0.9rem, 0.5rem + 1.4vw, 1.5rem);
  --content: 74rem;
  --measure: 40rem;
  --radius: 4px;      /* UI only; never on artwork */
  --header-h: 4.25rem;
}

/* ---- Reset / base ---- */
*, *::before, *::after { 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(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture { max-width: 100%; display: block; }
figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.012em; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

/* Accessible focus */
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; }
/* Light focus ring on the dark sections for adequate contrast */
.contact :focus-visible, .site-footer :focus-visible, .lightbox :focus-visible { outline-color: var(--paper); }

.wrap { width: 100%; max-width: var(--content); margin-inline: auto; padding-inline: clamp(1.1rem, 5vw, 3rem); }

.skip-link {
  position: absolute; left: 0.75rem; top: -3.5rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus { top: 0.75rem; color: var(--paper); }

/* ---- Section heads ---- */
.section-head { margin-bottom: clamp(1.6rem, 1rem + 2vw, 3rem); max-width: var(--measure); }
.section-head h2 { font-size: var(--h2); }
.section-sub { color: var(--ink-soft); margin: 0.6rem 0 0; font-size: 1rem; }
.eyebrow {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: var(--eyebrow); font-weight: 600; color: var(--accent); margin: 0 0 1rem;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--hairline); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
}
.wordmark {
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.nav-menu { list-style: none; display: flex; gap: clamp(1rem, 2.5vw, 2.25rem); align-items: center; }
.nav-menu a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 0.4rem 0.1rem; position: relative;
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a::after {
  content: ''; position: absolute; left: 0; bottom: 0.05rem; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s ease;
}
.nav-menu a:hover::after { width: 100%; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem 0; color: var(--ink); line-height: 0;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-open { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }

@media (max-width: 40rem) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: 0.5rem clamp(1.1rem, 5vw, 3rem) 1.25rem;
    box-shadow: 0 14px 30px -18px rgba(20,24,32,0.4);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; border-top: 1px solid var(--hairline); }
  .nav-menu li:first-child { border-top: 0; }
  .nav-menu a { display: block; width: 100%; padding: 0.85rem 0; font-size: 1.05rem; }
  .nav-menu a::after { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) 0 var(--section-y); }
.hero-grid {
  display: grid; gap: clamp(1.75rem, 1rem + 4vw, 4rem);
  grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}
.hero-title { font-size: var(--h1); margin: 0 0 1.25rem; }
.hero-lead {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem); line-height: 1.4;
  color: var(--ink-soft); max-width: 30ch; margin: 0 0 2rem;
  font-family: var(--font-display); font-weight: 400; font-style: italic;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-figure { margin: 0; }
.hero-figure img { width: 100%; height: auto; border: 1px solid var(--hairline); box-shadow: 0 30px 60px -34px rgba(20,24,32,0.55); }
.figcap { font-size: 0.85rem; color: var(--ink-soft); margin: 0.85rem 0 0; font-style: italic; }
.figcap .prov { font-style: normal; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ============================================================
   Work / gallery (CSS columns masonry — preserves aspect ratios)
   ============================================================ */
.work { padding: var(--section-y) 0; border-top: 1px solid var(--hairline); }
.gallery { columns: 1; column-gap: var(--gap); }
@media (min-width: 34rem) { .gallery { columns: 2; } }
@media (min-width: 60rem) { .gallery { columns: 3; } }
.gallery-item { break-inside: avoid; margin: 0 0 var(--gap); }
.art-btn {
  display: block; width: 100%; padding: 0; border: 1px solid var(--hairline);
  background: var(--paper-2); cursor: pointer; overflow: hidden; position: relative;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.art-btn img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.art-btn::after {
  content: ''; position: absolute; inset: 0; background: var(--ink); opacity: 0;
  transition: opacity 0.25s ease;
}
.art-btn:hover, .art-btn:focus-visible { box-shadow: 0 22px 40px -26px rgba(20,24,32,0.6); transform: translateY(-3px); }
.art-btn:hover::after, .art-btn:focus-visible::after { opacity: 0.06; }

/* ============================================================
   About
   ============================================================ */
.about { padding: var(--section-y) 0; background: var(--paper-2); border-top: 1px solid var(--hairline); }
.about-grid { display: grid; gap: clamp(1.75rem, 1rem + 4vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52rem) { .about-grid { grid-template-columns: 0.9fr 1.1fr; } }
.about-photo img { width: 100%; height: auto; border: 1px solid var(--hairline); box-shadow: 0 26px 50px -34px rgba(20,24,32,0.5); }
.about-body { max-width: var(--measure); }
.about-h { font-size: var(--h2); margin-bottom: 1.25rem; }
.about-body p { color: var(--ink); }
.about-actions { margin-top: 1.5rem; }
.cv-link { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; text-decoration: none; }
.cv-link svg { width: 18px; height: 18px; }
.cv-link:hover { text-decoration: underline; }

/* ---- Statement pull-quote ---- */
.statement { padding: var(--section-y) 0; }
.statement-inner { max-width: 52rem; margin-inline: auto; text-align: center; }
.statement-mark { color: var(--accent); font-family: var(--font-display); font-size: 3.5rem; line-height: 0; display: block; height: 1.6rem; }
.statement blockquote {
  margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.35rem, 1.05rem + 1.5vw, 2rem); line-height: 1.4; color: var(--ink);
}
.statement .w10 { margin-top: 2.5rem; max-width: 44rem; margin-inline: auto; color: var(--ink-soft); font-size: 1.02rem; }
.statement .w10 h3 { font-size: var(--eyebrow); text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-family: var(--font-body); margin-bottom: 0.6rem; }

/* ============================================================
   Exhibitions
   ============================================================ */
.exhibitions { padding: var(--section-y) 0; background: var(--paper-2); border-top: 1px solid var(--hairline); }
.exh-layout { display: grid; gap: clamp(2rem, 1rem + 4vw, 4rem); grid-template-columns: 1fr; }
@media (min-width: 62rem) { .exh-layout { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.exh-group + .exh-group { margin-top: 2.5rem; }
.exh-group h3 {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-bottom: 0.9rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--hairline);
}
.exh-list { list-style: none; }
.exh-list li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--hairline); }
.exh-list li:last-child { border-bottom: 0; }
.exh-year { font-variant-numeric: tabular-nums; color: var(--accent-ink); font-weight: 600; font-size: 0.92rem; padding-top: 0.05rem; }
.exh-detail .exh-title { font-weight: 600; color: var(--ink); }
.exh-detail .exh-venue { color: var(--ink-soft); font-size: 0.92rem; }
.exh-note { margin-top: 1.5rem; font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
.exh-media { columns: 2; column-gap: var(--gap); }
.exh-media figure { margin: 0 0 var(--gap); break-inside: avoid; }
.exh-media img { width: 100%; height: auto; }

/* ============================================================
   Contact
   ============================================================ */
.contact { padding: var(--section-y) 0; background: var(--night); color: var(--paper); text-align: center; }
.contact h2 { font-size: var(--h2); }
.contact-body { max-width: 40rem; margin: 1rem auto 2rem; color: color-mix(in srgb, var(--paper) 82%, transparent); }
.contact-email {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.25rem); color: var(--paper); text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 80%, white 20%); padding-bottom: 0.15rem;
  overflow-wrap: anywhere;
}
.contact-email:hover { color: var(--paper); border-bottom-color: var(--paper); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; justify-content: center; align-items: center; margin-top: 1.75rem; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  background: transparent; border: 1.5px solid color-mix(in srgb, var(--paper) 35%, transparent);
  color: var(--paper); padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.copy-btn:hover { border-color: var(--paper); }
.copy-btn.copied { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.copy-btn svg { width: 16px; height: 16px; }
.ig-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--paper); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.ig-link:hover { color: var(--paper); text-decoration: underline; }
.ig-link svg { width: 20px; height: 20px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--night); color: color-mix(in srgb, var(--paper) 62%, transparent); border-top: 1px solid rgba(255,255,255,0.08); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding-block: 2rem; font-size: 0.85rem; }
.footer-inner a { color: color-mix(in srgb, var(--paper) 80%, transparent); text-decoration: none; }
.footer-inner a:hover { color: var(--paper); text-decoration: underline; }
.footer-mark { font-family: var(--font-display); font-weight: 600; color: var(--paper); font-size: 1.05rem; }

/* ============================================================
   Lightbox (native <dialog>)
   ============================================================ */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; margin: 0; overflow: hidden; }
.lightbox::backdrop { background: rgba(18, 21, 28, 0.96); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.lb-stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(0.75rem, 3vw, 2.5rem); }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: 100%; }
.lb-img { max-width: min(94vw, 1400px); max-height: 82vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7); background: #10131a; }
.lb-cap { color: color-mix(in srgb, #FCFCFC 88%, transparent); text-align: center; max-width: 46rem; font-size: 0.95rem; line-height: 1.5; }
.lb-cap .lb-title { display: block; font-family: var(--font-display); font-style: italic; color: #FCFCFC; margin-bottom: 0.15rem; font-size: 1.05rem; }
.lb-cap .lb-index { display: block; margin-top: 0.35rem; font-size: 0.78rem; letter-spacing: 0.08em; color: color-mix(in srgb, #FCFCFC 55%, transparent); }
.lb-btn {
  position: absolute; background: rgba(250,247,242,0.1); border: 1px solid rgba(250,247,242,0.2);
  color: #FCFCFC; cursor: pointer; width: 3rem; height: 3rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.15s;
}
.lb-btn:hover { background: rgba(250,247,242,0.22); }
.lb-btn:active { transform: scale(0.94); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); }
.lb-prev { left: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(0.94); }
@media (max-width: 34rem) {
  .lb-prev { left: 0.5rem; top: auto; bottom: 1rem; transform: none; }
  .lb-next { right: 0.5rem; top: auto; bottom: 1rem; transform: none; }
  .lb-prev:active, .lb-next:active { transform: scale(0.94); }
}
body.lb-open { overflow: hidden; }

/* ============================================================
   Reveal on scroll (respects reduced motion)
   ============================================================ */
/* Progressive enhancement: only hide reveal content when JS is present (html.js set
   synchronously in <head>). Without JS, or if the script fails, everything stays visible. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .art-btn img, .btn, .lb-btn { transition: none; }
}

/* scroll offset for sticky header */
:target { scroll-margin-top: calc(var(--header-h) + 1rem); }
section[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
