:root {
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --content-max: 640px;
  --marginalia-width: 172px;
  --marginalia-gap: 22px;
  --text: #1f1a17;
  --muted: #6b625c;
  --line: #e8dfd8;
  --link: #2e5f50;
  --link-glow: #9de098;
  --bg: #f8f8f8;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: 'Instrument Sans', sans-serif;
  line-height: 1.5;
  text-rendering: optimizeSpeed;
  word-break: break-word;
  overflow-wrap: break-word;
}

.top-bar {
  position: absolute;
  top: var(--safe-top);
  left: 16px;
  right: 16px;
  height: var(--nav-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  background: transparent;
  z-index: 30;
}

.top-bar.no-brand {
  justify-content: flex-end;
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: #1e1b19;
  font-size: clamp(16px, 1.35vw, 21px);
}

.top-brand-leaf {
  width: 0.92em;
  height: 0.92em;
  transform: translateY(-2px);
}

.top-brand-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1em;
  line-height: 1;
  font-weight: 500;
}

.top-links {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 2vw, 24px);
}

.top-bar.with-brand .top-links {
  margin-left: auto;
}

.nav-link {
  font-family: 'Gaegu', cursive;
  color: #1e1b19;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.nav-link:hover {
  opacity: 0.82;
}

.top-bar-cta {
  color: #1e1b19;
  border: 1.5px solid rgba(30, 27, 25, 0.25);
  border-radius: 8px;
  padding: 0.25em 0.75em;
  background: linear-gradient(105deg, rgba(255, 107, 107, 0.35), rgba(254, 202, 87, 0.35), rgba(72, 219, 251, 0.35), rgba(255, 159, 243, 0.35), rgba(84, 160, 255, 0.35));
  font-family: 'Gaegu', cursive;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.top-bar,
.top-bar * {
  word-break: normal;
  overflow-wrap: normal;
}

.nav-link:focus-visible,
.top-bar-cta:focus-visible,
.top-brand:focus-visible {
  outline: 2px solid #0d5ad1;
  outline-offset: 2px;
}

.content-shell {
  padding: calc(var(--safe-top) + var(--nav-h) + 1.3rem) 0 2.4rem;
}

.content-column {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 19px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
blockquote,
pre,
table,
hr {
  margin: 0 0 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.24;
  font-weight: 600;
}

h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.95rem;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.2rem;
}

p,
li,
blockquote,
.post-date,
.pagination-inner,
.marginalia {
  font-family: 'Instrument Sans', sans-serif;
}

ul,
ol {
  padding-left: 1.4rem;
}

a {
  color: var(--link);
  text-decoration: none;
}

.content-column a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--link-glow), 0 0 16px var(--link-glow);
}

blockquote {
  border-left: 0.22rem solid var(--link);
  color: var(--muted);
  padding: 0.35rem 0 0.35rem 1rem;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  background: #f4efe9;
  border-radius: 0.25rem;
}

code {
  padding: 0.1rem 0.28rem;
}

pre {
  padding: 0.8rem;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: transparent;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.post {
  margin-bottom: 2rem;
}

.post-date {
  display: block;
  margin-bottom: 0.65rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.pagination {
  margin-top: 2rem;
}

.pagination-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.76rem;
}

.pagination-link {
  color: var(--muted);
  text-decoration: none;
}

.pagination-link:hover {
  text-shadow: 0 0 8px var(--link-glow), 0 0 16px var(--link-glow);
}

.marginalia {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--muted);
  width: var(--marginalia-width);
}

.marginalia p {
  font-family: inherit;
  font-size: inherit;
}

.inline-logo-tag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin-right: 3px;
}

.inline-logo-leaf {
  width: 0.92em;
  height: 0.92em;
  transform: translateY(1px);
}

.pin-callout {
  display: block;
  margin: 0 0 1.5rem;
  padding: 0.55rem 0.8rem;
  min-height: 2.5em;
  border-radius: 1em;
  border-left: 0.35em solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pin-callout-beige {
  border-left-color: #e8dba8;
  background: #fff3c9;
}

.pin-callout-green {
  border-left-color: #c5e8d4;
  background: #daf6e5;
}

.pin-callout p,
.pin-callout ul,
.pin-callout ol {
  margin-bottom: 0.5rem;
}

.pin-callout p:last-child,
.pin-callout ul:last-child,
.pin-callout ol:last-child {
  margin-bottom: 0;
}

@media (min-width: 980px) {
  .content-column {
    position: relative;
  }

  .marginalia-left {
    float: left;
    margin-left: calc(-1 * (var(--marginalia-width) + var(--marginalia-gap)));
    margin-right: var(--marginalia-gap);
    transform: translateY(6px);
  }

  .marginalia-right {
    float: right;
    margin-right: calc(-1 * (var(--marginalia-width) + var(--marginalia-gap)));
    margin-left: var(--marginalia-gap);
  }
}

@media (max-width: 720px) {
  :root {
    --nav-h: 102px;
  }

  .top-bar {
    left: 8px;
    right: 8px;
    height: auto;
    min-height: var(--nav-h);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
    padding-top: 6px;
  }

  .top-brand {
    grid-column: 1;
    grid-row: 1;
    gap: 2px;
    font-size: 14px;
  }

  .top-brand-leaf {
    width: 0.86em;
    height: 0.86em;
  }

  .top-links {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .nav-link {
    font-size: 1.2rem;
  }

  .top-bar-cta {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    font-size: 1.2rem;
    padding: 0.22em 0.62em;
  }

  .content-shell {
    padding-top: calc(var(--safe-top) + var(--nav-h) + 0.75rem);
  }

  .content-column {
    font-size: 17px;
  }

  .marginalia {
    width: auto;
    margin: 0 0 1.2rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--line);
  }
}

.pull-double,
.push-double,
.pull-single,
.push-single {
  display: inline-block;
}

.pull-double {
  margin-left: -0.46em;
}

.push-double {
  margin-right: 0.46em;
}

.pull-single {
  margin-left: -0.27em;
}

.push-single {
  margin-right: 0.27em;
}

.pull-T,
.pull-V,
.pull-W,
.pull-Y {
  margin-left: -0.07em;
}

.push-T,
.push-V,
.push-W,
.push-Y {
  margin-right: 0.07em;
}

.pull-O,
.pull-C,
.pull-o,
.pull-c {
  margin-left: -0.04em;
}

.push-O,
.push-C,
.push-o,
.push-c {
  margin-right: 0.04em;
}

.pull-A {
  margin-left: -0.03em;
}

.push-A {
  margin-right: 0.03em;
}
