/* Posthaven-style blog: sidebar, reading column, aquamarine accents */

:root {
  --accent-dark: #37899e;
  --accent-mid: #46a1be;
  --accent-light: #8ec8da;
  --accent-faint: #eef6f9;
  --text: #4d5966;
  --text-muted: #667480;
  --link: #46a1be;
  --link-visited: #3a8599;
  --ph-rule: #e4e4e4;
  --ph-measure: 40rem; /* ~ readable line */
  --ph-current-site-min: 70vh;
  --ph-current-site-gap: 3rem;
  --ph-former-blog-offset: calc(
    var(--ph-current-site-min) + var(--ph-current-site-gap) + 1px
  );
  --ph-former-section-gap: 3.5rem;
  --ph-grid-row-gap: 1.5rem;
  --ph-site-header-spacing: 2.5rem;
  --ph-site-block-gap: calc(var(--ph-site-header-spacing) + var(--ph-grid-row-gap));
  --ph-page-top: 2.75rem;
  --ph-site-name-size: clamp(1.65rem, 2.85vw, 2.05rem);
  --ph-site-name-row: calc(var(--ph-site-name-size) * 1.2 + var(--ph-site-header-spacing));
  --ph-folder-tabs-gutter: 3rem;
  --ph-bio-sticker-shadow:
    1px 2px 0 rgba(0, 0, 0, 0.05),
    2px 5px 10px rgba(0, 0, 0, 0.12),
    4px 12px 22px rgba(0, 0, 0, 0.08);
  --ph-selection: rgba(70, 161, 190, 0.28);
  --ph-ui: Helvetica, "Helvetica Neue", Arial, sans-serif;
  --ph-serif: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-size: 16px;
  /* With margin-centered layouts, a scrollbar that appears only on taller pages
     re-centers the main column; it often reads as the whole view shifting. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--ph-ui);
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

::selection {
  background: var(--ph-selection);
  color: var(--text);
}

::-moz-selection {
  background: var(--ph-selection);
  color: var(--text);
}

body:has(.ph-folder-tabs),
body:has(.ph-main--stacked) {
  position: relative;
}

/* —— Side folder tabs —— */
.ph-folder-tabs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  grid-column: 2;
  justify-self: center;
}

.ph-folder-tabs__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 1.1rem 0.55rem;
  margin: 0 0 -0.55rem;
  border: 1px solid var(--ph-rule);
  border-right: none;
  border-radius: 0.45rem 0 0 0.45rem;
  background: linear-gradient(to left, #f7f9fa 0%, #fff 55%);
  box-shadow:
    -2px 0 0 rgba(255, 255, 255, 0.9),
    -3px 2px 8px rgba(77, 89, 102, 0.08);
  color: var(--text-muted);
  font-family: var(--ph-ui);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(0deg);
  text-decoration: none;
}

.ph-folder-tabs__tab:hover {
  color: var(--link);
}

.ph-folder-tabs__tab:nth-child(1) {
  z-index: 4;
}

.ph-folder-tabs__tab[aria-current="page"] {
  color: var(--link);
}

.ph-folder-tabs__tab:nth-child(2) {
  z-index: 3;
}

.ph-folder-tabs__tab:nth-child(3) {
  z-index: 2;
}

.ph-folder-tabs__tab:last-child {
  z-index: 1;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
}

