/* ==========================================================================
   ArticlePortfolioSite
   One black page, EB Garamond, nothing else.
   Layout:  [ mark ]  [ 3 links, right aligned ]
             |        [ article list, left aligned ]
   ========================================================================== */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --fg-soft: #e9e9e9;
  --fg-mute: rgba(255, 255, 255, 0.5);

  /* Latin in EB Garamond; Hangul falls through to a Korean serif so the
     Korean article titles keep the same colour of type. */
  --serif: "EB Garamond", Garamond, "AppleMyungjo", "Nanum Myeongjo",
    "Noto Serif KR", "Noto Serif CJK KR", "Hoefler Text", "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --size: 14px;          /* links + article list */
  --leading: 1.2;
  --tracking: 0.01em;

  --mark-w: 105px;       /* mark column width */
  --mark-bleed: 0px;     /* negative value lets the mark run off the top edge */
  --row-gap: 1.2em;      /* between the links block and the article list */

  --read-size: 17px;
}

@media (max-width: 480px) {
  :root {
    --size: 3.4vw;
    --leading: 1.25;
    --mark-w: 25vw;
    --mark-bleed: 0px;
    --row-gap: 1.25em;
    --read-size: 16px;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--size);
  font-weight: 500;
  line-height: var(--leading);
  letter-spacing: var(--tracking);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.18s ease;
}

a:hover { opacity: 0.42; }

a:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.site {
  /* normal flow, so a long article list simply makes the page scroll */
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: auto auto;
  align-items: end;
  column-gap: 0;
  row-gap: var(--row-gap);
  max-width: 100%;
}

.site__mark {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: var(--mark-w);
  margin-top: var(--mark-bleed);
}

.site__mark img {
  display: block;
  width: 100%;
  height: auto;
}

.site__links {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  text-align: right;
  white-space: nowrap;
}

.site__links a { display: block; }

.site__articles {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  text-align: left;
  white-space: nowrap;
}

.site__articles a { display: block; }

/* --------------------------------------------------------------------------
   Notice (data failed to load, noscript)
   -------------------------------------------------------------------------- */

.notice {
  position: fixed;
  left: 16px;
  bottom: 16px;
  margin: 0;
  max-width: 22em;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-mute);
}

.notice a { text-decoration: underline; text-underline-offset: 0.15em; }

/* --------------------------------------------------------------------------
   Article reader
   -------------------------------------------------------------------------- */

.back {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: var(--size);
  line-height: 1;
  padding: 6px;
}

.doc {
  padding: 64px 20px 140px;
  max-width: 660px;
}

@media (min-width: 760px) {
  .doc {
    padding: 64px 0 160px;
    margin-left: var(--mark-w);
    width: 640px;
    max-width: calc(100% - var(--mark-w) - 40px);
  }
}

.doc__meta {
  margin: 0 0 2.6em;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
}

.doc__meta:empty { display: none; }

.prose {
  font-size: var(--read-size);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0;
  color: var(--fg-soft);
}

.prose > :first-child { margin-top: 0; }

.prose h1 {
  margin: 0 0 1.1em;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--fg);
}

.prose h2 {
  margin: 2.1em 0 0.65em;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--fg);
}

.prose h3 {
  margin: 1.9em 0 0.55em;
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
}

.prose p { margin: 0 0 1.15em; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.5px;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.prose strong { font-weight: 500; color: var(--fg); }
.prose em { font-style: italic; }

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.25em;
}

.prose li { margin-bottom: 0.3em; }

.prose blockquote {
  margin: 1.7em 0;
  padding-left: 1em;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 2.6em 0;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  color: var(--fg);
}

.prose pre {
  margin: 0 0 1.5em;
  padding: 14px 16px;
  background: #0c0c0c;
  overflow-x: auto;
  line-height: 1.55;
}

.prose pre code {
  font-size: 12.5px;
  color: #d8d8d8;
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
