*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  font-size: 14px;
  --color-text: #fff;
  --color-bg: #0f0e0e;
  --color-link: #ffffff;
  --color-link-hover: rgba(255, 255, 255, 0.6);
  --page-padding: 0.5rem;
  --aspect: 4/5;
  --grid-item-height: 20vh;
  --c-gap: 3rem;
  --r-gap: 3rem;
  --column: 80px;
  --column-count: 3;
  --border-radius: 4px;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  height: 100%;
  width: 100%;
  font-family: 'forma-djr-mono', sans-serif;
  text-transform: uppercase;
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (scripting: enabled) {
  .loading {
    &::before,
    &::after {
      content: '';
      position: fixed;
      z-index: 10000;
    }

    &::before {
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: var(--color-bg);
    }

    &::after {
      top: 50%;
      left: 50%;
      width: 100px;
      height: 1px;
      margin: 0 0 0 -50px;
      background: var(--color-link);
      animation: loaderAnim 1.5s ease-in-out infinite alternate forwards;
    }
  }
}

@keyframes loaderAnim {
  0% {
    transform: scaleX(0);
    transform-origin: 0% 50%;
  }

  50% {
    transform: scaleX(1);
    transform-origin: 0% 50%;
  }

  50.1% {
    transform: scaleX(1);
    transform-origin: 100% 50%;
  }

  100% {
    transform: scaleX(0);
    transform-origin: 100% 50%;
  }
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;

  &:hover {
    text-decoration: none;
    color: var(--color-link-hover);
  }

  &:focus {
    outline: none;
    background: lightgrey;

    &:not(:focus-visible) {
      background: transparent;
    }

    &:focus-visible {
      outline: 2px solid red;
      background: transparent;
    }
  }
}