@media (min-width: 721px) {
  .ph-folder-tabs {
    position: fixed;
    right: 0;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
  }

  /* Side tabs: name at top-right edge, scrolls with the page */
  body:has(.ph-folder-tabs) .ph-site-name {
    position: absolute;
    top: var(--ph-page-top);
    right: 0;
    z-index: 4;
    margin: 0;
    padding-right: 0.75rem;
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
  }

  body:has(.ph-site-iterations) .ph-site-iterations {
    position: absolute;
    top: var(--ph-page-top);
    left: 0;
    z-index: 4;
    margin: 0;
    padding-left: 0.75rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  body:has(.ph-folder-tabs) .ph-site-header:not(:has(.ph-site-iterations)) {
    display: contents;
  }

  /* Absolute name sits out of flow; reserve a header band before page content */
  body:has(.ph-folder-tabs) .page-wrap:not(:has(.ph-site-iterations)) {
    padding-top: calc(var(--ph-page-top) + var(--ph-site-name-row));
  }
}

@media (max-width: 720px) {
  .ph-folder-tabs {
    position: static;
    transform: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    z-index: auto;
  }

  .ph-folder-tabs__tab {
    writing-mode: horizontal-tb;
    min-width: auto;
    padding: 0.58rem 0.95rem;
    margin: 0 0 0 -0.55rem;
    border: 1px solid var(--ph-rule);
    border-bottom: none;
    border-radius: 0.45rem 0.45rem 0 0;
    background: linear-gradient(to top, #fff 0%, #f7f9fa 55%);
    box-shadow:
      0 -2px 0 rgba(255, 255, 255, 0.9),
      0 -3px 8px rgba(77, 89, 102, 0.06);
    font-size: 1.05rem;
  }

  .ph-folder-tabs__tab:first-child {
    margin-left: 0;
  }

  .ph-folder-tabs__tab:last-child {
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
  }

  /* Design page: four tabs + iterations + name need smaller labels */
  .ph-site-header:has(.ph-site-iterations) .ph-folder-tabs:has(.ph-folder-tabs__tab:nth-child(4)) .ph-folder-tabs__tab {
    padding: 0.48rem 0.72rem;
    margin: 0 0 0 -0.45rem;
    font-size: 0.82rem;
  }

  .ph-site-header:has(.ph-site-iterations) .ph-folder-tabs:has(.ph-folder-tabs__tab:nth-child(4)) .ph-folder-tabs__tab:last-child {
    padding-top: 0.48rem;
    padding-bottom: 0.48rem;
  }

  /* Home header with iterations + three tabs: stay compact when tight */
  @media (max-width: 480px) {
    .ph-site-header:has(.ph-site-iterations) .ph-folder-tabs:not(:has(.ph-folder-tabs__tab:nth-child(4))) .ph-folder-tabs__tab {
      padding: 0.48rem 0.8rem;
      margin: 0 0 0 -0.5rem;
      font-size: 1rem;
    }

    .ph-site-header:has(.ph-site-iterations) .ph-folder-tabs:not(:has(.ph-folder-tabs__tab:nth-child(4))) .ph-folder-tabs__tab:last-child {
      padding-top: 0.48rem;
      padding-bottom: 0.48rem;
    }

    .ph-site-header:has(.ph-site-iterations) .ph-folder-tabs:has(.ph-folder-tabs__tab:nth-child(4)) .ph-folder-tabs__tab {
      font-size: 0.76rem;
      padding: 0.4rem 0.6rem;
    }
  }

  .ph-site-header {
    gap: 0.5rem;
  }

  .ph-site-iterations,
  .ph-site-name {
    flex-shrink: 0;
    font-size: clamp(0.85rem, 3.2vw, 1.15rem);
  }
}

/* —— Page grid: sidebar (Posthaven-style) + main —— */
.page-wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: var(--ph-page-top) 0.75rem 5rem;
  display: grid;
  grid-template-columns: 13.5rem 1fr;
  gap: var(--ph-grid-row-gap) 2rem;
  align-items: start;
}

.page-wrap:not(:has(.ph-sidebar)) {
  grid-template-columns: 1fr;
}

@media (min-width: 721px) {
  body:has(.ph-folder-tabs) .page-wrap {
    --ph-tab-band: var(--ph-folder-tabs-gutter);
    max-width: min(68rem, calc(100vw - var(--ph-tab-band) - 1.5rem));
    margin-left: calc(
      (100vw - var(--ph-tab-band) - min(68rem, calc(100vw - var(--ph-tab-band) - 1.5rem))) / 2
    );
    margin-right: calc(
      (100vw - var(--ph-tab-band) - min(68rem, calc(100vw - var(--ph-tab-band) - 1.5rem))) / 2
      + var(--ph-tab-band)
    );
  }

  body:has(.ph-folder-tabs) .page-wrap.page-wrap--bio {
    max-width: min(76rem, calc(100vw - var(--ph-tab-band) - 1.5rem));
    margin-left: calc(
      (100vw - var(--ph-tab-band) - min(76rem, calc(100vw - var(--ph-tab-band) - 1.5rem))) / 2
    );
    margin-right: calc(
      (100vw - var(--ph-tab-band) - min(76rem, calc(100vw - var(--ph-tab-band) - 1.5rem))) / 2
      + var(--ph-tab-band)
    );
  }
}

.ph-site-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: var(--ph-site-header-spacing);
}

.ph-site-iterations {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  font-size: clamp(1.65rem, 2.85vw, 2.05rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.ph-site-name {
  grid-column: 3;
  justify-self: end;
  margin: 0;
  font-size: clamp(1.65rem, 2.85vw, 2.05rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--link);
  text-decoration: none;
}

.ph-site-name:hover,
.ph-site-name:focus-visible {
  color: var(--link);
}

@media (max-width: 720px) {
  .page-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "sidebar"
      "main";
  }

  .ph-site-header {
    grid-area: header;
  }

  .ph-main {
    grid-area: main;
  }

  .ph-sidebar {
    grid-area: sidebar;
  }

  .page-wrap--thoughts {
    grid-template-areas:
      "header"
      "images"
      "sidebar"
      "main";
  }

  .page-wrap--thoughts .ph-thoughts-images {
    grid-area: images;
  }
}

.ph-thoughts-images {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ph-grid-row-gap);
  margin: 0 0 var(--ph-site-header-spacing);
}

.ph-thoughts-images:has(.ph-sticky-notes) {
  --sticky-size: 15.4rem;
  align-items: center;
}

