/* Xavier Lince — portfolio */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --ink-soft: #3a3a3a;
  --ink-quiet: #6b6b6b;
  --rule: #e4e4e4;
  --veil: rgba(255, 255, 255, 0.98);

  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;   /* titles */
  --font: "Cormorant Garamond", Garamond, Georgia, serif;     /* text and artwork details */

  /* Cormorant runs small, so its sizes sit a step above a sans */
  --step--1: 1rem;       /* 16px captions */
  --step-0: 1.125rem;    /* 18px nav */
  --step-1: 1.25rem;     /* 20px reading text */
  --step-3: 2rem;        /* 32px name */

  --gutter: clamp(16px, 4vw, 56px);
  --gap: clamp(20px, 3.2vw, 48px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
body[data-page="home"] { overflow-x: clip; }   /* the edge-to-edge filmstrip must never cause sideways scrolling */

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

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

.skip {
  position: absolute; left: 8px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 8px 12px; z-index: 100; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 28px var(--gutter) 0;
  max-width: var(--max);
  margin: 0 auto;
}

.social { display: flex; gap: 4px; padding-top: 6px; }
.social a, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: -12px 0 0 -12px;
  color: var(--ink);
  border-radius: 50%;
  transition: opacity 0.2s ease;
}
.social a:hover { opacity: 0.55; }
.social svg { width: 18px; height: 18px; }

.brand { text-align: center; }
.brand-name {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-decoration: none;
  line-height: 1.1;
  margin: 0;
}

.nav { grid-column: 2; margin-top: 10px; }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px;
}
.nav a {
  display: inline-block;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink-soft);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.header-end { display: flex; justify-content: flex-end; }
.lang-toggle {
  font: inherit; font-size: var(--step--1);
  color: var(--ink-soft);
  background: none; border: 0; cursor: pointer;
  padding: 10px 0 10px 12px; margin-top: -4px;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule);
}
.lang-toggle:hover { color: var(--ink); text-decoration-color: currentColor; }

.menu-toggle { display: none; }

/* ---------- main ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 96px;
}

.page-title {
  /* visible to screen readers, quiet for sighted users: the nav already says where you are */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- gallery ---------- */
/* Masonry (positions set by layoutGrid() in js/main.js): equal-width columns, each work
   whole at its own proportions, images only. Without the script it falls back to one column. */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; row-gap: 6px; column-gap: 6px;   /* thin seams: the works read as one wall */
}
/* The gallery block is a little narrower than the header, centred */
.gallery { max-width: 1000px; margin: 0 auto; }
/* A page can hold several series, each with a small centred heading (e.g. pastels page) */
.series + .series { margin-top: clamp(56px, 8vw, 96px); }
.series-title {
  margin: 0 0 20px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.grid.is-masonry { display: block; position: relative; }
.grid.is-masonry .work { position: absolute; top: 0; left: 0; }

.work-open {
  display: block; width: 100%;
  padding: 0; border: 0; background: #f3f3f3;
  cursor: zoom-in;
  overflow: hidden;
}
.work-open img {
  width: 100%; height: 100%;
  object-fit: cover;   /* the box already has the work's exact proportions: nothing is cut */
  transition: opacity 0.25s ease;
}
.work-open:hover img { opacity: 0.88; }

.work-after { display: block; font-style: italic; color: var(--ink); }
.work-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 2px;
}

/* ---------- home ---------- */
/* Landing filmstrip. Photos sit side by side at one shared height, each at its own width
   (never cropped), and the row drifts left in an endless loop. It runs edge to edge. */
.filmstrip {
  --strip-h: clamp(320px, calc(100dvh - 250px), 720px);
  --strip-gap: 6px;
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
}
.filmstrip-track {
  display: flex;
  gap: var(--strip-gap);
  width: max-content;
  will-change: transform;
  touch-action: pan-y;
  cursor: grab;
}
.filmstrip-track.is-dragging { cursor: grabbing; }
.frame {
  position: relative;
  flex: none;
  margin: 0;
  height: var(--strip-h);
  aspect-ratio: var(--ar);
}
.frame img {
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.credit {
  position: absolute; right: 10px; bottom: 8px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--ink-soft);
}
.credit a { color: var(--ink); text-underline-offset: 3px; }

/* Arrows sit over the photos at mid-height, inset from the edges: a small translucent
   white disc with a thin dark chevron, readable on light and dark photos alike. */
.filmstrip-controls {
  position: absolute; left: 0; right: 0;
  top: calc(var(--strip-h) / 2);
  pointer-events: none;            /* only the buttons themselves catch clicks */
}
.strip-btn {
  position: absolute; top: 0; transform: translateY(-50%);
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;  /* comfortable click/tap area */
  background: none; border: 0; cursor: pointer;
  color: #2b2b2b;
}
.strip-btn::before {
  content: ""; position: absolute; inset: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease;
}
.strip-btn:hover::before { background: rgba(255, 255, 255, 0.95); }
.strip-btn svg { position: relative; width: 18px; height: 18px; }
.strip-prev { left: clamp(12px, 2.5vw, 32px); }
.strip-next { right: clamp(12px, 2.5vw, 32px); }

/* ---------- about ---------- */
/* Intro row: photo beside the short biography. Below it, the statement as one centered
   reading column, closing on its question set apart in the display face. */
