:root {
  --space-1: 0.5rem;        /* ~8px */
  --space-2: 1rem;          /* ~16px */
  --space-3: 1.5rem;        /* ~24px */
  --space-4: 2rem;          /* ~32px */
  --space-6: 3rem;          /* ~48px */
  --page-padding: 4rem;     /* Desktop outer margins */
  --page-padding-mobile: 1.5rem;
  --max-width: 1200px;

  --grid-gap: var(--space-3); /* vertical + horizontal gap */
}

/* ==========================
   Layout grid
========================== */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--page-padding);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--space-6);
}

.project {
  display: contents; /* children sit directly on the grid */
}

.project a {
  text-decoration: none;
}

.project a:hover {
  text-decoration:underline;
}

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

.project-image img {
  display: block;
  width: 100%;
  max-width: 300px;   /* plate-style on desktop */
  height: auto;
  margin-left: auto;  /* right-align within its column */
}

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

/* margin utilities */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ==========================
   Base typography
========================== */

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
}

hr {
  border: none;
  border-top: 1px solid lightgrey;
}

p {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

h1, h2, h3, h4, h5, h6,
p, ul, ol, blockquote, figure {
  margin-top: 0;
}

h1, h2 {
  font-family: "Inter", sans-serif;
  font-weight: 100;  /* super airy */
  line-height: 1.3;
}

a {
  color: #444;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: black;
  text-decoration: none;
}

.project-text h2 {
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.project-text p {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  max-width: 60ch;
  margin-bottom: 0.6rem;
}

/* Treat the last line as metadata (year) */
.project-text p:last-child {
  font-weight: 300;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.wordmark {
  font-family: "Inter", sans-serif;
  font-weight: 200;
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.3;
  display: inline-block;
}

/* ==========================
   Info page
========================== */

.info-image {
  grid-column: 1 / span 5;
}

.info-image figure {
  margin: 0;
}

.info-image img {
  display: block;
  width: 100%;
  height: auto;
}

.info-content {
  grid-column: 6 / span 7;
  max-width: 60ch;
}

.info-content p {
  margin-bottom: 0.8rem;
}

/* ==========================
   Project layout (series pages)
========================== */

.project-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  row-gap: var(--space-6);
}

/* Left rail: series names */
.series-rail {
  grid-column: 1 / span 2;
  align-self: start;
  position: sticky;
  top: 80px;
  font-size: 0.9rem;
  text-align: right;
}

.series-rail nav {
  display: block;
  padding: 0;
  margin: 0;
}

.series-rail nav a {
  display: block;
  text-decoration: none;
  font-weight: 500;
  color: #333;
  padding: 0.1rem 0;
  line-height: 1.5;
  margin-bottom: 0.15rem;
}

.series-rail nav a.is-active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* Main text column */
.series-content-main {
  grid-column: 3 / span 8;
  max-width: 40ch;
}

/* ==========================
   Landing page
========================== */

.work-intro {
  grid-column: 6 / span 7;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.work-intro p {
  font-size: 2.5rem;
  line-height: 1.2;
  max-width: 28ch;
}

/* ==========================
   Navigation
========================== */

nav {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--grid-gap);
  align-items: flex-start;

  max-width: var(--max-width);
  margin: 0 auto;
  padding: 25px var(--page-padding) 10px var(--page-padding);
}

/* Left: name/logo block */
ul.logo {
  grid-column: 1 / span 5;
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.logo li a {
  text-decoration: none;
  color: black;
}

ul.nav-menu {
  grid-column: 6 / span 3;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  font-size: 0.85rem;
}

.nav-menu a {
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-menu a:hover {
  text-decoration: underline;
}

/* ==========================
   Footer
========================== */

footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================
   MEDIA QUERIES
========================== */

/* ---------- TABLET / SMALL LAPTOP (<= 800px) ---------- */
@media (max-width: 800px) {

  .page {
    padding: var(--space-4) var(--page-padding-mobile);
  }

  /* collapse 12-col into one column */
  .grid,
  .project-layout {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  /* nav becomes simpler block layout */
  nav {
    display: block;
    padding: var(--space-3) var(--page-padding-mobile) var(--space-2);
    max-width: 100%;
  }

  ul.logo {
    margin: 0 0 var(--space-2) 0;
  }

  ul.nav-menu {
    flex-direction: row;
    gap: var(--space-2);
  }

  /* homepage hero */
  .work-intro {
    grid-column: 1 / -1;
    max-width: 50ch;
    padding: 0;
    margin-bottom: var(--space-5);
  }

  .work-intro p {
    font-size: 2.4rem;
    line-height: 1.25;
    max-width: 28ch;
  }

  /* project rows
     (homepage + series pages) */
  .project-image,
  .project-text {
    grid-column: 1 / -1;
  }

  .project-image img {
    margin-left: 0;
    max-width: 100%;
  }

  /* info page */
  .info-image,
  .info-content {
    grid-column: 1 / -1;
    padding: 0;
  }

  .info-image {
    margin-bottom: var(--space-3);
  }

  /* series layout */
  .series-rail,
  .series-content-main {
    grid-column: 1 / -1;
    position: static;
  }

  .series-rail {
    text-align: left;
    margin-bottom: var(--space-3);
  }

  .series-rail nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .series-content-main {
    max-width: 100%;
    padding: 0;
  }

  footer {
    padding:0;
    text-align: left;
  }
}

/* ---------- PHONE (<= 675px) ---------- */
@media (max-width: 675px) {

  /* hero gets smaller / tighter */
  .work-intro {
    padding:0;
    margin-bottom: var(--space-5);
  }

  .work-intro p {
    font-size: 1.7rem;
    line-height: 1.25;
    max-width: 20ch;
    margin: 0;
  }

  /* nav: same structure, just tighter padding */
  nav {
    padding: var(--space-3) var(--page-padding-mobile) var(--space-2);
  }

  /* hide series rail completely on small screens */
  .series-rail {
    display: none;
  }

  /* images: full-width column */
  .project-image img,
  .info-image img {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .project-text,
  .info-content {
    padding: 0;
    max-width: 100%;
  }

  footer {
    font-size: 0.9rem;
    padding: 0;
  }
}
