/* Outfit for titles and headings, Figtree for text. Both are SIL Open Font
   License fonts from Google Fonts, kept here in fonts/ (licenses alongside). */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-italic-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-italic-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    url("img/bg-main.jpg") no-repeat center top,
    url("img/bubbles-bottom.jpg") repeat-x center bottom,
    #334;
  color: #141414;
  font: 1rem/1.6 Figtree, "Century Gothic", sans-serif;
}

a { color: #228; text-underline-offset: .16em; }
a:hover { color: #22f; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.wrap {
  width: min(922px, calc(100% - 2rem));
  margin-inline: auto;
}

.visually-hidden,
h1.site-name,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  z-index: 1;
  top: .5rem;
  left: .5rem;
  padding: .5rem 1rem;
  background: white;
}

.masthead-inner {
  position: relative;
  min-height: 99px;
  padding: 8px 0 8px 420px;
}

/* On the other pages the logo (part of bg-main.jpg) links home. */
a.site-name {
  position: absolute;
  top: 8px;
  left: 0;
  width: 400px;
  height: 76px;
  overflow: hidden;
  color: transparent;
}

.masthead nav,
.links,
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.masthead nav a {
  min-width: 60px;
  font-size: 1.15rem;
  line-height: 20px; /* with the padding, 60px tall: one dot in color-dots.png */
  text-decoration: none;
  padding: 20px 5px;
  text-align: center;
  color: #eee;
}

.masthead nav a:hover,
.masthead nav a:focus-visible,
.masthead nav a[aria-current] {
  color: white;
  background: url("img/color-dots.png") no-repeat;
}

.masthead nav a:nth-child(2) { background-position: 0 -60px; }
.masthead nav a:nth-child(3) { background-position: 0 -120px; }
.masthead nav a:nth-child(4) { background-position: 0 -180px; }
.masthead nav a:nth-child(5) { background-position: 0 -240px; }
.masthead nav a:nth-child(6) { background-position: 0 -300px; }
.masthead nav a:nth-child(7) { background-position: 0 -360px; }
.masthead nav a:nth-child(8) { background-position: 0 -60px; }

main.wrap {
  position: relative;
  display: flow-root; /* holds in floated screenshots at the end of a page */
  padding: 16px clamp(14px, 3vw, 24px) 20px;
  border-inline: 1px solid #000;
  background:
    url("img/content-body.jpg") repeat #e3e5e3;
}

main::before,
main::after {
  position: absolute;
  right: -1px;
  left: -1px;
  height: 11px;
  background: url("img/content-caps.png") no-repeat center top / 100% 22px;
  content: "";
}

main::before { bottom: 100%; }
main::after { top: 100%; background-position: center bottom; }

h2, h3, h4, p { margin: 0; }
h2, h3, h4 { line-height: 1.25; }
h1, h2, h3, h4, dt,
.masthead nav {
  font-family: Outfit, "Century Gothic", sans-serif;
  font-weight: 600;
}
p { max-width: 65ch; }


/* --- home page ----------------------------------------------------------- */

.projects { display: grid; gap: 1.5rem; }

.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  align-items: start;
  gap: .75rem 1.25rem;
}

.project-feature h3 { margin-bottom: .4rem; font-size: 1.35rem; }
/* Links to a project: pills, the first one (usually "Play" or "Read") filled in. */
.links { gap: .5rem; margin: .75rem 0 1rem; padding: 0; list-style: none; }
.links a {
  display: inline-block;
  padding: .22rem .8rem;
  border: 1px solid #228;
  border-radius: 999px;
  background: rgb(255 255 255 / .6);
  font-size: .9rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}

