/* Boids (2014 archive): an ornithologist's field notebook. Everything is
   scoped under .arc-boids so nothing leaks to other pages. */

html:has(.arc-boids),
body:has(.arc-boids) {
  margin: 0;
  padding: 0;
  background: #efe7d4;
  color: #2b251d;
  color-scheme: light;
}

.arc-boids {
  --paper: #efe7d4;
  --paper-light: #f7f1e3;
  --ink: #2b251d;
  --ink-soft: #5e5242;
  --rule: #b9aa8c;
  --vermilion: #a63f1d;
  --serif: "Skolar PE Web", Charter, Georgia, ui-serif, serif;
  --hand: Charter, Georgia, ui-serif, serif;

  min-height: 100svh;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 250, 238, 0.7), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(196, 176, 138, 0.18), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

.arc-boids a {
  color: inherit;
  text-decoration-color: #9c8a68;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.arc-boids a:hover {
  color: var(--vermilion);
  text-decoration-color: currentColor;
}

.arc-boids :focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Top bar */

.arc-boids-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 10px 32px;
  border-bottom: 1px solid var(--rule);
}

.arc-boids-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.arc-boids-archive {
  margin: 0;
  font-family: var(--hand);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
}

/* The plate: title and field notes in the margin, the sky as the figure */

.arc-boids-plate {
  display: grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
  grid-template-areas:
    "title figure"
    "notes figure";
  grid-template-rows: auto 1fr;
  column-gap: 40px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 32px 0;
}

.arc-boids-title {
  grid-area: title;
}

.arc-boids-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.arc-boids-title h1 {
  margin: 0;
  font-weight: 300;
  font-size: 76px;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.arc-boids-dek {
  margin: 18px 0 0;
  font-family: var(--hand);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.arc-boids-figure {
  grid-area: figure;
  position: relative;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 18px 40px -28px rgba(60, 40, 10, 0.45);
}

/* Corner ticks, like a mounted print */
.arc-boids-figure::before,
.arc-boids-figure::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--ink);
  border-style: solid;
  pointer-events: none;
}

.arc-boids-figure::before {
  top: -7px;
  left: -7px;
  border-width: 1px 0 0 1px;
}

.arc-boids-figure::after {
  right: -7px;
  bottom: -7px;
  border-width: 0 1px 1px 0;
}

/* The controller element: it sizes the canvas from its clientWidth, so it
   may carry a border but must not carry padding. */
.arc-boids-sky {
  position: relative;
  padding: 0;
  border: 1px solid var(--rule);
  cursor: crosshair;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(214, 196, 160, 0.35), transparent 55%),
    linear-gradient(180deg, #f9f5ea 0%, #f3ecdb 100%);
  overflow: hidden;
}

.arc-boids-sky canvas {
  display: block;
  width: 100%;
}

.arc-boids-notice {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  max-width: calc(100% - 24px);
  font-family: var(--hand);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  background: rgba(247, 241, 227, 0.8);
  pointer-events: none;
  user-select: none;
}

.arc-boids-figure figcaption {
  display: flex;
  gap: 8px;
  padding: 10px 2px 0;
  font-family: var(--hand);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.arc-boids-figure figcaption span {
  flex-shrink: 0;
  font-style: normal;
  font-weight: bold;
  color: var(--ink);
}

/* Field notes */

.arc-boids-margin {
  grid-area: notes;
  margin-top: 36px;
}

.arc-boids-margin-head {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.arc-boids-margin ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.arc-boids-margin li {
  padding: 16px 0;
  border-bottom: 1px dotted var(--rule);
}

.arc-boids-margin svg {
  display: block;
  width: 96px;
  height: 48px;
  margin-bottom: 6px;
  overflow: visible;
}

.arc-boids-margin h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
}

.arc-boids-margin h2 span {
  display: inline-block;
  min-width: 28px;
  font-family: var(--hand);
  font-style: italic;
  font-weight: normal;
  color: var(--vermilion);
}

.arc-boids-margin li p {
  margin: 0;
  font-family: var(--hand);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.arc-boids-bird {
  fill: rgba(236, 72, 22, 0.8);
  stroke: #c2410c;
  stroke-width: 1;
  stroke-linejoin: round;
}

.arc-boids-dash {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.arc-boids-arrow {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.arc-boids-dot {
  fill: var(--ink);
}

/* Article */

.arc-boids-article {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 24px 8px;
  font-size: 19px;
  line-height: 1.68;
}

.arc-boids-article p {
  margin: 0 0 1.1em;
}

.arc-boids-lede::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  font-size: 3.6em;
  line-height: 0.8;
  font-weight: 300;
  color: var(--vermilion);
}

.arc-boids-article h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2.2em 0 0.8em;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.arc-boids-article h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.arc-boids-article cite {
  font-family: var(--hand);
  font-style: italic;
  font-size: 0.94em;
  line-height: 1;
}

.arc-boids-article strong {
  font-weight: 600;
}

.arc-boids-rules {
  margin: 0 0 1.1em;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.arc-boids-rules li {
  position: relative;
  margin: 0 0 0.9em;
  padding-left: 44px;
  counter-increment: rule;
}

.arc-boids-rules li::before {
  content: counter(rule, lower-roman) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--hand);
  font-style: italic;
  color: var(--vermilion);
}

.arc-boids-moral {
  margin-top: 1.8em !important;
  padding: 18px 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--hand);
  font-style: italic;
  font-size: 21px;
  line-height: 1.55;
}

/* Footer */

.arc-boids-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 680px;
  margin: 40px auto 0;
  padding: 18px 24px 40px;
  border-top: 1px solid var(--ink);
  font-size: 15px;
}

.arc-boids-footer p {
  margin: 0;
  font-family: var(--hand);
  font-style: italic;
}

.arc-boids-footer p a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Narrower screens: stack title, sky, notes */

@media (max-width: 900px) {
  .arc-boids-plate {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "figure"
      "notes";
    grid-template-rows: auto;
    padding: 24px 20px 0;
  }

  .arc-boids-title {
    margin-bottom: 24px;
  }

  .arc-boids-title h1 {
    font-size: 60px;
  }

  .arc-boids-margin ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
  }

  .arc-boids-margin li {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .arc-boids-bar {
    padding: 6px 16px;
  }

  .arc-boids-home {
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .arc-boids-archive {
    font-size: 14px;
    text-align: right;
  }

  .arc-boids-plate {
    padding: 20px 16px 0;
  }

  .arc-boids-title h1 {
    font-size: 52px;
  }

  .arc-boids-dek {
    font-size: 16px;
  }

  .arc-boids-figure {
    padding: 6px;
  }

  .arc-boids-notice {
    font-size: 14px;
  }

  .arc-boids-margin ol {
    display: block;
  }

  .arc-boids-margin li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 16px;
    border-bottom: 1px dotted var(--rule);
  }

  .arc-boids-margin svg {
    grid-row: span 2;
    margin: 4px 0 0;
  }

  .arc-boids-article {
    padding: 48px 16px 8px;
    font-size: 18px;
  }

  .arc-boids-footer {
    padding: 14px 16px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arc-boids * {
    transition: none !important;
  }
}
