/* roddyschrock.net — site.css
   One column, near-black on white, one link colour, and two things kept
   from the 2020 site (design Richard The, development Zach Krall): the
   Financier Display typeface in a few key places, and the glowing spheres
   that colour the type as they drift past (see assets/js/site.js). */

/* Financier Display, by Klim Type Foundry, under the site's web licence.
   Only the two licensed web weights are served; the trial fonts are not. */
@font-face {
  font-family: "Financier Display";
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/financier-display-web-light.woff2") format("woff2"),
       url("../fonts/financier-display-web-light.woff") format("woff");
}
@font-face {
  font-family: "Financier Display";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/financier-display-web-regular.woff2") format("woff2"),
       url("../fonts/financier-display-web-regular.woff") format("woff");
}

:root {
  --bg: #ffffff;
  --fg: #24292e;
  --muted: #6a737d;
  --rule: #e1e4e8;
  --link: #0f6b5c;
  --link-hover: #0a4f44;
  --selection-bg: #000000;
  --selection-fg: #ffffff;
  --measure: 40rem;          /* ~65–70 characters per line at this size */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
          "Apple Color Emoji", "Segoe UI Emoji";
  --serif: "Financier Display", "Times New Roman", Times, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #c9d1d9;
    --muted: #8b949e;
    --rule: #30363d;
    --link: #56c2ad;
    --link-hover: #7fd6c4;
    --selection-bg: #ffffff;
    --selection-fg: #000000;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* The spheres. A fixed canvas over the whole page, blended into it, so the
   page shows through untouched and only the type picks up the colour. It
   starts hidden; the script shows it once the shader is running, and only
   where blend modes exist. */
#gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  pointer-events: none;
  display: none;
}
@supports (mix-blend-mode: screen) {
  #gradient.on {
    display: block;
    mix-blend-mode: screen;
  }
  /* On the dark ground the sphere itself shows as a glow; keep it soft. */
  @media (prefers-color-scheme: dark) {
    #gradient.on { opacity: 0.55; }
  }
}
@media (prefers-contrast: more) {
  #gradient { display: none !important; }
}

/* Accessibility: keyboard users get a way past the header */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 0.5rem 1rem;
  text-decoration: none;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
}

/* Small header on inner pages: the name, linking home */
.site-header {
  margin-bottom: 2.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
}
.site-header a {
  color: inherit;
  text-decoration: none;
}
.site-header a:hover {
  color: var(--link);
}

/* Headings in Financier Display: the name very large and light, as on the
   old site; section headings regular. Everything else stays in the
   system sans so the CV reads quickly. */
h1 {
  font-family: var(--serif);
  font-size: 3.25rem;
  line-height: 1.05;
  font-weight: 300;
  letter-spacing: -0.005em;
  margin: 0 0 1.75rem;
  text-rendering: optimizeLegibility;
}
.page h1 {
  font-size: 2.75rem;
}

h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0;
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-rendering: optimizeLegibility;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 1.75rem 0 0.25rem;
}
h3 .org {
  font-weight: 400;
  color: var(--muted);
}

p {
  margin: 0 0 1.25rem;
}

/* The opening paragraph on the home page is set in the display face, large
   and light: the one place the old site's big type comes back whole. */
.home main > p:first-of-type {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 1.75rem;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
}
a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Standalone links (the forward link on the home page, the footer row)
   underline themselves on hover with a line that grows from the left,
   as the old site's email link did. */
.more,
.site-footer a {
  position: relative;
  display: inline-block;
  text-decoration: none;
}
.more::after,
.site-footer a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.05em;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.more:hover::after,
.more:focus-visible::after,
.site-footer a:hover::after,
.site-footer a:focus-visible::after {
  width: 100%;
}

/* The one forward link on the home page */
.more {
  font-weight: 600;
}

/* Portrait: small, honest, credited */
.portrait {
  margin: 0 0 2rem;
}
.portrait img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 3px;
}
.portrait figcaption {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* CV entries. The <span class="when"> inside the h3 leads each entry with
   its dates, as on jeremyzilar.com/work/resume. */
.entry {
  margin-bottom: 1.5rem;
}
.entry .when {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.entry p:last-child {
  margin-bottom: 0;
}

ul {
  padding-left: 1.2rem;
  margin: 0 0 1.25rem;
}
li {
  margin: 0.3rem 0;
}

/* Kind words, in the display face */
blockquote {
  margin: 0 0 1.75rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}
blockquote p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.375rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  text-rendering: optimizeLegibility;
}
blockquote footer {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Footer: a single row of plain links */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
}
.site-footer li {
  margin: 0;
}
.site-footer li:not(:last-child)::after {
  content: "·";
  margin: 0 0.6rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--link);
}
.site-footer .colophon {
  margin: 0.9rem 0 0;
  font-size: 0.8125rem;
}

/* Scroll fade-in. The class is added by the script, so without it nothing
   is ever hidden. */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .more::after,
  .site-footer a::after {
    transition: none;
  }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .wrap { padding: 2.25rem 1rem 3rem; }
  h1 { font-size: 2.5rem; }
  .page h1 { font-size: 2.25rem; }
  h2 { font-size: 1.5rem; }
  .home main > p:first-of-type { font-size: 1.5rem; }
  blockquote p { font-size: 1.25rem; }
}

@media print {
  body { font-size: 11pt; color: #000; background: #fff; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .skip, .site-footer, #gradient { display: none !important; }
  .fade-in { opacity: 1; transform: none; }
}
