/* Undermountain Coding Company - Bioluminescent Underdark Theme */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Fira+Code:wght@300;400;500&display=swap');

/* CSS Custom Properties - The Color Palette */
:root {
  /* The Void (Backgrounds) */
  --void-deep: #0a0a12;
  --void-surface: #0d0d18;
  --void-elevated: #12121f;

  /* Lolth's Web (Connectors/Lines) */
  --web-dark: #202030;
  --web-light: #2a2a40;

  /* Faerzress (Accents/Glows) */
  --faerzress-purple: #9d00ff;
  --faerzress-purple-dim: rgba(157, 0, 255, 0.3);
  --faerzress-cyan: #00f3ff;
  --faerzress-cyan-dim: rgba(0, 243, 255, 0.3);

  /* Jarlaxle's Gold (Highlights/CTAs) */
  --gold: #ffd700;
  --gold-dim: rgba(255, 215, 0, 0.3);

  /* Text Colors */
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Fira Code', monospace;
  background-color: var(--void-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: linear-gradient(to bottom, var(--void-deep), transparent);
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo svg,
.nav-logo-img {
  width: 50px;
  height: 50px;
  aspect-ratio: 1;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--faerzress-cyan);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, var(--faerzress-purple-dim) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, var(--faerzress-cyan-dim) 0%, transparent 50%),
    var(--void-deep);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 15V45L30 60L0 45V15L30 0Z' fill='none' stroke='%23202030' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  padding: 2rem;
  margin-left: 10%;
}

.hero-title {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--faerzress-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 800px;
}

/* CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
}

.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta-button:hover {
  color: var(--void-deep);
  box-shadow: 0 0 30px var(--gold-dim);
}

.cta-button:hover::before {
  opacity: 1;
}

.cta-button span {
  position: relative;
  z-index: 1;
}

/* About Section */
.about {
  padding: 8rem 2rem;
  background: var(--void-surface);
  position: relative;
}

.about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--web-light), transparent);
}

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

.section-label {
  font-size: 0.75rem;
  color: var(--faerzress-cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.about-content {
  max-width: 800px;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.about-text strong {
  color: var(--text-primary);
}

/* Services Section */
.services {
  padding: 8rem 2rem;
  background: var(--void-deep);
}

.services-title {
  text-align: center;
  margin-bottom: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Service Card - Hexagonal Border */
.service-card {
  position: relative;
  padding: 2rem;
  background: var(--void-elevated);
  clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--void-elevated);
  clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
  z-index: -1;
}

.service-card:hover {
  transform: translateY(-5px);
}

.service-card.purple {
  box-shadow: 0 0 30px var(--faerzress-purple-dim);
}

.service-card.cyan {
  box-shadow: 0 0 30px var(--faerzress-cyan-dim);
}

.service-card.gold {
  box-shadow: 0 0 30px var(--gold-dim);
}

.service-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
}

.service-name {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.service-tagline {
  font-size: 0.8rem;
  color: var(--faerzress-cyan);
  margin-bottom: 1rem;
}

.service-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Labs Page Specific Styles */
.labs-hero {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4rem;
  position: relative;
}

.labs-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 0%, var(--void-deep) 100%),
    radial-gradient(ellipse at 50% 0%, var(--faerzress-purple-dim) 0%, transparent 60%);
}

.labs-content {
  padding: 4rem 2rem;
}

.labs-intro {
  max-width: 800px;
  margin: 0 auto 4rem;
  text-align: center;
}

.warning-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #ff6464;
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.experiment-card {
  background: var(--void-surface);
  border: 1px solid var(--web-dark);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.experiment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--faerzress-purple), var(--faerzress-cyan));
}

.experiment-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-active {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88;
}

.status-unstable {
  background: #ff6464;
  box-shadow: 0 0 10px #ff6464;
}

.status-archived {
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.experiment-title {
  margin-bottom: 1rem;
}

.experiment-description {
  margin-bottom: 1.5rem;
}

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

.tech-tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  background: var(--web-dark);
  color: var(--text-secondary);
  border-radius: 2px;
}

/* Footer */
.footer {
  padding: 4rem 2rem;
  background: var(--void-surface);
  border-top: 1px solid var(--web-dark);
  text-align: center;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--faerzress-cyan);
}

/* Contact Section */
.contact {
  padding: 8rem 2rem;
  background: var(--void-surface);
  text-align: center;
}

.contact-title {
  margin-bottom: 1rem;
}

