/* chelseahopkins.co.uk · a field guide */

:root {
  --paper: #fdf9f1;
  --paper-2: #f5eedf;
  --ink: #2a251d;
  --ink-2: #4a4335;
  --muted: #857a68;
  --line: #d9cfbc;
  --amber: #c9962e;
  --amber-2: #e0b04a;
  --olive: #44503f;

  --display: "Fraunces", Georgia, "Iowan Old Style", serif;
  --body: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(.2,.7,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --paper-2: #1e1b14;
    --ink: #f1eadb;
    --ink-2: #d9d0bd;
    --muted: #9a8f7a;
    --line: #3a3427;
    --amber: #d9a83a;
    --amber-2: #e8bd5c;
    --olive: #9db08f;
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::before { mix-blend-mode: screen; opacity: .05; } }

a { color: inherit; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
a:hover { color: var(--amber); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .5rem 1rem; font-family: var(--mono); font-size: .8rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

.eyebrow, .num, figcaption, .status, .rule, .index, dt, .diet, .colophon, summary, .range span {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- cover ---------- */

.cover {
  position: relative;
  min-height: 92svh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: clip;
}

.cover-photo {
  margin: 0;
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cover-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%;
  animation: settle 2.4s var(--ease) both;
}
.cover-photo::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--paper) 0%, color-mix(in oklab, var(--paper) 78%, transparent) 26%, transparent 62%),
    linear-gradient(to right, color-mix(in oklab, var(--ink) 28%, transparent), transparent 60%);
}

.cover-text {
  position: relative; z-index: 1;
  align-self: end;
  padding: 0 var(--gutter) 1.5rem;
  max-width: 60rem;
}

.cover-text .eyebrow {
  display: inline-block;
  color: var(--amber-2);
  background: rgba(26, 22, 15, .82);
  padding: .45rem .7rem;
  margin: 0 0 1.25rem;
}

h1 {
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: .88;
  letter-spacing: -.035em;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
h1::after { content: "."; color: var(--amber); }

.lede { font-size: clamp(1.05rem, 1rem + .5vw, 1.35rem); max-width: 42ch; margin: 0 0 .6rem; line-height: 1.4; text-wrap: pretty; }
.cta { margin: 1.1rem 0 0; }
.cta a {
  display: inline-block;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paper); background: var(--ink);
  padding: .8rem 1.1rem; text-decoration: none;
  border: 1px solid transparent;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.cta a::after { content: " →"; color: var(--amber-2); }
.cta a:hover { background: var(--amber); color: var(--ink); }
.cta a:hover::after { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .cta a { color: #16140f; background: #f1eadb; }
  .cta a::after { color: var(--amber); }
}
br.wide { display: none; }
@media (min-width: 60rem) { br.wide { display: inline; } .lede { max-width: none; } }

.rule {
  position: relative; z-index: 1;
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem var(--gutter) 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.rule span:first-child { color: var(--ink); }

/* ---------- sticky index ---------- */

.index {
  display: none;
}
@media (min-width: 72rem) {
  .index {
    display: flex; flex-direction: column; gap: .35rem;
    position: fixed; left: 1.25rem; top: 50%; transform: translateY(-50%);
    z-index: 5;
    opacity: 0; visibility: hidden;
    transition: opacity .5s var(--ease), visibility 0s .5s;
  }
  .index.show { opacity: 1; visibility: visible; transition-delay: 0s; }
  .index a {
    display: grid; grid-template-columns: 2.2rem auto; align-items: baseline;
    text-decoration: none; color: var(--muted);
    padding: .2rem .4rem; border-radius: 2px;
    transition: color .3s var(--ease), background .3s var(--ease);
  }
  .index a b { font-weight: 500; color: var(--amber); }
  .index a:hover, .index a[aria-current="true"] { color: var(--ink); background: var(--paper-2); }
}

/* ---------- chapters ---------- */

main { position: relative; z-index: 1; }
@media (min-width: 72rem) { main { padding-left: 11rem; } }

.chapter { padding: clamp(3rem, 8vw, 7rem) var(--gutter); max-width: 76rem; margin: 0 auto; }
.chapter + .chapter { border-top: 1px solid var(--line); }

.chapter-head {
  display: grid;
  grid-template-columns: 4rem 1fr;
  column-gap: 1rem;
  align-items: baseline;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.chapter-head .num { color: var(--amber); font-size: .8rem; padding-top: .4rem; }
.chapter-head h2 {
  grid-column: 2;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0;
}
.chapter-head .note { grid-column: 2; color: var(--muted); font-style: italic; margin: .75rem 0 0; max-width: var(--measure); }

/* ---------- about ---------- */

.about { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 60rem) { .about { grid-template-columns: 5fr 7fr; gap: 3.5rem; } }
.about-photo { margin: 0; border: 1px solid var(--line); padding: .5rem; background: var(--paper-2); color: var(--muted); }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.about-photo figcaption { padding: .8rem .25rem .3rem; }
@media (min-width: 60rem) { .about-photo { position: sticky; top: 2rem; } }

.lead {
  font-family: var(--display); font-weight: 400; font-variation-settings: "opsz" 48;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); line-height: 1.3; letter-spacing: -.01em;
  margin: 0 0 1.25rem; text-wrap: pretty;
}
.about-text p { max-width: var(--measure); text-wrap: pretty; }
.about-text p:not(.lead) { margin: 0 0 1rem; color: var(--ink-2); }

.habits { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.habits li { padding: .55rem 0; border-bottom: 1px dashed var(--line); font-family: var(--display); font-size: 1.15rem; }
.habits li::before { content: "◆"; color: var(--amber); font-size: .5em; vertical-align: .35em; margin-right: .8em; }

/* ---------- for hire ---------- */

.hire { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .hire { grid-template-columns: 7fr 5fr; gap: 3.5rem; } }
.where { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.where::before { content: "◆ "; color: var(--amber); }
.hire-text dl { margin: 1.5rem 0 0; }
.hire-text dd { max-width: var(--measure); color: var(--ink-2); }
.contact {
  margin: 2rem 0 0; padding: 1.25rem 1.4rem;
  border: 1px solid var(--amber); background: color-mix(in oklab, var(--amber) 8%, var(--paper));
  font-family: var(--display); font-size: 1.2rem; line-height: 1.4; max-width: var(--measure);
}
.contact a { text-decoration-thickness: 2px; }
.hire .diet { align-content: start; margin-left: 0; }

/* ---------- plates ---------- */

.plates {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 60rem) { .plates { grid-template-columns: 1fr 1fr; } }

.plate { display: grid; gap: 1.25rem; align-content: start; }

.plate-photo {
  display: block; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); padding: .5rem; background: var(--paper-2);
  transition: transform .5s var(--ease), border-color .5s var(--ease);
}
.plate-photo img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.plate-photo figcaption { padding: .8rem .25rem .3rem; }
.plate-photo:hover { transform: translateY(-3px) rotate(-.3deg); border-color: var(--amber); }

.plate-body h3 {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: "opsz" 72;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -.02em;
  margin: .25rem 0 .5rem;
}
.plate-body h3 a { text-decoration: none; }
.plate-body h3 a:hover { color: var(--amber); }

.status { color: var(--olive); margin: 0 0 1.25rem; display: flex; align-items: center; gap: .5rem; }
.status i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 3px color-mix(in oklab, var(--olive) 25%, transparent); }
.status.beta { color: var(--amber); }
.status.beta i { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in oklab, var(--amber) 25%, transparent); }

dl { margin: 0; }
dt { color: var(--muted); margin-bottom: .3rem; }
dt::before { content: "◆ "; color: var(--amber); }
dd { margin: 0 0 1.1rem; text-wrap: pretty; max-width: 48ch; }
dd:last-child { margin-bottom: 0; }

/* ---------- bleed figures ---------- */

.bleed {
  margin: 0 calc(-1 * var(--gutter)) clamp(2rem, 5vw, 4rem);
  position: relative;
}
.bleed img { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.bleed figcaption {
  position: absolute; right: var(--gutter); bottom: .9rem;
  background: var(--paper); color: var(--ink-2); padding: .4rem .7rem;
}

/* ---------- sightings ---------- */

.sightings {
  list-style: none; margin: 0; padding: 0;
  counter-reset: s;
  border-top: 1px solid var(--line);
}
.sightings li {
  counter-increment: s;
  display: grid; grid-template-columns: 3rem 15rem 1fr; gap: 1rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.sightings li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .75rem; color: var(--amber); letter-spacing: .1em; }
.sightings li > a { font-family: var(--display); font-weight: 500; font-size: 1.35rem; letter-spacing: -.01em; text-decoration: none; }
.sightings li > a:hover { color: var(--amber); }
.sightings li p { margin: 0; color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
.sightings.small li > a { font-size: 1.1rem; }
@media (max-width: 48rem) {
  .sightings li { grid-template-columns: 2.5rem 1fr; }
  .sightings li p { grid-column: 2; }
}

.lesser { margin-top: 1.5rem; }
.lesser summary { color: var(--muted); cursor: pointer; list-style: none; padding: .5rem 0; }
.lesser summary::before { content: "+ "; color: var(--amber); }
.lesser[open] summary::before { content: "− "; }
.lesser summary::-webkit-details-marker { display: none; }
.lesser .sightings { margin-top: .5rem; }

/* ---------- prose / lists ---------- */

.prose { max-width: var(--measure); margin: 0; font-size: 1.15em; line-height: 1.5; text-wrap: pretty; }
.prose.small { font-size: 1em; color: var(--ink-2); margin-top: 2rem; }
@media (min-width: 48rem) { .prose { margin-left: 5rem; } }

.diet { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 48rem) { .diet { margin-left: 5rem; } }
.diet li {
  border: 1px solid var(--line); padding: .5rem .8rem; color: var(--ink-2); background: var(--paper-2);
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.diet li:hover { border-color: var(--amber); color: var(--ink); }

.behaviour {
  list-style: none; margin: 0; padding: 0;
  font-family: var(--display); font-weight: 400; font-variation-settings: "opsz" 72;
  font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.25; letter-spacing: -.01em;
}
@media (min-width: 48rem) { .behaviour { margin-left: 5rem; } }
.behaviour li { padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.behaviour li::before { content: "◆"; color: var(--amber); font-size: .5em; vertical-align: .35em; margin-right: .8em; }

/* ---------- life history ---------- */

.history {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.history li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.history .when { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); padding-top: .55rem; white-space: nowrap; }
.history h3 {
  font-family: var(--display); font-weight: 500; font-variation-settings: "opsz" 72;
  font-size: 1.5rem; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5rem;
}
.history h3 span { display: block; font-family: var(--body); font-weight: 400; font-size: 1rem; color: var(--muted); letter-spacing: 0; margin-top: .15rem; }
.history p { margin: 0; color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
@media (max-width: 40rem) {
  .history li { grid-template-columns: 1fr; gap: .4rem; }
  .history .when { padding-top: 0; }
}

.sub {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
  margin: 3rem 0 1rem;
}
.sub::before { content: "◆ "; color: var(--amber); }
@media (min-width: 48rem) { .sub, .seen, .creds { margin-left: 5rem; } }

.seen { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 48rem) { .seen { grid-template-columns: 1fr 1fr; } }
.seen li { background: var(--paper); padding: 1.1rem 1.2rem; color: var(--ink-2); text-wrap: pretty; }
.seen li b { display: block; font-family: var(--display); font-weight: 500; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; margin-bottom: .25rem; }

.creds { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; color: var(--ink-2); }
.creds li { break-inside: avoid; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 40rem) { .creds { columns: 1; } }

.range { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 48rem) { .range { margin-left: 5rem; } }
.range li { border-bottom: 1px solid var(--line); }
.range a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem 0; text-decoration: none;
  font-family: var(--display); font-size: 1.4rem; font-weight: 500; letter-spacing: -.01em;
}
.range a span { color: var(--muted); text-transform: none; letter-spacing: .04em; }
.range a:hover span { color: var(--amber); }
@media (min-width: 48rem) { .prose.small { margin-left: 5rem; } }

/* ---------- notes ---------- */

.notes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
@media (min-width: 48rem) { .chapter .notes { margin-left: 5rem; } }
.notes li { border-bottom: 1px solid var(--line); }
.notes a {
  display: grid; grid-template-columns: 9rem 1fr; column-gap: 1.5rem; align-items: baseline;
  padding: 1.1rem 0; text-decoration: none;
}
.notes a .when { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); white-space: nowrap; }
.notes a b { font-family: var(--display); font-weight: 500; font-size: 1.35rem; letter-spacing: -.01em; }
.notes a p { grid-column: 2; margin: .25rem 0 0; color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
.notes a:hover b { color: var(--amber); }
@media (max-width: 40rem) { .notes a { grid-template-columns: 1fr; row-gap: .2rem; } .notes a p { grid-column: 1; } }

/* note pages */
.note-page { background: var(--paper); }
.note-head {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter); border-bottom: 1px solid var(--line);
  position: relative; z-index: 1;
}
.crumb { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--amber); }

.note-main { position: relative; z-index: 1; max-width: 46rem; margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.note-main .eyebrow { color: var(--amber); margin: 0 0 1rem; }
.note-main h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 400; line-height: 1;
  font-variation-settings: "opsz" 96, "SOFT" 20; letter-spacing: -.025em; margin: 0 0 2rem;
}
.note-main h1::after { content: none; }
.note-main .notes { margin-top: 2rem; }

.note-body { font-size: 1.1em; line-height: 1.6; }
.note-body > * + * { margin-top: 1.1em; }
.note-body h2, .note-body h3 {
  font-family: var(--display); font-weight: 500; font-variation-settings: "opsz" 48;
  line-height: 1.15; letter-spacing: -.015em; margin-top: 2.2em;
}
.note-body h2 { font-size: 1.7rem; }
.note-body h3 { font-size: 1.3rem; }
.note-body h2::before { content: "◆"; color: var(--amber); font-size: .5em; vertical-align: .45em; margin-right: .7em; }
.note-body p, .note-body li { text-wrap: pretty; }
.note-body ul, .note-body ol { padding-left: 1.4em; }
.note-body li + li { margin-top: .35em; }
.note-body blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.2em; border-left: 2px solid var(--amber); color: var(--ink-2); font-style: italic; }
.note-body code { font-family: var(--mono); font-size: .86em; background: var(--paper-2); padding: .1em .35em; border: 1px solid var(--line); }
.note-body pre { background: var(--paper-2); border: 1px solid var(--line); padding: 1rem 1.2rem; overflow-x: auto; font-size: .9em; line-height: 1.5; }
.note-body pre code { background: none; border: 0; padding: 0; font-size: 1em; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-body img { border: 1px solid var(--line); padding: .4rem; background: var(--paper-2); }
.note-body hr { border: 0; border-top: 1px dashed var(--line); margin: 2.5em 0; }
.note-body a { text-decoration-thickness: 1.5px; }

/* ---------- colophon ---------- */

.colophon {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter) 3rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  color: var(--muted);
  position: relative; z-index: 1;
}
.colophon p { margin: 0; }
.colophon a { text-decoration: none; }
.colophon a:hover { color: var(--amber); }

/* ---------- motion ---------- */

@keyframes settle { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.reveal { animation: rise 1.1s var(--ease) both; animation-delay: calc(.25s + var(--d, 0) * .14s); }

.chapter > *, .plate, .sightings li {
  --in: 0;
}
.observe { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.observe.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .cover-photo img { animation: none; }
  .observe { opacity: 1; transform: none; transition: none; }
  .plate-photo:hover { transform: none; }
}
