/* ---------------------------------------------------------------
   Marco Zaplan — mineral palette, stratigraphic dividers
   --------------------------------------------------------------- */

:root {
  --paper:     #ffffff;
  --paper-sun: #eceeea;
  --ink:       #15201c;
  --ink-soft:  #55635d;
  --rule:      #d3d9d4;
  --ore:       #1f6f63;
  --ore-deep:  #12463e;
  --ochre:     #a8641e;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 34rem;
  --wide:    46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #101613;
    --paper-sun: #182220;
    --ink:       #e6ebe7;
    --ink-soft:  #97a49e;
    --rule:      #2c3a35;
    --ore:       #6cc3ac;
    --ore-deep:  #a5ddcc;
    --ochre:     #d99a4e;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem .75rem;
  font-family: var(--sans);
}

/* --- Shell -------------------------------------------------- */

.shell {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

@media (min-width: 60rem) {
  .shell {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 4.5rem;
    padding: 5rem 2.5rem 6rem;
  }
}

/* --- Rail --------------------------------------------------- */

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

@media (min-width: 60rem) {
  .rail {
    position: sticky;
    top: 5rem;
    align-self: start;
  }
}

.wordmark {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.75rem;
}
.wordmark-name {
  display: block;
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.wordmark-role {
  display: block;
  margin-top: .35rem;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 13rem;
}
.wordmark:hover .wordmark-name { color: var(--ore); }

.nav, .rail-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  border-top: 1px solid var(--rule);
  padding-top: .9rem;
}
.nav a {
  display: inline-block;
  padding: .15rem 0;
  font-size: .9375rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.nav a:hover { color: var(--ore); }
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--ochre);
}

@media (min-width: 60rem) {
  .nav { display: block; }
  .nav li { margin-bottom: .35rem; }
}

.rail-links {
  margin-top: 1.75rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.1rem;
  font-size: .8125rem;
}
.rail-links a { color: var(--ink-soft); text-decoration: none; }
.rail-links a:hover { color: var(--ore); text-decoration: underline; }

@media (min-width: 60rem) {
  .rail-links { display: block; }
  .rail-links li { margin-bottom: .3rem; }
}

/* --- Content ------------------------------------------------ */

.content { max-width: var(--wide); margin-top: 2.75rem; }
@media (min-width: 60rem) { .content { margin-top: 0; } }

.content > p,
.content > ul,
.content > ol,
.post p, .post ul, .post ol, .post blockquote {
  max-width: var(--measure);
}

h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 .6rem;
}

h1 { font-size: 1.875rem; }
h2 {
  font-size: 1.1875rem;
  margin-top: 2.75rem;
}
h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.75rem;
}

p { margin: 0 0 1.1rem; }

a { color: var(--ore); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ore-deep); }

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
}

/* --- Stratigraphic divider (the signature) ------------------ */

hr.strata {
  border: 0;
  height: 1px;
  background: var(--ink);
  margin: 2.25rem 0;
  box-shadow:
    0 4px 0 -1px var(--ochre),
    0 9px 0 -2px var(--rule);
}

/* --- Hero --------------------------------------------------- */

.lede {
  font-size: 1.5rem;
  line-height: 1.38;
  letter-spacing: -0.011em;
  max-width: 28ch;
  margin: 0 0 1.5rem;
}
@media (min-width: 60rem) {
  .lede { font-size: 1.75rem; }
}

