@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
@import "tailwindcss";

/* Theme variables */
:root {
  --c-background: #031D44; /* background */
  --c-background-light: #04395E; /* background highlight */
  --c-boxes: #24719f; /* boxes */
  --c-lines: #87a9da; /* lines */
  --c-text: #CAF0F8; /* text */
  --c-other: #70A288; /* accent */

  color-scheme: dark;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--c-text);
  background: radial-gradient(1200px 800px at 10% 10%, var(--c-background-light), transparent 60%),
              radial-gradient(1000px 700px at 90% 20%, color-mix(in hsl, var(--c-lines), transparent 85%), transparent 60%),
              linear-gradient(180deg, var(--c-background) 0%, color-mix(in hsl, var(--c-background), black 15%) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  line-height: 1.2;
}

@layer base {
  button {
    border-radius: 0.75rem;
    border: 1px solid color-mix(in hsl, var(--c-lines), transparent 60%);
    font: inherit;
    background-color: color-mix(in hsl, var(--c-background-light), black 15%);
    color: var(--c-text);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  }
  button:hover {
    border-color: var(--c-other);
    box-shadow: 0 0 0.5rem color-mix(in hsl, var(--c-other), transparent 60%);
  }
  button:active { transform: translateY(1px) }
}

/* Reusable helpers */
.glass {
  background: linear-gradient(180deg, color-mix(in hsl, var(--c-background-light), transparent 30%), color-mix(in hsl, black, transparent 70%));
  /* no border for a modern look */
  border: none;
  box-shadow: 0 0 1.2rem rgba(3, 29, 68, 0.35);
  border-radius: 1rem;
}

.glow:hover {
  box-shadow: 0 0 0.8rem color-mix(in hsl, var(--c-other), transparent 50%);
}

.section {
  padding: 4rem 1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-lines), transparent);
  margin: 2rem 0;
}

/* Nav underline animation */
.nav-item {
  position: relative;
}
.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--c-other);
  transition: width .2s ease;
}
.nav-item:hover::after,
.nav-item.active::after {
  width: 100%;
}

/* Chat message flash highlight when jumped to via reply */
@keyframes msg-flash {
  0%   {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
  20%  {
    background-color: color-mix(in hsl, var(--c-lines), transparent 88%);
    box-shadow: 0 0 14px 4px color-mix(in hsl, var(--c-lines), transparent 65%);
  }
  70%  {
    background-color: color-mix(in hsl, var(--c-lines), transparent 88%);
    box-shadow: 0 0 14px 4px color-mix(in hsl, var(--c-lines), transparent 65%);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}
.msg-flash {
  animation: msg-flash 1.4s ease;
}

/* ── Global custom scrollbar ───────────────────────────────────────────────── */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in hsl, var(--c-lines), transparent 55%) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

/* Track — fully transparent */
::-webkit-scrollbar-track {
  background: transparent;
}

/* Hide the up/down arrow buttons */
::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

/* Thumb */
::-webkit-scrollbar-thumb {
  background: color-mix(in hsl, var(--c-lines), transparent 55%);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in hsl, var(--c-lines), transparent 30%);
}

/* Corner where horizontal + vertical scrollbars meet */
::-webkit-scrollbar-corner {
  background: transparent;
}

.nav-item:focus-visible {
  outline: 2px solid color-mix(in hsl, var(--c-other), transparent 20%);
  outline-offset: 2px;
}

/* Rainbow text using project palette */
.text-rainbow {
  background: linear-gradient(90deg, var(--c-other), var(--c-lines), var(--c-boxes));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Card hover/animation */
.card {
  background: color-mix(in hsl, var(--c-background-light), transparent 15%);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px color-mix(in hsl, var(--c-other), transparent 70%);
  background: color-mix(in hsl, var(--c-background-light), transparent 5%);
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none }
  .card:hover { transform: none }
}

/* Scroll-reveal animations (applied to .section and [data-reveal]) */
.section,
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  will-change: opacity, transform;
  transition: opacity .6s ease, transform .6s ease;
}

.reveal-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .section,
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Reusable full-page gradient — same background as the login/register pages */
.bg-brand-gradient {
  background:
    radial-gradient(1200px 800px at 10% 10%, var(--c-background-light), transparent 60%),
    radial-gradient(1000px 700px at 90% 20%, color-mix(in hsl, var(--c-lines), transparent 85%), transparent 60%),
    linear-gradient(180deg, var(--c-background) 0%, color-mix(in hsl, var(--c-background), black 15%) 100%);
}

/* Use project palette for list markers (bullets) and summary markers */
li::marker,
ol li::marker,
ul li::marker,
summary::marker {
  color: var(--c-boxes);
}

/* Ensure fallback for older browsers by tinting bullets via ::before where used */
li.custom-marker::before {
  content: "\2022"; /* bullet */
  color: var(--c-boxes);
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* ── Landing page animations ── */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0.5rem color-mix(in hsl, var(--c-other), transparent 60%); }
  50%       { box-shadow: 0 0 1.5rem color-mix(in hsl, var(--c-other), transparent 30%); }
}

@keyframes bounce-y {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-marquee      { animation: marquee 30s linear infinite; }
.animate-float        { animation: float 5s ease-in-out infinite; }
.animate-spin-slow    { animation: spin-slow 20s linear infinite; }
.animate-pulse-glow   { animation: pulse-glow 2.5s ease-in-out infinite; }
.animate-bounce-y     { animation: bounce-y 1.4s ease-in-out infinite; }
.animate-gradient     {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}
