/* ============================================================
   Alex Schupak — portfolio
   Radically minimal, gallery-white. Type carries restraint;
   images carry everything else.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;1,400&display=swap');

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

:root {
  --bg: #ffffff;
  --ink: #161616;
  --muted: #8c8c8c;
  --faint: #b8b8b8;
  --rule: #e7e7e5;

  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Spectral", Georgia, "Times New Roman", serif;
  --font: var(--font-sans);

  --fs: 14px;
  --fs-nav: 13.5px;
  --fs-cap: 12.5px;
  --fs-small: 11.5px;

  --pad: clamp(20px, 4.2vw, 60px);
  --measure: 33em;

  /* single unified image width — slightly wider than the former detail
     size (.fig-mid, 880px); every picture sits at this width, left-justified */
  --img-w: 940px;
}

html[data-type="serif"] {
  --font: var(--font-serif);
  --fs: 16px;
  --fs-nav: 15px;
  --fs-cap: 13.5px;
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.005em;
}

html[data-type="serif"] body { line-height: 1.62; letter-spacing: 0; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

p { margin: 0 0 1.1em; }
h1, h2, h3 { font-weight: 400; margin: 0; }

/* ---- Layout shell ---- */
.page { padding: 0 var(--pad) 14vh; }

/* ---- Masthead (inner pages) ---- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2em;
  flex-wrap: wrap;
  padding: 26px 0 0;
  margin-bottom: clamp(48px, 9vh, 110px);
}
.masthead .name {
  font-size: var(--fs-nav);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4em;
  font-size: var(--fs-nav);
  color: var(--ink);
}
.nav a[aria-current="page"] { color: var(--faint); }
.nav a[aria-current="page"]:hover { text-decoration: none; cursor: default; }

/* ---- Generic text column ---- */
.col { max-width: var(--measure); }
.muted { color: var(--muted); }
.lead { font-size: calc(var(--fs) + 1px); }

/* section label, tiny */
.label {
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Page title block ---- */
.titleblock { margin-bottom: clamp(40px, 8vh, 90px); max-width: 46em; }
.titleblock .worktitle {
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: -0.01em;
  line-height: 1.18;
  font-style: italic;
}
html[data-type="serif"] .titleblock .worktitle { font-style: italic; }
.titleblock .sub { color: var(--muted); margin-top: 0.7em; font-size: var(--fs-cap); }

/* ============================================================
   Works / installation images
   ============================================================ */
.works { display: flex; flex-direction: column; }
.work { margin: 0 0 clamp(60px, 13vh, 170px); }
.work:last-child { margin-bottom: 0; }

.work figure { margin: 0; }
/* <picture> wrappers generate no box, so the <img> keeps its original
   layout role (flex item, width/height rules, aspect-ratio) unchanged */
picture { display: contents; }
.work img {
  display: block;
  width: 100%;
  height: auto;
}

/* width rhythm — UNIFIED: every work image renders at one width
   (--img-w), left-justified. Height varies with each image's aspect ratio. */
.work.fig-full, .work.fig-wide, .work.fig-mid, .work.fig-narrow {
  width: 100%;
  max-width: var(--img-w);
}
/* legacy centering modifiers — kept for non-work uses (e.g. the New Americans
   controls bar relies on .right), but works always left-align now */
.center     { margin-left: auto; margin-right: auto; }
.right      { margin-left: auto; }
.work.center, .work.right { margin-left: 0; margin-right: 0; }

/* caption */
figcaption {
  margin-top: 14px;
  font-size: var(--fs-cap);
  line-height: 1.45;
  max-width: 30em;
}
figcaption .t { font-style: italic; }
html[data-type="serif"] figcaption .t { font-style: italic; }
figcaption .m { color: var(--muted); display: block; }
figcaption .n { color: var(--faint); }

/* index number for works/checklist */
.idx { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ============================================================
   Checklist (gallery handout)
   ============================================================ */
.checklist { list-style: none; margin: 0; padding: 0; max-width: 44em; }
.checklist li {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 0.4em 1em;
  padding: 0.62em 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.checklist li:last-child { border-bottom: 1px solid var(--rule); }
.checklist .ct { font-style: italic; }
html[data-type="serif"] .checklist .ct { font-style: italic; }
.checklist .cy { color: var(--muted); font-size: var(--fs-cap); font-variant-numeric: tabular-nums; white-space: nowrap; }
.checklist .cm { grid-column: 2 / -1; color: var(--muted); font-size: var(--fs-cap); }

/* ============================================================
   CV
   ============================================================ */
.cv { max-width: 50em; }
.cv section { display: grid; grid-template-columns: 9.5em 1fr; gap: 1.4em; padding: 1.6em 0; border-top: 1px solid var(--rule); }
.cv section:last-child { border-bottom: 1px solid var(--rule); }
.cv .entry { margin-bottom: 1.15em; }
.cv .entry:last-child { margin-bottom: 0; }
.cv .role { display: flex; justify-content: space-between; gap: 1.2em; flex-wrap: wrap; }
.cv .where { color: var(--muted); font-size: var(--fs-cap); white-space: nowrap; }
.cv ul { margin: 0.3em 0 0; padding-left: 1.1em; color: var(--muted); font-size: var(--fs-cap); }
.cv ul li { margin-bottom: 0.18em; }

/* ============================================================
   Footer + type toggle
   ============================================================ */
.foot {
  margin-top: 14vh;
  padding: 22px 0 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1.5em;
  flex-wrap: wrap;
  font-size: var(--fs-small);
  color: var(--muted);
}
.foot a { color: var(--muted); }

@media (max-width: 620px) {
  .cv section { grid-template-columns: 1fr; gap: 0.5em; }
  .checklist li { grid-template-columns: 1.8em 1fr; }
  .checklist .cy { grid-column: 2; }
}