.ph-thoughts-images .ph-sticky-notes {
  column-gap: 0.85rem;
  row-gap: 1.75rem;
  align-items: flex-start;
}

.ph-thoughts-images .ph-sticky-note-wrap:nth-child(2) .ph-sticky-note--photo {
  margin-top: calc(var(--sticky-size) * (854 - 491) / 735 / 2);
}

.ph-thoughts-images:has(.ph-sticky-notes) .ph-thoughts-images__label {
  align-self: flex-start;
  width: 100%;
}

.ph-thoughts-images__label {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

@media (min-width: 721px) {
  .ph-thoughts-images:has(.ph-sticky-notes) {
    --sticky-size: 13rem;
  }

  .ph-thoughts-images .ph-sticky-notes {
    column-gap: 1rem;
    row-gap: 2rem;
  }
}

.ph-thoughts-images .ph-sticky-note-wrap:first-child .ph-sticky-note--photo,
.ph-thoughts-images .ph-sticky-note-wrap:nth-child(3) .ph-sticky-note--photo {
  --sticky-photo-ratio: calc(854 / 735);
}

.ph-thoughts-images .ph-sticky-note-wrap:nth-child(2) .ph-sticky-note--photo {
  --sticky-photo-ratio: calc(491 / 735);
}

/* —— Posthaven-style sidebar (narrow, quiet type, teal accents) —— */
.ph-sidebar {
  position: sticky;
  top: 2.75rem; /* keep nav aligned with .page-wrap top padding while scrolling */
  font-family: var(--ph-ui);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  align-self: start;
}

@media (max-width: 720px) {
  .ph-sidebar {
    padding: 0 0 1.5rem;
    margin-bottom: 0.5rem;
    max-width: 100%;
  }

  .page-wrap:has(.ph-main--stacked) .ph-sidebar {
    padding-top: 0;
  }

  .ph-sidebar__block {
    border-right: 0;
    border-bottom: 1px solid var(--ph-rule);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }

  .ph-site-section--current {
    min-height: auto;
  }
}

.ph-sidebar__block {
  margin: 0 0 1.25rem;
  padding-right: 1.25rem;
  border-right: 1px solid var(--ph-rule);
}

.ph-sidebar__block:last-child {
  margin-bottom: 0;
}

.ph-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ph-sidebar__list li {
  margin: 0 0 0.2rem;
}

.ph-sidebar__list .ph-sidebar__dropdown {
  margin: 0 0 0.2rem;
}

/* Blog archive: button toggles dated links inline (not a floating panel) */
.ph-sidebar__dropdown {
  width: 100%;
  list-style: none;
}

.ph-sidebar__dropdown-btn {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0.1em 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--link);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.ph-sidebar__dropdown-btn:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}

.ph-sidebar__dropdown-btn[aria-expanded="true"] {
  /* Same as collapsed: no “open” styling */
  color: var(--link);
  font-weight: 400;
}

.ph-sidebar__dropdown-menu[hidden] {
  display: none;
}

.ph-sidebar__dropdown-menu {
  margin: 0.15rem 0 0.35rem;
  padding: 0;
  list-style: none;
}

.ph-sidebar__dropdown-item {
  display: block;
  padding: 0.2rem 0.25rem 0.2rem 0.65rem; /* extra indent: lighter rows sit inset */
  margin: 0;
  color: #9a9a9a;
  font-size: 0.86em;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  border: 0;
}

.ph-sidebar__dropdown-item:visited {
  color: #8e8e8e;
}

.ph-sidebar__dropdown-item:hover,
.ph-sidebar__dropdown-item:focus-visible {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
  outline: none;
}

.ph-sidebar__dropdown-item[aria-current="page"] {
  color: var(--link);
}

.ph-sidebar__link {
  color: var(--link);
  text-decoration: none;
  padding: 0.1em 0;
  display: inline-block;
  font-weight: 400;
}

.ph-sidebar a[href]:visited,
.ph-sidebar a[href]:active {
  color: var(--link);
}

.ph-sidebar__link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}

.ph-sidebar__link--current,
.ph-sidebar__link[aria-current="page"] {
  color: var(--link);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}

/* —— Posthaven-style main column —— */
.ph-main {
  min-width: 0;
  max-width: var(--ph-measure);
}

.ph-main--article {
  max-width: var(--ph-measure);
}

.ph-main--home {
  max-width: var(--ph-measure);
}

