@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@custom-variant dark (&:is(.dark *));

:root {
  --background: oklch(0.9753 0.004 106.47);
  --foreground: oklch(0.262 0.0126 107.24);
  --card: oklch(0.95 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
    font-family: var(--font-inter), Arial, Helvetica, sans-serif;
  }
}

.typography {
  @apply prose prose-zinc prose-headings:scroll-m-20 prose-code:rounded-md prose-code:p-1 prose-code:leading-6 prose-code:before:content-none prose-code:after:content-none prose-pre:border prose-pre:bg-neutral-100 prose-img:rounded-md prose-img:border;
  @apply prose-code:text-xs w-[85vw] !min-w-full pt-2 text-sm sm:mx-auto sm:w-full;
  @apply dark:prose-invert prose-code:text-neutral-800 dark:prose-code:bg-neutral-900 dark:prose-code:text-white dark:prose-pre:bg-neutral-900;
}

.prose {
  margin: 0 !important;
}

.prose ul > li::marker {
  color: hsl(0, 0%, 29%);
}

.dark .prose ul > li::marker {
  color: hsl(0, 0%, 79%);
}

.prose :where([class~="not-prose"] ul > li)::marker,
.prose :where([class~="not-prose"] ul > li)::marker * {
  color: inherit;
}

.prose
  :where(ul > li):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
  padding-inline-start: 0;
}

.code-line {
  padding: 0.75px 12.5px;
}

pre {
  padding: 0 !important;
  width: inherit !important;
  overflow-x: auto;
}

pre > code {
  display: grid;
  max-width: inherit !important;
  padding: 14px 0 !important;
}

.contains-task-list {
  list-style-type: none;
  padding-inline-start: 0;
}

.task-list-item {
  display: flex;
  align-items: center;
}

.task-list-item input {
  margin-right: 0.5rem;
}

.line-number::before {
  display: inline-block;
  width: 1rem;
  margin-right: 22px;
  margin-left: -2px;
  color: rgb(110, 110, 110);
  content: attr(line);
  text-align: right;
}

.highlight {
  font-weight: bold;
  color: black;
}

.dark .highlight {
  font-weight: bold;
  color: white;
}

.highlight-line {
  @apply dark:bg-neutral-800/90;
  @apply bg-neutral-200/90;
}

.highlight-comp > code {
  background-color: transparent !important;
}

.attr-name {
  color: #414141;
}

.dark .attr-name {
  color: #cacaca;
}

.punctuation,
.comment {
  color: gray;
}

.attr-name,
.number,
.tag,
.property-access,
.keyword {
  color: hsla(335, 73%, 53%, 1);
}

.dark .attr-name,
.dark .tag,
.dark .keyword,
.dark .property-access,
.dark .number {
  color: hsla(335, 76%, 59%, 1);
}

.at.operator,
.builtin,
.function {
  color: hsla(210, 100%, 66%, 1);
}

.attr-value,
.string {
  color: hsla(131, 43%, 57%, 1);
}

.constant,
.annotation,
.boolean {
  color: hsl(0, 0%, 29%);
}

.dark .constant,
.dark .annotation,
.dark .boolean {
  color: hsl(0, 0%, 71%);
}

span.katex-display {
  display: flex;
}

span.katex-html {
  display: none;
}

.rehype-code-title {
  @apply px-2;
  @apply -mb-8;
  @apply w-full;
  @apply text-sm;
  @apply pt-1;
  @apply pb-5;
  @apply font-normal;
  @apply tracking-wider;
  @apply font-medium;
  font-family: var(--font-code) !important;
}

.CollapsibleContent {
  overflow: hidden;
}
.CollapsibleContent[data-state="open"] {
  animation: slideDown 300ms ease-out;
}

.CollapsibleContent[data-state="closed"] {
  animation: slideUp 300ms ease-out;
}

@keyframes slideDown {
  from {
    height: 0;
  }
  to {
    height: var(--radix-collapsible-content-height);
  }
}

@keyframes slideUp {
  from {
    height: var(--radix-collapsible-content-height);
  }
  to {
    height: 0;
  }
}

