/* ==========================================================================
   Portfolio — styles.css
   One stylesheet for every page. No build step, no dependencies.

   Contents
   1.  Design tokens (colours, type, spacing)  <- edit these first
   2.  Reset and base
   3.  Typography
   4.  Layout helpers
   5.  Header and navigation
   6.  Home: hero, featured work, about, contact
   7.  Work page (filters and grid)
   8.  Inner page headers (About, Contact, 404)
   9.  Project pages
   10. Footer
   ========================================================================== */


/* 1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colour: neutral ground, dark ink, two quiet accents.
     Text colours below all meet WCAG AA contrast on --bg and --wash. */
  --bg: #f2efed;       /* page background: a pale, slightly rosy grey */
  --wash: #e8e3e1;     /* image frames and the contact band */
  --ink: #1f1a1c;      /* main text */
  --muted: #645b5f;    /* secondary text */
  --line: #d6cecd;     /* hairlines */
  --plum: #6a4357;     /* accent for links, hover and focus */
  --mauve: #b394a1;    /* decorative accent only (not for text) */
  --sage: #8d9a8b;     /* decorative accent only (not for text) */

  /* Type: system font stacks, so nothing is downloaded and nothing is licensed.
     To use your own fonts, see the README ("Changing fonts"). */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Space */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 92rem;
  --section: clamp(4.5rem, 10vw, 9rem);
}