@media (min-width: 721px) {
  .page-wrap:not(:has(.ph-sidebar)) .ph-main,
  .page-wrap:not(:has(.ph-sidebar)) .ph-main--home {
    max-width: var(--ph-measure);
    width: 100%;
    margin-left: auto;
    margin-right: 0;
  }

  .page-wrap--bio:not(:has(.ph-sidebar)) .ph-main,
  .page-wrap--bio:not(:has(.ph-sidebar)) .ph-main--home {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Home: center iterations content between header labels */
  .page-wrap:has(.ph-site-iterations) .ph-main {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Stacked site sections: blank current site above former blog */
.ph-main--stacked {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ph-site-section--current {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--ph-site-block-gap);
  min-height: var(--ph-current-site-min);
  margin: 0 0 var(--ph-current-site-gap);
  padding: 0 0 var(--ph-current-site-gap);
}

.page-wrap:has(.ph-site-iterations) .ph-site-section--current {
  align-items: center;
}

.page-wrap--home .ph-site-header,
.page-wrap--design .ph-site-header,
.page-wrap--bio .ph-site-header {
  margin-bottom: 1.25rem;
}

.page-wrap--home,
.page-wrap--design,
.page-wrap--bio {
  --ph-compact-edge-gap: 1.25rem;
  padding-bottom: var(--ph-compact-edge-gap);
}

.page-wrap--bio {
  min-height: 100vh;
  min-height: 100dvh;
  align-content: center;
}

.page-wrap--home .ph-site-section--current,
.page-wrap--design .ph-site-section--current,
.page-wrap--bio .ph-site-section--current {
  min-height: auto;
  gap: var(--ph-compact-edge-gap);
  margin-bottom: 0;
  padding-bottom: 0;
}

@media (min-width: 721px) {
  .ph-site-section--current {
    margin-left: calc(-1 * (13.5rem + 2rem));
    width: calc(100% + 13.5rem + 2rem);
  }

  .page-wrap:not(:has(.ph-sidebar)) .ph-site-section--current {
    margin-left: 0;
    width: 100%;
  }
}

.ph-site-section--current:has(.ph-sticky-notes) {
  --ph-home-span-nudge: 0px;
  transform: translateX(var(--ph-home-span-nudge));
}

.ph-current-site__desc {
  margin: 0;
  width: 100%;
  max-width: var(--ph-measure);
}

@media (max-width: 720px) {
  .ph-site-section--current:has(.ph-sticky-notes) {
    align-items: center;
  }

  /* Top folder tabs: center the Frankenstein intro under the sticky notes */
  body:has(.ph-folder-tabs) .ph-current-site__desc {
    text-align: center;
    margin-inline: auto;
  }

  .ph-site-section--current:has(.ph-sticky-notes) .ph-current-site__desc {
    width: var(--sticky-size);
    max-width: 100%;
  }
}

@media (min-width: 480px) and (max-width: 720px) {
  .ph-site-section--current:has(.ph-sticky-note-wrap + .ph-sticky-note-wrap)
    .ph-current-site__desc {
    width: min(100%, calc(var(--sticky-size) * 2 + 1.25rem));
  }

  .ph-site-section--current:has(.ph-sticky-note-wrap + .ph-sticky-note-wrap + .ph-sticky-note-wrap)
    .ph-current-site__desc {
    width: min(100%, calc(var(--sticky-size) * 3 + 1.25rem * 2));
  }
}

.ph-sticky-notes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-self: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  column-gap: 1.25rem;
  row-gap: 2rem;
}

.ph-site-section--current:has(.ph-sticky-note-wrap--with-desc) {
  container-type: inline-size;
}

.ph-site-section--current:has(.ph-sticky-notes) {
  --sticky-size: 21rem;
}

.ph-sticky-note-wrap {
  position: relative;
  margin: 0;
  width: var(--sticky-size);
}

.ph-sticky-note-wrap--with-desc {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 1 var(--sticky-size);
  max-width: 100%;
}

@container (max-width: calc(var(--sticky-size) * 2 + 1.25rem - 1px)) {
  .ph-sticky-notes {
    flex-direction: column;
    align-items: center;
    row-gap: 2.25rem;
  }
}

.ph-sticky-note__desc {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text);
  text-align: center;
}

.ph-sticky-note {
  --sticky-w: var(--sticky-size);
  --sticky-h: var(--sticky-size);
  --sticky-edge: rgba(162, 203, 229, 0.13);
  --sticky-border-width: 2px;
  --sticky-glass:
    linear-gradient(to right, rgba(162, 203, 229, 0.08), transparent 14%, transparent 86%, rgba(162, 203, 229, 0.08)),
    linear-gradient(to bottom, rgba(162, 203, 229, 0.08), transparent 14%, transparent 86%, rgba(162, 203, 229, 0.08)),
    radial-gradient(ellipse 120% 120% at 0 0, rgba(162, 203, 229, 0.12) 0%, rgba(162, 203, 229, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 100% 0, rgba(162, 203, 229, 0.12) 0%, rgba(162, 203, 229, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 0 100%, rgba(162, 203, 229, 0.12) 0%, rgba(162, 203, 229, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 100% 100%, rgba(162, 203, 229, 0.12) 0%, rgba(162, 203, 229, 0.04) 38%, transparent 62%),
    radial-gradient(
      ellipse farthest-corner at 50% 50%,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(255, 255, 255, 0.05) 62%,
      rgba(255, 255, 255, 0.03) 100%
    );
  --sticky-frame:
    linear-gradient(to right, var(--sticky-edge), transparent 10%, transparent 90%, var(--sticky-edge)),
    linear-gradient(to bottom, var(--sticky-edge), transparent 10%, transparent 90%, var(--sticky-edge)),
    radial-gradient(ellipse 120% 120% at 0 0, var(--sticky-edge) 0%, transparent 52%),
    radial-gradient(ellipse 120% 120% at 100% 0, var(--sticky-edge) 0%, transparent 52%),
    radial-gradient(ellipse 120% 120% at 0 100%, var(--sticky-edge) 0%, transparent 52%),
    radial-gradient(ellipse 120% 120% at 100% 100%, var(--sticky-edge) 0%, transparent 52%),
    transparent;
  --sticky-surface:
    var(--sticky-glass) padding-box,
    var(--sticky-frame) border-box;
  position: relative;
  margin: 0;
  width: var(--sticky-w);
  height: var(--sticky-h);
  overflow: hidden;
}

.ph-sticky-note__ripple {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1.85rem 1.35rem;
  text-align: left;
  background: var(--sticky-surface);
  background-clip: padding-box, border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--sticky-border-width) solid transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0.15rem 0.35rem rgba(0, 0, 0, 0.04),
    0 0.65rem 1.25rem rgba(162, 203, 229, 0.02);
  transform: rotate(0deg) skewX(0deg) translate(0, 0);
  transform-origin: 0 0;
  animation: ph-sticky-note-wind 5.5s ease-in-out infinite;
  will-change: transform;
}

.ph-sticky-note-wrap + .ph-sticky-note-wrap .ph-sticky-note__ripple {
  animation-delay: 0.45s;
}

.ph-sticky-note__text {
  margin: 0;
  font-family: var(--ph-ui);
  font-size: 3rem;
  line-height: 1.1;
  color: var(--text);
  text-align: left;
}

.ph-sticky-note--grey .ph-sticky-note__text {
  font-size: 2.5rem;
  line-height: 1.15;
}

.ph-sticky-note__dates {
  position: absolute;
  right: 0.65rem;
  bottom: 1.1rem;
  margin: 0;
  font-family: var(--ph-ui);
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.ph-sticky-note--grey {
  --sticky-edge: rgba(130, 138, 146, 0.13);
  --sticky-glass:
    linear-gradient(to right, rgba(130, 138, 146, 0.08), transparent 14%, transparent 86%, rgba(130, 138, 146, 0.08)),
    linear-gradient(to bottom, rgba(130, 138, 146, 0.08), transparent 14%, transparent 86%, rgba(130, 138, 146, 0.08)),
    radial-gradient(ellipse 120% 120% at 0 0, rgba(130, 138, 146, 0.12) 0%, rgba(130, 138, 146, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 100% 0, rgba(130, 138, 146, 0.12) 0%, rgba(130, 138, 146, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 0 100%, rgba(130, 138, 146, 0.12) 0%, rgba(130, 138, 146, 0.04) 38%, transparent 62%),
    radial-gradient(ellipse 120% 120% at 100% 100%, rgba(130, 138, 146, 0.12) 0%, rgba(130, 138, 146, 0.04) 38%, transparent 62%),
    radial-gradient(
      ellipse farthest-corner at 50% 50%,
      rgba(255, 255, 255, 0.07) 0%,
      rgba(255, 255, 255, 0.05) 62%,
      rgba(255, 255, 255, 0.03) 100%
    );
}

.ph-sticky-note--grey .ph-sticky-note__ripple {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0.15rem 0.35rem rgba(0, 0, 0, 0.04),
    0 0.65rem 1.25rem rgba(130, 138, 146, 0.02);
}

.ph-sticky-note--photo {
  --sticky-photo-ratio: calc(1406 / 1930);
  --sticky-h: calc(var(--sticky-w) * var(--sticky-photo-ratio));
  height: var(--sticky-h);
}

.ph-sticky-note--neutboom,
.ph-sticky-note--loxai,
.ph-sticky-note--speaksandiego {
  --sticky-h: var(--sticky-size);
  height: var(--sticky-size);
}

.ph-sticky-note--photo .ph-sticky-note__ripple {
  padding: 0;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(77, 89, 102, 0.12);
  box-shadow:
    0 0.15rem 0.35rem rgba(0, 0, 0, 0.06),
    0 0.65rem 1.25rem rgba(77, 89, 102, 0.08);
}

.ph-sticky-note__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.ph-sticky-note__link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.ph-sticky-note__link:hover .ph-sticky-note__ripple,
.ph-sticky-note__link:focus-visible .ph-sticky-note__ripple {
  box-shadow:
    0 0.2rem 0.45rem rgba(0, 0, 0, 0.08),
    0 0.85rem 1.5rem rgba(77, 89, 102, 0.12);
}

.ph-sticky-note__link:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}

@keyframes ph-sticky-note-wind {
  0%,
  100% {
    transform: rotate(0deg) skewX(0deg) translate(0, 0);
  }
  18% {
    transform: rotate(-0.9deg) skewX(-0.65deg) translate(-0.1rem, -0.04rem);
  }
  42% {
    transform: rotate(-2.8deg) skewX(-1.35deg) translate(-0.28rem, -0.08rem);
  }
  68% {
    transform: rotate(-1.6deg) skewX(-0.55deg) translate(-0.14rem, -0.04rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-sticky-note__ripple {
    animation: none;
    transform: rotate(0deg) skewX(0deg) translate(0, 0);
  }
}

@media (min-width: 721px) {
  .ph-sticky-notes {
    column-gap: 1.5rem;
    row-gap: 2.25rem;
  }

  .ph-site-section--current:has(.ph-sticky-notes) {
    --sticky-size: 19rem;
  }

  .ph-sticky-note__ripple {
    padding: 0 2.15rem 1.6rem;
  }

  .ph-sticky-note__text {
    font-size: 3.5rem;
  }

  .ph-sticky-note--grey .ph-sticky-note__text {
    font-size: 3rem;
  }

  .ph-sticky-note__dates {
    right: 0.85rem;
    bottom: 1.35rem;
    font-size: 0.85rem;
  }
}

.ph-site-section--former {
  min-width: 0;
  padding-top: var(--ph-former-section-gap);
  border-top: 1px solid var(--ph-rule);
}

@media (min-width: 721px) {
  .ph-site-section--former {
    margin-left: calc(-1 * (13.5rem + 2rem));
    width: calc(100% + 13.5rem + 2rem);
  }
}

.ph-site-section__label {
  margin: 0 0 1.25rem;
}

/* Sidebar archive nav lines up with the former-blog section title */
@media (min-width: 721px) {
  .page-wrap:has(.ph-main--stacked) .ph-sidebar {
    padding-top: calc(var(--ph-former-blog-offset) + var(--ph-former-section-gap));
  }
}

/* Masthead: simple blog title, default Posthaven-ish */
.ph-masthead {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ph-rule);
  box-shadow: 0 1px 0 0 #fff, 0 2px 0 0 var(--accent-light);
}

.ph-masthead__title {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.35em;
  color: var(--text);
}

/* Shared serif (Posthaven uses readable, book-like type) */
.ph-serif {
  font-family: var(--ph-serif);
}

/* Prose block (about + post body) */
.ph-prose {
  font-family: var(--ph-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

.ph-prose p {
  margin: 0 0 1em;
}
.ph-prose p:last-child {
  margin-bottom: 0;
}

.ph-prose__accent {
  color: var(--link);
}

.ph-sticky-note__desc.ph-prose {
  font-size: 0.72rem;
  line-height: 1.45;
}

.ph-prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}
.ph-prose a:visited {
  color: var(--link-visited);
}
.ph-prose a:hover {
  color: var(--accent-mid);
}

.ph-prose code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.ph-about {
  margin: 0 0 1.75rem;
  padding: 0;
}

.ph-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-family: var(--ph-ui);
}

/* Period page: one section’s posts */
.ph-main--period .ph-masthead {
  margin-bottom: 1.25rem;
}

.ph-main--period .ph-archive__list {
  margin-top: 0;
}

.ph-archive__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ph-archive__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0.65rem;
  line-height: 1.4;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.ph-archive__list li:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ph-archive__link {
  color: var(--text);
  text-decoration: none;
  font-family: var(--ph-serif);
  font-size: 1.02rem;
  flex: 1;
  min-width: 8rem;
}
.ph-archive__link:hover {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}

.ph-archive__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--ph-ui);
  white-space: nowrap;
}

.post__date {
  color: var(--text-muted);
}

/* Single article: Posthaven post page */
.post--article {
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.post-article__head {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ph-rule);
}

.post-article__title {
  font-size: clamp(1.65rem, 3.5vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.4em;
  color: var(--text);
}

.ph-home-post__head,
.post-article__head {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.75rem;
  align-items: center;
}

.ph-home-post__head .ph-home-post__title,
.post-article__head .post-article__title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

.ph-home-post__head .post-actions,
.post-article__head .post-actions {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: end;
  margin: 0;
  padding-top: 0;
  border-top: none;
}

.ph-home-post__head .post-article__meta,
.post-article__head .post-article__meta {
  grid-column: 1;
  grid-row: 2;
  margin: 0.35em 0 0;
}

.post-article__head .post-article__meta {
  margin-top: 0.4em;
}

.post-article__meta {
  font-family: var(--ph-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Home: full post feed, newest first */
.ph-home-feed {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.ph-home-post {
  margin: 0 0 2.25rem;
  padding: 0 0 2.25rem;
  border-bottom: 1px solid var(--ph-rule);
  scroll-margin-top: 0.5rem;
}

.ph-home-post:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.ph-home-post__head {
  margin: 0 0 1rem;
  padding: 0;
}

.ph-home-post__title {
  font-size: clamp(1.28rem, 2.4vw, 1.7rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.ph-home-feed__loading {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.ph-home-feed__err {
  color: var(--text-muted);
  margin: 0;
}

.post-article__body {
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
}

/* Post: upvote + X share (post.html) */
.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--ph-rule);
  font-family: var(--ph-ui);
}

.post-actions__upvote {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  min-height: 1.4rem;
  margin: 0;
  padding: 0.15em;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  line-height: 1;
  border-radius: 0;
  cursor: pointer;
  overflow: visible;
}

.post-actions__upvote:focus {
  outline: none;
}

.post-actions__upvote:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.post-actions__upvote--on,
.post-actions__upvote[aria-pressed="true"] {
  color: var(--accent-dark);
}

.post-actions__upvote--on .post-actions__upvote-icon,
.post-actions__upvote-icon--on {
  color: var(--accent-mid);
}

.post-actions__upvote-bursts {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.post-actions__upvote-icon {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 1.05rem;
  line-height: 1;
  color: currentColor;
}

.post-actions__upvote-spark {
  --upvote-sx: 0;
  --upvote-sy: 0;
  --upvote-dx: 0;
  --upvote-dy: 0;
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-mid);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: post-actions-upvote-burst 0.95s ease-out forwards;
  animation-delay: 0s;
  pointer-events: none;
}

@keyframes post-actions-upvote-burst {
  0% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--upvote-sx, 0px)),
        calc(-50% + var(--upvote-sy, 0px))
      )
      scale(0.2);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--upvote-dx, 0px)),
        calc(-50% + var(--upvote-dy, 0px))
      )
      scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-actions__upvote-spark {
    animation: none;
    opacity: 0;
  }
}

/* Utility */
.teal {
  color: var(--accent-mid);
}

/* Bottom nav: plain blog links, not a gray window on article page */
.ph-article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ph-rule);
  font-size: 0.9rem;
  font-family: var(--ph-ui);
}

.ph-article-nav__link {
  color: var(--text-muted);
  text-decoration: none;
}
.ph-article-nav__link:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ph-comments {
  margin: 2rem 0 0;
  padding: 0;
}

.ph-comments__hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.25em 0 0;
}