/* Animated background elements */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes drift {
  0% {
    transform: translateX(0px) translateY(0px);
  }
  25% {
    transform: translateX(10px) translateY(-10px);
  }
  50% {
    transform: translateX(-5px) translateY(-20px);
  }
  75% {
    transform: translateX(-10px) translateY(-5px);
  }
  100% {
    transform: translateX(0px) translateY(0px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.1);
  }
}

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  opacity: 0.1;
  animation-duration: 20s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.floating-shape:nth-child(1) {
  top: 18%;
  left: 20%;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #333, #aaa);
  border-radius: 50%;
  animation-name: drift;
  animation-delay: 0s;
}

.floating-shape:nth-child(2) {
  top: 20%;
  right: 15%;
  width: 40px;
  height: 40px;
  background: linear-gradient(45deg, #444, #777);
  transform: rotate(45deg);
  animation-name: drift;
  animation-delay: -5s;
}

.floating-shape:nth-child(3) {
  bottom: 30%;
  left: 20%;
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #222, #555);
  border-radius: 20%;
  animation-name: float;
  animation-delay: -10s;
}

.floating-shape:nth-child(4) {
  bottom: 20%;
  right: 25%;
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, #555, #888);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  animation-name: drift;
  animation-delay: -15s;
}

.floating-shape:nth-child(5) {
  top: 45%;
  left: 10%;
  width: 30px;
  height: 30px;
  background: linear-gradient(45deg, #111, #222);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: rotate(20deg);
  animation-name: drift;
  animation-delay: -1s;
}

.floating-shape:nth-child(6) {
  top: 60%;
  right: 10%;
  width: 45px;
  height: 45px;
  background: linear-gradient(45deg, #444, #777);
  transform: rotate(30deg);
  animation-name: float;
  animation-delay: -12s;
}

.floating-shape:nth-child(7) {
  top: 15%;
  left: 50%;
  width: 35px;
  height: 35px;
  background: linear-gradient(45deg, #222, #555);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  animation-name: drift;
  animation-delay: -3s;
}

.floating-shape:nth-child(8) {
  bottom: 40%;
  left: 70%;
  width: 55px;
  height: 55px;
  background: linear-gradient(45deg, #555, #888);
  border-radius: 30%;
  animation-name: float;
  animation-delay: -18s;
}

/* Dark mode adjustments */
.dark .floating-shape {
  opacity: 0.4;
}

.dark .floating-shape:nth-child(1) {
  background: linear-gradient(45deg, #333, #666);
}

.dark .floating-shape:nth-child(2) {
  background: linear-gradient(45deg, #444, #777);
}

.dark .floating-shape:nth-child(3) {
  background: linear-gradient(45deg, #222, #555);
}

.dark .floating-shape:nth-child(4) {
  background: linear-gradient(45deg, #555, #fff);
}

.dark .floating-shape:nth-child(5) {
  background: linear-gradient(45deg, #333, #666);
}

.dark .floating-shape:nth-child(6) {
  background: linear-gradient(45deg, #444, #777);
}

.dark .floating-shape:nth-child(7) {
  background: linear-gradient(45deg, #222, #555);
}

.dark .floating-shape:nth-child(8) {
  background: linear-gradient(45deg, #555, #888);
}

/* Logo cube rotation animations */
@keyframes cube-rotate {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

.perspective-1000 {
  perspective: 1000px;
}

.preserve-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

.rotate-y-180 {
  transform: rotateY(180deg);
}

.animate-cube-rotate {
  animation: cube-rotate 8s ease-in-out infinite;
}


@keyframes scale {
  from, to {
    transform: scale(0);
  }
  
  50% {
    transform: scale(1);
  }
}

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


@keyframes background-pan {
  from {
    background-position: 0% center;
  }
  
  to {
    background-position: -200% center;
  }
}

.sparkle-purple {
  animation: background-pan 3s linear infinite;
  background: linear-gradient(
    to right,
    rgb(5, 142, 108),
    rgb(1, 125, 131),
    rgb(169, 43, 243),
    rgb(5, 142, 108)
  );
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.magic-star {
  --size: clamp(20px, 1.5vw, 30px);
  
  animation: scale 700ms ease forwards;
  display: block;
  height: var(--size);
  left: var(--star-left);
  position: absolute;
  top: var(--star-top);
  width: var(--size);
}

.magic-star > svg {
  animation: rotate 1000ms linear infinite;
  display: block;
  opacity: 0.7;
}


.magic-star > svg > path {
  fill: rgb(123, 31, 162);
}