/* Type tokens */
:root {
  --text-s: 14px;
  --text-m: 16px;
  --text-l: 24px;
  --display-m: clamp(2.5rem, 5vw, 4rem);
  --display-s: clamp(1.875rem, 3.75vw, 3rem);
  --display-xs: clamp(1.5rem, 2.5vw, 2rem);
  --display-xl: clamp(4.5rem, 12vw, 12rem);
  --lh-body: 1.45;
  --lh-tight: 1.1;
  --lh-meta: 1.35;
  --lh-heading: clamp(33px, calc(8px + 3.125vw), 48px);
  --lh-lede: 28px;
  --track-xl: -.04em;
  --track-m: -.02em;
  --track-mono: .02em;
}

:root {
  --bg: #fff;
  --fg: #080808;
  --muted: #666;
  --border: #d0d0d0;
  --blue: #0000ff;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Stack Sans Text', Arial, sans-serif;
  font-size: var(--text-m);
  line-height: var(--lh-body);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  position: relative;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font: var(--text-m)/1 'Inconsolata', monospace;
  text-transform: uppercase;
}
.wordmark img { width: 36px; height: 36px; }

/* Mobile menu toggle */
.menu-toggle {
  display: block;
  background: none;
  border: 1px solid var(--fg);
  padding: 8px 14px;
  font: var(--text-s) 'Inconsolata', monospace;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-toggle:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Nav (closed by default on mobile) */
.site-nav {
  display: none;
  align-items: center;
  gap: 24px;
  font: var(--text-m) 'Inconsolata', monospace;
  text-transform: uppercase;
}
.site-nav.is-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  padding: 20px 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.site-nav a:hover, .text-link, .meta { color: var(--blue); }
.site-nav a:active { color: var(--blue); }
.meta {
  font: var(--text-s)/var(--lh-meta) 'Inconsolata', monospace;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}

/* Feed / post shared padding */
.edge-feed, .post-page { padding: 18px 18px 70px; }

.feed-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 38px;
}
.feed-heading h1 {
  margin: 0;
  font-weight: 500;
  font-family: 'Stack Sans Headline', Arial, sans-serif;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-xl);
  font-size: var(--display-xl);
}
.post-page h1 {
  margin: 22px 0 42px;
  font-weight: 500;
  font-family: 'Stack Sans Headline', Arial, sans-serif;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-m);
  font-size: var(--display-m);
  max-width: 900px;
}

/* Work grid — natural aspect ratio, no crop, no forced stretch */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 42px;
}
.project-card {
  width: 100%;
  margin: 0;
}
.image-wrap { display: block; overflow: hidden; background: #eee; }
.project-card img {
  display: block;
  width: 100%;
  height: auto;
}
.card-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  font-size: var(--text-s);
  min-height: 48px;
}
.card-caption .meta { text-align: right; }

/* Blog list (mobile: 2-col) */
.newsletter-list { width: 100%; }
.letter-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.letter-row time { grid-column: 2; }
.edge-image {
  display: block;
  width: 92px;
  height: 70px;
  grid-row: span 2;
  overflow: hidden;
  background: #eee;
}
.edge-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .35s;
}
.letter-row:hover img { transform: scale(1.03); }
.letter-title { display: block; font-size: var(--text-l); line-height: var(--lh-tight); font-weight: 400; }
.post-excerpt {
  max-width: 520px;
  margin: 12px 0 0;
  color: #555;
  font-size: var(--text-m);
}

/* Post page */
.post-page { max-width: 1100px; margin-inline: auto; }
.back-link {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  padding-bottom: 10px;
}
.post-meta { margin-top: 80px; }
.post-lede { max-width: 500px; font-size: var(--text-l); line-height: var(--lh-lede); }
.post-copy {
  margin: 70px 0 0;
}
.post-page .post-copy > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.post-page .post-copy > .kg-width-wide,
.post-page .post-copy > .kg-width-full { max-width: none; }
.post-copy > .kg-width-wide img,
.post-copy > .kg-width-full img { width: 100%; }
.post-page .post-copy > iframe { display: block; width: 100% !important; }