/* Global link default (outside prose) */
a[href] {
  color: var(--link);
}
a[href]:visited {
  color: var(--link-visited);
}

/* Masthead: blog title link; beat global a[href] / :visited */
.ph-masthead__title a.ph-masthead__title-link,
.ph-masthead__title a.ph-masthead__title-link:visited {
  color: var(--text);
  text-decoration: none;
}
.ph-masthead__title a.ph-masthead__title-link:hover {
  color: var(--link);
}

/* Home feed: titles link to each post (same target as data-post-url on the article) */
a.ph-home-post__title-link,
a.ph-home-post__title-link:visited {
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}
a.ph-home-post__title-link:hover {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-light);
  text-underline-offset: 2px;
}
a.ph-home-post__title-link:focus {
  outline: none;
}
a.ph-home-post__title-link:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Bio page: die-cut sticker photos scattered beside prose */
.page-wrap--bio .ph-main {
  max-width: 100%;
  width: 100%;
  overflow: visible;
}

.ph-bio {
  position: relative;
  overflow: visible;
  width: 100%;
  gap: var(--ph-compact-edge-gap);
  --ph-bio-measure: clamp(13rem, 46vw, 28rem);
  --ph-bio-half-measure: clamp(6.5rem, 23vw, 14rem);
  --ph-bio-side-sticker-size: clamp(6.5rem, 12vw, 13rem);
  --ph-bio-seawind-gap: clamp(3.5rem, 9vw, 6.5rem);
  --ph-bio-bluebird-size: calc(var(--ph-bio-side-sticker-size) * 0.88);
}

