:root {
  --paper: #ffffff;
  --ink: #23262d;
  --graphite: #5e6470;
  --rule: #dcdfe4;
  --proof: #c42b2b;   /* deletions only */
  --pen: #2348c9;     /* insertions and links */
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --measure: 66ch;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pen); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

/* Site header */
.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.site-head .name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-head nav { display: flex; gap: 1.5rem; font-size: .95rem; }
.site-head nav a { color: var(--ink); text-decoration: none; }
.site-head nav a:hover { color: var(--pen); }

/* Hero: the editor's markup */
.hero { padding: clamp(3.5rem, 10vw, 7.5rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 {
  font-family: var(--serif); font-weight: 600; font-optical-sizing: auto;
  font-size: clamp(2.4rem, 6.2vw, 4.9rem); line-height: 1.06; letter-spacing: -0.015em;
  margin: 0; max-width: 17ch;
}
.edit { white-space: nowrap; }
.edit del {
  color: var(--graphite); text-decoration: none; position: relative;
}
.edit del::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 55%; height: .07em;
  background: var(--proof); transform-origin: left center;
  animation: strike .5s cubic-bezier(.6,0,.2,1) .9s both;
}
.edit ins {
  text-decoration: none; color: var(--pen); font-style: italic; margin-left: .18em;
  animation: write .6s ease-out 1.5s both;
}
.caret { display: inline-block; font-family: var(--sans); font-weight: 400; color: var(--proof); font-size: .45em; vertical-align: super; margin-left: -.1em; animation: write .3s ease-out 1.3s both; }
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes write { from { opacity: 0; transform: translateY(.12em); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .edit del::after, .edit ins, .caret { animation: none; }
}
.hero .lede { max-width: 54ch; margin: 2rem 0 0; font-size: 1.2rem; color: var(--ink); }
.hero .contact { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; font-size: .98rem; }

/* Sections */
section { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--rule); }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.15; margin: 0 0 .5rem; }
.section-intro { color: var(--graphite); max-width: var(--measure); margin: 0 0 2.5rem; }

/* Work list */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.25rem, 4vw, 3.5rem); align-items: start; padding: 2.25rem 0; border-top: 1px solid var(--rule); }
.work-item:first-child { border-top: 0; padding-top: 0; }
.work-item h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.35rem, 2.2vw, 1.65rem); line-height: 1.2; margin: 0 0 .35rem; }
.work-item h3 a { color: var(--ink); text-decoration: none; }
.work-item h3 a:hover { color: var(--pen); }
.work-item .meta { color: var(--graphite); font-size: .95rem; margin: 0 0 .9rem; }
.work-item p { margin: 0 0 1rem; max-width: 52ch; }
.work-item .shot { border: 1px solid var(--rule); overflow: hidden; aspect-ratio: 16 / 10; }
.work-item .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.group { font-family: var(--sans); font-weight: 600; font-size: 1rem; color: var(--graphite); margin: 2.5rem 0 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--rule); }
.group + .work-list .work-item:first-child { padding-top: 0; }

/* Writing */
.writing { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5rem; }
.writing li { display: grid; grid-template-columns: 12rem 1fr; gap: 1.5rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.writing li:first-child { border-top: 0; padding-top: 0; }
.writing .pub { color: var(--graphite); font-size: .95rem; }
.writing h3 { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 0 0 .25rem; line-height: 1.25; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 5vw, 4rem); }
.about p { max-width: var(--measure); margin: 0 0 1.1rem; }
.about dl { margin: 0; font-size: .97rem; }
.about dt { font-weight: 600; margin-top: 1rem; }
.about dt:first-child { margin-top: 0; }
.about dd { margin: .15rem 0 0; color: var(--graphite); }

.site-foot { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--graphite); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

/* Case study pages */
.case-head { padding: clamp(3rem, 8vw, 5.5rem) 0 2rem; }
.case-head .back { font-size: .95rem; }
.case-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -0.01em; margin: 1.25rem 0 1rem; max-width: 20ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem 2rem; margin: 1.5rem 0 0; padding: 1.25rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { font-size: .95rem; }
.facts dt { color: var(--graphite); }
.facts dd { margin: .1rem 0 0; font-weight: 600; }
.case-hero { margin: 2.5rem 0; border: 1px solid var(--rule); }
.case-body { max-width: var(--measure); padding-bottom: 2rem; }
.case-body h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
.case-body ul { padding-left: 1.2rem; }
.case-body li { margin-bottom: .6rem; }
.case-body blockquote { margin: 1.5rem 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--pen); font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; }
.credit { color: var(--graphite); font-size: .92rem; font-style: italic; max-width: var(--measure); margin: 2rem 0 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin: 2rem 0 3rem; }
.gallery figure { margin: 0; }
.gallery img { border: 1px solid var(--rule); }
.gallery figcaption { color: var(--graphite); font-size: .9rem; margin-top: .5rem; }
.next { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 760px) {
  .work-item, .about, .writing li { grid-template-columns: 1fr; }
  .work-item .shot { order: -1; }
  .site-head { flex-wrap: wrap; }
  .site-head nav { gap: 1rem; font-size: .9rem; }
  .edit { white-space: normal; }
}
