/* Field notes: the index and each note. Type, colour and buttons come from app.css and site.css. */

.notes-page main {
  padding-top: clamp(112px, 13vw, 176px);
}
.site-mast .text-button.is-here {
  opacity: 1;
}
.site-mast.is-moved::before {
  opacity: 1;
}

/* ───────── Headings ───────── */

.notes-head,
.note-head {
  display: grid;
  gap: 18px;
}
.note-title {
  margin: 0;
  max-width: 15em;
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.note-dek {
  margin: 0;
  max-width: 34em;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.42;
  color: var(--ink-2);
  text-wrap: pretty;
}
.note-meta {
  margin: 6px 0 0;
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--ink-2);
}
.note-dek,
.note-meta {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease) 0.5s, transform 0.9s var(--ease) 0.5s;
}
.is-ready .note-dek,
.is-ready .note-meta {
  opacity: 1;
  transform: none;
}

/* ───────── The index ───────── */

.notes-feature {
  margin-top: clamp(40px, 5vw, 72px);
}
.notes-grid {
  margin-top: clamp(10px, 1.4vw, 20px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(10px, 1.4vw, 20px);
}
.note-card {
  display: grid;
  align-content: start;
  gap: 16px;
  color: inherit;
}
.note-card-pic {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-l);
  aspect-ratio: 3 / 2;
  background: var(--wash);
  /* Tilted towards the pointer, a few degrees at most; set by notes.js. */
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}
/* The picture sits a little larger than its frame and drifts against the tilt. */
.note-card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1 + 0.07 * var(--on, 0))) translate(calc(var(--px, 0) * -1.6%), calc(var(--py, 0) * -1.6%));
}
/* A soft light that follows the pointer across the picture. */
.note-card-pic::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at calc(50% + var(--px, 0) * 50%) calc(50% + var(--py, 0) * 50%), rgba(255, 255, 255, 0.26), transparent 55%);
  opacity: var(--on, 0);
  pointer-events: none;
}
/* "Read", in a pill that rises into the corner of the picture. */
.note-card-go {
  position: absolute;
  left: clamp(12px, 1.4vw, 18px);
  bottom: clamp(12px, 1.4vw, 18px);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}
.note-card-go i {
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 1.4px 1.4px 0 0;
  transform: rotate(45deg);
  margin-left: -2px;
  transition: transform 0.6s var(--ease);
}
.note-card:hover .note-card-go,
.note-card:focus-visible .note-card-go {
  opacity: 1;
  transform: none;
}
.note-card:hover .note-card-go i {
  transform: translateX(3px) rotate(45deg);
}
.note-card-copy b {
  transition: color 0.5s var(--ease), background-size 0.6s var(--ease);
}
.note-card:hover .note-card-copy b {
  color: var(--brand);
}
.note-card-copy {
  display: grid;
  gap: 8px;
}
.note-card-copy b {
  font-weight: 500;
  font-size: var(--h3);
  line-height: 1.2;
  letter-spacing: -0.007em;
  text-wrap: balance;
  justify-self: start;
}
.note-card-copy span {
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}
.note-card-copy em {
  font-style: normal;
  font-size: 13.5px;
  color: var(--ink-2);
}
/* The first note, larger, with its words beside the picture. */
.note-card.is-big {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  gap: 20px clamp(24px, 4vw, 64px);
  margin-bottom: clamp(28px, 3vw, 44px);
}
.note-card.is-big .note-card-copy b {
  font-size: var(--h2);
  line-height: 1.06;
  letter-spacing: -0.011em;
}
.note-card.is-big .note-card-copy span {
  font-size: 17px;
}

/* ───────── A note ───────── */