.ph-bio-block {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  padding: 0.75rem clamp(0.5rem, 1.5vw, 1.25rem);
  --ph-bio-text-edge: calc(50% + var(--ph-bio-half-measure) + clamp(0.35rem, 1.25vw, 0.85rem));
}

.ph-current-site__desc.ph-bio__text {
  width: 100%;
  max-width: var(--ph-bio-measure);
  margin: 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.ph-bio-sticker {
  position: absolute;
  top: 50%;
  z-index: 0;
}

.ph-bio-sticker:not(.ph-bio-sticker--3):not(.ph-bio-sticker--6):not(.ph-bio-sticker--bluebird) {
  margin: 0;
  width: 100%;
  max-width: clamp(5rem, 11vw, 8.25rem);
  min-width: 0;
  justify-self: center;
}

.ph-bio-sticker--3,
.ph-bio-sticker--6 {
  margin: 0;
  min-width: 0;
}

.ph-bio-sticker--6 {
  max-width: none;
}

.ph-bio-sticker--3 {
  right: var(--ph-bio-text-edge);
  left: auto;
  align-self: auto;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  transform: translateY(-50%) rotate(-8deg) translate(clamp(0.5rem, 3.5vw, 6rem), clamp(-0.5rem, -0.25vw, 0.25rem));
  transform-origin: right center;
}

.ph-bio-sticker--cutout:not(.ph-bio-sticker--3):not(.ph-bio-sticker--6) {
  display: flex;
  justify-content: center;
  width: auto;
  max-width: clamp(5rem, 11vw, 8.25rem);
}

.ph-bio-sticker--3.ph-bio-sticker--cutout {
  display: flex;
  justify-content: center;
}

.ph-bio-sticker--3 .ph-bio-sticker__cut--shape {
  width: clamp(8rem, 22vw, 24rem);
}

.ph-bio-sticker--3 .ph-bio-sticker__cut--shape img {
  width: 100%;
  max-width: none;
}

.ph-bio-sticker--6.ph-bio-sticker--cutout {
  display: flex;
  justify-content: center;
}

.ph-bio-sticker--6 .ph-bio-sticker__cut--shape {
  width: clamp(9rem, 26vw, 36rem);
}

.ph-bio-sticker--6 .ph-bio-sticker__cut--shape img {
  width: 100%;
  max-width: none;
  transform: scaleX(-1);
}

.ph-bio-sticker--6 {
  left: var(--ph-bio-text-edge);
  right: auto;
  width: auto;
  flex-shrink: 0;
  transform: translateY(-50%) rotate(6deg) translate(calc(-1 * clamp(2.5rem, 9vw, 13rem)), 0);
}

.ph-bio-sticker--seawind {
  left: var(--ph-bio-text-edge);
  right: auto;
  margin-left: var(--ph-bio-seawind-gap);
  width: var(--ph-bio-side-sticker-size);
  max-width: none;
  min-width: 0;
  transform: translateY(-50%) rotate(5deg);
}

.ph-bio-sticker--bluebird {
  right: var(--ph-bio-text-edge);
  left: auto;
  width: var(--ph-bio-bluebird-size);
  max-width: none;
  min-width: 0;
  transform: translateY(-50%) rotate(-7deg);
}

.ph-bio-sticker--bluebird .ph-bio-sticker__circle {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 0.2rem solid #fff;
  box-shadow: var(--ph-bio-sticker-shadow);
  box-sizing: border-box;
}

.ph-bio-sticker img {
  display: block;
  width: 100%;
  height: auto;
}

.ph-bio-sticker--cutout:not(.ph-bio-sticker--3):not(.ph-bio-sticker--6) .ph-bio-sticker__cut--shape img {
  width: clamp(5rem, 11vw, 8.25rem);
  max-width: 100%;
}

.ph-bio-sticker-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ph-bio-sticker__cut {
  display: block;
  padding: 0.35rem;
  background: #fff;
  box-shadow: var(--ph-bio-sticker-shadow);
}

.ph-bio-sticker__cut--shape {
  display: inline-block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.ph-bio-sticker__cut--shape img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    url(#ph-bio-sticker-shape-border)
    drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.05))
    drop-shadow(2px 5px 10px rgba(0, 0, 0, 0.12))
    drop-shadow(4px 12px 22px rgba(0, 0, 0, 0.08));
}