/* In-body headings */
.post-page .post-copy h1,
.post-page .post-copy h2 {
  font: 500 var(--display-s)/var(--lh-heading) 'Stack Sans Headline', Arial, sans-serif;
  letter-spacing: var(--track-m);
  margin-block: 1.5em .4em;
}
.post-page .post-copy h3 {
  font: 500 var(--display-xs)/var(--lh-tight) 'Stack Sans Headline', Arial, sans-serif;
  letter-spacing: var(--track-m);
  margin-block: 1.5em .4em;
}
.post-copy .kg-embed-card iframe { width: 100% !important; }
.post-copy img { max-width: 100%; height: auto; }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 150px;
  padding: 18px;
  background: #fff;
  color: var(--muted);
  font: var(--text-s) 'Inconsolata', monospace;
  border-top: 1px solid var(--border);
}

/* ============================= */
/* Desktop and up (Tailwind md: 768px) */
/* ============================= */
@media (min-width: 768px) {
  .site-header { padding: 24px 32px; }
  .menu-toggle { display: none; }
  .site-nav { display: flex; }

  .edge-feed { padding: 20px 32px 112px; }
  .post-page { padding: 80px 32px 144px; }

  .feed-heading { margin-bottom: 54px; }

  .project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 24px;
  }
  .project-card {
    width: 100%;
  }
  .project-card .image-wrap {
    display: block;
  }
  .project-card img {
    width: 100%;
    height: auto;
  }
  .project-card:hover img { transform: scale(1.025); }

  .letter-row { grid-template-columns: 170px 1fr 140px; gap: 20px; }
  .letter-row time { grid-column: auto; }
  .edge-image { width: 170px; height: 126px; grid-row: auto; }

  .post-meta { margin-top: 128px; }
  .post-copy { margin: 100px 0 0; }


}
.feed-heading h1.tag-heading {
  margin: 0;
  font-weight: 500;
  font-family: 'Stack Sans Headline', Arial, sans-serif;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-m);
  font-size: var(--display-m);
}
.tag-heading a { color: var(--blue); }
#ghost-portal-root .gh-portal-triggerbtn-iframe { display: none !important; }

/* Two-column project intro layout (added for post.hbs project branch) */
.post-intro {
    line-height: var(--lh-tight);
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}
@media (min-width: 768px) {
    .post-intro { grid-template-columns: 1.5fr 1fr; }
}

.post-meta,
.post-lede {
    white-space: pre-line;
}


/* Pagination disabled (posts_per_page set high, single-page index) */
.pagination { display: none; }

/* postcopy-margin-top */
.post-page .post-copy {
    margin-top: 36px;
}

