@import 'tailwindcss';

@config '../../tailwind.config.js';

/*
  The default border color has changed to `currentColor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentColor);
  }
}

/*
  The default border color has changed to `currentColor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentColor);
  }
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 222.2 84% 4.9%;

    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

.home-intro p {
  @apply text-3xl md:text-5xl font-thin md:leading-tight;

  a {
    @apply before:-z-10 relative before:bg-secondary font-normal no-underline transition-all inline-block before:content-normal before:absolute before:w-0 before:transition-all before:duration-300 before:h-full before:-left-1 before:top-1;
  }

  a:hover {
    @apply before:w-[calc(100%+0.5rem)];
  }
}

.prose-outstatic {
  --tw-prose-code: #000;
}

.prose :where(pre):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
  @apply px-4 pb-4 pt-6 border rounded-sm bg-gray-800 dark:bg-gray-800 text-white dark:text-gray-800;
}

@media (min-width: 768px) {
  .md\:prose-xl.prose-outstatic
    :where(pre):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
    @apply pt-8;
  }
}

.prose :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
  @apply px-0 py-1 border rounded-sm bg-gray-800 dark:bg-gray-800 text-white;
}

.prose
  pre
  :where(code):not(:where([class~='not-prose'], [class~='not-prose'] *)) {
  @apply bg-transparent dark:bg-transparent border-0 whitespace-break-spaces;
}

.prose
  pre
  :where(code):not(
    :where([class~='not-prose'], [class~='not-prose'] *)
  )::before,
.prose
  pre
  :where(code):not(
    :where([class~='not-prose'], [class~='not-prose'] *)
  )::after {
  content: '';
}

.prose-outstatic :where(code):not(:where([class~='not-prose'] *))::before,
.prose-outstatic :where(code):not(:where([class~='not-prose'] *))::after {
  color: transparent;
}

.prose-outstatic > ol > li > :last-child,
.prose-outstatic > ul > li > :last-child {
  margin-bottom: 0;
}
.prose-outstatic > ol > li > :first-child,
.prose-outstatic > ul > li > :first-child {
  margin-top: 0;
}

.prose-outstatic blockquote p:first-of-type::before,
.prose-outstatic blockquote p:last-of-type::after {
  content: '';
}

.prose-outstatic :where(pre code):not(:where([class~='not-prose'] *)) {
  font-size: 1.1em;
}

.prose-outstatic :where(h1, h2, h3, h4) {
  scroll-margin-top: 100px;
  position: relative;
  display: block;
  margin-right: 0.5rem;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
}

.prose-outstatic:not(.home-intro) :where(h1, h2, h3, h4):hover {
  text-decoration: underline;
}

/** HASH ANCHOR */
.hash-anchor {
  @apply inset-y-0 w-full absolute transition-none bg-none;
}
.hash-anchor:hover {
  @apply underline;
}

.hash-anchor:hover:after,
.hash-anchor:focus:after {
  visibility: visible;
}

.hash-anchor:after {
  @apply invisible absolute -right-5 top-1/2 -translate-y-1/2 text-lg;
  content: '#';
}

.home-hero-fade > * {
  @apply animate-fade-up opacity-0;

  &:nth-child(1) {
    animation-delay: 0.1s;
  }
  &:nth-child(2) {
    animation-delay: 0.3s;
  }
  &:nth-child(3) {
    animation-delay: 0.5s;
  }
}
