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

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

@theme inline {
  --radius: 0.625rem;
  --text-4xxl: 2.5rem;
  --text-6xxl: 4rem;

  --display-weight: 600;
  --text-weight: 400;
  --font-display: var(--font-rubik);
  --font-text: var(--font-imprima);

  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --animate-marquee: marquee var(--duration) infinite linear;
  --animate-marquee-vertical: marquee-vertical var(--duration) linear infinite;
  @keyframes marquee {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(calc(-100% - var(--gap)));
    }
  }
  @keyframes marquee-vertical {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(calc(-100% - var(--gap)));
    }
  }
}

:root {
  /* Soft sky-blue academic palette */
  --foreground: oklch(0.13 0.02 240);
  --background: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.02 240);
  --card: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.02 240);
  --popover: oklch(1 0 0);
  --primary: oklch(0.45 0.16 255);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.58 0.17 255);
  --secondary-foreground: oklch(0.99 0 0);
  --muted: oklch(0.96 0.008 230);
  --muted-foreground: oklch(0.40 0.02 235);
  --accent: oklch(0.95 0.02 230);
  --accent-foreground: oklch(0.22 0.06 240);
  --destructive: oklch(0.604 0.191 22.216);
  --border: oklch(0.92 0.012 230);
  --input: oklch(0.91 0.012 230);
  --ring: oklch(0.58 0.17 255);

  --chart-1: oklch(0.45 0.16 255);
  --chart-2: oklch(0.58 0.17 255);
  --chart-3: oklch(0.62 0.09 190);
  --chart-4: oklch(0.72 0.07 65);

  --sidebar: oklch(0.97 0.008 230);
  --sidebar-foreground: oklch(0.18 0.02 240);
  --sidebar-primary: oklch(0.45 0.16 255);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.93 0.015 230);
  --sidebar-accent-foreground: oklch(0.18 0.02 240);
  --sidebar-border: oklch(0 0 0 / 8%);
  --sidebar-ring: oklch(0.58 0.17 255);
}

.dark {
  --foreground: oklch(0.97 0 0);
  --background: oklch(0.12 0.01 255);
  --card-foreground: oklch(0.97 0 0);
  --card: oklch(0.155 0.012 255);
  --popover-foreground: oklch(0.97 0 0);
  --popover: oklch(0.155 0.012 255);
  --primary: oklch(0.75 0.1 250);
  --primary-foreground: oklch(0.12 0.01 255);
  --secondary: oklch(0.6 0.12 250);
  --secondary-foreground: oklch(0.97 0 0);
  --muted: oklch(0.2 0.015 255);
  --muted-foreground: oklch(0.65 0.01 260);
  --accent: oklch(0.2 0.02 255);
  --accent-foreground: oklch(0.92 0.02 250);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(0.22 0.015 255);
  --input: oklch(0.28 0.015 255);
  --ring: oklch(0.6 0.12 250);

  --chart-1: oklch(0.55 0.1 255);
  --chart-2: oklch(0.6 0.12 250);
  --chart-3: oklch(0.5 0.1 180);
  --chart-4: oklch(0.155 0.012 255);

  --sidebar: oklch(0.14 0.01 255);
  --sidebar-foreground: oklch(0.97 0 0);
  --sidebar-primary: oklch(0.6 0.12 250);
  --sidebar-primary-foreground: oklch(0.97 0 0);
  --sidebar-accent: oklch(0.2 0.015 255);
  --sidebar-accent-foreground: oklch(0.97 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.6 0.12 250);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  html {
    scroll-behavior: smooth;
  }
  body {
    @apply bg-background text-foreground font-text font-weight-text text-[15px];
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    @apply font-display font-weight-display;
  }
}

@layer utilities {
  .section-padding {
    @apply py-10 md:py-14 lg:py-16;
  }
}

@utility font-weight-display {
  font-weight: var(--display-weight);
}

@utility font-weight-text {
  font-weight: var(--text-weight);
}

@utility container {
  margin-inline: auto;
  padding-inline: 1.375rem;
  @media (width >= --theme(--breakpoint-sm)) {
    max-width: none;
  }
  @media (width >= 1200px) {
    max-width: 1112px;
  }
}
@utility bigger-container {
  margin-inline: auto;
  padding-inline: 1.375rem;
  @media (width >= --theme(--breakpoint-sm)) {
    max-width: none;
  }
  @media (width >= 1200px) {
    max-width: 1254px;
  }
}

@utility navbar-container {
  margin-inline: auto;
  padding-inline: 1.375rem;
  @media (width >= --theme(--breakpoint-sm)) {
    max-width: none;
  }
  @media (width >= 1200px) {
    max-width: 1334px;
  }
}

/* Toggle Theme View Transitions */
@keyframes theme-mask {
  0% {
    clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
  }

  100% {
    clip-path: circle(150% at var(--x, 50%) var(--y, 50%));
  }
}

html.theme-transition::view-transition-old(root),
html.theme-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.theme-transition::view-transition-old(root) {
  z-index: 1;
}

html.theme-transition::view-transition-new(root) {
  z-index: 2;
  animation: theme-mask 0.5s ease-in forwards;
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .motion-safe-only {
    display: none !important;
  }
}
