/* navy panel like the banner, white page for reading */
:root {
  --paper: #ffffff;
  --bar: #f2f4f7;
  --ink: #0c1b33;
  --muted: #566175;
  --accent: #0b3d91;
  --red: #c8201a;
  --ochre: #8a4b00;
  --rule: #d4dae3;
  --code: #f4f6f9;
  --panel: linear-gradient(160deg, #0a1e46 0%, #12357a 100%);
  --panel-ink: #ffffff;
  --panel-muted: #b9cdf5;
  --hot: #ff5a5f;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --serif: "Source Serif 4", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
  --paper: #0a1220;
  --bar: #0f1a2c;
  --ink: #e2e7ef;
  --muted: #8e99ab;
  --accent: #7fb0ff;
  --red: #ff6b5e;
  --ochre: #e0b36a;
  --rule: #22314a;
  --code: #0f1a2c;
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  font: 20px/1.7 var(--serif);
  font-optical-sizing: auto;
}

.page { min-height: 100vh; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

.side {
  background: var(--panel);
  color: var(--panel-ink);
  font-family: var(--mono);
  font-size: .8rem;
  padding: 2rem 1rem 1.2rem;
}

.side .name {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--panel-ink);
  text-decoration: none;
}

.side .name::after { content: ""; display: block; width: 3rem; height: 4px; background: var(--hot); margin-top: .6rem; }
.side .tag { color: var(--panel-muted); margin: .7rem 0 1.6rem; }
.side nav a, .side .projects a { display: block; color: var(--panel-ink); text-decoration: none; padding: .15rem 0; }
.side nav a:hover, .side .projects a:hover { color: var(--hot); }
.side .projects { margin-top: 1.8rem; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.side .label { text-transform: uppercase; letter-spacing: .1em; color: var(--hot); font-weight: 600; margin: 0 0 .5rem; }
.side .projects a { font-weight: 600; margin-top: .5rem; }
.side .projects span { display: block; color: var(--panel-muted); line-height: 1.4; }

main { padding: 2rem 1rem 3rem; min-width: 0; }
main > :not(.hero):not(article), article > :not(.hero) { max-width: 63rem; }

@media (min-width: 62rem) {
  .page {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .side {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 3rem 2rem;
  }

  main { padding: 3rem 4.5rem; }
}

@media (max-width: 61.99rem) {
  .side { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
  .side .name::after { display: none; }
  .side .tag { margin: 0; flex: 1; }
  .side nav { display: flex; gap: 1rem; width: 100%; margin-top: .4rem; }
  .side .projects { display: none; }
}

h1 { font-size: 2.6rem; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .6rem; }

h2, h3 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .02em;
}

h2 {
  font-size: .95rem;
  text-transform: uppercase;
  margin: 2.8rem 0 1rem;
  padding-top: .6rem;
  border-top: 1px solid var(--rule);
}

h3 { font-size: .9rem; margin-top: 2rem; }

.meta, .posts time, .posts .repo, footer.site {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
}

.meta { margin-bottom: 2.4rem; }
.meta a { color: var(--muted); }

.intro p:first-child { font-size: 1.15rem; }

.posts { list-style: none; padding: 0; margin: 3rem 0; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.posts li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) 8rem;
  gap: .2rem 1rem;
  padding: .9rem .6rem;
}
.posts li:nth-child(odd) { background: var(--bar); }
.posts time { padding-top: .3rem; font-variant-numeric: tabular-nums; }
.posts a { font-size: 1.12rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.posts a:hover { color: var(--red); }
.posts p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.posts .repo { padding-top: .3rem; text-align: right; }

@media (max-width: 36rem) {
  .posts li { grid-template-columns: 1fr; }
  .posts .repo { display: none; }
}

code {
  font: .82em/1.5 var(--mono);
  background: var(--code);
  padding: .08em .3em;
}

pre {
  background: var(--code);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.6;
  margin: 1.6rem 0;
}

pre code { background: none; padding: 0; font-size: inherit; line-height: inherit; }

blockquote {
  margin: 1.6rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.8rem 0;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
}
th { font: 600 .75rem var(--mono); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--ink); }
th, td { padding: .45rem .7rem; text-align: left; }
tbody tr:nth-child(odd) { background: var(--bar); }

.back { margin-top: 3.5rem; font-family: var(--mono); font-size: .8rem; }

footer.site { margin-top: 4.5rem; padding-top: .8rem; border-top: 3px double var(--ink); }

.highlight .k, .highlight .kd, .highlight .kt, .highlight .kr, .highlight .kn { color: var(--accent); font-weight: 500; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sc, .highlight .si { color: var(--ochre); }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic; }
.highlight .m, .highlight .mi, .highlight .mf { color: var(--red); }

/* same block as the banner and the post images */
.hero {
  background: var(--panel);
  color: var(--panel-ink);
  margin: -2rem -1rem 2.5rem;
  padding: 2.5rem 1rem 2.2rem;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.hero .kicker { font: 600 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hot); margin: 0 0 .7rem; }
.hero h1 { color: var(--panel-ink); max-width: 46rem; }
.hero h1::after { content: ""; display: block; width: 5rem; height: 5px; background: var(--hot); margin-top: 1.1rem; }
.hero .lead, .hero .meta { font-family: var(--mono); font-size: .85rem; color: var(--panel-muted); margin: 1rem 0 0; }
.hero .meta a { color: var(--panel-muted); }
.hero a:hover { color: var(--hot); }

@media (min-width: 62rem) {
  .hero { margin: -3rem -4.5rem 3rem; padding: 4rem 4.5rem 3rem; }
}

.hero { position: relative; }
.hero .diagram { display: none; position: absolute; right: 4.5rem; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .55); }
@media (min-width: 90rem) { .hero .diagram { display: block; } }
