/* dedyoc.com: the site's only stylesheet. Tokens and rules: AGENTS.md → Design. */

/* Self-hosted fonts (Latin subset, from Fontsource 5.3.0, SIL OFL: see static/fonts/OFL-*.txt).
   JetBrains Mono frames the site (heading, labels, contact, stamp, code);
   IBM Plex Sans carries links and prose. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
/* Just the ↗ glyph (U+2197), cut from the full JetBrains Mono 2.304: the Latin subset above
   doesn't have it. Browsers download this file only for pages that use the character. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-arrow-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+2197;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
/* Vietnamese letters (ễ, ư, ờ, …) for the owner's name; unicode-range is Fontsource's, so the
   browser fetches this file only on pages that use those characters. Declared after the Latin
   face so it wins for its range. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-vietnamese-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
    U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  color-scheme: light dark;
  --bg: #f5f3ee;
  --text: #2e2e2e;
  --muted: #6b6760;
  --accent: #2f5d8a;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1f21;
    --text: #d4d2cc;
    --muted: #9a968e;
    --accent: #8fb3d9;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.7 var(--sans);
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 14vh 1.5rem 3rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

/* links that leave the site get a small ↗ in JetBrains Mono. The second `content` line gives
   it empty alt text, so screen readers don't announce "north east arrow" after every link;
   browsers that don't understand it keep the first line. */
a[href^="http"]::after,
a[href^="mailto:"]::after {
  content: "\2197";
  content: "\2197" / "";
  margin-left: 0.15em;
  font-family: var(--mono);
  font-size: 0.75em;
  font-weight: 400;
  opacity: 0.75;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

h1 {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

/* top of every page: the <h1>, then an optional line or two under it */
header { margin-bottom: 2.5rem; }
header p { margin: 0.25rem 0 0; }
.byline { color: var(--muted); }
.byline { font-family: var(--mono); font-size: 0.8125rem; }

/* the directory: a two-column grid, label | links */
.directory {
  display: grid;
  grid-template-columns: 6rem 1fr;
  row-gap: 0.6rem;
  margin: 0;
}
.directory dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9375rem;
}
.directory dd { margin: 0; }

.directory ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.directory li + li::before {
  content: "·";
  color: var(--muted);
  padding: 0 0.6em;
}

/* contact: set apart, monospace, one entry per line */
.directory .contact { margin-top: 1.75rem; }
dd.contact ul {
  flex-direction: column;
  font-family: var(--mono);
  font-size: 0.9375rem;
}
dd.contact li::before { content: none; }
dd.contact .key {
  display: inline-block;
  width: 6ch;
  color: var(--muted);
}
dd.contact .to { color: var(--muted); }

/* placeholder for a page that doesn't exist yet: muted, not a link */
.soon { color: var(--muted); }
.soon::after { content: " (soon)"; font-size: 0.8em; }

/* dated entries (home "latest", /log/, tag pages): date | title, one per line */
ul.entries { display: block; }
ul.entries li {
  display: grid;
  grid-template-columns: 6rem 1fr;
  align-items: baseline;
}
ul.entries li::before { content: none; }

/* plain lists (/notes/, /projects/, /tags/) */
.list { list-style: none; margin: 0; padding: 0; }
.list li { margin-bottom: 0.6rem; }

/* small muted mono bits: dates, tags, counts */
.entries time,
.meta,
.tags {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.desc,
.empty { color: var(--muted); }

/* single pages: the h1 reads as a path, "dedyoc / log / …" */
h1 a { font-weight: 400; }
h1 .sep { color: var(--muted); font-weight: 400; }

/* prose (about, later notes): normal case, links underlined so they're easy to spot */
.prose { max-width: 70ch; }
.prose p,
.prose ul,
.prose ol { margin: 0 0 1.1em; }
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.prose h2 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
}
.prose code { font-family: var(--mono); font-size: 0.9em; }

footer {
  margin-top: 3.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

/* narrow screens: label above its links */
@media (max-width: 30rem) {
  .directory { grid-template-columns: 1fr; row-gap: 0; }
  .directory dd { margin-bottom: 1rem; }
  .directory .contact { margin-top: 0.75rem; }
  dd.contact { margin-top: 0; }
}
