/* TOKENS */
:root {
  --bg: #F7F1D6;
  --bg-card: #ECE5C6;
  --text: #1B2E2E;
  --text-muted: #6f6e63;
  --dark: #2A4747;
  --title-green: #439775;
  --link: #439775;
  --link-hover: #347659;
  --peach: #DE6B48;
  --emerald: #48BF84;
  --font-title: "Pixelify Sans", Helvetica, Arial, sans-serif;
  --font-body: "Libre Franklin", Helvetica, Arial, -apple-system, "Segoe UI", sans-serif;
  --width: 640px;
}

/* BASE */
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* LAYOUT */
.main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2rem 20px 5rem;
}
.site-header {
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.5rem 20px 0;
  text-align: center;
}
.site-logo {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--title-green);
}

/* LANDING PAGE */
.masthead {
  padding: 3rem 0 3rem;
  text-align: center;
}
.wave {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(2.75rem, 15vw, 4rem);
  font-weight: 700;
  line-height: 1;
  text-transform: lowercase;
  color: var(--title-green);
}
.wave-letters {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  column-gap: 0.0625em;
}
.letter {
  display: block;
  transform-origin: 50% 85%;
}
.letter:nth-child(1) { --amp: 0.22em; --tilt: 4deg;  animation-delay: 0s; }
.letter:nth-child(2) { --amp: 0.16em; --tilt: -3deg; animation-delay: 0.22s; }
.letter:nth-child(3) { --amp: 0.26em; --tilt: 5deg;  animation-delay: 0.44s; }
.letter:nth-child(4) { --amp: 0.18em; --tilt: -4deg; animation-delay: 0.66s; }
.letter:nth-child(5) { --amp: 0.24em; --tilt: 3deg;  animation-delay: 0.88s; margin-left: 0.3em; }
.letter:nth-child(6) { --amp: 0.15em; --tilt: -5deg; animation-delay: 1.1s; }
.letter:nth-child(7) { --amp: 0.27em; --tilt: 6deg;  animation-delay: 1.32s; }
.letter:nth-child(8) { --amp: 0.2em;  --tilt: -2deg; animation-delay: 1.54s; }

@keyframes wave {
  0% {
    transform: translateY(0) rotate(0deg);
    animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);
  }
  25% {
    transform: translateY(calc(var(--amp) * -1)) rotate(calc(var(--tilt) * -1));
    animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0);
  }
  50% {
    transform: translateY(0) rotate(0deg);
    animation-timing-function: cubic-bezier(0.61, 1, 0.88, 1);
  }
  75% {
    transform: translateY(var(--amp)) rotate(var(--tilt));
    animation-timing-function: cubic-bezier(0.12, 0, 0.39, 0);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .letter {
    animation: wave 2.4s infinite;
  }
}

.tagline {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--text);
}

/* POST LIST */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.post-item + .post-item {
  margin-top: 2rem;
}
.post-link {
  display: block;
  text-decoration: none;
  color: inherit;
  font-weight: 400;
}
.post-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--title-green);
}
.post-link:hover .post-title {
  color: var(--link-hover);
}
.post-date {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.archive-title {
  margin: 2rem 0;
  font-family: var(--font-title);
  font-size: 2rem;
  text-transform: lowercase;
  color: var(--title-green);
}

/* LINKS */
.post-content a,
.pagination a,
.site-logo,
.post-title-text {
  position: relative;
}
.post-title-text {
  display: inline-block;
}

.post-content a::after,
.pagination a::after,
.site-logo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15em;
  height: 2px;
  background: radial-gradient(circle at 50% 50%, currentColor 0.9px, transparent 1.1px) 0 0 / 4px 2px repeat-x;
  clip-path: inset(0 50% 0 50%);
  transition: clip-path 0.3s ease;
  pointer-events: none;
}
.post-title-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.1em;
  height: 4px;
  background: radial-gradient(circle at 50% 50%, currentColor 1.8px, transparent 2.2px) 0 0 / 8px 4px repeat-x;
  clip-path: inset(0 50% 0 50%);
  transition: clip-path 0.3s ease;
  pointer-events: none;
}

.post-content a:hover::after,
.post-content a:focus-visible::after,
.pagination a:hover::after,
.pagination a:focus-visible::after,
.site-logo:hover::after,
.site-logo:focus-visible::after,
.post-link:hover .post-title-text::after,
.post-link:focus-visible .post-title-text::after {
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .post-content a::after,
  .pagination a::after,
  .site-logo::after,
  .post-title-text::after {
    transition: none;
  }
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pagination a {
  text-decoration: none;
}

/* POST */
.post-header {
  margin-bottom: 2.5rem;
}
.post-heading {
  margin: 0 0 0.5rem;
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  text-transform: lowercase;
  color: var(--title-green);
}
.post-content {
  line-height: 2;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  text-transform: lowercase;
  color: var(--dark);
}
.post-content h1.sans,
.post-content h2.sans,
.post-content h3.sans,
.post-content h4.sans,
.post-content h5.sans,
.post-content h6.sans,
.post-content .sans h1,
.post-content .sans h2,
.post-content .sans h3,
.post-content .sans h4,
.post-content .sans h5,
.post-content .sans h6 {
  font-family: var(--font-body);
  text-transform: none;
}
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1.4em;
  border: none;
  background: var(--bg-card);
  color: var(--text);
}
.post-content blockquote p {
  margin: 0;
}
.post-content hr {
  border: none;
  border-top: 2px solid var(--bg-card);
  margin: 3rem 0;
}
.post-feature {
  margin: 0 0 2.5rem;
}

/* EDITOR CARDS */
.kg-width-wide {
  width: min(960px, calc(100vw - 40px));
  max-width: none;
  margin-left: calc(50% - min(480px, 50vw - 20px));
}
.kg-width-full {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
}
.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}
.post-content figure {
  margin: 2rem 0;
}
.post-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

/* LAYOUT CLASSES */
.photo-block {
  margin: 24px 0;
  text-align: center;
}
.photo-item {
  margin: 0 0 24px;
}
.photo-item:last-child {
  margin-bottom: 0;
}
.photo-block img {
  display: block;
  margin: 0 auto 8px;
}
.caption {
  margin: 0;
  font-size: 14px;
  font-style: italic;
  line-height: 1.4;
  color: var(--dark);
}

.media-text {
  margin: 24px 0;
  overflow: hidden;
}
.media {
  width: 42%;
}
.media img {
  display: block;
  width: 100%;
}
.media-left .media {
  float: left;
  margin: 0 24px 12px 0;
}
.media-right .media {
  float: right;
  margin: 0 0 12px 24px;
}

.img-left,
.img-right {
  width: 40%;
  max-width: 260px;
  border: 10px solid var(--dark);
}
.img-left  { float: left;  margin: 4px 20px 12px 0; }
.img-right { float: right; margin: 4px 0 12px 20px; }

.border-peach    { border-color: var(--peach); }
.border-emerald  { border-color: var(--emerald); }
.border-seagrass { border-color: var(--title-green); }
.border-slate    { border-color: var(--dark); }

.clear {
  clear: both;
}

@media (max-width: 600px) {
  .media,
  .media-left .media,
  .media-right .media {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }
  .img-left,
  .img-right {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px;
  }
}
