:root {
  --text-muted: #666;
  --text-primary: #fff;
  --text-secondary: #aaa;
  --bg: #000;
  --border: #333;
}

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

@font-face {
  font-family: 'GeistMono';
  src: url('/fonts/geistmono.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  background: var(--bg);
  font-family: 'GeistMono', monospace;
  color: #fff;
  margin: 0;
  padding: clamp(1.5rem, 5vw, 5rem);
  line-height: 1.75;
  font-size: clamp(0.84375rem, 0.8125rem + 0.1563vw, 1rem);
  display: flex;
  flex-direction: column;
  min-height: 100dvh; /* respects mobile browser chrome */
}

a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: #444;
  text-underline-offset: 3px;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

a:hover {
  color: #aaa;
  text-decoration-color: #aaa;
  text-decoration-thickness: 2px;
}

a:visited {
  color: #fff;
}

/* start arrow styling for links */

a[href^="http"]::after {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2ch;
  margin-top: 0.3em;
  vertical-align: top;
  opacity: 0.6;
  background-color: #aaa;
  -webkit-mask: url('/assets/arrow.svg') no-repeat center / contain;
  mask: url('/assets/arrow.svg') no-repeat center / contain;
  transform: translate(0, 0);
}

a[href^="http"]:hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* end arrow styling for links */

.prose {
  max-width: 920px;
}

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

/* start code highlighting */
.code {
  color: #c5c9c5;
  background-color: #0d0c0c;
}

.comment,
.punctuation.definition.comment {
  color: #595b56;
  font-style: italic;
}
.keyword.control,
.keyword.operator.word {
  color: #e46876;
}
.keyword {
  color: #7fb4ca;
}
.storage.type,
.storage.modifier {
  color: #7fb4ca;
}
.string,
.string.quoted,
.string.template {
  color: #87a987;
}
.constant.character.escape {
  color: #7aa89f;
}
.constant.numeric {
  color: #e6c384;
}
.constant.language {
  color: #e6a96d;
}
.entity.name.function,
.meta.function-call.generic {
  color: #7aa89f;
}
.entity.name.type,
.entity.name.class,
.support.type,
.support.class {
  color: #938aa9;
}
.variable,
.variable.other {
  color: #c5c9c5;
}
.variable.parameter {
  color: #8ba4b0;
}
.variable.other.property,
.support.variable.property {
  color: #8ea4a2;
}
.entity.name.decorator,
.meta.decorator {
  color: #e6a5c9;
}
.entity.name.tag {
  color: #e46876;
}
.entity.other.attribute-name {
  color: #7fb4ca;
}
.keyword.operator {
  color: #a6a69c;
}
.punctuation {
  color: #686b64;
}
.entity.name.namespace,
.entity.name.module {
  color: #99a4cc;
}
.support.type.property-name.css {
  color: #7aa89f;
}
.support.constant.property-value.css,
.meta.property-value.css {
  color: #a292a3;
}
.entity.other.attribute-name.class.css,
.entity.other.attribute-name.id.css {
  color: #d98aad;
}
/* end code highlighting */

/* start nav stuff */
nav .nav-brand {
  display: block;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: bold;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

nav .nav-links {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* end nav stuff */

/* start post stuff */
.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

.meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

pre .meta {
    display: inline;
}

.description {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  margin: 0;
}

article {
  margin-top: 1rem;
  max-width: 50rem;
}

article h1,
article h2,
article h3 {
  color: var(--text-primary);
}

article code {
  background: #111;
  color: var(--text-secondary);
  padding: 0.15rem 0.4rem;
  font-family: inherit;
  font-size: 0.9em;
}

article pre {
  background: #111;
  padding: 1rem;
  overflow-x: auto;
  max-width: 100%;
  margin: 1.25rem 0;
}

article pre code {
  background: none;
  padding: 0;
}

article img {
  max-width: 90%;
  height: auto;
  display: block;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  padding: 1.25rem 0;
}

.post-card:first-child {
  border-top: 1px dashed var(--border);
}

.post-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card h2 {
  margin: 0 0 0.25rem 0;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.post-card a:hover h2 {
  color: var(--text-secondary);
}
/* end post stuff */

/* start lain */
.site-grid {
  display: grid;
  grid-template-columns: minmax(0, 920px) 325px;
  gap: 5rem;
  align-items: start;
}

.lain-panel img {
  width: 100%;
  image-rendering: pixelated;
  position: sticky;
  top: 12rem;
}

@media (max-width: 768px) {
  .site-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .lain-panel {
    display: none;
  }
}
/* end lain */

/* start misc stuff */
@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
  a[href^="http"]::after {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a[href^="http"]::after {
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
}
/* end misc stuff */