:root {
  --theme: #a33b2e;
  --text: #222;
  --bg: hsl(34, 26%, 95%);
  --muted: #888;
  --subtle: #555;
  --faint: #aaa;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-body: "Lato", system-ui, sans-serif;
  --font-my-name: var(--font-body);
  --code-bg: hsla(0, 0%, 0%, 0.04);
  --code-border: hsla(0, 0%, 0%, 0.08);
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

a {
  color: var(--theme);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 a, h2 a {
  color: inherit;
}

h1 a:hover, h2 a:hover {
  color: var(--theme);
}

/* header */
header nav {
  font-family: var(--body);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--faint);
}

header nav div {
  display: flex;
  gap: 0.75rem;
}

header nav div a + a::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--faint);
  text-decoration: none;
  display: inline-block;
}

.site-name {
  font-family: var(--font-my-name);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
}

/* home */
.about {
  font-family: var(--font-body);
  line-height: 1.7;
}

.about p {
  margin-bottom: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 2rem 0;
}

/* post list */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 2rem;
}

.post-item a {
  font-weight: 600;
  font-size: 1.1rem;
}

.post-item time {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.2rem 0 0.4rem;
}

.post-item p {
  font-family: var(--font-body);
  color: var(--subtle);
  font-size: 0.95rem;
}

/* single post */
article h1 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

article h2 {
  margin-bottom: 0.5rem;
}

article time {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

article img {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.1);
  display: block;
  margin: 0 auto;
}

.video-wrapper {
  border-radius: 6px;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.1);
  overflow: hidden;
  margin: 0 auto;
}

.video-wrapper video,
.video-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
}

article figure {
  margin: 0 auto 1.5rem;
  text-align: center;
}

article figcaption {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

article figcaption p {
  margin: 0;
}

article ul, article ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.spoiler {
  background: var(--text);
  color: var(--text);
  border-radius: 3px;
  padding: 0 0.2em;
  transition: color 0.15s;
}

.spoiler:hover {
  color: var(--bg);
}

blockquote {
  border-left: 3px solid var(--theme);
  padding-left: 1rem;
  margin: 0 0 1rem 1rem;
  color: var(--subtle);
  font-style: italic;
}

article p {
  font-family: var(--font-body);
  margin-bottom: 1rem;
}

/* inline code */
code {
  font-size: 0.9em;
  color: var(--theme);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.15em 0.35em;
}

pre {
  background: #111 !important;
  color: hsl(34, 26%, 90%);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 1.2em;
}

pre code {
  color: inherit;
  background: inherit;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* carousel */
article .carousel {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 1rem;
  padding: 0.5rem 0 1rem;
  margin: 0 0 1.5rem;
  scrollbar-width: thin;
}

article .carousel-slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  margin: 0;
  text-align: center;
}

article .carousel-slide img {
  max-width: none;
  max-height: 500px;
  width: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.1);
}

article .carousel-slide figcaption {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

article .carousel-slide figcaption p {
  margin: 0;
}

/* projects */
.project {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.project-image {
  flex-shrink: 0;
  width: 240px;
}

.project-image img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 1px 4px hsla(0, 0%, 0%, 0.1);
}

.project-body h2 {
  margin-bottom: 0.5rem;
}

.project-body p {
  font-family: var(--font-body);
  margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
  .project {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
  }
}

/* footer */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--faint);
}
