:root {
  --bg: #fff;
  --text: #222;
  --muted: #555;
  --purple: #4b45b5;
  --placeholder: #f1f1f1;
  --line: #e2e2e2;

  --heading: "Open Sans", Arial, sans-serif;
  --body: "Barlow", "DIN Alternate", Arial, sans-serif;

  --gutter: clamp(16px, 3.5vw, 50px);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--purple);
  color: #fff;
  padding: 0.5em 1em;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.head {
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(24px, 4vw, 48px);
  text-align: center;
}
.head__name {
  display: inline-block;
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  letter-spacing: 0.2em;
  text-decoration: none;
  color: var(--text);
  /* balance the trailing letter-spacing so the name stays centred */
  margin-right: -0.2em;
}

/* ---------- Layout: menu | content ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  padding: 0 var(--gutter) 80px;
}

.content:focus { outline: none; }

/* ---------- Portfolio (home) ---------- */
.intro__title {
  font-family: var(--heading);
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 clamp(32px, 5vw, 64px);
}
.intro__portrait {
  display: block;
  width: min(220px, 50vw);
  height: auto;
  margin: 0 auto clamp(40px, 5vw, 64px);
}
.index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 40px 32px;
}
.index a { text-decoration: none; display: block; }
.index__cover {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--placeholder);
}
.index__cover img { width: 100%; height: 100%; object-fit: cover; }
.index__cover .ph { height: 100%; aspect-ratio: auto; border: 0; }
.index__title {
  display: block;
  margin-top: 12px;
  font-family: var(--heading);
  font-size: 1rem;
  text-transform: uppercase;
}
.index a:hover .index__title { color: var(--purple); }

/* ---------- Project page ---------- */
.project {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  gap: clamp(32px, 4vw, 64px);
  padding-top: clamp(24px, 4vw, 56px);
}
.project__text { order: 2; }
.project__work { order: 1; }

/* Sections with no text: title above, images use the full width */
.project--images-only { grid-template-columns: 1fr; }
.project--images-only .project__text { order: 1; }
.project--images-only .project__title { margin-bottom: 0.2em; }

.project__title {
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: 0.18em;
  line-height: 1.2;
  margin: 0 0 1.4em;
}
.project__fr p {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.85;
  letter-spacing: 0.02em;
  margin: 0 0 1em;
}
.project__en {
  margin-top: 2.4em;
  color: var(--muted);
}
.project__en p {
  font-size: 1.1rem;
  line-height: 1.75;
  letter-spacing: 0.03em;
  margin: 0 0 1em;
}

.group + .group { margin-top: 56px; }
.group__label {
  font-family: var(--heading);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  margin: 0 0 12px;
}
.group__images {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}
.group--row .shot { flex: 1 1 140px; max-width: 340px; }
.group--justified .group__images { align-items: flex-start; }
.group--box { border: 1px solid var(--line); padding: 16px; }
.shot__label {
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.group--logos .logo {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 44px;
  align-items: center;
}
.group--logos .logo + .logo { margin-top: 56px; }
.logo__images { display: grid; gap: 16px; justify-items: start; }
.logo__images .shot img { max-width: 100%; height: auto; }
.logo__text p { margin: 0 0 1.2em; display: grid; line-height: 1.5; }
.logo__fr { font-size: clamp(1.05rem, 1.4vw, 1.25rem); }
.logo__en { font-size: 0.95rem; color: var(--muted); }
.group--grid .group__images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: start;
}
.group--grid[style*="--cols"] .group__images { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.group--tiles .shot__open {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line);
}
.group--tiles .shot--wide { grid-column: span 2; }
.group--tiles .shot--wide .shot__open { aspect-ratio: 2 / 1; }
.group--grid.group--tiles .shot img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.group--grid .shot img { aspect-ratio: 1; object-fit: contain; }
.group--stack .group__images { display: grid; gap: 24px; }

.shot { margin: 0; }
.shot__open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.shot img { width: 100%; height: auto; }
.shot__caption { margin: 8px 0 0; font-size: 0.95rem; color: var(--muted); }

/* Stand-in until real images are added */
.ph {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--placeholder);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #999;
  font-size: 0.9rem;
}

.empty { color: var(--muted); }

/* ---------- Image viewer ---------- */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px var(--gutter);
  border: 0;
  background: #fff;
  color: var(--text);
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #fff; }
.viewer__bar { display: flex; justify-content: flex-end; gap: 8px; }
.viewer__btn {
  font-family: var(--heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
}
.viewer__btn:hover { color: var(--purple); border-color: var(--purple); }
.viewer__btn[hidden] { display: none; }
.viewer__figure {
  flex: 1;
  min-height: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.viewer__figure img {
  max-width: 100%;
  max-height: calc(100dvh - 130px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.viewer__figure figcaption { color: var(--muted); font-size: 0.95rem; text-align: center; }

/* ---------- Footer ---------- */
.foot {
  padding: 24px var(--gutter) 32px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}
.foot p { margin: 0; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .project { grid-template-columns: 1fr; }
  .project__text { order: 1; max-width: 62ch; }
  .project__work { order: 2; }
}
@media (max-width: 760px) {
  .group--logos .logo { grid-template-columns: 1fr; gap: 16px; }
  .group--row .shot { flex-basis: 100%; max-width: none; }
  .group--grid .group__images,
  .group--grid[style*="--cols"] .group__images { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
