/* Monokai Pro Ristretto - Correct palette */
:root {
  color-scheme: dark;
  --bg: #2C2525;
  --bg-1: #403838;
  --bg-2: #5B5353;
  --fg-muted: #72696A;
  --fg-dim: #948A8B;
  --fg-soft: #B5A9AA;
  --fg-1: #FFF1F3;
  --fg: #FFF8F9;

  --red: #fd6883;
  --orange: #f38d70;
  --yellow: #f9cc6c;
  --green: #adda78;
  --blue: #85dacc;
  --purple: #a8a9eb;
}

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

body {
  font-family: "JetBrains Mono", monospace;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 0.8rem;
}

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

a:hover {
  text-decoration: underline;
}

/* Home page */
div.home {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  width: 100%;
  padding: 2rem;
}

div.home > div {
  text-align: left;
  margin: auto 0;
}

div.home .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  border: 3px solid var(--bg-2);
  display: block;
}

div.home h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #FFFFFF;
}

div.home .title {
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

div.home .links {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

div.home .links a {
  color: var(--green);
  font-size: 1rem;
}

div.home .links a:hover {
  color: var(--orange);
}

div.home > .social {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
}

div.home > .social a {
  color: var(--fg-dim);
}

div.home > .social a:hover {
  color: var(--blue);
}

.made-with {
  position: fixed;
  top: 2rem;
  right: 2rem;
  font-size: 0.7rem;
  color: var(--fg-muted);
  z-index: 100;
  user-select: none;
}

.made-with .heart {
  color: var(--red);
  display: inline-block;
}

.made-with:hover .heart {
  animation: heartbeat 0.6s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
  60% { transform: scale(1); }
}

/* Floating shapes */
div.home .shapes {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

div.home .shape {
  position: absolute;
  opacity: 0.3;
  cursor: default;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

div.home .shape:hover {
  transform: scale(1.2) rotate(15deg);
  opacity: 0.5;
}

div.home .shape-1 {
  width: 60px;
  height: 60px;
  border: 2px solid var(--red);
  top: 20%;
  right: 25%;
  animation: float-1 12s ease-in-out infinite, rotate 20s linear infinite;
}

div.home .shape-2 {
  width: 40px;
  height: 40px;
  background: var(--green);
  border-radius: 50%;
  top: 60%;
  right: 15%;
  animation: float-2 10s ease-in-out infinite;
}

div.home .shape-3 {
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-bottom: 43px solid var(--yellow);
  top: 35%;
  right: 40%;
  animation: float-3 14s ease-in-out infinite, rotate 25s linear infinite reverse;
}

div.home .shape-4 {
  width: 80px;
  height: 80px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  top: 70%;
  right: 35%;
  animation: float-1 16s ease-in-out infinite reverse;
}

div.home .shape-5 {
  width: 30px;
  height: 30px;
  background: var(--purple);
  top: 15%;
  right: 10%;
  animation: float-2 11s ease-in-out infinite, rotate 15s linear infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-20px, 30px); }
  50% { transform: translate(10px, -20px); }
  75% { transform: translate(-15px, -10px); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(25px, -25px); }
  66% { transform: translate(-15px, 20px); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-30px, 40px) rotate(180deg); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating keywords */
div.home .keyword {
  position: absolute;
  font-family: "JetBrains Mono", monospace;
  font-weight: bold;
  font-size: 1rem;
  opacity: 0.2;
  cursor: default;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

div.home .keyword:hover {
  transform: scale(1.3) translateY(-5px);
  opacity: 0.5;
}

div.home .kw-1 {
  color: var(--red);
  top: 45%;
  right: 8%;
  animation: float-2 13s ease-in-out infinite;
}

div.home .kw-2 {
  color: var(--red);
  top: 75%;
  right: 12%;
  animation: float-1 11s ease-in-out infinite;
}

div.home .kw-3 {
  color: var(--green);
  top: 25%;
  right: 42%;
  animation: float-3 15s ease-in-out infinite;
}

div.home .kw-4 {
  color: var(--purple);
  top: 55%;
  right: 38%;
  animation: float-2 10s ease-in-out infinite reverse;
}

div.home .kw-5 {
  color: var(--green);
  top: 85%;
  right: 30%;
  animation: float-1 14s ease-in-out infinite;
}

div.home .kw-6 {
  color: var(--blue);
  top: 12%;
  right: 18%;
  animation: float-2 12s ease-in-out infinite reverse;
}

div.home .kw-7 {
  color: var(--yellow);
  top: 65%;
  right: 45%;
  animation: float-3 16s ease-in-out infinite;
}

div.home .kw-8 {
  color: var(--orange);
  top: 30%;
  right: 5%;
  animation: float-1 9s ease-in-out infinite reverse;
}

/* Single layout (posts) */
div.single {
  display: flex;
  min-height: 100vh;
  padding: 2rem;
  gap: 2rem;
}

div.single nav {
  flex: 1;
  max-width: 220px;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 2rem;
  height: calc(100vh - 4rem);
  align-self: flex-start;
}

div.single nav .nav-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 2px solid var(--bg-2);
}

div.single nav h1 {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

div.single nav h1 a {
  color: var(--fg);
}

div.single nav h1 a:hover {
  text-decoration: none;
  color: var(--orange);
}

div.single nav .nav-top > p:first-of-type {
  color: var(--fg-muted);
  font-size: 0.7rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

div.single nav .nav-top p a[href^="/"] {
  color: var(--green);
  font-size: 0.875rem;
}

div.single nav .nav-top p a[href^="/"]:hover {
  color: var(--orange);
}

div.single nav .nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

div.single nav .nav-bottom a {
  color: var(--fg-dim);
  font-size: 0.75rem;
}

div.single nav .nav-bottom a:hover {
  color: var(--blue);
}

div.single article {
  flex: 3;
  max-width: 700px;
  padding-bottom: 0.8rem;
}

div.single article header {
  margin-bottom: 2rem;
}

div.single article header .date {
  color: var(--fg-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

div.single article header h1 {
  font-size: 1.5rem;
  color: var(--orange);
  line-height: 1.3;
  display: inline;
  text-decoration: underline wavy var(--red);
  text-decoration-skip-ink: none;
  text-underline-offset: 0.3em;
}

/* Post list */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-item time {
  color: var(--fg-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-item a {
  color: var(--fg);
  font-size: 1rem;
}

.post-item a:hover {
  color: var(--orange);
}

.empty {
  color: var(--fg-muted);
}

/* Article content styling */
article p {
  margin-bottom: 0.5rem;
}

article h2 {
  font-size: 1.25rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--yellow);
}

article h3 {
  font-size: 1.1rem;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: var(--green);
}

article code {
  background: var(--bg-1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

article pre {
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
  background: #403838 !important;
}

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

article blockquote {
  border-left: 3px solid var(--purple);
  padding-left: 1rem;
  color: var(--fg-dim);
  font-style: italic;
  margin: 1rem 0;
}

article img, article iframe, article video {
  max-width: 100%;
}

/* Glitch text effect */
.glitch-text {
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.glitch-text.active::before,
.glitch-text.active::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text.active::before {
  color: #ff0000;
  animation: glitch-effect 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.glitch-text.active::after {
  color: #00ffff;
  animation: glitch-effect 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch-effect {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 3px);
  }
  40% {
    transform: translate(-3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(3px, -3px);
  }
  100% {
    transform: translate(0);
  }
}

/* Floating category theory symbols */
.floats {
  position: fixed;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.float {
  position: absolute;
  font-family: "JetBrains Mono", monospace;
  font-weight: bold;
  opacity: 0.2;
  cursor: default;
  pointer-events: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.float:hover {
  transform: scale(1.2);
  opacity: 0.5;
}

.float::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.float:hover::after {
  opacity: 1;
}

.float:hover > span {
  opacity: 0;
}

.float > span {
  transition: opacity 0.3s ease;
}

/* Cats / Cats Effect */
.float-1 { /* ~> FunctionK */
  color: var(--yellow);
  font-size: 1.4rem;
  top: 15%;
  right: 20%;
  animation: float-1 12s ease-in-out infinite;
}

.float-2 { /* >>= flatMap */
  color: var(--purple);
  font-size: 1.1rem;
  top: 30%;
  right: 8%;
  animation: float-2 10s ease-in-out infinite;
}

.float-3 { /* IO Effect */
  color: var(--blue);
  font-size: 1.3rem;
  top: 45%;
  right: 30%;
  animation: float-3 14s ease-in-out infinite;
}

.float-4 { /* F[_] Higher-kinded */
  color: var(--green);
  font-size: 1rem;
  top: 60%;
  right: 12%;
  animation: float-1 11s ease-in-out infinite reverse;
}

.float-5 { /* pure Lift */
  color: var(--red);
  font-size: 1rem;
  top: 75%;
  right: 28%;
  animation: float-2 13s ease-in-out infinite;
}

/* Terraform */
.float-6 { /* resource */
  color: var(--purple);
  font-size: 0.9rem;
  top: 20%;
  right: 35%;
  animation: float-3 15s ease-in-out infinite reverse;
}

.float-7 { /* module */
  color: var(--blue);
  font-size: 0.95rem;
  top: 38%;
  right: 6%;
  animation: float-1 9s ease-in-out infinite;
}

.float-8 { /* => HCL */
  color: var(--yellow);
  font-size: 1.3rem;
  top: 52%;
  right: 22%;
  animation: float-2 16s ease-in-out infinite reverse;
}

.float-9 { /* plan */
  color: var(--green);
  font-size: 1rem;
  top: 68%;
  right: 35%;
  animation: float-3 12s ease-in-out infinite;
}

.float-10 { /* state */
  color: var(--orange);
  font-size: 0.95rem;
  top: 82%;
  right: 6%;
  animation: float-1 14s ease-in-out infinite reverse;
}

.float-11 { /* var */
  color: var(--red);
  font-size: 1rem;
  top: 42%;
  right: 18%;
  animation: float-2 11s ease-in-out infinite;
}

.float-12 { /* for_each */
  color: var(--orange);
  font-size: 0.85rem;
  top: 88%;
  right: 15%;
  animation: float-3 13s ease-in-out infinite reverse;
}

/* Responsive */
@media (max-width: 768px) {
  div.single {
    flex-direction: column;
  }

  div.single nav {
    max-width: 100%;
  }

  div.home h1 {
    font-size: 1.5rem;
  }

  .floats {
    display: none;
  }
}
