/* ============================================================
   Carlotta Crepax — styles.css
   Editorial / gallery aesthetic. Mobile-first, vanilla CSS.
   Headings: Libre Baskerville (Baskerville stack).
   Body:     Archivo (modern neutral sans-serif).
   ============================================================ */

:root {
  --bg:        #f7f5f1;   /* warm gallery paper */
  --ink:       #16140f;   /* near-black text   */
  --muted:     #837e74;   /* labels / captions */
  --line:      #e3ded4;   /* hairlines         */
  --placeholder: #d8d4cb; /* grey image boxes  */
  --placeholder-2: #ece9e2;

  --serif: "Libre Baskerville", Baskerville, "Baskerville Old Face",
           "Hoefler Text", Garamond, "Times New Roman", serif;
  --sans:  "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1320px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --nav-h: 4.5rem;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }

/* ---------- accessibility helpers ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: .75rem 1.25rem; font-size: .8rem; letter-spacing: .12em;
  text-transform: uppercase; text-decoration: none;
}
.skip-link:focus { left: .75rem; top: .75rem; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}


/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent;
  transition: background .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(247, 245, 241, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.site-nav nav {
  max-width: var(--maxw); margin: 0 auto;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: flex-end;
}
/* On the hero (before scroll) the nav sits over the image: light text */
.site-nav:not(.scrolled) .nav-links a { color: #fff; }

.nav-links { display: flex; gap: clamp(1.1rem, 3vw, 2.5rem); }
.nav-links a {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
  padding: .25rem 0; position: relative;
  transition: color .3s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s ease;
}
.nav-links a:hover { color: var(--ink); }
.site-nav:not(.scrolled) .nav-links a:hover { color: #fff; }
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links a[aria-current="true"] { color: var(--ink); }
.site-nav:not(.scrolled) .nav-links a[aria-current="true"] { color: #fff; }

/* ============================================================
   SECTION 1 — HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
  background: #0e1310; /* fallback while the image loads */
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
/* subtle left darkening keeps the white title legible over the image */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 40%, rgba(0,0,0,0) 66%);
  pointer-events: none;
}
.hero-overlay {
  position: relative; z-index: 2;
  padding: 0 var(--gutter);
  width: 100%; max-width: var(--maxw); margin: 0 auto;
}
.hero-title {
  font-family: var(--serif); font-weight: 400;
  color: rgba(255, 255, 255, .9);
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.15; letter-spacing: .01em;
  /* wide gap between the two names, as in the design */
  word-spacing: clamp(.5rem, 2.4vw, 1.7rem);
}

/* On phones: a portrait crop that shows the whole painting, with the
   name sitting low over the dark lower area (matches the design). */
@media (max-width: 640px) {
  .hero {
    min-height: 0;
    aspect-ratio: 3 / 4;
    align-items: flex-end;
  }
  .hero-img { object-position: right center; }
  .hero::after { background: none; } /* no dimming scrim on mobile */
  .hero-overlay { padding-bottom: clamp(2.5rem, 11vw, 4.5rem); }
  .hero-title { font-size: clamp(2.1rem, 8.5vw, 3rem); }
}

/* ============================================================
   SHARED SECTION SCAFFOLDING
   ============================================================ */
section[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }

.work, .about, .contact {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) var(--gutter);
}

.section-head {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-head h2 {
  font-family: var(--sans); font-weight: 600;
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
  white-space: nowrap;
}
.section-head .rule { flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   SECTION 2 — WORK GRID
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 3rem);
}
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.artwork { margin: 0; overflow: hidden; }
.thumb {
  display: block; width: 100%;
  background: var(--placeholder-2);
  border: 1px solid var(--line);
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.6,.2,1), opacity .4s ease;
}
.thumb--square    { aspect-ratio: 1 / 1; }
.thumb--landscape { aspect-ratio: 333 / 237; }
.artwork:hover .thumb { transform: scale(1.03); opacity: .92; }

figcaption { margin-top: 1rem; display: flex; flex-direction: column; gap: .15rem; }
.art-title {
  font-family: var(--serif); font-style: italic;
  font-size: 1.05rem; line-height: 1.3; color: var(--ink);
}
.art-subtitle {
  font-size: .76rem; letter-spacing: .06em; color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Exhibitions (under the bio) ---------- */
.exhibitions {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid var(--line);
  display: grid; gap: 1.25rem;
}
.exhibition { display: flex; flex-direction: column; gap: .3rem; }
.exhibition-status {
  font-family: var(--sans); font-weight: 500;
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.exhibition-detail {
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.4; color: var(--ink);
}

/* ============================================================
   SECTION 3 — ABOUT
   ============================================================ */
.about {
  display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}
@media (min-width: 860px) {
  .about { grid-template-columns: 0.85fr 1.15fr; }
}
.portrait {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; border: 1px solid var(--line);
  max-width: 460px;
}
.portrait-caption {
  font-size: 12px; color: #837e74; margin-top: .6rem; max-width: 460px;
}
.about-text .section-head { margin-bottom: 1.75rem; }
.about-text .lead {
  font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.35; margin-bottom: 1.5rem; color: var(--ink);
}
.about-text p:not(.lead) {
  font-size: 1.02rem; color: #3a372f; max-width: 56ch;
  margin-bottom: 1.15rem;
}

/* ============================================================
   SECTION 4 — CONTACT
   ============================================================ */
.contact { border-top: 1px solid var(--line); }
.contact-inner { max-width: 560px; }
.contact-intro { font-size: 12px; color: #3a372f; margin-bottom: 2.25rem; }

.field { margin-bottom: 1.5rem; display: flex; flex-direction: column; }
.field label {
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .55rem;
}
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  padding: .65rem 0; transition: border-color .3s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-bottom-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-bottom-color: #9b2c2c;
}
.error { min-height: 1rem; margin-top: .4rem; font-size: .78rem; color: #9b2c2c; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit-btn {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bg); background: var(--ink);
  border: 1px solid var(--ink); padding: 1rem 2.4rem; margin-top: .5rem;
  cursor: pointer; transition: background .3s ease, color .3s ease;
}
.submit-btn:hover { background: transparent; color: var(--ink); }
.submit-btn[disabled] { opacity: .5; cursor: default; }

.form-status { margin-top: 1.25rem; font-size: .9rem; }
.form-status.success { color: #2f6b34; }
.form-status.error { color: #9b2c2c; }

.contact-social {
  margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.contact-social a {
  font-size: .95rem; text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: border-color .3s ease;
}
.contact-social a:hover { border-bottom-color: var(--ink); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 2.75rem var(--gutter);
  text-align: center;
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); border-top: 1px solid var(--line);
}

/* ============================================================
   MOTION — gentle fade-in reveals
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s ease, transform .8s ease;
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .artwork:hover .thumb { transform: none; }
}
