:root {
  --text: #222;
  --accent: #a63d2f;
  --muted: #9a9a9a;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html {
  font-size: 17px;
}

body {
  font-family: var(--serif);
  color: var(--text);
  background: #fff;
  line-height: 1.65;
}

.container {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 2.75rem 0 0;
  margin-bottom: 4.5rem;
}

.site-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #000;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

nav a {
  margin-left: 1.5rem;
  font-size: 1.15rem;
  color: #333;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

nav a:first-child {
  margin-left: 0;
}

nav a.active {
  color: var(--accent);
}

nav a.nav-cv {
  color: var(--muted);
}

nav a:hover {
  color: var(--accent);
}

/* Content */
main {
  font-size: 1.15rem;
}

main p {
  margin-bottom: 1.4rem;
}

main a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* About page */
.about-sidebar {
  float: right;
  width: 230px;
  max-width: 40%;
  margin: 0 0 1.25rem 2.25rem;
}

.about-photo {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.about-links {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 0.9rem;
}

.about-links a {
  color: #222;
  position: relative;
}

.about-links a:hover {
  color: var(--accent);
}

.about-links a::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #222;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.about-links a::before {
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border: 5px solid transparent;
  border-bottom-color: #222;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.about-links a:hover::after,
.about-links a:focus-visible::after,
.about-links a:hover::before,
.about-links a:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.about-links svg {
  width: 22px;
  height: 22px;
  display: block;
}

.about-text {
  text-align: justify;
  hyphens: auto;
}

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

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 2.75rem;
}

.post-list .post-title {
  font-size: 1.45rem;
  color: #111;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.post-list .post-title:hover {
  color: var(--accent);
}

.post-meta {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Single post */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.post-header .post-meta {
  display: block;
}

/* Toast notification */
#toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #2f6fd0;
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  header {
    margin-bottom: 3rem;
  }

  nav a {
    margin-left: 1rem;
    font-size: 1.05rem;
  }

  .about-sidebar {
    float: none;
    margin: 0 auto 1.5rem;
    max-width: 60%;
  }

  .post-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}
