/* ============================================
   JUSTIN NEALEY — Portfolio
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --text: #e8e8ef;
  --text-muted: #6b6b80;
  --accent: #00d4ff;
  --accent-2: #7b61ff;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b61ff 100%);
  --font-primary: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Custom Cursor --- */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              background 0.3s;
}

.cursor.hovering {
  width: 40px;
  height: 40px;
  background: var(--accent);
  mix-blend-mode: difference;
}

.cursor-follower {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.5s var(--ease-out-expo),
              height 0.5s var(--ease-out-expo),
              border-color 0.3s,
              opacity 0.3s;
}

.cursor-follower.hovering {
  width: 60px;
  height: 60px;
  border-color: rgba(123, 97, 255, 0.5);
}

/* --- Noise Overlay --- */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}

.nav-link:hover::after {
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

.tag-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.tag-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.hero-name {
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.name-line {
  display: block;
  overflow: hidden;
}

.name-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: slideUp 1s var(--ease-out-expo) 0.7s forwards;
}

.name-line:nth-child(2) .name-word {
  animation-delay: 0.85s;
}

.name-accent {
  color: var(--accent);
  display: inline-block;
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-out-expo) 1.2s forwards;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 3rem;
  overflow: hidden;
}

.subtitle-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: slideUp 0.8s var(--ease-out-expo) 1s forwards;
}

.subtitle-reveal strong {
  color: var(--text);
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  opacity: 0;
  animation: fadeIn 0.8s var(--ease-out-expo) 1.3s forwards;
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}

.btn-primary:hover {
  border-color: var(--accent);
  color: var(--bg);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-arrow {
  transition: transform 0.4s var(--ease-out-expo);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Scroll Indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* --- Section Common --- */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 3rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s var(--ease-out-expo);
}

.section-label.visible {
  opacity: 1;
  transform: translateY(0);
}

.label-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.label-line {
  width: 60px;
  height: 1px;
  background: rgba(0, 212, 255, 0.3);
}

.label-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* --- About Section --- */
.about {
  position: relative;
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-headline h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.about-headline em {
  font-style: italic;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-description p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.stat-suffix {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 0.25rem;
}

/* --- Marquee --- */
.marquee-section {
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding-right: 3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  white-space: nowrap;
}

.marquee-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* --- Projects Section --- */
.projects {
  background: var(--bg-secondary);
  position: relative;
}

.projects::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.projects-header h2 {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 4rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Project Card */
.project-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.4s var(--ease-out-expo);
}

.project-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateY(-4px);
}

.project-card-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 320px;
}

.project-visual {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-graphic {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.project-graphic-label {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  opacity: 0.08;
  position: absolute;
  z-index: 1;
}

/* DesignSetGo Graphic */
.dsg-grid {
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 8px;
  transform: rotate(45deg);
}

.dsg-block {
  background: var(--accent-gradient);
  border-radius: 8px;
  opacity: 0;
  animation: dsgPulse 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.2s);
}

/* Airo Graphic */
.airo-graphic canvas {
  width: 100%;
  height: 100%;
}

/* RPG Graphic */
.rpg-graphic canvas {
  width: 100%;
  height: 100%;
}

/* Obsidian Graphic */
.obsidian-graphic canvas {
  width: 100%;
  height: 100%;
}

/* Vantalyze Graphic */
.vantalyze-graphic canvas {
  width: 100%;
  height: 100%;
}

.project-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  color: var(--accent);
}

.project-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

/* --- Contact Section --- */
.contact {
  background: var(--bg);
  position: relative;
}

.contact-content {
  text-align: center;
  padding: 4rem 0;
}

.contact-headline h2 {
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: all 0.4s var(--ease-out-expo);
}

.contact-link:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.05);
  transform: translateY(-2px);
}

.contact-link-arrow {
  transition: transform 0.4s var(--ease-out-expo);
}

.contact-link:hover .contact-link-arrow {
  transform: translate(2px, -2px);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 2rem 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-name, .footer-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* --- Reveal Animations --- */
.reveal-text .reveal-line {
  display: block;
  overflow: hidden;
}

.reveal-text .reveal-line > * {
  display: inline-block;
}

.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--ease-out-expo);
  transition-delay: var(--delay, 0s);
}

.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-text .reveal-line {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-text.visible .reveal-line {
  opacity: 1;
  transform: translateY(0);
}

.reveal-text.visible .reveal-line:nth-child(1) { transition-delay: 0s; }
.reveal-text.visible .reveal-line:nth-child(2) { transition-delay: 0.1s; }
.reveal-text.visible .reveal-line:nth-child(3) { transition-delay: 0.2s; }

/* --- Keyframes --- */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes dsgPulse {
  0%, 100% { opacity: 0.15; transform: scale(0.9); }
  50% { opacity: 0.6; transform: scale(1); }
}


/* --- Responsive --- */
@media (max-width: 900px) {
  body { cursor: auto; }
  .cursor, .cursor-follower { display: none; }

  .nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.5rem; }

  .section-container { padding: 5rem 1.5rem; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .project-card-inner {
    grid-template-columns: 1fr;
  }

  .project-visual {
    min-height: 200px;
  }

  .hero-cta {
    flex-direction: column;
    gap: 2rem;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .nav-links { gap: 1rem; }
  .nav-link { font-size: 0.7rem; }

  .hero-name {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .about-stats {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .project-info { padding: 1.5rem; }
  .footer { padding: 1.5rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; }
}
