/* Liliane Carlos — project pages.
   Same language as the Home (styles.css): its tokens, type and 12-column
   grid, on the light reading ground. Scrolling is the only temporal
   structure: no motion, no hover effects, no containers.
   Images are never cropped — every placement keeps the file's own ratio. */

:root {
  --ground: #f2f0eb;
  --ink: #1c1b19;
  --muted: #8a8680;

  --margin: clamp(20px, 4vw, 64px);
  --gutter: clamp(16px, 2vw, 32px);

  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --small: 0.8125rem;   /* 13px */
  --body: 1.0625rem;    /* 17px */

  /* Pauses between images (mobile values; desktop below) */
  --pause-s: 3vh;
  --pause-m: 12vh;
  --pause-l: 22vh;
  --pause-xl: 34vh;
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; margin: 0; padding: 0; }
p, h1, h2, figure { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Items with no destination yet: plain text, never styled as links. */
.inactive { color: var(--muted); }

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: var(--margin);
  font-size: var(--small);
  letter-spacing: 0.02em;
}

.name { font-size: 0.875rem; letter-spacing: 0.15em; }

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* ---------- Opening: identification ---------- */

.project-head,
.credits,
.closing {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
}

.project-head > * { grid-column: 1 / -1; }

.project-head { padding-block: 18vh 0; }

.project-title {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.25;
}

.project-meta {
  display: flex;
  flex-direction: column;
  margin-top: 0.75rem;
  font-size: var(--small);
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.project-descriptor { margin-top: 2.5rem; max-width: 26em; }

.project-text {
  margin-top: 1.75rem;
  max-width: 30em;
  line-height: 1.5;
}
.project-text p + p { margin-top: 1em; }

/* ---------- Sequence ---------- */

.work { margin-top: var(--pause); }
.pause-s  { --pause: var(--pause-s); }
.pause-m  { --pause: var(--pause-m); }
.pause-l  { --pause: var(--pause-l); }
.pause-xl { --pause: var(--pause-xl); }

/* Captions: small, quiet, attached to the image's own left edge. */
.work figcaption {
  margin-top: 0.75rem;
  max-width: 34em;
  font-size: var(--small);
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Text sections between images ----------
   Same column and measure as the opening text; the heading is a quiet label,
   never a chapter title. */

.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  margin-top: var(--pause);
}
.section > * { grid-column: 1 / -1; }

.section-label {
  font-size: var(--small);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.section-text {
  margin-top: 1.25rem;
  max-width: 30em;
  line-height: 1.5;
}
.section-text p + p { margin-top: 1em; }

.section-text .lead { display: block; }
/* A quiet second label: the section is a study, not documentation. */
.section-qualifier {
  margin-top: 0.25rem;
  font-size: var(--small);
  letter-spacing: 0.02em;
  color: var(--muted);
}
.section-link { margin-top: 2rem; }

/* ---------- Fragments ----------
   Short texts set large: they interrupt the reading instead of being
   quoted inside it. Same ink, same face — only scale and position change.
   Each line is its own line; if the screen is too narrow, the overflow
   hangs under it so a wrapped line never reads as a new verse. */
.fragment {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  margin-top: var(--pause);
}
.fragment > * { grid-column: 1 / -1; }
.fragment-text {
  margin-top: 1.5rem;
  font-size: clamp(1.375rem, 1rem + 1.9vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.fragment-text p + p { margin-top: 0.85em; }
.fragment-text .line {
  display: block;
  padding-left: 1em;
  text-indent: -1em;
}
.section-link a { text-decoration: underline; }
.section-link a:hover { text-decoration: none; }

/* ---------- Credits and closing ---------- */

.credits {
  padding-block: var(--pause, var(--pause-xl)) 0;
  font-size: var(--small);
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.credits > * { grid-column: 1 / -1; max-width: 34em; }
.credits-label { font-size: inherit; font-weight: 400; color: var(--muted); }
.credits-text { margin-top: 0.5rem; }
.credits-text + .credits-text { margin-top: 0.25rem; }

.closing {
  padding-block: 18vh var(--margin);
  font-size: var(--small);
  letter-spacing: 0.02em;
}
.copyright { grid-column: 1 / -1; color: var(--muted); }

/* ---------- Mobile composition ----------
   Not a reduced desktop: one column, with the image's relation to the
   screen edges carrying the rhythm — edge to edge, inside the margins,
   offset and running out of one side, or small against open ground. */

@media (max-width: 899px) {
  .m-full img { width: 100%; }

  .m-margins { padding-inline: var(--margin); }

  .m-inset-left  { padding-left: 18vw; }
  .m-inset-right { padding-right: 18vw; }

  .m-small-left  { padding-left: var(--margin); }
  .m-small-right { padding-right: var(--margin); display: flex; justify-content: flex-end; }
  .m-small-left img,
  .m-small-right img { width: 64vw; }
  .m-small-right { flex-direction: column; align-items: flex-end; }

  /* Captions keep a margin even when the image runs to the edge. */
  .m-full figcaption        { padding-inline: var(--margin); }
  .m-inset-left figcaption  { padding-right: var(--margin); }
  .m-inset-right figcaption { padding-left: var(--margin); }
  .m-small-right figcaption { width: 64vw; }
  .fragment.m-inset-left { padding-left: calc(var(--margin) + 10vw); }
}

/* ---------- Desktop composition ----------
   The 12 columns are read as three modules of four; images begin on a
   module line (1, 5, 9). Column 5 is the Home's reading axis, so text and
   images share one left edge across the page. */

@media (min-width: 900px) {
  :root {
    --pause-s: 4vh;
    --pause-m: 22vh;
    --pause-l: 36vh;
    --pause-xl: 52vh;
  }

  .masthead {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: calc(var(--margin) * 0.75) var(--margin);
  }
  .nav ul { gap: 0 1.75rem; }

  .project-head { padding-block: 26vh 0; }
  .project-head > * { grid-column: 5 / span 6; }
  .project-title { font-size: 1.75rem; }
  .project-meta { margin-top: 1rem; }
  .project-descriptor { margin-top: 3rem; }

  .work {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    padding-inline: var(--margin);
  }

  .d-full img,
  .d-wide img { grid-column: 1 / -1; }

  .d-full img {
    width: calc(100% + 2 * var(--margin));
    max-width: none;
    margin-left: calc(-1 * var(--margin));
  }

  .d-cols img,
  .d-cols figcaption { grid-column: var(--start) / span var(--span); }
  .d-full figcaption,
  .d-wide figcaption { grid-column: 1 / span 6; }

  .section > * { grid-column: 5 / span 6; }
  .fragment > * { grid-column: var(--start) / span var(--span); }
  .fragment-text { margin-top: 2rem; }

  .d-bleed-right img,
  .d-bleed-left img {
    width: calc(100% + var(--margin));
    max-width: none;
  }
  .d-bleed-left img { margin-left: calc(-1 * var(--margin)); }

  /* A vertical image never exceeds the screen height; it narrows instead. */
  .is-portrait img { width: min(100%, calc(90vh * 2 / 3)); }

  .credits > * { grid-column: 5 / span 6; }
  .closing { align-items: baseline; }
  .copyright { grid-column: 5 / span 6; }
}
