/* ==========================================================================
   Loic Ocafrain · ocafrain.studio
   Quiet on purpose. The photographs supply the colour.
   ========================================================================== */

:root {
  --bg: #f4f1ec;        /* warm off-white */
  --ink: #1b1a18;       /* near-black */
  --muted: #6f6960;     /* secondary text */
  --line: #dcd6cc;      /* hairlines */
  --tint: #e8e3da;      /* empty image frames */
  --accent: #8a1c2b;    /* tie red: links and hovers only */

  --serif: "Instrument Serif", "Times New Roman", Times, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: clamp(1.25rem, 4.5vw, 4rem);
  --max: 1440px;
  --frame-h: 86vh;      /* tallest an image may be, so it always fits on screen */
}

@supports (height: 1svh) {
  :root { --frame-h: 86svh; }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent); }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  top: -4rem;
  left: var(--pad);
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  outline: 1px solid var(--accent);
  font-size: 0.875rem;
}
.skip:focus { top: 1rem; }

.eyebrow {
  font: 500 0.75rem/1.4 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot { color: var(--accent); }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2.5rem;
  padding-block: clamp(1.25rem, 3vw, 2rem);
}
.site-header--home { justify-content: flex-end; }

.wordmark {
  font-family: var(--serif);
  font-size: 1.625rem;
  line-height: 1;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.nav a {
  font-size: 0.875rem;
  color: var(--muted);
}
.nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer { margin-top: clamp(5rem, 14vh, 9rem); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Image frames (shared) ---------- */

/* A frame is as wide as it can be while the whole image still fits on
   screen. --ratio starts at 4:5 and is corrected once the photo loads,
   so nothing is ever cropped. */
.frame {
  width: min(100%, calc(var(--frame-h) * var(--ratio, 0.8)));
  justify-self: center;
  align-self: start;
}
.frame img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--tint);
}
.frame figcaption {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Stand-in until the real file is in /images */
.placeholder {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 5;
  padding: 1rem 1.1rem;
  background: var(--tint);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Gentle fade-in as images scroll into view (JS adds .is-visible) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Home ---------- */

.home {
  display: grid;
  gap: clamp(2.5rem, 8vw, 4rem);
  padding-block: clamp(1rem, 4vw, 2rem) 0;
}

.home__intro { container-type: inline-size; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.25rem, 15vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
}
@supports (font-size: 1cqi) {
  .display { font-size: min(20cqi, 9rem); }
}
.display > span { display: block; }

.lede {
  margin-top: 1.5rem;
  color: var(--muted);
}

.index ol { border-bottom: 1px solid var(--line); }

.index a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  column-gap: 1rem;
  padding-block: 1rem 1.1rem;
  border-top: 1px solid var(--line);
}
.index__no {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.index__title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.1;
}
.index__meta {
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (min-width: 560px) {
  .index a { grid-template-columns: 2.25rem minmax(0, 1fr) auto; }
  .index__meta { grid-column: auto; text-align: right; }
}

@media (min-width: 900px) {
  .home {
    --frame-h: max(28rem, calc(100vh - 10rem));
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 3rem;
  }
  @supports (height: 1svh) {
    .home { --frame-h: max(28rem, calc(100svh - 10rem)); }
  }
  .home__intro { grid-column: 1; grid-row: 1; }
  .home__index { grid-column: 1; grid-row: 3; }
  .home__hero {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
    width: min(50vw, calc(var(--frame-h) * var(--ratio, 0.8)));
  }
}

/* ---------- Gallery pages ---------- */

.gallery-head {
  padding-block: clamp(3rem, 12vh, 8rem) clamp(3rem, 10vh, 6rem);
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.gallery-head .meta {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(4rem, 14vw, 6rem);
}

/* Rhythm on larger screens: one photo alone, then a staggered pair. */
@media (min-width: 720px) {
  .gallery {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(1.5rem, 3vw, 3rem);
    row-gap: clamp(6rem, 16vh, 11rem);
  }
  .frame--solo  { grid-column: 1 / -1; justify-self: center; }
  .frame--left  { grid-column: 1 / span 6; justify-self: start; }
  .frame--right {
    grid-column: 8 / span 5;
    justify-self: end;
    margin-top: clamp(5rem, 14vw, 14rem);
  }
}

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

.next {
  margin-top: clamp(6rem, 18vh, 12rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.next a { display: inline-block; }
.next .title {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(2.5rem, 6vw, 5rem);
}

/* ---------- About and Contact ---------- */

.page {
  padding-block: clamp(3rem, 14vh, 9rem) 0;
}

.statement {
  margin-top: 2rem;
  max-width: 17em;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.contact {
  margin-top: 2.5rem;
  max-width: 60rem;
  border-bottom: 1px solid var(--line);
}
.contact div {
  display: grid;
  gap: 0.35rem 2rem;
  padding-block: 1.25rem 1.4rem;
  border-top: 1px solid var(--line);
}
.contact dt {
  font-size: 0.8125rem;
  color: var(--muted);
}
.contact dd {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.contact a { color: var(--accent); }
.contact a:hover { color: var(--ink); }

@media (min-width: 720px) {
  .contact div {
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: baseline;
  }
}

/* ---------- Reduced motion: no fades, no transitions ---------- */

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  a { transition: none; }
}
