/* Only the three faces the page uses are loaded: body (400), and the
   condensed face for the header/eyebrow (400) and the h2 headings (700). */
@font-face {
  font-family: "Test American Grotesk";
  src: url("fonts/american-grotesk-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Test American Grotesk Condensed";
  src: url("fonts/american-grotesk-condensed-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Test American Grotesk Condensed";
  src: url("fonts/american-grotesk-condensed-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg: #000000;
  --color-text: #eeede6;

  --font-headline: "Test American Grotesk Condensed", sans-serif;
  --font-body: "Test American Grotesk", sans-serif;

  --grid-cols: 12;
  --grid-gutter: clamp(18px, 1.286vw, 20.6px);
  --grid-margin: 40px;
  --max-width: 1600px;

  /* Spacing scales with viewport width (1.286vw etc.), holding steady
     at its minimum below ~1400px and capping out at --max-width so it
     stops growing once the grid itself stops widening. */
  --space-section: clamp(160px, 11.429vw, 183px);
  --space-intro: clamp(80px, 5.714vw, 91px);
  --space-project: clamp(60px, 4.286vw, 68.6px);

  /* Same clamp pattern as spacing: holds at its minimum below ~1400px,
     scales with viewport width, caps at the value it hits at --max-width
     so line length stops growing once the grid stops widening. */
  --font-size-heading: clamp(40px, 2.857vw, 45.7px);
  --font-size-intro: clamp(24px, 1.714vw, 27.4px);
  --font-size-body: clamp(18px, 1.286vw, 20.6px);
  --font-size-eyebrow: clamp(14px, 1vw, 16px);
  --font-size-header: clamp(28px, 2vw, 32px);
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  column-gap: var(--grid-gutter);
  row-gap: var(--space-section);
  padding: 0 var(--grid-margin) 30px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.heading {
  font-family: var(--font-headline);
  font-size: var(--font-size-heading);
  line-height: normal;
}

.body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: 1.444;
}

.intro {
  grid-column: 6 / span 6;
  grid-row: 1;
  font-family: var(--font-body);
  font-size: var(--font-size-intro);
  line-height: 1.333;
  margin-top: var(--space-intro);
  margin-bottom: var(--space-intro);
}

.intro-portrait {
  grid-column: 2 / span 3;
  grid-row: 1;
  align-self: start;
  width: 100%;
  height: auto;
  margin-top: var(--space-intro);
  padding: 40px;
}

.intro p + p {
  margin-top: 24px;
}

.work-samples {
  grid-column: 1 / span 5;
}

.work-samples .body {
  text-wrap: balance;
}

.work-samples .heading {
  margin-bottom: 16px;
}

/* <picture> wrappers must not become grid items themselves; the <img> inside
   keeps its grid placement classes. */
picture {
  display: contents;
}

.image-placeholder {
  background: #2a2a2a;
  border-radius: 12px;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.ratio-3-4 {
  aspect-ratio: 3 / 4;
}

.ratio-4-5 {
  aspect-ratio: 4 / 5;
}

.ratio-5-4 {
  aspect-ratio: 5 / 4;
}

.project {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: auto auto;
  row-gap: 80px;
  margin-top: var(--space-project);
}

.project-image-primary {
  grid-column: 5 / span 8;
  grid-row: 1;
}

.project-image-secondary {
  grid-column: 1 / span 3;
  grid-row: 1 / span 2;
  align-self: end;
}

.project-text {
  grid-column: 7 / span 5;
  grid-row: 2;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--font-size-eyebrow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 16px;
}

.project-text .heading {
  margin-bottom: 24px;
  text-wrap: balance;
}

.project-text .body + .body {
  margin-top: 16px;
}

.project--wide .project-image-primary {
  grid-column: 2 / span 10;
  grid-row: 1;
}

.project--wide .project-image-secondary {
  grid-column: 2 / span 3;
  grid-row: 2;
}

.project--wide .project-text {
  grid-column: 7 / span 5;
  grid-row: 2;
  margin-top: 100px;
}

.project--data .project-image-primary {
  grid-column: 8 / span 4;
  grid-row: 1;
}

.project--data .project-text {
  grid-column: 2 / span 5;
  grid-row: 1;
}

.project--data .project-image-secondary {
  grid-column: 2 / span 9;
  grid-row: 2;
}

.project--split .project-image-primary {
  grid-column: 1 / span 4;
  grid-row: 1;
}

.project--split .project-text {
  grid-column: 7 / span 5;
  grid-row: 1;
}

.project--split .project-image-secondary {
  grid-column: 2 / span 10;
  grid-row: 2;
}

.site-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-text);
  padding-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px var(--grid-margin);
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-name,
.header-about {
  font-family: var(--font-headline);
  font-size: var(--font-size-header);
}

.header-name {
  color: var(--color-text);
}

.header-about {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-about:hover {
  color: #ff705c;
}

/* Tablet: same 12-column grid, tighter margins and spacing, and wider text
   spans so line lengths stay readable at smaller column widths. */
@media (max-width: 1023px) {
  :root {
    --grid-margin: 32px;
    --space-section: 120px;
    --space-intro: 64px;
    --space-project: 48px;
  }

  .intro {
    grid-column: 5 / span 8;
  }

  .intro-portrait {
    grid-column: 1 / span 4;
    padding: 24px;
  }

  .work-samples {
    grid-column: 1 / span 7;
  }

  .project {
    row-gap: 56px;
  }

  .project-text {
    grid-column: 6 / span 7;
  }

  .project--wide .project-image-secondary {
    grid-column: 2 / span 4;
  }

  .project--wide .project-text {
    grid-column: 7 / span 6;
    margin-top: 60px;
  }

  .project--data .project-image-primary {
    grid-column: 8 / span 5;
  }

  .project--data .project-text {
    grid-column: 1 / span 6;
  }

  .project--data .project-image-secondary {
    grid-column: 2 / span 10;
  }

  .project--split .project-image-primary {
    grid-column: 1 / span 5;
  }

  .project--split .project-text {
    grid-column: 7 / span 6;
  }
}

/* Mobile: 4-column grid. Each project stacks as primary media, text, then
   secondary media; the portrait-shaped secondary items are inset and
   alternate sides for a little rhythm. */
@media (max-width: 767px) {
  :root {
    --grid-cols: 4;
    --grid-gutter: 16px;
    --grid-margin: 20px;
    --space-project: 56px;
    --font-size-heading: 32px;
    --font-size-intro: 20px;
    --font-size-body: 16px;
    --font-size-eyebrow: 13px;
    --font-size-header: 22px;
  }

  .site-header {
    padding-block: 20px;
  }

  .grid {
    row-gap: 24px;
  }

  .intro-portrait {
    grid-column: 1 / span 2;
    grid-row: 1;
    padding: 0;
    margin-top: 32px;
  }

  .intro {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
  }

  .work-samples {
    grid-column: 1 / -1;
    margin-top: 64px;
  }

  .project {
    grid-template-rows: auto auto auto;
    row-gap: 32px;
  }

  .project .project-image-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .project .project-text {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
  }

  .project .project-image-secondary {
    grid-column: 1 / span 3;
    grid-row: 3;
    align-self: start;
  }

  .project--wide .project-image-secondary {
    grid-column: 2 / span 3;
  }

  .project--data .project-image-secondary,
  .project--split .project-image-secondary {
    grid-column: 1 / -1;
  }

  .site-footer {
    margin-top: 64px;
  }
}
