/* Fonts */
@font-face {
  font-family: "Lexend";
  src: url('/static/lexend-b7e7538f.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Metric-compatible fallback: system fonts resized to Lexend's exact metrics
   (hhea values from the woff2; size-adjust from avg lowercase advance vs
   Arial-metric fonts) so font-display: swap doesn't reflow text when the
   real font lands. Recompute these if lexend.woff2 is ever replaced. */
@font-face {
  font-family: "Lexend Fallback";
  src: local("Arial"), local("Roboto"), local("Liberation Sans");
  size-adjust: 112.19%;
  ascent-override: 100%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* Illinois Mono: a monospaced Lexend derivative (github.com/MadSimple/illinois-mono,
   OFL). Single 400 weight; bold-in-code (rare) falls back to synthesized bold. */
@font-face {
  font-family: "Illinois Mono";
  src: url('/static/illinois-mono-regular-62a99e83.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

*:not(dialog) {
  margin: 0;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

p {
  text-align: justify;
  text-justify: inter-character;
}

input, button, textarea, select {
  font: inherit;
}

/* Vars */
:root {
  color-scheme: light dark;
  --white: #faf8f5;
  --black: #1c1b18;
  --ramblings-colour: #7c3aed;
  --uses-colour: oklch(0.55 0.11 190);
  --projects-colour: oklch(0.57 0.19 35);
  --colour: var(--ramblings-colour);
  --bg: light-dark(var(--white), var(--black));
  --fg: light-dark(var(--black), var(--white));
  --highlight: light-dark(
      var(--colour),
      oklch(from var(--colour) calc(l + 0.20) c h)
  );
  --links: light-dark(
      oklch(from var(--highlight) calc(l - 0.15) c h),
      oklch(from var(--highlight) calc(l + 0.15) c h)
  );
  --fg-dim: light-dark(
      oklch(from var(--black) calc(l + 0.40) c h),
      oklch(from var(--white) calc(l - 0.40) c h)
  );
  --fg-subtle: light-dark(
      oklch(from var(--black) calc(l + 0.50) c h),
      oklch(from var(--white) calc(l - 0.50) c h)
  );
  --fg-text-dim: light-dark(
      oklch(from var(--black) calc(l + 0.20) c h),
      oklch(from var(--white) calc(l - 0.20) c h)
  );
  --fg-text-very-dim: light-dark(
      oklch(from var(--black) calc(l + 0.10) c h),
      oklch(from var(--white) calc(l - 0.10) c h)
  );
  --highlight-subtle: light-dark(
      oklch(from var(--colour) calc(l + 0.20) 0.1 h / 0.05),
      oklch(from var(--colour) calc(l + 0.40) 0.1 h / 0.05)
  );
  --highlight-transparent: light-dark(
      oklch(from var(--colour) calc(l + 0.20) 0.1 h / 0.1),
      oklch(from var(--colour) calc(l + 0.40) 0.1 h / 0.1)
  );
  --highlight-shadow: light-dark(
      oklch(from var(--colour) calc(l + 0.20) 0.1 h / 0.15),
      oklch(from var(--colour) calc(l + 0.40) 0.1 h / 0.15)
  );
  --content-wide: min(90vw, 60rem);
  --font-sans: "Lexend", "Lexend Fallback", system-ui, sans-serif;
  --font-mono: "Illinois Mono", ui-monospace, monospace;
}

html:has(.uses) {
  --colour: var(--uses-colour);
}

html:has(.projects) {
  --colour: var(--projects-colour);
}

/* Styling */
html {
  color: var(--fg);
  background-color: var(--bg);
  font-family: var(--font-sans);
  font-size: 112.5%;
}

@property --strip-a { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --strip-b { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --strip-c { syntax: '<color>'; inherits: true; initial-value: transparent; }

html {
  --strip-a: var(--ramblings-colour);
  --strip-b: var(--uses-colour);
  --strip-c: var(--projects-colour);
  transition: --strip-a 0.8s ease, --strip-b 0.8s ease, --strip-c 0.8s ease;
}

html::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: 0.5rem;
  z-index: 10;
  background: linear-gradient(90deg in oklch, var(--strip-a), var(--strip-b), var(--strip-c));
}

/* Homepage: hovering a section card floods the strip and name period with its colour */
html:has(.home-index-card:is(:hover, :focus-visible)) {
  --strip-a: var(--hover-section);
  --strip-b: var(--hover-section);
  --strip-c: var(--hover-section);
}

html:has(.home-index-card[href="/ramblings"]:is(:hover, :focus-visible)) {
  --hover-section: var(--ramblings-colour);
}

html:has(.home-index-card[href="/uses"]:is(:hover, :focus-visible)) {
  --hover-section: var(--uses-colour);
}

html:has(.home-index-card[href="/projects"]:is(:hover, :focus-visible)) {
  --hover-section: var(--projects-colour);
}

.home-name .home-period {
  transition: color 0.8s ease;
}

html:has(.home-index-card:is(:hover, :focus-visible)) .home-name .home-period {
  color: light-dark(var(--hover-section), oklch(from var(--hover-section) calc(l + 0.20) c h));
}

@media (prefers-reduced-motion: reduce) {
  html, .home-name .home-period {
    transition: none;
  }
}

body {
  line-height: 1.5;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  min-height: 100vh;
}

h1 {
  color: var(--highlight);
}

a {
  color: var(--links);
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;

  p {
    padding-bottom: 1rem;

    img {
      max-height: 25vh;
    }
  }

  &:has(article) {
    padding-top: 2rem;

    ul {
      padding-bottom: 1rem;
    }

    /* Only top-level chrome (subpages nav) and the article itself get
       width-constrained, aligned to the same wide frame as the site header;
       navs nested inside articles keep their natural size. */
    & > nav {
      width: var(--content-wide);
    }

    & > article {
      width: var(--content-wide);
      padding-bottom: 2rem;
    }
  }

  &:not(:has(article)) {
    justify-content: center;

    ul {
      list-style: none;
      padding: 0;

      li {
        display: inline;
      }
    }
  }
}

nav[aria-label="subpages"] {
  font-size: 0.85rem;
  padding-bottom: 1rem;

  ul {
    list-style: none;
    padding-left: 0;

    &::before {
      content: "→";
      padding-right: .5ch;
      speak: never;
    }

    li {
      display: inline-block;
      padding-right: 0;

      &:not(:first-child):before {
        content: "·";
        display: inline-block;
        padding: 0 .5ch;
        speak: never;
      }
    }
  }
}

/* ---- site chrome: skip link, header, footer, page headers ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1001;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--links);
  border: 1px solid var(--fg-dim);
  border-radius: 0 0 0.25rem 0.25rem;
  text-decoration: none;

  &:focus {
    top: 0;
  }
}

.site-header {
  width: var(--content-wide);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 0 0;

  .site-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fg);
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: var(--links);
    }
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.9rem;

    a {
      color: var(--fg-text-dim);
      text-decoration: none;
      transition: color 0.2s ease;

      &:hover {
        color: var(--highlight);
      }
    }
  }
}

.site-footer {
  width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0 2rem;
  font-size: 0.85rem;
  color: var(--fg-text-very-dim);

  a {
    color: var(--fg-text-dim);
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: var(--highlight);
    }
  }
}

.page-header {
  width: 100%;
  margin-bottom: 2rem;

  p {
    padding-bottom: 0;
  }

  .page-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-text-dim);
  }

  .page-title {
    margin-top: 0.5rem;
    color: var(--highlight);
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-wrap: balance;

    .home-period {
      color: var(--fg);
    }
  }

  .page-lead {
    margin-top: 0.75rem;
    color: var(--fg-text-dim);
  }

  .page-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
  }
}

a:not(
	[href^="#"],
	[href^="/"],
	[href="https://greboid.com" i],
	[href^="https://greboid.com/" i],
	[href^="https://greboid.com#" i],
	[href^="https://greboid.com?" i]
)::after {
  content: "↗";
  vertical-align: super;
  font-size: 0.5em;
  display: inline-block;
  bottom: 0.5em;
  padding-left: 1ch;
  position: relative;
}

code, kbd, samp {
  font-family: var(--font-mono);
}

code {
  padding: 0.125rem 0.375rem;
  background: var(--highlight-transparent);
  border-radius: 0.25rem;
  overflow-wrap: break-word;
}

pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

pre {
  font: inherit;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  padding: 0.75rem 1rem;
  background: var(--highlight-subtle);
  border-radius: 0.25rem;
}

table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
  tr {
    border-bottom: 1px solid oklch(from var(--fg) calc(l - 0.50) c h);
    transition: border-color 0.5s ease, background-color 0.5s ease;

    &:hover {
      border-bottom-color: var(--highlight);
    }
  }
  th {
    text-align: left;
    width: 130px;
    padding: 0.5rem 0;
    color: var(--highlight);
    font-weight: normal;
  }
  td {
    padding: 0.5rem 0;
    font-size: 0.95rem;
  }
}

.uses {
  .uses-section {
    margin-bottom: 2.5rem;
  }

  .uses-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-text-dim);
  }

  .uses-photo {
    margin: 0 0 1.5rem 0;

    img {
      display: block;
      width: 100%;
      height: auto;
      border-radius: 0.75rem;
    }
  }

  .uses-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: 1.25rem 2rem;

    h3 {
      margin: 0;
      font-size: 1.05rem;
      font-weight: 600;

      span {
        display: block;
        font-size: 0.9rem;
        font-weight: 400;
        color: var(--fg-text-dim);
      }
    }

    p {
      margin: 0.35rem 0 0;
      padding: 0;
      font-size: 0.85rem;
      font-style: italic;
      color: var(--fg-text-dim);
    }
  }

  .uses-pc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 2rem;
    align-items: start;
  }

  .uses-pc-case {
    img {
      width: 100%;
      height: auto;
      border-radius: 0.75rem;
    }
  }

  .uses-pc-sides {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.5rem;
    margin-top: 2rem;

    .uses-photo {
      margin: 0;
    }

    figcaption {
      margin-top: 0.5rem;
      font-size: 0.85rem;
      color: var(--fg-text-dim);
    }
  }

  .uses-table-wrap {
    overflow-x: auto;
  }

  .uses-spec {
    width: 100%;
    border-collapse: collapse;

    th,
    td {
      padding: 0.6rem 0.5rem;
      border-bottom: 1px solid var(--highlight-transparent);
      text-align: left;
      vertical-align: top;
    }

    th {
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--fg-text-dim);
      white-space: nowrap;
    }

    small {
      display: block;
      margin-top: 0.25rem;
      font-size: 0.8rem;
      font-style: italic;
      color: var(--fg-text-dim);
    }
  }
}

.projects {
  .projects-section {
    margin-bottom: 2.5rem;
  }

  .projects-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-text-dim);
  }

  /* The grid is all external links; drop the per-link ↗ marker. */
  .projects-images a::after {
    content: none;
  }

  .projects-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0 0 0.75rem;
    padding: 0;
    color: var(--fg-text-dim);

    strong {
      color: var(--highlight);
      font-weight: 600;
    }
  }

  .projects-text {
    margin: 0 0 1.25rem;
    padding: 0;
    font-size: 0.95rem;
    color: var(--fg-text-dim);
  }

  .projects-images {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
    gap: 0.25rem 1rem;

    a {
      display: flex;
      flex-direction: column;
      padding: 0.4rem 0;
      border-bottom: 1px solid var(--highlight-transparent);
      color: var(--fg);
      text-decoration: none;
      transition: color 0.2s ease, border-color 0.2s ease;

      &:hover,
      &:focus-visible {
        color: var(--highlight);
        border-bottom-color: var(--highlight);
      }
    }

    .projects-image-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .projects-image-tag {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--fg-text-dim);
    }
  }
}

.post-meta {
  color: var(--fg-text-dim);

  a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: var(--highlight);
    }
  }
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.post-tag,
.post-item-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  --tag: oklch(0.55 0.15 var(--tag-hue, 295));
  color: light-dark(
      oklch(from var(--tag) calc(l - 0.05) c h),
      oklch(from var(--tag) calc(l + 0.27) c h)
  );
  background: light-dark(
      oklch(from var(--tag) l c h / 0.08),
      oklch(from var(--tag) calc(l + 0.2) c h / 0.1)
  );
  padding: 0.1rem 0.55rem;
  border: 1px solid light-dark(
      oklch(from var(--tag) l c h / 0.25),
      oklch(from var(--tag) calc(l + 0.2) c h / 0.3)
  );
  border-radius: 999px;
  white-space: nowrap;

  &::before {
    content: '#';
    opacity: 0.65;
    margin-right: 0.05em;
  }
}

.post-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.feed-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;

  &:hover {
    color: var(--highlight);

    svg {
      transform: scale(1.1);
    }
  }

  svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
  }
}

