/* jack-kraus.net
   A maple, a tall sky, a small daytime moon. Sky blue for links, the maple's red for labels,
   warm white for the page. One column, no scripts, no third parties. */

@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f9f5;
  --ink: #1d2a33;
  --muted: #5f6f7a;
  --rule: #d6e0d8;
  --accent: #c2502a;
  --link: #1f5fa8;
  --sky: #7fa3dc;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "URW Palladio L", "P052", Charter, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", "URW Gothic", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Hero: the image at its own proportions, name set in the empty sky */

.hero {
  position: relative;
  background: var(--sky);
}

.hero img {
  display: block;
  width: 100%;
  height: clamp(15rem, 42.4vw, 46rem);
  object-fit: cover;
  object-position: 50% 60%;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 78, 150, 0.34), rgba(22, 78, 150, 0) 58%);
  pointer-events: none;
}

.title {
  position: absolute;
  left: clamp(1.5rem, 7vw, 7rem);
  top: 64%;
  transform: translateY(-50%);
  max-width: min(27rem, 44vw);
  color: #fff;
  text-shadow: 0 1px 14px rgba(16, 60, 120, 0.45);
}

h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2rem, 1rem + 3.4vw, 4.2rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  white-space: nowrap;
}

.lede {
  margin: 1.1rem 0 0;
  font-style: italic;
  line-height: 1.45;
  text-wrap: balance;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

nav a {
  color: inherit;
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
}

nav a:hover {
  color: inherit;
  border-bottom-color: transparent;
}

/* Narrow screens: the picture on its own, the name beneath it */

@media (max-width: 54rem) {
  .hero {
    background: none;
  }
  .hero::before {
    display: none;
  }
  .title {
    position: static;
    transform: none;
    max-width: 38rem;
    margin-inline: auto;
    padding: 2rem 1.5rem 0;
    color: var(--ink);
    text-shadow: none;
  }
  h1 {
    white-space: normal;
    font-weight: 300;
  }
  .lede {
    color: var(--muted);
  }
  nav a {
    color: var(--accent);
    border-bottom-color: transparent;
  }
}

/* Column */

main,
footer {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main {
  flex: 1;
}

/* Sections */

section {
  margin-top: 3.75rem;
  scroll-margin-top: 1.5rem;
}

h2 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

p {
  margin: 0;
  text-wrap: pretty;
}

p + p {
  margin-top: 1em;
}

/* Research entries */

article {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

article:first-of-type {
  padding-top: 0;
}

article header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
}

h3 {
  margin: 0;
  font-size: 1.12em;
  font-weight: 400;
  line-height: 1.3;
  text-wrap: balance;
}

.meta {
  flex: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.byline {
  margin-top: 0.3rem;
  font-size: 0.9em;
  font-style: italic;
  color: var(--muted);
}

article .byline + p {
  margin-top: 0.7rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 0.8rem;
  font-size: 0.92em;
}

.more {
  margin-top: 1.5rem;
  color: var(--muted);
}

/* Links */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

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

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 4.5rem 2rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

footer a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: #bcdcf7;
  color: var(--ink);
}

@media (max-width: 30rem) {
  article header {
    flex-direction: column;
    gap: 0.15rem;
  }
}

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

@media print {
  .hero img,
  .hero::before,
  nav {
    display: none;
  }
  .title {
    position: static;
    transform: none;
    color: #000;
    text-shadow: none;
  }
  body,
  html {
    background: none;
  }
}
