/* Catppuccin Mocha */
:root {
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --text: #cdd6f4;
  --subtext: #a6adc8;
  --surface0: #313244;
  --surface1: #45475a;
  --blue: #89b4fa;
  --lavender: #b4befe;
  --mauve: #cba6f7;
  --pink: #f5c2e7;
  --green: #a6e3a1;
  --peach: #fab387;
  --yellow: #f9e2af;
  --teal: #94e2d5;
  --sky: #89dceb;
  --red: #f38ba8;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--base);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#dot-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.no-scroll {
  overflow: hidden;
}

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

a:hover {
  color: var(--lavender);
  text-decoration: underline;
}

/* Header */
header {
  border-bottom: 1px solid var(--surface0);
  padding: 0.25rem 0;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: var(--peach);
  z-index: 1000;
  box-shadow: 0 0 8px rgba(250, 179, 135, 0.5);
}

nav {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  display: flex;
  align-items: center;
}

.site-title:hover {
  text-decoration: none;
}

.site-logo {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--subtext);
}

.nav-links a:hover {
  color: var(--text);
}

/* Main */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

h1, h2, h3 {
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.75rem;
  color: var(--mauve);
}

h2 {
  font-size: 1.4rem;
  color: var(--pink);
  position: relative;
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.2rem;
  color: var(--lavender);
}

p {
  margin-bottom: 1rem;
}

strong, b {
  color: var(--peach);
  font-weight: 700;
}

em, i {
  color: var(--green);
}

ul, ol {
  list-style-position: inside;
  padding-left: 0;
  margin-bottom: 1rem;
}

/* Section CTA links */
.section-link {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.section-link a {
  color: var(--peach);
  font-weight: 700;
}

.section-link a:hover {
  color: var(--yellow);
  text-decoration: none;
}

/* Intro section */
.intro {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--mauve);
}

.intro-text h1 {
  margin-bottom: 0.5rem;
}

.intro-text p {
  margin-bottom: 0;
  color: var(--subtext);
}

/* Latest post on home */
.latest-post {
  background-color: var(--surface0);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 3px solid var(--teal);
}

.latest-post time {
  color: var(--subtext);
  font-size: 0.875rem;
}

.latest-post h3 {
  margin: 0.5rem 0;
}

.latest-post p {
  color: var(--subtext);
  margin-bottom: 0;
}

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

.post-list li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--surface0);
  padding-left: 1rem;
  border-left: 2px solid var(--surface1);
  transition: border-left-color 0.2s ease;
}

.post-list li:hover {
  border-left-color: var(--peach);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list time {
  color: var(--subtext);
  font-size: 0.875rem;
}

.post-list h2 {
  margin: 0.25rem 0;
}

.read-more-link {
  display: inline-block;
  margin-top: 0.1rem;
  color: var(--peach);
  font-weight: 700;
}

.read-more-link:hover {
  color: var(--yellow);
  text-decoration: none;
}

.read-more-row {
  display: flex;
  justify-content: flex-end;
}

/* Category navigation */
/* Category navigation */
.category-nav {
  background-color: var(--surface0);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0 2rem;
}

.category-nav h2 {
  margin-bottom: 0.75rem;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.category-nav-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  margin-left: 0;
}

.category-tag--active {
  border-color: var(--peach);
  color: var(--peach);
}

.category-count {
  color: var(--subtext);
  font-size: 0.75rem;
}

/* Category tags */
.category-tag {
  display: inline-block;
  background-color: var(--surface1);
  color: var(--teal);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  line-height: 1.2;
  border: 1px solid transparent;
}

/* Post */
.post-header {
  margin-bottom: 2rem;
}

.post-header time {
  color: var(--subtext);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-content {
  color: var(--text);
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, var(--peach), var(--teal));
  border-radius: 999px;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

/* Post images */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 8px;
  border: 1px solid var(--surface1);
}

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 27, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1100;
}

.image-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.image-modal__img {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--surface1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.image-modal__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--surface0);
  color: var(--text);
  border: 1px solid var(--surface1);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.image-modal__close:hover {
  color: var(--peach);
  border-color: var(--peach);
}

/* Code */
code {
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--surface0);
  color: var(--yellow);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Quotes */
blockquote {
  background-color: var(--surface0);
  border-left: 4px solid var(--teal);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  color: var(--subtext);
}

blockquote p:last-child {
  margin-bottom: 0;
}

pre {
  background-color: var(--mantle);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

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

/* Footer */
footer {
  border-top: 1px solid var(--surface0);
  padding: 1rem;
  text-align: center;
  color: var(--subtext);
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.social-links a {
  color: var(--subtext);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.social-links a:hover {
  color: var(--mauve);
  text-decoration: none;
  transform: scale(1.15) rotate(5deg);
  animation: wiggle 0.4s ease-in-out;
}

.social-links a[data-platform="github"]:hover {
  color: var(--text);
}

.social-links a[data-platform="linkedin"]:hover {
  color: var(--blue);
}

.social-links a[data-platform="twitter"]:hover {
  color: var(--sky);
}

.social-links a[data-platform="instagram"]:hover {
  color: var(--pink);
}

.social-links a[data-platform="email"]:hover {
  color: var(--green);
}

.social-links a[data-platform="rss"]:hover {
  color: var(--peach);
}

@keyframes wiggle {
  0%, 100% { transform: scale(1.15) rotate(5deg); }
  25% { transform: scale(1.15) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
  75% { transform: scale(1.15) rotate(-5deg); }
}
