@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --bg-dark: #06060a;
  --bg-card: #0d0d14;
  --bg-card-hover: #12121c;
  --text: #e8e8ef;
  --text-secondary: #b8b8c8;
  --text-muted: #6a6a7e;
  --purple: #a855f7;
  --pink: #ec4899;
  --glow-purple: rgba(168, 85, 247, 0.4);
  --glow-pink: rgba(236, 72, 153, 0.4);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
}

/* Grid pattern */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

body {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg-dark);
  min-height: 100vh;
  position: relative;
}

header {
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  padding: 0.5rem 0;
}

.logo::before {
  content: '//';
  color: var(--purple);
  margin-right: 0.5rem;
}

.logo:hover {
  color: var(--purple);
  text-shadow: 0 0 20px var(--glow-purple);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid rgba(168, 85, 247, 0.1);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Typography */
h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--text) 0%, var(--purple) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 3rem 0 1.25rem;
  color: var(--text);
  position: relative;
  padding-left: 1rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--purple), var(--pink));
}

h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 2rem 0 0.75rem;
  color: var(--purple);
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--pink);
  text-shadow: 0 0 10px var(--glow-pink);
}

/* Posts list */
.posts-list {
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.posts-list li {
  background: var(--bg-card);
  padding: 2rem;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  transition: all 0.3s ease;
}

.posts-list li::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.posts-list li::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-card);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  z-index: -1;
}

.posts-list li:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.posts-list li:hover::before {
  opacity: 1;
}

.posts-list li:hover::after {
  background: var(--bg-card-hover);
}

.post-link {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.post-link:hover {
  color: var(--purple);
  text-shadow: 0 0 20px var(--glow-purple);
}

.post-date {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--text-muted);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.7;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.post-header .post-meta {
  margin-bottom: 0;
}

.post-header .post-tags {
  margin-top: 0;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--purple);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--purple);
  color: var(--bg-dark);
  text-shadow: none;
}

/* Article styles */
article {
  max-width: 850px;
}

.post-meta {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

article img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

article code {
  font-family: 'Space Mono', monospace;
  background: rgba(168, 85, 247, 0.1);
  padding: 0.2rem 0.5rem;
  font-size: 0.85em;
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

article pre {
  background: var(--bg-card);
  color: var(--text);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.7;
  border-left: 3px solid var(--purple);
  position: relative;
}

article pre::before {
  content: 'CODE';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--purple);
  color: var(--bg-dark);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  letter-spacing: 0.1em;
}

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

article blockquote {
  font-size: 1.25rem;
  line-height: 1.6;
  border-left: 3px solid var(--pink);
  padding: 1.5rem;
  margin: 2.5rem 0;
  color: var(--text);
  background: rgba(236, 72, 153, 0.05);
  font-style: italic;
}

article ul, article ol {
  margin: 1.5rem 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-secondary);
}

article li {
  margin-bottom: 0.75rem;
  padding-left: 2rem;
  position: relative;
}

article li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--purple);
  font-weight: bold;
}

article ol {
  counter-reset: item;
}

article ol li::before {
  content: counter(item, decimal-leading-zero);
  counter-increment: item;
  color: var(--pink);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
}

article strong {
  font-weight: 600;
  color: var(--text-secondary);
}

article hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--pink), transparent);
  margin: 3rem 0;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
}

.back-link:hover {
  color: var(--purple);
  border-color: rgba(168, 85, 247, 0.3);
  text-shadow: 0 0 10px var(--glow-purple);
}

/* Selection */
::selection {
  background: var(--pink);
  color: var(--bg-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--purple), var(--pink));
  border-radius: 0;
}

/* Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  .posts-list li {
    padding: 1.5rem;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  }

  .posts-list li::before,
  .posts-list li::after {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  }

  .post-link {
    font-size: 1.15rem;
  }

  main {
    padding: 1.5rem 1.25rem 3rem;
  }

  header {
    padding: 1.5rem 1.25rem;
  }

  .logo {
    font-size: 1rem;
  }
}

/* Prism Syntax Highlighting - Custom Theme */
code[class*="language-"],
pre[class*="language-"] {
  color: var(--text-secondary);
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.7;
  tab-size: 2;
  hyphens: none;
}

pre[class*="language-"] {
  padding: 1.5rem;
  margin: 2rem 0;
  overflow: auto;
  background: var(--bg-card);
  border-left: 3px solid var(--purple);
  position: relative;
}

pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  background: var(--purple);
  color: var(--bg-dark);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:not(pre) > code[class*="language-"] {
  padding: 0.2rem 0.5rem;
  border-radius: 0;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Tokens */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--text-muted);
  font-style: italic;
}

.token.punctuation {
  color: var(--text-muted);
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--pink);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #22d3ee;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--text-secondary);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--purple);
}

.token.function,
.token.class-name {
  color: var(--pink);
}

.token.regex,
.token.important,
.token.variable {
  color: #fbbf24;
}

.token.important,
.token.bold {
  font-weight: 600;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* EmmyLua doc comments */
.token.doc-comment {
  color: var(--text-muted);
  font-style: italic;
}

.token.doc-comment .token.annotation {
  color: var(--purple);
  font-style: normal;
  font-weight: 600;
}

.token.doc-comment .token.parameter {
  color: #fbbf24;
  font-style: normal;
}

.token.doc-comment .token.type,
.token.doc-comment .token.return-type,
.token.doc-comment .token.class-name {
  color: var(--pink);
  font-style: normal;
}

.token.doc-comment .token.punctuation {
  color: var(--text-muted);
}

/* Line highlighting */
.highlight-line {
  background: rgba(168, 85, 247, 0.1);
  display: block;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}