/* embed-16x9 */
.post-page .post-copy iframe[src*="youtube"],
.post-page .post-copy iframe[src*="youtu.be"],
.post-page .post-copy iframe[src*="vimeo"] {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* blog-heading */
.feed-heading h1.blog-heading {
  --blog-stroke: 1px;
  --blog-indent: 1em;
  font-size: clamp(2.5rem, 12vw, 12rem);
  line-height: .455;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: var(--blog-stroke) #0000FF;
  padding-block: .13em;
}
.blog-heading span { display: block; }
.blog-heading span + span { padding-left: var(--blog-indent); }

/* blog-list-width */
.newsletter-list {
  max-width: 1064px;
  margin-inline: auto;
}
.letter-row {
  border-bottom-color: #0000FF;
}

/* post-copy-spacing */
.post-page .post-copy {
  --space-para: 1em;
  --space-block: 2.5em;
}
.post-page .post-copy > * + * {
  margin-top: var(--space-para);
}
.post-page .post-copy > figure,
.post-page .post-copy > iframe,
.post-page .post-copy > .kg-card {
  margin-top: var(--space-block);
  margin-bottom: var(--space-block);
}
.post-page .post-copy > :first-child {
  margin-top: 0;
}

/* divider-captions */
.post-page .post-copy > hr {
  height: 0;
  border: 0;
  border-top: 1px solid #d0d0d0;
  margin-top: 40px;
  margin-bottom: 40px;
}
.post-page .post-copy figcaption {
  font-family: 'Inconsolata', monospace;
  font-size: var(--text-m);
  line-height: var(--lh-meta);
  letter-spacing: var(--track-mono);
  color: #666;
}

/* footer-social */
.footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-social-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-social {
  display: inline-flex;
  color: inherit;
}
.footer-social .icon {
  width: 20px;
  height: 20px;
}
.footer-social:hover {
  color: #0000FF;
}

/* footer-layout (consolidated) */
.site-footer {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.site-footer .footer-right {
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) {
  .site-footer {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    padding: 28px 32px;
    text-align: left;
  }
  .site-footer .footer-identity {
    flex: 0 1 auto;
    width: auto;
  }
  .site-footer .footer-right {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-start;
  }
  .site-footer .footer-right > span {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    text-align: right;
  }
  .site-footer .footer-social-links {
    flex: none;
  }
}

/* post-links */
.post-page .post-copy {
  --link-color: #0000FF;
  --link-highlight: #FFFF00;
}
.post-page .post-copy a:not(.kg-bookmark-container):not(.kg-btn) {
  color: var(--link-color);
  text-decoration: none;
}
.post-page .post-copy a:not(.kg-bookmark-container):not(.kg-btn):hover {
  background: var(--link-highlight);
}

/* thumb-halftone: #0000FF dot-matrix hover, technique A v1 */
.image-wrap { --dot: 7px; --dot-bright: .72; }
.edge-image { --dot: 3px; --dot-bright: .72; }
.image-wrap, .edge-image { position: relative; }

@media (hover: hover) {
  .project-card:hover .image-wrap,
  .letter-row:hover .edge-image {
    background: #fff;
    filter: brightness(var(--dot-bright)) contrast(30);
    outline: 1px solid #0000FF;
    outline-offset: -1px;
  }
  .project-card:hover img,
  .letter-row:hover img {
    filter: grayscale(1) contrast(1.3);
    transform: none;
  }
  .project-card:hover .image-wrap::before,
  .letter-row:hover .edge-image::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle closest-side, #000, #fff) 0 0 / var(--dot) var(--dot);
    mix-blend-mode: screen;
  }
  .project-card:hover .image-wrap::after,
  .letter-row:hover .edge-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: #0000FF;
    mix-blend-mode: lighten;
  }
}

/* post-gaps */
.post-page .post-copy h1,
.post-page .post-copy h2,
.post-page .post-copy h3 { margin-block: 48px .4em; }
.post-page .post-copy > :is(figure, iframe, .kg-card) + *:not(h1, h2, h3) {
  margin-top: var(--space-block);
}

/* lightbox */
.lb-ok { cursor: zoom-in; }
.lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: #fff;
}
.lb-bar,
.lb-foot {
  display: grid;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  font: 400 var(--text-s)/var(--lh-meta) 'Inconsolata', monospace;
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: #666;
}
.lb-bar { grid-template-columns: 1fr auto; }
.lb-foot { grid-template-columns: 5.5em 1fr 5.5em; }
.lb-cap {
  margin: 0;
  text-align: center;
  text-transform: none;
  font-size: var(--text-m);
  line-height: var(--lh-meta);
  color: #666;
}
.lb button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: #000;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.lb-prev { justify-self: start; }
.lb-next,
.lb-close { justify-self: end; }
.lb button:hover,
.lb button:focus-visible { color: #0000FF; }
.lb button:focus-visible { outline: 1px solid #0000FF; outline-offset: 4px; }
.lb-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}
.lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
