/* dmedovich.com - static site styles. Editorial personal blog, dark theme. */

:root{
  --bg:#111111;
  --tx:#e8e6e1;        /* headings, nav active, titles */
  --body:#c9c6bf;      /* body copy */
  --muted:#8a8a8a;     /* dates, footer copyright */
  --muted2:#8f8c85;    /* footnotes, misc descriptions */
  --nav-off:#6b6b6b;   /* inactive nav */
  --line:#2a2a2a;      /* borders / dividers */
  --code-bg:#1a1a1a;
  --icon:#7d8590;      /* footer icon default */
  --accent:#3b82f6;    /* links, active dot, hover states */
  --serif:Georgia,"Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

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

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

body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--tx);
  font-family:var(--serif);
  font-synthesis:none;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

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

.skip{
  position:absolute;
  left:-9999px;
  top:0;
  z-index:100;
  background:var(--tx);
  color:var(--bg);
  padding:8px 14px;
  font-family:var(--mono);
  font-size:13px;
}

.skip:focus{
  left:8px;
  top:8px;
}

/* ---- shell ---- */

.page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.container{
  width:100%;
  max-width:960px;
  margin:0 auto;
  padding:56px 24px 0;
  flex:1 0 auto;
}

.wordmark{
  display:inline-flex;
  align-items:center;
  gap:14px;
  margin-bottom:52px;
  font-family:var(--mono);
  font-weight:600;
  font-size:14px;
  letter-spacing:.07em;
  color:var(--tx);
  cursor:pointer;
  background:none;
  border:0;
  padding:0;
}

.shell{
  display:flex;
  gap:48px;
  flex-wrap:wrap;
}

/* ---- sidebar nav ---- */

.nav{
  flex:0 0 140px;
  min-width:120px;
  display:flex;
  flex-direction:column;
  gap:14px;
  font-size:15px;
}

.nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--nav-off);
  cursor:pointer;
  transition:color .13s ease;
}

.nav-dot{
  width:5px;
  height:5px;
  flex-shrink:0;
  background:var(--accent);
  opacity:0;
  transition:opacity .13s ease;
}

.nav-link.is-active,
.nav-link[aria-current="page"]{
  color:var(--tx);
}

.nav-link.is-active .nav-dot,
.nav-link[aria-current="page"] .nav-dot{
  opacity:1;
}

/* ---- content column ---- */

.content{
  flex:1 1 480px;
  min-width:300px;
  padding-bottom:56px;
}

.view{
  display:block;
  scroll-margin-top:48px;
}

/* ---- About / bio ---- */

.bio p{
  margin:0 0 18px;
  max-width:600px;
  font-size:17px;
  line-height:1.7;
  color:var(--body);
}

.bio a{
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:2px;
}

.bio-gpg{
  margin-top:26px;
  font-family:var(--mono);
  font-size:12.5px;
  line-height:1.6;
  color:var(--muted2);
  overflow-wrap:anywhere;
}

.bio-gpg span{
  color:var(--nav-off);
}

.bio-gpg a{
  color:var(--muted2);
  text-decoration:none;
}

.bio-gpg a:hover{
  color:var(--accent);
}

/* ---- section heading ---- */

.section-title{
  margin:0 0 28px;
  font-size:22px;
  font-weight:700;
  color:var(--tx);
}

/* ---- Writing list ---- */

.post-list{
  display:flex;
  flex-direction:column;
}

.post-row{
  display:block;
  padding:14px 18px;
  margin:0 -18px;
  cursor:pointer;
  transition:background .13s ease;
}

.post-row:hover{
  background:rgba(255,255,255,.045);
}

.post-row-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:20px;
}

.post-row-title{
  font-size:16px;
  font-weight:700;
  color:var(--tx);
}

.post-row-date{
  font-family:var(--mono);
  font-size:13px;
  color:var(--muted);
  white-space:nowrap;
}