.ramblings-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;

  .ramblings-nav-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-text-dim);
  }

  section {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
  }

  ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  a {
    color: var(--fg-text-dim);
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
      color: var(--highlight);
    }
  }
}

.posts {
  .posts-count {
    margin: 0 0 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-text-dim);
  }

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

    /* Flat rows like the homepage's latest list: a date column on the
       left, title and excerpt stacked on the right so the excerpt aligns
       under the title. The whole row is one link; hover/focus lights up
       the title. */
    .post-item {
      display: grid;
      grid-template-columns: max-content 1fr;
      column-gap: 2.5rem;
      align-items: baseline;
      padding: 1rem 0.5rem;
      color: var(--fg);
      text-decoration: none;
    }

    .post-date {
      font-family: var(--font-mono);
      font-size: 0.8rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--fg-text-dim);
    }

    .post-item-title {
      font-size: 1.25rem;
      font-weight: 600;
      transition: color 0.2s ease;
    }

    .post-item-desc {
      display: block;
      margin-top: 0.15rem;
      font-size: 0.9rem;
      line-height: 1.5;
      color: var(--fg-text-dim);
    }

    .post-item:hover .post-item-title,
    .post-item:focus-visible .post-item-title {
      color: var(--highlight);
    }
  }
}

.link-card .link-card-meta {
  grid-area: meta;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--fg-text-dim);
}

