.diary {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: 1.6rem var(--pad) 4rem;
}

.diary-head {
  margin-bottom: 1.2rem;
}

.diary-head h1 {
  margin: 0 0 0.7rem;
  color: var(--patina);
  font-size: clamp(2.8rem, 11vw, 5rem);
}

.diary-head h1 em {
  display: inline;
  color: var(--teal);
}

.diary-head .intro {
  margin: 0 0 1.1rem;
  max-width: 38rem;
  font-size: 1.08rem;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}

.counts li {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 12%, white);
  color: var(--patina);
  font-size: 0.9rem;
  font-weight: 600;
}

.counts b {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-right: 0.2rem;
}

.tools {
  position: sticky;
  top: var(--top);
  z-index: 30;
  display: grid;
  gap: 0.6rem;
  margin: 0 calc(-1 * var(--pad)) 1.2rem;
  padding: 0.7rem var(--pad) 0.65rem;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 14%, transparent);
}

.tools-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.search {
  flex: 1;
  min-width: 0;
  min-height: 2.7rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, transparent);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

.search:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 2.7rem;
  padding: 0 0.95rem;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, transparent);
  border-radius: 999px;
  color: var(--patina);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--teal);
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.toggle:has(input:checked) {
  background: var(--patina);
  color: var(--cream);
  border-color: var(--patina);
}

.months {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.months::-webkit-scrollbar {
  display: none;
}

.months a {
  flex: 0 0 auto;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--patina);
  font-size: 0.88rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  transition: background 0.25s ease, color 0.25s ease;
}

.months a small {
  margin-left: 0.3rem;
  opacity: 0.7;
  font-size: 0.78rem;
}

.months a.is-on {
  background: var(--patina);
  color: var(--cream);
}

.feed {
  position: relative;
  padding-left: 1.35rem;
}

.feed::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 1rem;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--teal) 0 8px, transparent 8px 14px);
  opacity: 0.45;
}

.month {
  position: relative;
  margin: 2.2rem 0 0.4rem;
  padding-top: 0.2rem;
  color: var(--teal);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--top) + 7.2rem);
}

.month:first-child {
  margin-top: 0.6rem;
}

.day {
  position: relative;
  margin: 1.4rem 0 0.7rem;
  color: var(--patina);
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  scroll-margin-top: calc(var(--top) + 7.2rem);
}

.day::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 0.55rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px var(--cream);
}

.note {
  position: relative;
  margin: 0 0 1rem;
  padding: 1rem;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--teal) 12%, transparent);
  scroll-margin-top: calc(var(--top) + 7.4rem);
  transition: box-shadow 0.3s ease, transform 0.3s var(--ease);
}

.note:hover {
  box-shadow: 0 16px 36px rgba(30, 92, 88, 0.1);
}

.note.is-target {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.meta {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 0.7rem;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 600;
}

.meta .kind {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 14%, white);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shots {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.shots-2,
.shots-3,
.shots-4 {
  grid-template-columns: 1fr 1fr;
}

.clips {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.clips-2,
.clips-3,
.clips-4 {
  grid-template-columns: 1fr 1fr;
}

.clip-shell {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: #1a3331;
  cursor: pointer;
}

.clip-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 30rem;
  object-fit: cover;
  background: #1a3331;
}

.clips-1 .clip-shell video {
  aspect-ratio: 4 / 4;
}

.clip-shell.is-live {
  grid-column: 1 / -1;
}

.clip-shell.is-live video {
  aspect-ratio: auto;
  max-height: 75vh;
  object-fit: contain;
}

.clip-shell .play {
  width: 3.6rem;
  height: 3.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease);
}

.clip-shell .play::after {
  border-width: 0.65rem 0 0.65rem 1.1rem;
}

.clip-shell:hover .play {
  transform: scale(1.08);
}

.clip-shell.is-live {
  cursor: default;
}

.clip-shell.is-live .play {
  display: none;
}

.clip-len {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(16, 32, 30, 0.7);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.clip-shell.is-live .clip-len {
  display: none;
}

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #d7c7b0;
  cursor: zoom-in;
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.shot:hover img {
  transform: scale(1.03);
}

.shots-1 .shot img {
  aspect-ratio: 4 / 3;
  max-height: 32rem;
}

.caption {
  margin: 0;
  white-space: pre-wrap;
}

.stats {
  margin: 0.6rem 0 0;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
  font-size: 0.88rem;
}

.meta .perma {
  margin-left: auto;
  color: var(--patina);
  font-size: 0.82rem;
  text-decoration: none;
  opacity: 0.7;
}

.meta .perma:hover {
  opacity: 1;
  text-decoration: underline;
}

.btn-line {
  background: transparent;
  color: var(--patina);
  border-color: color-mix(in srgb, var(--patina) 40%, transparent);
}

.btn-line:hover {
  border-color: var(--patina);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

/* ---------- one note on its own page ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 1rem;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  font-size: 0.88rem;
}

.crumbs a {
  color: var(--patina);
  font-weight: 600;
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.note-page .note:hover {
  box-shadow: none;
}

.note-page h1 {
  margin: 0 0 1rem;
  color: var(--patina);
  font-size: clamp(1.9rem, 7vw, 3rem);
  overflow-wrap: anywhere;
}

.note-page .caption {
  font-size: 1.08rem;
}

.note-nav {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0;
}

.note-step {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--teal) 12%, transparent);
  text-decoration: none;
  transition: border-color 0.25s ease;
}

.note-step:hover {
  border-color: var(--teal);
}

.note-step small {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 600;
}

.note-step b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--patina);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
}

.note-step-next {
  text-align: right;
}

.note-all {
  margin: 0;
  text-align: center;
}

.lost {
  min-height: 62vh;
  padding-top: 3rem;
}

.lost h1 {
  margin: 0 0 0.7rem;
  color: var(--patina);
  font-size: clamp(2.6rem, 10vw, 4.6rem);
}

.lost h1 em {
  color: var(--teal);
}

.lost .intro {
  margin: 0;
  max-width: 34rem;
}

.lost-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
}

.diary-empty {
  margin: 2rem 0;
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  color: var(--patina);
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

@media (max-width: 719px) {
  .shots-3 .shot:first-child,
  .shots-1 .shot {
    grid-column: 1 / -1;
  }
}

@media (min-width: 720px) {
  .feed {
    padding-left: 1.8rem;
  }

  .feed::before {
    left: 0.4rem;
  }

  .day::before {
    left: -1.8rem;
  }

  .note {
    padding: 1.25rem;
  }

  .note-nav {
    grid-template-columns: 1fr 1fr;
  }

  .note-step-next:first-child {
    grid-column: 2;
  }
}