.standfirst {
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* --- Definition-style blocks -------------------------------- */

.practice {
  margin: 0;
  border-top: 1px solid var(--rule);
}
.practice > div {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 44rem) {
  .practice > div {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}
.practice dt {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .9375rem;
}
.practice dd {
  margin: .25rem 0 0;
  color: var(--ink-soft);
  font-size: .9688rem;
}
@media (min-width: 44rem) {
  .practice dd { margin-top: 0; }
}

/* --- Filter bar --------------------------------------------- */

.filters {
  font-family: var(--sans);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 1.5rem 0 .75rem;
}
.filters label {
  font-size: .8125rem;
  color: var(--ink-soft);
  margin-right: .25rem;
}
.chip {
  font: inherit;
  font-size: .8125rem;
  padding: .3rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { border-color: var(--ore); color: var(--ore); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.search {
  font: inherit;
  font-family: var(--sans);
  font-size: .8125rem;
  padding: .35rem .6rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  min-width: 12rem;
  flex: 1 1 12rem;
}

.count {
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}
.count b {
  color: var(--ochre);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* --- Records (portfolio + research) ------------------------- */

.records {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.record {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 44rem) {
  .record {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1.75rem;
  }
}

.record-year {
  font-family: var(--sans);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ochre);
  padding-top: .15rem;
}

.record-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
  margin: 0 0 .2rem;
  line-height: 1.3;
}
.record-title a { text-decoration: none; color: var(--ink); }
.record-title a:hover { color: var(--ore); text-decoration: underline; }

.record-org {
  font-family: var(--sans);
  font-size: .8438rem;
  color: var(--ink-soft);
  margin: 0 0 .5rem;
}
.record-summary {
  margin: 0 0 .5rem;
  font-size: .9688rem;
  max-width: var(--measure);
}
.record-tags {
  font-family: var(--sans);
  font-size: .75rem;
  color: var(--ink-soft);
  margin: 0;
}
.record-tags span::after { content: " / "; color: var(--rule); }
.record-tags span:last-child::after { content: ""; }

.record[hidden] { display: none; }

.empty {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-soft);
  padding: 1.75rem 0;
}

/* --- Writing list ------------------------------------------- */

.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.entry {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 44rem) {
  .entry { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.75rem; }
}
.entry-date {
  font-family: var(--sans);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  padding-top: .2rem;
}
.entry-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  margin: 0 0 .2rem;
  line-height: 1.3;
}
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--ore); text-decoration: underline; }
.entry-excerpt { margin: 0; font-size: .9688rem; color: var(--ink-soft); max-width: var(--measure); }

/* --- Post --------------------------------------------------- */

.backlink { font-family: var(--sans); font-size: .8125rem; margin-bottom: 1.25rem; }
.post-meta { font-family: var(--sans); font-size: .8438rem; color: var(--ink-soft); }
.post h2 { margin-top: 2.25rem; }
.post blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--ochre);
  color: var(--ink-soft);
}
.post img { max-width: 100%; height: auto; }
.post code, .post pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875rem;
}
.post pre {
  background: var(--paper-sun);
  padding: 1rem;
  overflow-x: auto;
  border-left: 2px solid var(--rule);
}

/* --- Contact ------------------------------------------------ */

.contact-list { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.contact-list li {
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: .9375rem;
}
.contact-list .k { color: var(--ink-soft); }

/* --- Footer ------------------------------------------------- */

.foot {
  margin-top: 4rem;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-soft);
}

/* --- Hero photo -------------------------------------------- */

.hero {
  margin: 0 0 2.5rem;
  /* Bleeds to the edge of the content column */
}

.hero-img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center 20%;
  
  background: var(--paper-sun); /* placeholder colour while loading */
}

@media (min-width: 60rem) {
  .hero-img { height: auto; }
}

/* --- Logo grid --------------------------------------------- */

.logo-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem 2.5rem;
  align-items: center;
}

.logo-grid li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-grid img {
  display: block;
  max-width: 100%;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Greyscale by default; colour on hover */
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.2s, opacity 0.2s;
}

.logo-grid a:hover img,
.logo-grid a:focus img {
  filter: grayscale(0%);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .logo-grid img {
    filter: grayscale(100%) invert(1);
    opacity: 0.6;
  }
  .logo-grid a:hover img,
  .logo-grid a:focus img {
    filter: grayscale(0%) invert(0);
    opacity: 1;
  }
}

/* --- Hero photo --- */
.hero { margin: 0 0 2.5rem; }
.hero-img {
  display: block;
  width: 100%;
  
  
  
  background: #eceeea;
}
@media (min-width: 60rem) { .hero-img { height: auto; } }

/* --- Logo grid --- */
.logo-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem 2.5rem;
  align-items: center;
}
.logo-grid li { display: flex; align-items: center; justify-content: center; }
.logo-grid img {
  display: block;
  max-width: 100%;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.2s, opacity 0.2s;
}
.logo-grid a:hover img, .logo-grid a:focus img { filter: grayscale(0%); opacity: 1; }

/* --- Photo gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 2px;
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.gallery img:hover { opacity: 0.85; }