.about { max-width: 1080px; margin: 0 auto; }
.about h2 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0 0 18px;
}
.prose { font-size: var(--step-1); line-height: 1.65; color: var(--ink-soft); max-width: 62ch; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.about-photo { margin: 0; }
.about-photo img { width: 100%; height: auto; }

.about-statement {
  margin: clamp(72px, 10vw, 128px) 0 0;   /* same full width as the photo + biography row */
}
.about-statement .prose { max-width: none; }
.about-statement h2 { text-align: center; margin-bottom: 28px; }

/* ---------- contact ---------- */
.contact { text-align: center; padding-top: 24px; }
.contact p { margin: 0 0 6px; font-size: var(--step-1); }
.contact .lead { color: var(--ink-soft); font-size: var(--step-0); margin-bottom: 8px; }
.contact a.big {
  font-size: clamp(1.25rem, 3.4vw, 2rem);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
  word-break: break-word;
}
.contact a.big:hover { border-color: var(--ink); }
.contact .ig { margin-top: 40px; }
.contact .ig a { color: var(--ink-soft); text-underline-offset: 4px; }
.contact .ig a:hover { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--ink-quiet);
}
.site-footer a { color: var(--ink-quiet); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- lightbox ---------- */
/* The artwork is centred on the screen (about 75% of its height, no shadow, like a work on
   a white wall). On wide screens its label sits just to the right, aligned with the bottom
   of the painting; on narrow screens the label goes under it. */
.lightbox {
  --lb-panel: clamp(200px, 17vw, 260px);   /* label width: narrower on small laptops */
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--veil);
  color: var(--ink);
}
.lightbox::backdrop { background: var(--paper); }
.lightbox[open] { display: block; animation: lb-in 0.22s ease-out; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 64px 16px;
}
.lb-frame {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  max-width: 100%; max-height: 100%;
}
.lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 300px);   /* narrow screens: leave room for the label below */
  width: auto; height: auto;
  object-fit: contain;
}

.lb-meta {
  text-align: center;
  padding: 16px 0 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.lb-title { font-family: var(--font-display); font-size: 1.125rem; letter-spacing: 0.05em; color: var(--ink); margin: 0 0 4px; }
.lb-details, .lb-price { margin: 2px 0 0; }
.lb-note {
  margin: 6px auto 0; max-width: 46ch;
  font-size: 0.875rem; line-height: 1.4; font-style: italic;
  color: var(--ink-quiet);
}
.lb-links { margin-top: 8px; }
.lb-count { color: var(--ink-quiet); font-variant-numeric: tabular-nums; }

.lb-btn {
  position: absolute;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: none; border: 0; padding: 0;
  color: var(--ink); cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}
.lb-btn:hover { background: rgba(0,0,0,.05); }
.lb-btn svg { width: 26px; height: 26px; }
.lb-close { top: 16px; right: 20px; }
.lb-expand { top: 16px; left: 20px; }
.lb-expand svg { width: 24px; height: 24px; }
.lb-expand .i-shrink { display: none; }
.lightbox.is-expanded .lb-expand .i-expand { display: none; }
.lightbox.is-expanded .lb-expand .i-shrink { display: block; }

/* Expanded: the artwork fills the screen, label hidden; buttons stay on top */
.lightbox.is-expanded .lb-stage { padding: 12px; }
.lightbox.is-expanded .lb-img { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
.lightbox.is-expanded .lb-meta { display: none; }
.lightbox.is-expanded .lb-btn { background: rgba(255, 255, 255, 0.7); }
.lightbox:fullscreen { background: var(--paper); }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

@media (min-width: 900px) {
  .lb-stage { padding: 0; }
  .lb-img {
    max-height: 75vh;
    /* keep a margin on each side at least as wide as the label, so the image stays
       centred and the label always fits beside it */
    max-width: calc(100vw - 2 * (var(--lb-panel) + 100px));   /* + room for the arrows */
  }
  .lb-meta {
    position: absolute; left: 100%; bottom: 0;
    width: var(--lb-panel);
    padding: 0 0 0 32px;
    text-align: left;
  }
  .lb-title { font-size: 1.25rem; line-height: 1.3; margin-bottom: 10px; }
  .lb-note { margin: 14px 0 0; }
  .lb-links { margin-top: 18px; }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .about-intro { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { grid-template-columns: 44px 1fr 44px; padding-top: 18px; align-items: center; }
  .brand-name { font-size: 1.5rem; }
  .filmstrip { --strip-h: min(62svh, 460px); --strip-gap: 4px; }
  .social, .header-end .lang-toggle { display: none; }
  .menu-toggle {
    display: inline-flex; grid-column: 3;
    width: 44px; height: 44px; align-items: center; justify-content: center;
    background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0;
  }
  .menu-toggle svg { width: 22px; height: 22px; }
  .menu-toggle .i-close { display: none; }
  .menu-open .menu-toggle .i-open { display: none; }
  .menu-open .menu-toggle .i-close { display: block; }
  .brand { grid-column: 2; }
  .nav { display: none; grid-column: 1 / -1; margin-top: 18px; }
  .menu-open .nav { display: block; }
  .nav ul { flex-direction: column; align-items: center; gap: 4px; }
  .nav a { padding: 10px 0; font-size: 1.0625rem; }
  .nav .mobile-only { display: block; }
  .nav .lang-toggle { padding: 10px 0; margin: 0; font-size: 1rem; }

  .work-open { cursor: pointer; }

  .lb-stage { padding: 60px 8px 64px; }
  .lb-img { max-height: calc(100dvh - 330px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
}
@media (min-width: 641px) { .mobile-only { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
