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

:root {
  --font:      monospace;
  --bg:        #101214;
  --bg-2:      #1a1d1f;
  --text:      #929599;
  --text-2:    #777777;
  --text-3:    #505356;
  --heading:   #c8c8c8;
  --accent:    rgb(53, 161, 214);
  --accent-hi: rgb(126, 212, 255);
  --border:    rgba(58, 58, 58, 1);
  --radius:    8px;
  --max-w:     768px;
}

html { font-family: var(--font); font-size: 16px; line-height: 1.6; background: var(--bg); }
body { background: var(--bg); color: var(--text); }
img  { display: block; max-width: 100%; }
a    { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }

strong {
  color: var(--heading);
}

/* Layout */
header, main, footer { max-width: var(--max-w); margin: 0 auto; padding: 0 1em; }
main   { padding-top: 3rem; padding-bottom: 4rem; }

main p {
    margin-bottom: 1em;
    line-height: 1.4;
}

main ul {
    padding-left: 2em;
    margin-bottom: 1em;
    line-height: 1.4;
}

footer {
    padding-top: 2rem;
    padding-bottom: 2rem;
    font-size: 16px;
    color: var(--text-2);
    text-align: center;
}

.text-right {
    font-size: 12px;
    text-align: right;
    margin-bottom: 1.5em;
    line-height: 0.1em;
}

.xana-img {
    width: 50%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius)
}

/* Header */
header {
  text-align: center;
  padding: 2em 0 0;
  margin-bottom: 0;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75em;
  border: 1px solid var(--border);
}

.site-name {
  font-size: 32px;
  font-weight: bold;
  color: var(--heading);
  margin-bottom: 0.3em;
  line-height: 1;
}

.site-role {
  font-size: 16px;
  color: var(--text-2);
  margin-bottom: 1em;
}

/* Nav */
nav ul {
  list-style: none;
  margin-bottom: 0;
  text-align: center;
}

nav li {
  display: inline-block;
  margin: 0 0.5em;
}

nav a {
  font-size: 17px;
  color: var(--accent);
}

nav a:hover {
  color: var(--accent-hi);
  text-decoration: none;
}

nav a.selected {
  color: var(--heading);
  text-decoration: none;
}

/* Page title + separator */
.page-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--heading);
  margin-bottom: 0.2em;
  line-height: 1;
}

hr {
  border: none;
  height: 1px;
  background-color: var(--text);
  margin-top: 0;
  margin-bottom: 1.5em;
}

/* Projects section */
.projects h2 {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

section.projects {
    margin-top: 3em;
}

/* Project card */
.project-card {
  display: block;
  text-decoration: none;
}

.project-card:hover {
  text-decoration: none;
}

.card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.project-card:hover .card-media {
  border-color: var(--text);
}

.project-card:hover .card-media[data-gif] {
  background-image: var(--gif-url) !important;
}

.card-body {
  padding: 0.5rem 0 0;
  text-align: center;
}

.card-body h3 {
  font-size: 18px;
  font-weight: bold;
  color: var(--heading);
  margin-bottom: 0.1em;
}

.card-body p {
  font-size: 16px;
  color: var(--text-2);
  margin-bottom: 0;
}

.preload-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Project page */
.project-page { max-width: 680px; }

.project-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.project-header { margin-bottom: 2rem; }
.project-header .project-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
  margin-bottom: 0.4rem;
}
.project-header h1    { font-size: 1.5rem; font-weight: bold; color: var(--heading); margin-bottom: 0.3rem; }
.project-subtitle     { font-size: 15px; color: var(--text-2); }

.project-body { font-size: 15px; line-height: 1.75; color: var(--text); }
.project-body h2 { font-size: 1rem; font-weight: bold; color: var(--heading); margin: 2rem 0 0.5rem; }
.project-body p  { margin-bottom: 1rem; }
.project-body a  { color: var(--accent); }
.project-body a:hover { color: var(--accent-hi); }

/* Responsive */
@media (max-width: 540px) {
  .hero   { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .avatar { width: 80px; height: 80px; }
  .project-grid { grid-template-columns: 1fr; }

  body, p, code { font-size: 14px; }
}

/* Blog image and videos */
.blog-img {
    width: 100%;
    display: block;
    margin: 0 auto;
    margin-bottom: 1em;
    border-radius: var(--radius);
}

.yt-video {
    display: block;
    margin: 0 auto;
    margin-bottom: 1em;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
}

.yt-video iframe {
    border: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius);
    margin: 0 auto;
}

/* Blog sections */
.blog-section {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg-2);
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  padding: 1.25em;
}

.blog-section-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--heading);
  margin-bottom: 0.75em;
}

.blog-section-flexbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5em;
}

.blog-section-image {
  width: 100%;
  max-width: 650px;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
  margin-bottom: 1em;
}