.line {
  display: inline-block;
  overflow: hidden;
  position: relative;
  vertical-align: top;

  &::before {
    background: var(--color-link-hover);
    bottom: 0;
    content: '';
    height: 1px;
    left: 0;
    position: absolute;
    transition: transform 0.4s ease;
    width: 100%;
    transform: scaleX(0);
    transform-origin: right center;
  }

  &:hover::before {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

.frame {
  display: grid;
  z-index: 1000;
  width: 100%;
  height: 100vh;
  position: fixed;
  grid-column-gap: var(--c-gap);
  grid-row-gap: 0.5rem;
  pointer-events: none;
  justify-items: start;
  padding: var(--page-padding);
  align-content: space-between;
  justify-content: space-between;
  align-items: end;
  grid-template-areas: 'title links' 'tags sponsor';

  #cdawrap {
    justify-self: start;
    grid-area: sponsor;
    max-width: 230px;
    text-align: right;
  }

  a,
  button {
    pointer-events: auto;
    color: var(--color-text);
  }

  .frame__title {
    font-size: inherit;
    margin: 0;
    font-weight: inherit;
    grid-area: title;
    text-align: right;
  }

  .frame__tags,
  .frame__links {
    grid-area: tags;
    display: flex;
    gap: 1rem;
    align-items: start;
  }

  .frame__links {
    grid-area: links;
    justify-self: end;
  }

  &.frame--footer {
    display: flex;
    min-height: 300px;
    align-items: end;
    justify-content: space-between;
  }
}

.scene {
  perspective: 900px;
  position: relative;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scene__title {
  position: relative;
  z-index: 10;
  margin: 0;
  position: relative;
  display: inline-block;
    /* Create a gradient combining IEEE Blue, WIE Purple, and Cyan */
  background: linear-gradient(90deg, #0066cc, #9900cc, #00ffff, #0066cc);
  background-size: 300% auto;
  color: transparent !important;
  -webkit-background-clip: text;
  background-clip: text;
  /* Animate the gradient moving across the text */
  animation: shine 4s linear infinite;
  text-shadow: none !important; 
}

.scene__title a {
  display: block;
}

.scene__title span {
  display: inline-block;
}

.scene__title .char {
  display: inline-block;
  transform-style: preserve-3d;
  transform-origin: 50% 0%;
}

.carousel {
  width: 400px;
  height: 500px;
  top: 50%;
  left: 50%;
  margin: -250px 0 0 -200px;
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform;
  transform: translateZ(-550px) rotateY(0deg);
}

.scene:nth-child(even) .carousel {
  transform: translateZ(-550px) rotateY(45deg);
}

.carousel__cell {
  position: absolute;
  width: 350px;
  height: 420px;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.card__face {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  background-image: var(--img);
  background-size: cover;
}

.card__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.card__face--back {
  transform: rotateY(180deg);
}

.preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 15vw;
  display: grid;
  align-content: center;
  justify-items: center;
  grid-row-gap: 1rem;
  opacity: 0;
  pointer-events: none;
}

.preview__header {
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  line-height: 1;
}

.preview__title {
  margin: 0;
}

.preview__close {
  background: none;
  text-transform: inherit;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: var(--color-close);
  &:hover,
  &:focus {
    outline: none;
    color: var(--color-link-hover);
  }
}

.grid {
  padding: 1rem 0;
  display: grid;
  grid-template-columns: repeat(var(--column-count), minmax(var(--column), 1fr));
  grid-column-gap: var(--c-gap);
  grid-row-gap: var(--r-gap);
  width: 100%;
  perspective: 900px;
}

.grid__item {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  will-change: transform, clip-path;
  overflow: hidden;
  border-radius: var(--border-radius);
  position: relative;
  transform-style: preserve-3d;
}

.grid__item-image {
  width: 100%;
  aspect-ratio: var(--aspect);
  background-size: 100%;
  background-position: 50% 50%;
  transition: opacity 0.15s cubic-bezier(0.2, 0, 0.2, 1);
}

.grid__item:hover .grid__item-image {
  opacity: 0.7;
}

.grid__item-caption h3 {
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}

@media screen and (min-width: 65em) {
  :root {
    --column-count: 6;
  }
}

/* Navbar Base */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem, 2rem;
  background: rgba(0, 0, 0, 0.7); /* translucent, blends with Codrops bg */
  z-index: 1000;
}

.navbar .logo {
  font-size: 1.2rem;
  font-weight: bold;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar .nav-links a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s ease;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  color: #ff4081; /* accent color – adjust per theme */
}

.toggle {
  background: #ff4081;
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

/* --- MOBILE SPACING FIX --- */
@media screen and (max-width: 768px) {
    /* Target the template's massive spacer elements */
    .content, section, .frame, .grid {
        min-height: auto !important;
        height: auto !important;
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Remove artificial scroll distance */
    .spacing-huge {
        display: none !important;
    }
}
/* --- ANIMATED GRADIENT LIGHT TITLES --- */
.glow-title {
    position: relative;
    display: inline-block;
    /* Create a gradient combining IEEE Blue, WIE Purple, and Cyan */
    background: linear-gradient(90deg, #0066cc, #9900cc, #00ffff, #0066cc);
    background-size: 300% auto;
    z-index: 1000;
    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;
    /* Animate the gradient moving across the text */
    animation: shine 4s linear infinite;
    text-shadow: none !important; /* Remove the old static shadow */
}

/* This creates the actual light bleeding out from behind the letters */
.glow-title::after {
    content: attr(data-text); /* Pulls the text from your HTML attribute */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 100;
    background: linear-gradient(90deg, #0066cc, #9900cc, #00ffff, #0066cc);
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    filter: blur(12px); /* Diffuses the light */
    opacity: 0.8; /* Intensity of the glow */
    animation: shine 4s linear infinite;
}

/* The engine driving the light sweep */
@keyframes shine {
    to { background-position: 300% center; }
}
/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #050505; /* Matches your deep space background */
}
::-webkit-scrollbar-thumb {
    background: #0066cc; /* IEEE Blue */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #00ffff; /* Highlights cyan when hovered */
}
/* --- CUSTOM HIGHLIGHT/SELECTION COLOR --- */
::selection {
    background: rgba(153, 0, 204, 0.5); /* WIE Purple transparent */
    color: #ffffff;
    text-shadow: 0 0 5px #ffffff;
}
::-moz-selection {
    background: rgba(153, 0, 204, 0.5);
    color: #ffffff;
}
/* --- FROSTED GLASS DASHBOARD CARDS --- */
.glass-card {
    background: rgba(10, 15, 25, 0.4) !important; /* Dark, semi-transparent base */
    backdrop-filter: blur(12px); /* The magic frosted glass blur */
    -webkit-backdrop-filter: blur(12px); /* Safari support */
    
    /* Technical borders */
    border: 1px solid rgba(0, 102, 204, 0.3); /* IEEE Blue subtle border */
    border-top: 1px solid rgba(0, 255, 255, 0.5); /* Cyan top highlight */
    border-radius: 12px;
    
    padding: 2.5rem;
    margin: 2rem auto;
    max-width: 800px;
    
    /* Deep shadows for 3D depth */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.7), 
                inset 0 0 20px rgba(0, 102, 204, 0.05);
                
    /* Smooth hover animation */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

/* Hovering makes the card float up and glow cyan */
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 102, 204, 0.2), 
                inset 0 0 30px rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.5);
}

/* Ensure text inside the card is perfectly readable */
.glass-card p {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}
/* --- HERO TITLE CONTAINER --- */
.hero-title {
    text-align: center !important; /* Centers the massive title over your 3D canvas */
    margin: 10vh auto; /* Pushes it down slightly from the navbar */
    font-family: 'Fira Code', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertical */
    align-items: center;     /* horizontal */
    text-align: center;
}
/* --- MASSIVE MAIN TITLE (IEEE WIE CRCE) --- */
.hero-main {
    position: relative;
    display: inline-block;
    text-align: center;
    font-size: 6rem; /* Massive, dominant size */
    font-weight: 900;
    line-height: 1;
    
    /* The aggressive Cyan to Blue to Purple gradient */
    background: linear-gradient(90deg, #00ffff, #0066cc, #9900cc, #00ffff);
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    
    /* Sweeping light animation */
    animation: shine 4s linear infinite;
    
    /* Hard drop shadow to lift it off the 3D particles */
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.9));
}

/* The Volumetric Light Bleed (just like the smaller titles) */
.hero-main::after {
    content: attr(data-text);
    position: absolute;
	display: inline-block;
    text-align: center;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(90deg, #00ffff, #0066cc, #9900cc, #00ffff);
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    filter: blur(20px); /* Massive blur for a huge neon glow */
    opacity: 0.7;
    animation: shine 4s linear infinite;
}

/* --- SUBTITLE (Building a Future...) --- */
.hero-sub {
	display: inline-block;
    text-align: center;
    font-size: 3rem;
    color: #e0e0e0;
    font-weight: 400;
    letter-spacing: 4px; /* Widely tracked for a cinematic feel */
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.9);
}

/* --- ACCENT LINE (Innovate. Empower. Lead.) --- */
.hero-accent {
	display: inline-block;
    text-align: center;
    font-size: 2rem;
    color: #00ffff; /* High-contrast cyan */
    font-weight: 700;
    letter-spacing: 6px;
    opacity: 0.7;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 768px) {
    .hero-main { font-size: 6rem; } /* Shrinks the massive title on phones */
    .hero-sub { font-size: 3rem; letter-spacing: 4px; }
    .hero-accent { font-size: 2rem; letter-spacing: 6px; }
}
#cyber-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}