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

body {
  margin: 0;
  font-family: sans-serif;
}

@keyframes grayToColor {
  0%   { filter: grayscale(100%); }
  100% { filter: grayscale(0%); }
}

@keyframes redToGreen {
  0%   { color: red; }
  25%  { color: orange; }
  50%  { color: yellow; }
  80%  { color: green; }
  100% { color: blue; }
}

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

/* Header — base rules are the mobile (stacked) layout; the min-width query
   near the bottom of this file adds the side-by-side desktop treatment. */

header {
  display: flex;
  flex-wrap: wrap;
}

header .logo {
  display: flex;
  flex-basis: 100%;
  min-height: 12rem;
  background-color: black;
  align-items: center;
  justify-content: center;
  position: relative;
}

header .logo .earth {
  background-image: url(./i/globe_west_540.jpg);
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  height: 100%;
  width: 100%;
  z-index: 0;
  animation: grayToColor 30s;
}

header .logo .ring {
  animation: redToGreen 30s;
  color: blue;
  display: block;
  width: 78%;
  height: 0;
  padding-bottom: 74%;
  border: 0.3rem dotted currentcolor;
  border-radius: 100%;
  margin: 1rem;
  position: relative;
  z-index: 1;
}

header .blurb {
  display: flex;
  flex-direction: column;
  padding: 1em;
  font-size: 1.25rem;
  border-top: 1px solid;
}

header h1 {
  margin: 0 0 1rem;
  font-size: 3em;
}

header .blurb p {
  margin: 0;
  max-width: 50rem;
}

header nav {
  flex: 3 100%;
}

header nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid;
  border-bottom: 1px solid;
}

header nav ul li {
  border-left: 1px solid;
  flex: 1 1 50%;
}

header nav ul li:nth-child(odd) {
  border-left: none;
}

header nav ul li:nth-child(n+3) {
  border-top: 1px solid;
}

header nav a {
  display: block;
  padding: 1em;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

header nav a:hover {
  background-color: blue;
  color: white;
}

/* Main — same mobile-first approach: base is a single stacked column. */

main {
  display: flex;
  flex-wrap: wrap;
}

.row, .row > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.row {
  border-bottom: 1px solid;
  min-height: 20rem;
}

.row:hover { background: blue; color: white; border-bottom-color: black; }
.row.no-hover:hover { background: initial; color: initial; }

.row > a {
  color: inherit;
  text-decoration: none;
  min-height: auto;
}

.row .imageWrapper {
  display: flex;
  width: 100%;
  border-bottom: 1px solid;
  min-height: 20rem;
  height: 100%;
  position: relative;
  background-color: var(--tint, #000);
}

.row:last-child {
  border-bottom: none;
}

.row .imageWrapper img {
  display: block;
  width: 100%;
  min-height: 20rem;
  height: 100%;
  object-fit: cover;
  position: relative;
  mix-blend-mode: multiply;
}

.row .imageWrapper .ontop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -43%);
  rotate: 4deg;
  width: auto;
  box-shadow: 1px 1px 5px rgba(0,0,0,0.3);
}

.row .blurb {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

.row .blurb h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.row .blurb p {
  font-size: 1.375rem;
  font-weight: 300;
  max-width: 36rem;
}

/* Footer — stacked by default; touch-target padding on links applies at
   every viewport, not just mobile (it was undersized everywhere before). */

footer {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
  border-top: 1px solid;
}

footer ul { flex: 1; }
footer a { color: inherit; display: inline-block; padding: 0.75rem 0; }
footer ul p { margin: 0; }

/* Case study detail pages */

.caseStudyDetail {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid;
}

.caseStudyDetail .imageWrapper {
  display: flex;
  flex: 1 1 24rem;
  border-bottom: 1px solid;
  min-height: 20rem;
  position: relative;
  background-color: var(--tint, #000);
}

.caseStudyDetail .imageWrapper img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 20rem;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.caseStudyDetail .content {
  flex: 1 1 24rem;
  padding: 2rem;
  max-width: 38rem;
}

.caseStudyDetail .content h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.caseStudyDetail .content .dek {
  font-size: 1.25rem;
  font-weight: 300;
  margin: 0;
}

/* Text-first body: images are evidence, not the argument (SPEC.md §5) */
.caseStudyBody {
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.caseStudyBody h2 {
  font-size: 1.375rem;
  margin: 2.5rem 0 1rem;
}

.caseStudyBody figure {
  margin: 2rem 0;
  border: 1px solid;
}

.caseStudyBody figure img {
  display: block;
  width: 100%;
  height: auto;
}

.caseStudyBody figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-top: 1px solid;
}

.caseStudyBody dl {
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid;
  border-bottom: 1px solid;
}

.caseStudyBody dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: bold;
  margin-top: 1rem;
}

.caseStudyBody dt:first-child {
  margin-top: 0;
}

.caseStudyBody dd {
  margin: 0.25rem 0 0;
}

/* Ongoing/process-log pattern: a repeatable dated-entry list for projects
   that are more about the process than a single finished output (e.g.
   Chair-ness's one-chair-a-week format). Add a new <li> per entry. Base is
   a single column; the min-width query below adds the two-column layout. */
.processLog {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.processLog li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.processLog figure {
  margin: 0;
  border: 1px solid;
}

.processLog img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.processLog .entryMeta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}

.processLog p {
  margin: 0;
}

.backLink {
  display: inline-block;
  margin-top: 1rem;
}

/* Deliberately visible focus ring (SPEC.md §5) — thick enough to read as
   part of the brutalist aesthetic rather than a default-browser afterthought. */
a:focus-visible {
  outline: 0.25rem solid blue;
  outline-offset: 2px;
}

/* ============================================================================
   Progressive enhancement from here up: everything above is the mobile
   baseline; this query layers on the side-by-side desktop treatment once
   there's enough width for it to actually read well.
   ============================================================================ */
@media (min-width: 40rem) {
  header .logo {
    flex: 3;
    flex-basis: 0;
    min-height: 0;
  }

  header .blurb {
    flex: 6;
    font-size: 1.75rem;
    border-top: none;
    border-left: 1px solid;
  }

  header nav ul {
    flex-wrap: nowrap;
  }

  header nav ul li {
    flex: 1;
  }

  header nav ul li:nth-child(n+3) {
    border-top: none;
  }

  header nav ul li:first-child {
    border-left: none;
  }

  header nav ul li:not(:first-child) {
    border-left: 1px solid;
  }

  .row, .row > a {
    flex-direction: row;
    align-items: center;
  }

  .row .imageWrapper {
    flex: 3;
    border-bottom: none;
    border-right: 1px solid;
  }

  .row:nth-child(odd) .imageWrapper {
    order: 2;
    border-right: none;
    border-left: 1px solid;
  }

  .row .blurb {
    flex: 4;
    padding: 2rem;
  }

  .row .blurb p {
    font-size: 2rem;
  }

  footer {
    flex-direction: row;
    padding: 2rem;
    gap: 2rem;
  }

  .caseStudyDetail .imageWrapper {
    border-bottom: none;
    border-right: 1px solid;
  }

  .caseStudyDetail .content h1 {
    font-size: 2.25rem;
  }

  .caseStudyDetail .content .dek {
    font-size: 1.375rem;
  }

  .caseStudyBody {
    padding: 2rem;
  }

  .processLog li {
    grid-template-columns: 9rem 1fr;
  }
}
