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

:root {
  --bg: #ffffff;
  --border: #e4e3de;
  --text: #1c1c1a;
  --muted: #888882;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-serif-reading: 'PT Serif', Georgia, serif;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout: side column on the left, content to the right edge ── */
.layout {
  /* column = logo + the same margin on both sides */
  --pad: 1.5rem;
  --logo-w: clamp(88px, 6.5vw, 150px);
  --side-w: calc(var(--logo-w) + 2 * var(--pad));
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* logo on top, nav as a list, IG/Contact at the bottom */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: var(--side-w);
  padding: 2.5rem var(--pad);
  background: var(--bg);
  transition: width 0.4s ease, box-shadow 0.3s ease;
}

/* once the gallery is scrolled, the column (and the logo with it) narrows to the
   width of the links plus the same margin on both sides — gallery.js measures the
   links into --brand-compact — and a soft shadow on its right edge shows the
   images are passing behind it */
@media (min-width: 821px) {
  .topbar.is-compact {
    width: calc(var(--brand-compact, 4.5rem) + 2 * var(--pad));
    box-shadow: 10px 0 28px -14px rgba(28, 28, 26, 0.28);
  }
}

.brand { width: 100%; }
.brand img { width: 100%; height: auto; }

.nav, .meta { display: flex; flex-direction: column; gap: 0.6rem; }
.nav { margin-top: 2rem; }
.meta { margin-top: auto; }

.nav a, .meta a {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
}

.nav a:hover, .meta a:hover,
.nav a[aria-current="page"] { color: var(--text); }

main { padding: 2.5rem; min-width: 0; }

/* ── Work: gallery ──
   Two rows (written in index.html) of images butted edge to edge, scrolling
   sideways. gallery.js wraps each image in .gallery-item to trim its paper border.
   The strip runs from the left edge of the screen (behind the side column) to the
   right edge; the padding keeps the first image just right of the column. */
.gallery {
  --gap: 2rem;
  margin: 0 -2.5rem 0 calc(-1 * (var(--side-w) + 2.5rem));
  padding-left: var(--side-w);
  height: calc(100dvh - 5rem);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar { display: none; }

/* top row a bit taller than the bottom one */
.gallery-row { display: flex; height: 55%; width: max-content; gap: var(--gap); }
.gallery-row + .gallery-row { height: 45%; }

.gallery img {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  max-width: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* frame that hides the paper border: the image is scaled up and shifted so only
   the artwork shows (--t/--r/--b/--l are fractions of each side) */
.gallery-item {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  overflow: hidden;
}

.gallery-item img {
  position: absolute;
  width: calc(100% / (1 - var(--l) - var(--r)));
  height: calc(100% / (1 - var(--t) - var(--b)));
  left: calc(-100% * var(--l) / (1 - var(--l) - var(--r)));
  top: calc(-100% * var(--t) / (1 - var(--t) - var(--b)));
}

/* ── Bio ── */
.bio {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3.5rem;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 1rem;
}

.bio-photo {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f4f4;
}

/* ES/EN toggle with two hidden radios — no JS */
.lang-input { position: absolute; opacity: 0; pointer-events: none; }

.langs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.langs label { cursor: pointer; transition: color 0.15s; }
.langs label:hover,
#lang-es:checked ~ .langs [for="lang-es"],
#lang-en:checked ~ .langs [for="lang-en"] { color: var(--text); }

#lang-es:checked ~ [lang="en"],
#lang-en:checked ~ [lang="es"] { display: none; }

.bio p {
  font-family: var(--font-serif-reading);
  font-size: 1.05rem;
  line-height: 1.75;
}

.bio p + p { margin-top: 1.1rem; }

.mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-serif-reading);
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}

.mail:hover { border-bottom-color: var(--text); }

.press { margin-top: 2.5rem; }

.press a {
  font-family: var(--font-serif-reading);
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}

.press a:hover { border-bottom-color: var(--text); }

/* ── Shop: where to find the work ── */
.stockists {
  max-width: 560px;
  margin: 0 auto;
  padding-top: 1rem;
}

.stockists h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.stockists ul { list-style: none; margin-bottom: 2.75rem; }

/* one shop per row: name on the left, where it ships / where it is on the right */
.stockists li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}

.stockists li:last-child { border-bottom: 1px solid var(--border); }

.stockists li a {
  font-family: var(--font-serif-reading);
  font-size: 1.05rem;
  text-decoration: none;
  transition: opacity 0.15s;
}

.stockists li a::after { content: " ↗"; color: var(--muted); font-size: 0.8em; }
.stockists li a:hover { opacity: 0.6; }

.stockists li span {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

/* ── Mobile ── */
@media (max-width: 820px) {
  .layout { display: block; }

  /* logo + links on top, nav centred underneath */
  .topbar {
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.9rem 1rem;
  }
  .brand { grid-area: 1 / 1; }
  .meta { grid-area: 1 / 2; justify-self: end; flex-direction: row; margin-top: 0; }
  .brand { width: auto; }
  .nav { grid-area: 2 / 1 / 2 / -1; justify-self: center; flex-direction: row; margin-top: 0; }
  .brand img { width: 68px; }
  .nav, .meta { gap: 1.1rem; }

  .stockists li { flex-direction: column; gap: 0.2rem; }
  .stockists li span { text-align: left; }

  main { padding: 1.25rem 0.75rem 2rem; }

  .gallery {
    margin: 0 -0.75rem;
    padding-left: 0;
    height: calc(100dvh - 10.5rem);
  }

  .bio { grid-template-columns: 1fr; gap: 2rem; }

  /* one-time "swipe" hint, dismissed by gallery.js on first scroll/touch */
  .swipe-hint {
    position: fixed;
    left: 50%;
    bottom: 1.1rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(28, 28, 26, 0.78);
    color: #fff;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.4s ease;
  }

  .swipe-hint.is-hidden { opacity: 0; }

  .swipe-hint-dot {
    position: relative;
    width: 22px;
    height: 8px;
  }

  .swipe-hint-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    background: currentColor;
    border-radius: 50%;
    animation: swipe-hint-move 1.6s ease-in-out infinite;
  }
}

@media (min-width: 821px) {
  .swipe-hint { display: none; }
}

@keyframes swipe-hint-move {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(-18px); opacity: 0; }
}
