@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/ibm-plex-sans-kr-name.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page-width: 36rem;
  --text: #dedede;
  --muted: #999;
  --rule: #292929;
}

* {
  box-sizing: border-box;
}

html {
  background: #080808;
}

body {
  isolation: isolate;
  width: min(var(--page-width), calc(100% - 2.5rem));
  margin: clamp(2rem, 7vw, 5rem) auto 4rem;
  color: var(--text);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* A static, monochrome wash behind the content, with no overlay on the text. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #080808 url("/wash.svg") center / 960px 960px repeat;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.site-title {
  min-width: 0;
  margin: 0;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.4;
}

.site-name {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  text-decoration: none;
}

.name-separator {
  color: var(--muted);
}

.korean-name {
  font-family: "IBM Plex Sans KR", sans-serif;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 1rem;
  font-size: 1rem;
}

nav a {
  color: var(--muted);
}

nav a[hidden] {
  display: none;
}

p {
  margin: 0;
}

.bio-group + .bio-group {
  margin-top: 1.25rem;
}

.bio-group p + p {
  margin-top: 0.375rem;
}

.contact {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.contact p + p {
  margin-top: 0.25rem;
}

.newsletter {
  margin-top: 2rem;
}

.newsletter label {
  display: block;
  color: var(--muted);
  font-size: 1rem;
}

.signup-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.signup-fields input,
.signup-fields button {
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #666;
  border-radius: 2px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.signup-fields input {
  flex: 1 1 14rem;
  min-width: 0;
  background: #111;
  color: var(--text);
}

.signup-fields input::placeholder {
  color: #999;
  opacity: 1;
}

.signup-fields button {
  flex: 0 0 auto;
  border-color: var(--text);
  background: var(--text);
  color: #000;
  cursor: pointer;
}

.signup-fields button:hover {
  border-color: #fff;
  background: #fff;
}

.signup-fields button:disabled {
  cursor: default;
  opacity: 0.6;
}

.signup-fields[hidden] {
  display: none;
}

#signup-status:not(:empty),
.newsletter noscript p {
  margin-top: 0.75rem;
}

#signup-status[data-error] {
  color: #e1a6a6;
}

.signup-fields input:focus-visible,
.signup-fields button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration-color: #777;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.archive-heading,
.letter-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
}

.muted,
.letter-date {
  color: var(--muted);
}

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

.letter-list li + li {
  margin-top: 1.25rem;
}

.letter-list a {
  display: block;
}

.letter-date {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.letter-body {
  margin-top: 1.5rem;
}

.letter-body > * + * {
  margin-top: 1em;
}

.letter-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.letter-body pre {
  overflow-x: auto;
  padding: 1rem;
  background: #111;
}

.letter-body blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 1px solid #666;
}

.letter-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.letter-body th,
.letter-body td {
  padding: 0.5rem;
  border: 1px solid var(--rule);
}

.archive-back {
  margin-top: 2rem;
}

/* Compact on phones, while retaining readable inputs and natural page flow. */
@media (max-width: 40rem) {
  body {
    width: calc(100% - 2rem);
    margin: 1.25rem auto 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.45;
  }

  .site-header {
    gap: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
  }

  .site-title { font-size: 1.125rem; }
  nav { font-size: 0.875rem; gap: 0.875rem; }
  .site-name { gap: 0 0.375rem; }
  .bio-group + .bio-group { margin-top: 0.75rem; }
  .bio-group p + p { margin-top: 0.25rem; }
  .contact { margin-top: 1.25rem; padding-top: 0.75rem; }
  .newsletter { margin-top: 1rem; }
  .newsletter label { font-size: 0.875rem; }
  .signup-fields { gap: 0.5rem; margin-top: 0.5rem; }
  .signup-fields input { flex: 1 1 0; }
  .signup-fields input,
  .signup-fields button { padding: 0.5rem 0.625rem; }

  .about-page {
    --page-inset: 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 2 * var(--page-inset));
    margin: var(--page-inset) auto;
  }

  .about-page .site-header { flex-shrink: 0; }

  .about-page main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.875rem;
  }

  .about-page main > .bio-group,
  .about-page main > .contact,
  .about-page main > .newsletter {
    margin-top: 0;
  }
}

/* Short phone screens get smaller gaps, without hiding content or disabling zoom. */
@media (max-width: 40rem) and (max-height: 700px) {
  .about-page { --page-inset: 1rem; }
  .about-page .site-header { margin-bottom: 1rem; padding-bottom: 0.625rem; }
  .about-page main { gap: 0.625rem; }
  .about-page .contact { padding-top: 0.625rem; }
}
