/* ============================================================
   laura dillon — field notebook
   One stylesheet for the whole site. Edit colours and sizes in
   the :root block below; everything else follows from it.
   ============================================================ */

:root {
  /* colour */
  --paper:  #FFFFFF;
  --ink:    #252c27;   /* headings, strong text */
  --body:   #3c453c;   /* running text */
  --mute:   #8B9189;   /* captions, secondary */
  --faint:  #B4BBB0;   /* inactive marks */
  --moss:   #496534;   /* the one accent */
  --moss-lo:#c8d6bb;   /* accent, quietened */
  --rule:   #E8EAE5;   /* hairlines */
  --tile:   #F4F5F2;   /* empty media slots */

  /* type */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* measure */
  --sidebar: 146px;
  --gutter:  50px;
  --measure: 560px;
}

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

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

body {
  margin: 0;
  padding: 34px 40px 72px;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* ---------- masthead ---------- */

.name {
  display: inline-block;
  margin-bottom: 44px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.name:hover { color: var(--moss); }

/* ---------- shell ---------- */

.wrap {
  display: flex;
  gap: var(--gutter);
  align-items: flex-start;
  max-width: 1040px;
}

main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--measure);
  order: 2;
}
main.wide { max-width: 680px; }

/* ---------- a photo beside the text ----------
   Optional third column. Add <aside class="side-photo"> after
   the nav and it sits to the right of the writing on a wide
   screen, and above it on a phone. Leave it out and nothing
   shifts.
   --------------------------------------------- */

.side-photo {
  flex: 0 0 190px;
  order: 3;
  padding-top: 3px;
}
.side-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.side-photo .slot { aspect-ratio: 4 / 5; }
.side-photo figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
}

/* ---------- sidebar nav ---------- */

.nav {
  flex: 0 0 var(--sidebar);
  order: 1;
  padding-top: 2px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 2.05;
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  color: var(--mute);
  text-decoration: none;
}
.nav a:hover { color: var(--ink); }
.nav li.here > a { color: var(--ink); }
.nav li.here > a::before {
  content: "— ";
  margin-left: -14px;
  color: var(--moss);
}
.nav .sub {
  margin: 3px 0 8px;
  padding-left: 13px;
  font-size: 11.5px;
  line-height: 1.4;
}
.nav .sub li { margin-bottom: 6px; }
.nav .sub a { color: var(--faint); }
.nav .sub a:hover { color: var(--body); }

/* ---------- running text ---------- */

main p { margin: 0 0 15px; }
main p:last-child { margin-bottom: 0; }

.lede {
  margin-bottom: 22px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}

main a {
  color: var(--moss);
  text-decoration: none;
  border-bottom: 1px solid var(--moss-lo);
}
main a:hover { border-bottom-color: var(--moss); }

strong { font-weight: 600; color: var(--ink); }

/* ---------- structural devices ---------- */

.rule {
  height: 1px;
  margin: 30px 0 22px;
  border: 0;
  background: var(--rule);
}

.label {
  display: block;
  margin-bottom: 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--moss);
}

.meta {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--mute);
}

/* ---------- the index: a ledger of what exists ----------
   Each entry carries its real state. The dot fills as a piece
   moves from idea to published. Change the state by swapping
   the class on <span class="mark is-…">.
   -------------------------------------------------------- */

.index { list-style: none; margin: 0 0 4px; padding: 0; }

.entry {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; }

.entry-main { flex: 1 1 auto; min-width: 0; }

.entry-title {
  color: var(--ink);
  border-bottom: 0;
}
a.entry-title { color: var(--moss); border-bottom: 1px solid var(--moss-lo); }
a.entry-title:hover { border-bottom-color: var(--moss); }

.entry-gloss {
  margin: 1px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--mute);
  white-space: nowrap;
}
.mark::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--faint);
  border-radius: 50%;
  background: linear-gradient(to top, var(--moss) var(--fill), transparent var(--fill));
}

/* the legend explains the dots using the dots themselves */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
}

.mark            { --fill: 0%; }
.mark.is-idea    { --fill: 0%; }
.mark.is-outlined{ --fill: 25%; }
.mark.is-drafted { --fill: 50%; }
.mark.is-pitched { --fill: 75%; }
.mark.is-published { --fill: 100%; color: var(--moss); }
.mark.is-published::before { border-color: var(--moss); }

/* ---------- making: the media grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
}

.tile { margin: 0; }
.tile img,
.tile video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.tile.wide { grid-column: span 2; }

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--rule);
  background: var(--tile);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.tile.wide .slot { aspect-ratio: 2.06 / 1; }

.tile figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
}
.tile figcaption b { font-weight: 400; color: var(--body); }
.tile figcaption .tag { color: var(--moss); }

/* ---------- footer ---------- */

.foot {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
}

/* ---------- accessibility floor ---------- */

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

/* ---------- entrance ---------- */

main, .nav { animation: rise 0.5s ease both; }
.nav { animation-delay: 0.06s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  main, .nav { animation: none; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
  body { padding: 26px 24px 56px; }

  .name { margin-bottom: 26px; }

  .wrap { display: block; }

  .nav {
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rule);
  }
  .nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
    line-height: 1.9;
  }
  .nav li.here > a::before { margin-left: 0; }
  .nav .sub {
    flex-basis: 100%;
    padding-left: 0;
    margin: 0;
  }

  main, main.wide { max-width: none; }

  .side-photo {
    max-width: 210px;
    margin-bottom: 28px;
    padding-top: 0;
  }

  .grid { grid-template-columns: repeat(2, 1fr); }

  .entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .tile.wide { grid-column: span 1; }
}