.contact-subtitle {
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  background: var(--void-deep);
  border: 1px solid var(--web-dark);
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--faerzress-cyan);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-button {
  width: 100%;
  padding: 1rem 2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.submit-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.submit-button:hover {
  color: var(--void-deep);
}

.submit-button:hover::before {
  opacity: 1;
}

.submit-button span {
  position: relative;
  z-index: 1;
}

/* Form Success Message */
.submission-success {
  text-align: center;
  padding: 3rem 2rem;
  border: 1px solid var(--faerzress-purple-dim);
  border-radius: 4px;
  background: rgba(157, 0, 255, 0.05);
}

.submission-success .success-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.submission-success h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.submission-success p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Utilities */
.glow-purple {
  text-shadow: 0 0 20px var(--faerzress-purple-dim);
}

.glow-cyan {
  text-shadow: 0 0 20px var(--faerzress-cyan-dim);
}

.glow-gold {
  text-shadow: 0 0 20px var(--gold-dim);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--void-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--web-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--faerzress-purple);
}

/* Mobile Navigation - Hamburger Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.nav-links-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--void-deep);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-links-mobile.active {
  opacity: 1;
  visibility: visible;
}

.nav-links-mobile a {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links-mobile a:hover {
  color: var(--faerzress-cyan);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .nav-links {
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  .services-grid,
  .class-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Hide desktop nav, show hamburger */
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links-mobile {
    display: flex;
  }

  /* Hero adjustments */
  .hero-content {
    margin-left: 5%;
    margin-right: 5%;
    padding: 1rem;
  }

  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Grid layouts */
  .services-grid,
  .experiment-grid,
  .class-grid,
  .perks-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  /* Section padding */
  .about,
  .services,
  .contact,
  .guild-values {
    padding: 4rem 1.5rem;
  }

  .labs-content {
    padding: 2rem 1.5rem;
  }

  /* Footer */
  .footer-links {
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Form */
  .contact-form {
    padding: 0 1rem;
  }

  /* Service cards */
  .service-card,
  .class-card,
  .experiment-card {
    padding: 1.5rem;
  }

  /* Typography */
  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .about-text {
    font-size: 1rem;
  }

  /* CTA Button */
  .cta-button {
    padding: 0.875rem 1.5rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .nav-logo-text {
    font-size: 0.8rem;
  }

  .nav-logo svg,
  .nav-logo-img {
    width: 32px;
    height: 32px;
    aspect-ratio: 1;
  }

  .hero-title {
    font-size: clamp(1.5rem, 10vw, 2rem);
  }

  .section-label {
    font-size: 0.65rem;
  }

  .service-icon,
  .class-icon {
    width: 60px;
    height: 60px;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for grid items */
.animate-on-scroll.stagger-1 { transition-delay: 0.1s; }
.animate-on-scroll.stagger-2 { transition-delay: 0.2s; }
.animate-on-scroll.stagger-3 { transition-delay: 0.3s; }
.animate-on-scroll.stagger-4 { transition-delay: 0.4s; }
.animate-on-scroll.stagger-5 { transition-delay: 0.5s; }

/* Guild Page Styles */
.guild-hero {
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4rem;
  position: relative;
}

.guild-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 0%, var(--void-deep) 100%),
    radial-gradient(ellipse at 50% 0%, var(--gold-dim) 0%, transparent 60%);
}

.guild-intro {
  max-width: 800px;
  margin: 0 auto 4rem;
  text-align: center;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.class-card {
  position: relative;
  padding: 2rem;
  background: var(--void-elevated);
  border: 1px solid var(--web-dark);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.class-card:hover {
  transform: translateY(-8px);
}

.class-card.purple-glow:hover {
  box-shadow: 0 0 40px var(--faerzress-purple-dim);
  border-color: var(--faerzress-purple);
}

.class-card.cyan-glow:hover {
  box-shadow: 0 0 40px var(--faerzress-cyan-dim);
  border-color: var(--faerzress-cyan);
}

.class-card.gold-glow:hover {
  box-shadow: 0 0 40px var(--gold-dim);
  border-color: var(--gold);
}

.class-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
}

.class-name {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.class-role {
  font-size: 0.8rem;
  color: var(--faerzress-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.class-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Guild Values Section */
.guild-values {
  padding: 6rem 2rem;
  background: var(--void-surface);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto 0;
}

.value-item {
  text-align: center;
  padding: 1.5rem;
}

.value-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.value-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.value-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Careers Page Styles */
.careers-hero {
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4rem;
  position: relative;
}

.careers-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 0%, var(--void-deep) 100%),
    radial-gradient(ellipse at 30% 20%, var(--faerzress-purple-dim) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, var(--faerzress-cyan-dim) 0%, transparent 50%);
}

.careers-intro {
  max-width: 800px;
  margin: 0 auto 4rem;
  text-align: center;
}

.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto 4rem;
}

.perk-card {
  background: var(--void-elevated);
  border: 1px solid var(--web-dark);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.3s ease;
}

.perk-card:hover {
  border-color: var(--faerzress-cyan);
}

.perk-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.perk-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.perk-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Form Select */
.form-select {
  width: 100%;
  padding: 1rem;
  background: var(--void-deep);
  border: 1px solid var(--web-dark);
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.form-select:focus {
  outline: none;
  border-color: var(--faerzress-cyan);
}

.form-select option {
  background: var(--void-deep);
  color: var(--text-primary);
}
