@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&display=swap");

:root {
  color-scheme: light;
  font-family: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
color: #292824;
  background: #b8bb9d;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #b8bb9d;
}

.site-header,
.home-page,
.writing-page,
.essay-page {
  width: min(calc(100% - 2.5rem), 44rem);
  margin-inline: auto;
}

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 1.75rem;
  font-size: 1rem;
}

.site-nav--end {
  justify-content: flex-end;
}

.home-page {
  display: grid;
  place-items: start center;
  padding-block: clamp(3.5rem, 13vh, 7rem) 7rem;
}

.intro {
  width: min(100%, 34rem);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.word-collision-active {
  overflow: hidden;
}

.word-particle {
  position: relative;
  z-index: 2147483646;
  display: inline-block;
  will-change: transform;
}

p {
  margin: 1.2rem 0 0;
  color: #373630;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.58;
}

ol,
ul {
  margin: 0.75rem 0 0;
  padding-left: 1.5rem;
  color: #373630;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.58;
}

li + li {
  margin-top: 0.25rem;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.3em;
  text-decoration: none;
}

.writing-page,
.essay-page {
  padding-block: 4.5rem 7rem;
}

.post-list {
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
}

.post-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.5;
}

.post-row time {
  color: #67645b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-row a {
  justify-self: start;
}

.post-row + .post-row {
  margin-top: 0.65rem;
}

.essay-date {
  margin-top: 0.55rem;
  color: #67645b;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.essay-figure {
  margin: 2rem 0 0;
}

.essay-image {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
}

.essay-video {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
  background: #000;
}

.climate-hover {
  position: relative;
}

.climate-trigger {
  margin-inline: -0.08em;
  padding-inline: 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  background-image: linear-gradient(
    90deg,
    rgb(20 81 151 / 22%) 0 6%,
    rgb(46 125 184 / 19%) 6% 11%,
    rgb(12 67 135 / 23%) 11% 17%,
    rgb(68 145 193 / 18%) 17% 23%,
    rgb(35 104 169 / 21%) 23% 29%,
    rgb(99 165 203 / 17%) 29% 35%,
    rgb(54 133 187 / 18%) 35% 41%,
    rgb(132 187 213 / 16%) 41% 47%,
    rgb(84 155 197 / 17%) 47% 53%,
    rgb(166 205 222 / 16%) 53% 59%,
    rgb(117 178 210 / 16%) 59% 65%,
    rgb(213 219 211 / 18%) 65% 70%,
    rgb(244 202 177 / 19%) 70% 76%,
    rgb(238 145 117 / 18%) 76% 82%,
    rgb(229 91 79 / 19%) 82% 88%,
    rgb(211 50 53 / 21%) 88% 94%,
    rgb(177 25 45 / 23%) 94% 100%
  );
  background-position: 0 62%;
  background-repeat: no-repeat;
  background-size: 100% 82%;
  cursor: pointer;
  text-decoration: none;
}

.climate-trigger:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.2em;
  text-decoration: none;
}

.climate-preview {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: max(1rem, calc((100vw - 44rem) / 2 - 23rem));
  display: block;
  width: min(22rem, 50vw);
  padding: 0.4rem;
  border: 1px solid #d8d5cc;
  background: #fdfcf9;
  box-shadow: 0 0.75rem 2.5rem rgb(41 40 36 / 12%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) scale(0.98);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 0s linear 120ms;
  pointer-events: none;
}

.climate-hover--active .climate-preview {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
  transition-delay: 0s;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .climate-hover:not(.climate-hover--dismissed):hover .climate-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    transition-delay: 0s;
    pointer-events: auto;
  }
}

.climate-preview__video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.climate-preview__close {
  position: absolute;
  z-index: 1;
  top: 0.7rem;
  right: 0.7rem;
  display: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 50%;
  background: rgb(20 20 20 / 68%);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.climate-preview__credit {
  display: block;
  margin-top: 0.4rem;
  color: #67645b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.particle-link--active {
  color: transparent !important;
  text-decoration-color: transparent !important;
  text-shadow: none !important;
  outline: none !important;
}

.particle-field {
  position: fixed;
  z-index: 2147483647;
  display: block;
  overflow: hidden;
  border: 0;
  background: #fdfcf9;
  pointer-events: none;
}

.particle-field canvas {
  display: block;
  width: 100%;
  height: 100%;
}

::selection {
  background: #dfe9e4;
}

@media (max-width: 30rem) {
  .post-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media (hover: none), (pointer: coarse) {
  .climate-preview {
    right: 50%;
    width: min(22rem, calc(100vw - 2rem));
    transform: translate(50%, -50%) scale(0.98);
  }

  .climate-hover--active .climate-preview {
    transform: translate(50%, -50%) scale(1);
  }

  .climate-preview__close {
    display: grid;
    place-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .climate-preview {
    transition: none;
  }
}
