/* IM Fell Double Pica - the Google Fonts build (v14, latin subset), served
   from this origin rather than fonts.gstatic.com so the page makes no
   third-party requests and visitors' IPs are not handed to Google.
   font-display:swap so the name is never invisible while loading. */
@font-face {
  font-family: "IM Fell Double Pica";
  src: url("/fonts/im-fell-double-pica-v14-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   dideric.is
   Single stylesheet, no build step, no external requests.
   Colours are defined once as custom properties and flipped for dark mode.
--------------------------------------------------------------------------- */

:root {
  /* Dark only. There is no light variant by design, so these are the values,
     not defaults to be overridden. */
  --bg:      #14130f;
  --fg:      #e8e4d9;
  --muted:   #9c968a;
  --rule:    #33302a;
  /* Green from the Gitea fell theme (--color-primary). 7.52:1 on this
     background, comfortably past WCAG AA. */
  --accent:  #42b983;

  --measure: 34rem;
  --fell: "IM Fell Double Pica", "Iowan Old Style", Georgia, serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: clamp(2rem, 6vw, 5rem) 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--measure); margin-inline: auto; }

/* --- masthead ----------------------------------------------------------- */

header { margin-bottom: 2.5rem; }

.identity {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.portrait {
  flex: 0 0 auto;
  width: 116px;
  height: 116px;
  border-radius: 3px;
  border: 1px solid var(--rule);
  /* explicit intrinsic size + aspect-ratio prevents layout shift on load */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(0.92);
}

@media (max-width: 26rem) {
  .identity { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .portrait { width: 96px; height: 96px; }
}

h1 {
  margin: 0 0 0.2rem;
  font-family: var(--fell);
  /* Fell has a small x-height, so it needs more size than a modern face */
  font-size: clamp(2.1rem, 1.7rem + 1.8vw, 2.9rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* Back-links live inside .tagline; without this they render in the UA's
   default blue rather than the site palette. */
.tagline a { color: var(--muted); text-decoration: none; }
.tagline a:hover,
.tagline a:focus-visible { color: var(--accent); text-decoration: underline; }

/* Footer links likewise */
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

/* --- navigation --------------------------------------------------------- */

nav {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

nav a { color: var(--accent); text-decoration: none; }
nav a:hover,
nav a:focus-visible { text-decoration: underline; }

/* --- prose -------------------------------------------------------------- */

main p { margin: 0 0 1.2rem; }

main a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* --- footer ------------------------------------------------------------- */

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

footer a { color: inherit; }

/* --- accessibility ------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Blog
--------------------------------------------------------------------------- */

.post-title {
  font-family: var(--fell);
  font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

/* --- index listing ------------------------------------------------------ */

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

.post-list li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list time {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.post-list a { text-decoration: none; }
.post-list a:hover { text-decoration: underline; }

/* --- post body ---------------------------------------------------------- */

.post { margin-top: 2rem; }

.post h1, .post h2, .post h3 {
  font-family: var(--fell);
  font-weight: 400;
  line-height: 1.2;
  margin: 2.2rem 0 0.6rem;
}
.post h1 { font-size: 1.6rem; }
.post h2 { font-size: 1.35rem; }
.post h3 { font-size: 1.15rem; }

.post ul, .post ol { padding-left: 1.3rem; }
.post li { margin-bottom: 0.35rem; }

.post blockquote {
  margin: 1.4rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

/* Inline code and blocks. Wide blocks scroll inside themselves so the page
   itself never scrolls horizontally on a phone. */
.post code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: color-mix(in srgb, var(--rule) 45%, transparent);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.post pre {
  margin: 1.4rem 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: color-mix(in srgb, var(--rule) 32%, transparent);
  border: 1px solid var(--rule);
  border-radius: 4px;
  line-height: 1.5;
}

.post pre code {
  background: none;
  padding: 0;
  font-size: 0.78rem;
}

.post img { max-width: 100%; height: auto; }

.post table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.9em;
}
.post th, .post td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.post hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* ---------------------------------------------------------------------------
   Syntax highlighting

   Pandoc/skylighting emits these classes at conversion time, so there is no
   JavaScript involved. Its bundled themes are single-mode, so the palette is
   defined here as custom properties and flipped for dark.

   Deliberately restrained: four hues against warm paper, not a rainbow.
   Blocks with no language tag emit no spans and stay plain, which is what we
   want for the directory listings in the vim post.
--------------------------------------------------------------------------- */

:root {
  --syn-key: #c98cce;  /* keyword, control flow */
  --syn-str: #93c07c;  /* string */
  --syn-fun: #7fb0dd;  /* function, import */
  --syn-num: #d6a066;  /* number, datatype, attribute */
  --syn-com: #7d786c;  /* comment */
}

/* pandoc wraps each highlighted block in <div class="sourceCode"> */
.post div.sourceCode { margin: 1.4rem 0; }
.post div.sourceCode pre { margin: 0; }

.post pre.sourceCode code { white-space: pre; }

.post .kw,                        /* keyword      */
.post .cf { color: var(--syn-key); font-weight: 600; }  /* control flow */

.post .st,                        /* string       */
.post .ch,                        /* char         */
.post .vs,                        /* verbatim str */
.post .ss { color: var(--syn-str); }                    /* special str  */

.post .fu,                        /* function     */
.post .im,                        /* import       */
.post .bu { color: var(--syn-fun); }                    /* builtin      */

.post .dv,                        /* decimal      */
.post .bn,                        /* base-n       */
.post .fl,                        /* float        */
.post .dt,                        /* datatype     */
.post .at,                        /* attribute    */
.post .cn { color: var(--syn-num); }                    /* constant     */

.post .co,                        /* comment      */
.post .do { color: var(--syn-com); font-style: italic; } /* documentation */

.post .va { color: inherit; }     /* variable: left plain, they dominate */
.post .op,                        /* operator     */
.post .ot { color: inherit; }     /* other        */

.post .er,                        /* error        */
.post .al { color: #b3261e; font-weight: 600; }         /* alert        */
.post .wa { color: var(--syn-num); font-style: italic; } /* warning     */

/* Archive notice on the blog index */
.archive-note {
  margin: 0.9rem 0 0;
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Resume
--------------------------------------------------------------------------- */

/* The resume needs a wider measure than prose: job entries have a title on
   the left and dates on the right. */
.wrap-wide { max-width: 42rem; }

.resume-title {
  margin: 0.1rem 0 0.5rem;
  font-family: var(--fell);
  font-size: 1.15rem;
  color: var(--accent);
}

.contact-line {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
}
.contact-line a { color: var(--accent); text-decoration: none; }
.contact-line a:hover { text-decoration: underline; }

/* No visible title on the resume header: the Experience label below does
   the separating, so keep the header itself tight. */
.wrap-wide header { padding-bottom: 0; margin-bottom: 0.5rem; }
.wrap-wide main > h2:first-child { margin-top: 1.6rem; }

/* Present for assistive tech, absent visually. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Experience has no heading, so the first entry sits under the header
   rule directly. Skills/Education keep their labels. */
.wrap-wide main > .job:first-child { padding-top: 0; border-top: 0; }
.wrap-wide main > h2:first-of-type { margin-top: 2rem; }

/* Section labels. Applies site-wide, not just the resume: it also styles
   "Elsewhere" on the homepage, which is intentional. */
main h2 {
  margin: 2.6rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.job {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.job:last-of-type { border-bottom: 0; }

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
}

.job-head h3 {
  margin: 0;
  font-family: var(--fell);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.25;
}
.job-head h3 a { text-decoration: none; }
.job-head h3 a:hover { text-decoration: underline; }

.job-head .sep  { color: var(--rule); }
.job-head .role { color: var(--muted); font-size: 0.92rem; }

.job-head .dates {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.job p { margin: 0.55rem 0 0; }

.stack {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.02em;
}

/* --- skills ------------------------------------------------------------- */

.skills {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.4rem 1rem;
  margin: 0.9rem 0 0;
}

.skills dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}

.skills dd { margin: 0; }

@media (max-width: 30rem) {
  .skills { grid-template-columns: 1fr; gap: 0.1rem; }
  .skills dd { margin-bottom: 0.6rem; }
  .job-head .dates { width: 100%; }
}

/* Elsewhere row and the /code link list */
.elsewhere { font-family: var(--mono); font-size: 0.82rem; }
.elsewhere a { text-decoration: none; }
.elsewhere a:hover { text-decoration: underline; }

.links { margin: 1.6rem 0 0; }
.links dt {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.links dt a { text-decoration: none; }
.links dt a:hover { text-decoration: underline; }
.links dd { margin: 0.2rem 0 0; color: var(--muted); }

/* Native MathML: no images, no JS, and it inherits the text colour so it
   works on the dark background (the old rendered PNG had a white one). */
.post math {
  font-size: 1.15em;
  margin: 1.6rem 0;
}
.post math[display="block"] {
  display: block;
  text-align: center;
  overflow-x: auto;
}