.links li:first-child a { color: white; background: #228; }
.links a:hover,
.links li:first-child a:hover { border-color: #22f; color: white; background: #22f; }
/* Every pill ends in a chunky arrow (an SVG mask, so it takes the text color). */
.links a::after {
  display: inline-block;
  width: .75em;
  height: .75em;
  margin-left: .35em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h10.5M8.5 3.5 13 8l-4.5 4.5' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  content: "";
}

.screenshot {
  position: relative;
  display: block;
  width: min(100%, 340px);
  aspect-ratio: 340 / 260;
  margin-bottom: .5rem;
}

.screenshot img {
  position: absolute;
  inset: 3.85% 2.94%;
  width: 94.12%;
  height: 92.3%;
  background: #151526;
  object-fit: contain;
}

.screenshot::after {
  position: absolute;
  inset: 0;
  background: url("img/screenshot-frame-3.png") no-repeat left top / 100% 200%;
  pointer-events: none;
  content: "";
}

.footer {
  justify-content: center;
  gap: 1rem;
  padding-block: 26px 110px;
  color: #eee;
  font-size: .8rem;
}

.footer a { color: inherit; }

/* --- section pages (Games, Music, ...) --------------------------------- */

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

.section-page main h2 {
  clear: both;
  margin: 1.75rem 0 .5rem;
  padding-bottom: .2rem;
  border-bottom: 1px solid #999;
  font-size: 1.45rem;
}

.section-page main h2:first-of-type { margin-top: 0; }
.section-page main p,
.section-page main ul { max-width: none; margin: 0 0 .75rem; }

.right {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.screenshots .screenshot + .screenshot { margin-top: .75rem; }

a.screenshot:hover::after { background-position: left bottom; }

.quote {
  margin: 1rem 2.5rem;
  padding: .6rem 1rem;
  border-left: 1px solid #999;
  font-style: italic;
}

.unixline {
  width: min(500px, 100%);
  padding: 3px 7px;
  border: 0;
  color: #cc6;
  background: #000;
  font-family: monospace;
}

main table { max-width: 100%; }

.story { display: grid; justify-items: center; gap: 1rem; margin: 1.5rem 0; text-align: center; }

.games dt { margin-top: .9rem; font-weight: bold; }
.games dd { margin: .2rem 0 0 1.5rem; }
.games dd p { margin: 0; }

.elsewhere { padding: 0; list-style: none; }
.elsewhere a { display: inline-block; min-width: 6rem; }

/* --- blog ---------------------------------------------------------------- */

.blog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 2rem;
}

.page-title { margin-bottom: 1rem; font-size: 1.75rem; }

.post + .post { margin-top: 2.25rem; }
.post h1,
.post h2 {
  padding-bottom: .2rem;
  border-bottom: 1px solid #999;
  font-size: 1.5rem;
}

.post-date { margin: .2rem 0 .9rem; color: #444; font-size: .85rem; }
.private-note { margin-bottom: .9rem; color: #900; }
.comment-count { font-size: .85rem; }

.entry { display: flow-root; }
.entry p,
.entry ul,
.entry ol,
.entry blockquote,
.entry table { margin: 0 0 .9rem; }

.alignleft { float: left; margin: .25rem 1rem .5rem 0; }
.alignright { float: right; margin: .25rem 0 .5rem 1rem; }
.aligncenter { display: block; margin-inline: auto; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: .85rem;
}

.post-nav .next { margin-left: auto; }
.post + .post-nav { margin: 1.5rem 0 0; }

.comments { margin-top: 2rem; }
.comments h2 { margin-bottom: .5rem; font-size: 1.3rem; }
.comment-list,
.comment-list ol { margin: 0; padding: 0; list-style: none; }
.comment-list ol { margin-left: 1.5rem; }
.comment { margin: 1rem 0; padding-left: 1rem; border-left: 1px solid #999; }
.comment-meta { margin-bottom: .3rem; font-size: .8rem; }
.comment-meta cite { font-style: normal; font-weight: bold; }
.comment-body p { margin: 0 0 .5rem; }
.comments-closed { margin-top: 1rem; font-style: italic; }

.sidebar {
  padding-left: 1.25rem;
  border-left: 1px solid #999;
  font-size: .85rem;
}

.sidebar > * + * { margin-top: 1.4rem; }
.sidebar h2 {
  margin-bottom: .35rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid #999;
  font-size: 1.15rem;
}

.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li + li { margin-top: .15rem; }
.sidebar p { margin-top: .5rem; }
.archives .year { font-weight: bold; }
.archives ul { margin: 0 0 .5rem .75rem; }

.search { display: flex; flex-wrap: wrap; gap: .35rem; }
.search label { width: 100%; font-weight: bold; }
.search input { flex: 1; min-width: 0; font: inherit; }
.search button { font: inherit; }

#search-results { margin: 1rem 0 0 1.25rem; padding: 0; }
#search-results li { margin-bottom: .9rem; }
.search-date { margin-left: .4rem; color: #666; font-size: .85em; }
.search-snippet { margin: .15rem 0 0; }
mark { background: #ffe98a; }

@media (max-width: 800px) {
  .blog { grid-template-columns: 1fr; }
  .sidebar { padding: 1.25rem 0 0; border-top: 1px solid #999; border-left: 0; }
  .archives { columns: 3; }
  .archives > li { break-inside: avoid; }
}

@media (max-width: 959px) {
  body { background-position: left -195px top, center bottom; background-size: 1060px auto, auto; }
  .masthead-inner { padding: 64px 0 12px; }
  a.site-name { top: 0; width: min(400px, 100%); height: 64px; }
  .masthead nav { width: fit-content; background-color: #334; }
  .masthead nav a { padding-block: 10px; }
}

@media (max-width: 580px) {
  .masthead nav { display: grid; width: 100%; grid-template-columns: repeat(4, 1fr); }
  .masthead nav a { min-width: 0; }
  .project-feature { grid-template-columns: 1fr; }
  .right { float: none; margin: 0 0 1rem; }
  .archives { columns: 2; }
}