@media (min-width: 721px) {
  .ph-bio-sticker--3 .ph-bio-sticker__cut--shape {
    width: clamp(18rem, 26vw, 24rem);
  }

  .ph-bio-sticker--6 .ph-bio-sticker__cut--shape {
    width: clamp(22rem, 38vw, 36rem);
  }
}

@media (max-width: 720px) {
  .ph-bio {
    --ph-bio-measure: clamp(11.5rem, 44vw, 24rem);
    --ph-bio-half-measure: clamp(5.75rem, 22vw, 12rem);
    --ph-bio-side-sticker-size: clamp(13rem, 42vw, 18.5rem);
    --ph-bio-seawind-gap: clamp(4.5rem, 12vw, 8rem);
    --ph-bio-bluebird-size: clamp(4.75rem, 15vw, 7rem);
  }

  .ph-bio-block {
    --ph-bio-text-edge: calc(50% + var(--ph-bio-half-measure) + 0.1rem);
  }

  .ph-bio .ph-bio-sticker--3 {
    right: calc(50% + var(--ph-bio-half-measure) - 1rem);
    transform: translateY(-50%) rotate(-8deg) translate(clamp(2.5rem, 9vw, 3.25rem), 0.15rem);
  }

  .ph-bio .ph-bio-sticker--3 .ph-bio-sticker__cut--shape {
    width: clamp(16rem, 52vw, 26rem);
  }

  .ph-bio .ph-bio-sticker--6 {
    left: calc(50% + var(--ph-bio-half-measure) - 1rem);
    transform: translateY(-50%) rotate(6deg) translate(clamp(-5.5rem, -14vw, -2.5rem), 0);
  }

  .ph-bio .ph-bio-sticker--6 .ph-bio-sticker__cut--shape {
    width: clamp(17rem, 56vw, 28rem);
  }
}