.post-row-excerpt{
  margin-top:6px;
  font-size:14px;
  line-height:1.6;
  color:var(--muted2);
}

/* ---- Misc / pet projects ---- */

.pet-list{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.pet{
  display:flex;
  gap:6px;
  align-items:baseline;
  font-size:16px;
  line-height:1.6;
}

.pet a{
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:2px;
}

.pet-desc{
  color:var(--muted2);
  font-size:14.5px;
}

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

.site-footer{
  flex-shrink:0;
  border-top:1px solid var(--line);
}

.footer-inner{
  width:100%;
  max-width:960px;
  margin:0 auto;
  padding:20px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}

.footer-copy{
  font-size:13px;
  color:var(--muted);
}

.footer-icons{
  display:flex;
  gap:14px;
  align-items:center;
}

.footer-icons a{
  display:flex;
  color:var(--icon);
  transition:color .13s ease;
}

.footer-icons a:hover{
  color:var(--accent);
}

.footer-icons svg{
  width:16px;
  height:16px;
  fill:currentColor;
}

/* ---- article (individual post) ---- */

.article-head{
  display:block;
}

.article-head h1{
  margin:0;
  max-width:600px;
  font-size:26px;
  font-weight:700;
  line-height:1.35;
  color:var(--tx);
}

.article-meta{
  width:100%;
  padding-top:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.language-switch{
  display:inline-flex;
  overflow:hidden;
  border:1px solid var(--line);
  font-family:var(--mono);
  font-size:11px;
  line-height:1;
}

.language-switch a,
.language-switch span{
  min-width:28px;
  padding:5px 7px;
  text-align:center;
  color:var(--muted);
}

.language-switch a{
  transition:color .13s ease, background .13s ease;
}

.language-switch a:hover{
  background:rgba(255,255,255,.045);
  color:var(--accent);
}

.language-switch .is-active{
  background:var(--line);
  color:var(--tx);
}

.article-date{
  order:-1;
  font-family:var(--mono);
  font-size:14px;
  color:var(--muted);
  white-space:nowrap;
}

.post-body{
  padding-top:22px;
  color:var(--body);
  font-size:17px;
  line-height:1.7;
}

.post-body p{
  margin:0 0 16px;
  max-width:640px;
}

.post-body strong{
  color:var(--tx);
}

.post-body h2{
  margin:28px 0 12px;
  font-size:19px;
  font-weight:700;
  line-height:1.35;
  color:var(--tx);
}

.post-body ul,
.post-body ol{
  margin:0 0 16px;
  padding-left:22px;
  max-width:640px;
}

.post-body li{
  margin:.35rem 0;
  line-height:1.7;
}

.post-body a{
  color:var(--accent);
  text-decoration:underline;
  text-underline-offset:2px;
}

.post-body blockquote{
  margin:20px 0;
  padding-left:16px;
  border-left:2px solid var(--line);
  color:var(--muted2);
  font-style:italic;
}

code{
  padding:.1em .35em;
  background:var(--code-bg);
  border:1px solid var(--line);
  color:var(--tx);
  font-family:var(--mono);
  font-size:.82em;
}

pre{
  margin:8px 0 24px;
  padding:16px 20px;
  overflow-x:auto;
  background:var(--code-bg);
  border:1px solid var(--line);
  color:var(--tx);
  font-family:var(--mono);
  font-size:13px;
  line-height:1.85;
}

pre code{
  padding:0;
  border:0;
  background:none;
  font-size:1em;
}

::selection{
  background:rgba(59,130,246,.28);
}

/* ---- responsive ---- */

@media (max-width:640px){
  .container{
    padding:40px 20px 0;
  }

  .wordmark{
    margin-bottom:40px;
  }

  .shell{
    gap:32px;
  }

  .nav{
    flex-basis:100%;
    flex-direction:row;
    flex-wrap:wrap;
    gap:20px;
  }

  .article-head h1{
    font-size:23px;
  }

}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    animation-duration:.001ms !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}