.empty-state {
  padding: 1rem 0;
  text-align: center;

  p {
    margin: 0;
    color: var(--fg-text-dim);
  }
}

img {
  cursor: zoom-in;
}

#lightbox {
  position: fixed;
  inset: 0;
  background: oklch(from var(--bg) calc(l - 0.15) c h / 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;

  &[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;

    img {
      transform: scale(1);
    }
  }

  img {
    max-width: 95vw;
    max-height: 95vh;
    cursor: zoom-out;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s ease;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 1.1rem;
  }
  main:has(article) {
    padding-top: 3rem;
  }
}

.footnotes {
  margin-top: 2.5rem;
  font-size: 0.9em;
  color: var(--fg-text-dim);
}
.footnotes hr {
  margin-bottom: 1rem;
}
.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
}
button.footnote-ref {
  font: inherit;
  font-size: 0.75em;
  line-height: 1;
  color: var(--links);
  background: none;
  border: none;
  padding: 0 0.15em;
  cursor: pointer;
  text-decoration: underline;
}
.footnote-popover {
  margin: 0;
  inset: auto;
  position-area: bottom span-right;
  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  margin-block: 0.4rem;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--highlight);
  border-radius: 0.25rem;
  box-shadow: 0 0.25rem 1.25rem oklch(from var(--highlight) l c h / 0.35);
}
.footnote-popover > :first-child {
  margin-top: 0;
}
.footnote-popover > :last-child {
  margin-bottom: 0;
}
@supports not (position-area: bottom) {
  .footnote-popover {
    inset: 0;
    margin: auto;
  }
}