/* 2. Reset and base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--plum);
}

:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-120%);
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect reduced-motion preferences. The site uses almost no motion;
   this guarantees none for people who ask for none. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* 3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.625rem);
}

/* The name on the home page: the one loud thing on the site. */
.display {
  font-size: clamp(3.25rem, 13vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

/* Page titles on inner pages and project pages. */
.title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.875rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.label {
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

/* Small sans label used as a section title in the left column. */
.section-label {
  font-family: var(--sans);
  line-height: 1.65;
}

/* Serif section title used in the left column on project pages. */
.section-title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.prose {
  max-width: 40rem;
  font-size: 1.0625rem;
}

.prose p + p {
  margin-top: 1em;
}

.text-link {
  text-decoration: underline;
}

.big-link {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5.4vw, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}


/* 4. Layout helpers
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
}

.section--wash {
  background: var(--wash);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

/* Label on the left, content on the right. Stacks on small screens. */
.split {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .split__label {
    grid-column: 1 / 4;
  }

  .split__body {
    grid-column: 4 / 12;
  }
}

.list {
  list-style: none;
  padding: 0;
}

.list li {
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}

.list li:last-child {
  border-bottom: 1px solid var(--line);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  list-style: none;
  padding: 0;
}

.links a {
  display: inline-block;
  padding-block: 0.25rem;
}


/* 5. Header and navigation
   -------------------------------------------------------------------------- */
.site-header {
  padding-block: 1.5rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-block;
  padding-block: 0.5rem;
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.nav a:hover {
  border-bottom-color: currentColor;
}

.nav a[aria-current] {
  border-bottom-color: var(--plum);
  color: var(--plum);
}


/* 6. Home
   -------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 9vw, 8rem);
  padding-bottom: clamp(4rem, 9vw, 8rem);
}

.hero__name {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.hero__grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 52rem) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .hero__list {
    grid-column: 1 / 5;
  }

  .hero__intro {
    grid-column: 6 / 13;
  }
}

.hero__intro p + p {
  margin-top: 1.25rem;
}

.hero__list .label {
  margin-bottom: 0.75rem;
}

/* Featured work: a staggered, asymmetrical grid. */
.featured {
  display: grid;
  gap: clamp(3rem, 7vw, 5rem) var(--gutter);
}

@media (min-width: 48rem) {
  .featured {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .featured__item--a {
    grid-column: 1 / 8;
  }

  .featured__item--b {
    grid-column: 9 / 13;
    margin-top: clamp(5rem, 14vw, 12rem);
  }

  .featured__item--c {
    grid-column: 4 / 11;
  }
}

.card {
  display: block;
  text-decoration: none;
}

.card__frame {
  aspect-ratio: 4 / 5;
  background: var(--wash);
  overflow: hidden;
}

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

.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.card:hover .card__frame img,
.card:focus-visible .card__frame img {
  transform: scale(1.03);
}

.card__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 1rem;
}

.card__title {
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
}

.card__meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.card:hover .card__title {
  color: var(--plum);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.about-intro {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 52rem) {
  .about-intro {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--gutter);
    align-items: end;
  }
}

.portrait {
  background: var(--wash);
}

.portrait img {
  width: 100%;
  height: auto;
}

.contact-band .title {
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.contact-band .links {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}


/* 7. Work page: filters and project grid
   -------------------------------------------------------------------------- */
.work-section {
  padding-bottom: var(--section);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

/* The hidden attribute must win over the flex display above. */
.filters[hidden] {
  display: none;
}

.filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filters__btn {
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.filters__btn:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}

.filters__btn[aria-pressed="true"] {
  color: var(--plum);
  border-bottom-color: var(--plum);
}

.work-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem) var(--gutter);
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.work-grid__item[hidden] {
  display: none;
}

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

.work-more {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}


/* 8. Inner page headers
   -------------------------------------------------------------------------- */
.page-head {
  padding-top: clamp(3rem, 8vw, 7rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.page-head .title {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.page-head .lead {
  max-width: 44rem;
}

.pillars {
  display: grid;
  gap: 2rem var(--gutter);
}

@media (min-width: 48rem) {
  .pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pillars h3 {
  margin-bottom: 0.75rem;
}

.pillars p {
  color: var(--muted);
}


/* 9. Project pages
   -------------------------------------------------------------------------- */
.back {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.project-head {
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

.project-head .title {
  margin-block: clamp(1rem, 2vw, 1.5rem) clamp(1.25rem, 3vw, 2rem);
}

.project-head .lead {
  max-width: 46rem;
}

.cover img {
  width: 100%;
  height: auto;
  background: var(--wash);
}

.facts {
  display: grid;
  gap: 1.5rem var(--gutter);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.facts dt {
  color: var(--muted);
  font-size: 0.875rem;
}

.facts dd {
  margin-top: 0.25rem;
}

.block {
  padding-block: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
}

.block--first {
  margin-top: clamp(3rem, 7vw, 6rem);
}

.subhead {
  margin-block: clamp(2.5rem, 5vw, 4rem) 1.25rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.subhead:first-child {
  margin-top: 0;
}

.subnote {
  max-width: 40rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
}

/* Image gallery: 12-column grid, items choose how many columns to span.
   Everything is full width on small screens. */
.gallery {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.gallery__item {
  grid-column: 1 / -1;
}

@media (min-width: 40rem) {
  .gallery__item--4 {
    grid-column: span 4;
  }

  .gallery__item--6 {
    grid-column: span 6;
  }

  .gallery__item--8 {
    grid-column: span 8;
  }
}

.gallery__item img {
  width: 100%;
  height: auto;
  background: var(--wash);
}

.gallery__item figcaption {
  padding-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.swatches {
  display: grid;
  gap: 1.5rem var(--gutter);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  padding: 0;
}

@media (min-width: 48rem) {
  .swatches {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.swatch__chip {
  aspect-ratio: 1 / 1;
  background: var(--swatch, var(--wash));
  border: 1px solid var(--line);
}

.swatch__name {
  margin-top: 0.75rem;
}

.swatch__meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.specimens {
  display: grid;
  gap: 2rem var(--gutter);
}

@media (min-width: 48rem) {
  .specimens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.specimen {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.specimen__glyph {
  font-size: clamp(5rem, 14vw, 10rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.specimen__glyph--serif {
  font-family: var(--serif);
}

.specimen__glyph--sans {
  font-family: var(--sans);
}

.specimen figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.pager {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 48rem) {
  .pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .pager__next {
    text-align: right;
  }
}

.pager a {
  display: block;
  text-decoration: none;
}

.pager__label {
  color: var(--muted);
  font-size: 0.875rem;
}

.pager__title {
  margin-top: 0.25rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pager a:hover .pager__title {
  color: var(--plum);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}


/* 10. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem 3rem;
}

.site-footer .links {
  gap: 0.25rem 1.75rem;
}

.site-footer__copy {
  color: var(--muted);
}