.note-hero-wrap {
  margin-top: clamp(36px, 5vw, 72px);
}
.note-hero {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 78vh;
  object-fit: cover;
  border-radius: var(--r-l);
  opacity: 0;
  transform: translateY(40px);
  filter: blur(14px);
  transition: opacity 1.2s var(--ease) 0.3s, transform 1.4s var(--ease) 0.3s, filter 1.4s var(--ease) 0.3s;
}
.is-ready .note-hero {
  opacity: 1;
  transform: none;
  filter: none;
}
.note-body {
  max-width: 41rem;
  margin: clamp(48px, 6vw, 88px) auto 0;
  font-size: 17.5px;
  line-height: 1.62;
}
.note-body > * {
  margin: 0 0 1.05em;
}
.note-body h2 {
  margin: 2.1em 0 0.6em;
  font-weight: 500;
  font-size: clamp(23px, 2vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.007em;
  text-wrap: balance;
}
.note-body p,
.note-body li {
  text-wrap: pretty;
}
.note-body b {
  font-weight: 500;
}
.note-body i {
  font-style: normal;
  background: var(--wash);
  border-radius: var(--r-s);
  padding: 2px 7px 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.note-body ul,
.note-body ol {
  padding-left: 1.2em;
}
.note-body li {
  margin-bottom: 0.5em;
}
.note-body li::marker {
  color: var(--brand);
}
.note-body code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.82em;
  background: var(--wash);
  border-radius: var(--r-s);
  padding: 2px 6px 3px;
  word-break: break-word;
}
/* Figures run wider than the text column, to the left. */
.note-figure,
.note-drawing {
  margin: 2.4em 0;
}
.note-figure img {
  display: block;
  margin: 0 auto;
  width: min(100%, 26rem);
  border-radius: var(--r-l);
}
.note-drawing {
  background: var(--wash);
  border-radius: var(--r-l);
  padding: clamp(22px, 3vw, 44px);
  /* Wider than the text, by the same amount on both sides. */
  margin-left: clamp(-160px, -10vw, 0px);
  margin-right: clamp(-160px, -10vw, 0px);
}
.note-iso {
  aspect-ratio: 16 / 9;
  margin: 0;
}
.note-drawing figcaption {
  margin-top: 18px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 30em;
}
.iso-face.is-lit {
  fill: var(--brand);
  stroke: var(--brand);
}
.iso-cell-line {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 0.4;
  vector-effect: non-scaling-stroke;
}

.note-more {
  margin-top: clamp(88px, 11vw, 168px);
  margin-bottom: clamp(88px, 11vw, 168px);
}
.note-more .notes-grid {
  margin-top: clamp(28px, 3.6vw, 52px);
}

/* ───────── The monthly note ───────── */

.news {
  margin-top: clamp(88px, 11vw, 168px);
  background: var(--violet);
  color: #fff;
  padding: clamp(56px, 7vw, 104px) 0;
}
.notes .news {
  margin-bottom: 0;
}
.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px clamp(32px, 6vw, 96px);
  align-items: end;
}
.news-copy {
  display: grid;
  gap: 16px;
}
.news .aside {
  color: rgba(255, 255, 255, 0.82);
}
.news-form {
  display: grid;
  gap: 12px;
}
.news-field {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  transition: background var(--quick) var(--ease);
}
.news-field:focus-within {
  background: rgba(255, 255, 255, 0.22);
}
.news-field input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 16px;
  padding: 8px 14px 9px;
  outline: none;
}
.news-field input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.news .button {
  --fill: var(--lime);
  --fill-ink: #0a0a0a;
  background: #fff;
  border-color: #fff;
  color: #0a0a0a;
  flex: none;
}
.news-form.is-busy .button {
  opacity: 0.6;
  pointer-events: none;
}
.news-form.is-done .news-field {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
.news-says {
  margin: 0;
  min-height: 1.4em;
  padding-left: 20px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.news-says.is-in {
  opacity: 1;
  transform: none;
}
.hp,
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 900px) {
  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .note-card.is-big {
    grid-template-columns: minmax(0, 1fr);
  }
  .news-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .note-drawing {
    margin-left: 0;
    margin-right: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .note-hero,
  .note-dek,
  .note-meta {
    transform: none !important;
    filter: none !important;
  }
}