/* ---- home (poster) ---- */
main:has(.home) {
  justify-content: start;
}

.home {
  width: var(--content-wide);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0 3rem;
  margin-inline: auto;

  p {
    padding-bottom: 0;
    text-align: left;
  }
}

.home-period {
  color: var(--highlight);
}

.home-name {
  color: var(--fg);
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance;
}

.home-intro {
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg-text-dim);
  text-wrap: pretty;
}

.home-latest {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--fg-subtle);
}

.home-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-text-dim);
}

.home-latest-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.home-latest-link {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 2.5rem;
  align-items: baseline;
  padding: 0.6rem 0;
  color: var(--fg);
  text-decoration: none;
}

.home-latest-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-text-dim);
}

.home-latest-title {
  font-size: 1.1rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.home-latest-link:hover,
.home-latest-link:focus-visible {
  .home-latest-title {
    color: var(--highlight);
  }
}

.home-index {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.home-index-card {
  --section-base: var(--ramblings-colour);
  --section: light-dark(var(--section-base), oklch(from var(--section-base) calc(l + 0.20) c h));
  display: flex;
  flex-direction: column;
  color: var(--fg);
  text-decoration: none;

  &[href="/uses"] {
    --section-base: var(--uses-colour);
  }

  &[href="/projects"] {
    --section-base: var(--projects-colour);
  }

  .home-period {
    color: var(--section);
  }
}

.home-index-title {
  font-size: 1.25rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.home-index-desc {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-text-dim);
}

.home-index-card:hover,
.home-index-card:focus-visible {
  .home-index-title {
    color: var(--section);
  }

  .home-period {
    color: var(--fg);
  }
}

.link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title arrow"
    "desc arrow";
  column-gap: 1.5rem;
  padding: 1.1rem 0.5rem;
  color: var(--fg);
  text-decoration: none;
  transition: background-color 0.2s ease;

  .link-card-title {
    grid-area: title;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.2s ease;
  }

  .link-card-desc {
    grid-area: desc;
    margin-top: 0.15rem;
    font-size: 0.9rem;
    color: var(--fg-text-dim);
  }

  .link-card-arrow {
    grid-area: arrow;
    align-self: center;
    font-size: 1.25rem;
    color: var(--highlight);
    transition: transform 0.2s ease, color 0.2s ease;
  }

  &:hover,
  &:focus-visible {
    .link-card-title {
      color: var(--highlight);
    }

    .link-card-arrow {
      color: var(--fg);
      transform: translateX(3px);
    }

    .home-period {
      color: var(--fg);
    }
  }
}

@media (max-width: 768px) {
  .home {
    padding: 3rem 0 2rem;
  }

  .home-intro {
    margin-top: 1.5rem;
  }

  .home-latest-link {
    column-gap: 1.25rem;
  }

  .post-item {
    column-gap: 1.25rem;
  }

  .post-item-title {
    font-size: 1.1rem;
  }

  .home-latest-title {
    font-size: 1.05rem;
  }

  .home-index {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-top: 1.5rem;
  }

  .home-index-desc {
    display: none;
  }

  .home-latest {
    margin-top: 2rem;
  }
}

/* Prev/next post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--fg-subtle);

  a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    min-width: 0;

    &:hover .post-nav-title,
    &:focus-visible .post-nav-title {
      color: var(--links);
    }
  }

  .post-nav-older {
    margin-left: auto;
    text-align: right;
  }

  .post-nav-direction {
    font-size: 0.85rem;
    color: var(--fg-text-dim);
    transition: transform 0.2s ease;
  }

  .post-nav-title {
    color: var(--fg);
  }

  a:hover .post-nav-direction,
  a:focus-visible .post-nav-direction {
    transform: translateX(-3px);
  }

  .post-nav-older:hover .post-nav-direction,
  .post-nav-older:focus-visible .post-nav-direction {
    transform: translateX(3px);
  }
}

/* Keyboard-operable lightbox images */
img[role='button'] {
  cursor: zoom-in;

  &:focus-visible {
    outline: 2px solid var(--links);
    outline-offset: 2px;
  }
}

#lightbox:focus {
  outline: none;
}
