/*
Font Palette:
- Space Grotesk (main title)
- Sora (subtitles or smaller headers)
- Karla (body text)
*/

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

body {
  font-family: "Space Grotesk", sans-serif;
  overflow: hidden;
  background: #000000;
  color: #FFFFFF;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Color Variables */
:root {
  --charcoal: #0d2150;
  --electric-blue: #7DF5FF;
  --electric-blue-dark: #0099CC;
  --white-accent: #FFFFFF;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(13, 33, 80, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header h1 {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: var(--white-accent);
  margin: 0;
  text-shadow: 0 0 20px var(--electric-blue), 0 0 40px var(--electric-blue), 0 0 60px rgba(125, 245, 255, 0.5);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-icon-link {
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.header-icon-link:hover {
  transform: translateY(-2px);
  opacity: 0.8;
  filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--electric-blue));
}

.header-icon {
  width: 32px;
  height: 32px;
  image-rendering: crisp-edges;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

.header-icon.itch-icon {
  width: 32px;
  height: 32px;
}

.header-home-link {
  color: var(--white-accent);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.3s ease, text-shadow 0.3s ease;
}

.header-home-link:hover {
  opacity: 0.8;
  text-shadow: 0 0 30px var(--electric-blue), 0 0 50px var(--electric-blue), 0 0 70px rgba(125, 245, 255, 0.7);
}

.header-home-link:active {
  opacity: 0.9;
}

/* Portal Game Container */
.portal-container {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  padding: 0;
  margin: 0;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  background: #0a0e27;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--charcoal);
}

.instructions {
  position: absolute;
  top: 30px;
  color: var(--white-accent);
  text-align: center;
  width: 100%;
  font-size: 18px;
  opacity: 0.9;
  font-family: "Karla", sans-serif;
  z-index: 100;
  pointer-events: none;
}

.mobile-instructions {
  display: none;
}

.desktop-instructions {
  display: inline;
}

@media (max-width: 768px) {
  .instructions {
    font-size: 12px;
    top: 10px;
    padding: 0 0.5rem;
  }
  
  .mobile-instructions {
    display: inline;
  }
  
  .desktop-instructions {
    display: none;
  }
}

/* Landscape mobile - smaller instructions */
@media (max-width: 768px) and (orientation: landscape) {
  .instructions {
    font-size: 10px;
    top: 5px;
    padding: 0 0.25rem;
  }
}

.mobile-instructions {
  display: none;
}

.desktop-instructions {
  display: inline;
}

@media (max-width: 768px) {
  .mobile-instructions {
    display: inline;
  }
  
  .desktop-instructions {
    display: none;
  }
}

/* Section Preview (the modal that pops up) */
.section-preview {
  position: absolute;
  top: 42.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13, 33, 80, 0.98);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 2rem;
  border-radius: 10px;
  width: 400px;
  height: 250px;
  text-align: center;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.section-preview h3 {
  color: var(--white-accent);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 1.8rem;
  margin: 0;
  flex-shrink: 0;
}

.section-preview p {
  color: #FFFFFF;
  font-family: "Karla", sans-serif;
  font-size: 1rem;
  margin: 0;
  line-height: 1.6;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-preview .explore-btn {
  flex-shrink: 0;
  margin-top: auto;
}

.explore-btn {
  background: var(--charcoal);
  color: #d8d8d8;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.explore-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

.back-home-btn {
  background: var(--charcoal);
  color: #d8d8d8;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  margin: 0 auto 2rem auto;
  display: block;
  width: fit-content;
}

.section-content {
  text-align: left;
}

.section-content > .back-home-btn {
  margin-left: auto;
  margin-right: auto;
}

#the-flop-video .section-content > div:first-child .back-home-btn {
  margin: 0;
  display: inline-block;
}

.back-home-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

/* Treasure Chest Modal Close Button */
.treasure-modal-close-btn {
  background: var(--charcoal);
  color: #d8d8d8;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 30px;
  border-radius: 25px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-top: 1rem;
}

.treasure-modal-close-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

/* Return to Portal Button */
.return-portal-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: var(--charcoal);
  color: #d8d8d8;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 12px 24px;
  border-radius: 25px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.return-portal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

/* Content Sections */
.content-sections {
  display: none;
  padding-top: 90px;
  padding-bottom: 70px;
  overflow: hidden;
  height: calc(100vh - 70px - 50px);
  margin-top: 70px;
  position: relative;
  cursor: none; /* Hide default cursor */
}

/* Custom sword cursor for content sections */
.sword-cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 10000;
  display: none;
  transform: scaleX(-1); /* Flip horizontally */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.content-sections .sword-cursor {
  display: block;
}

/* Keep sword cursor even over links and buttons */
.content-sections a,
.content-sections button,
.content-sections .project {
  cursor: none;
}

/* Treasure Chest Modal - show sword cursor */
#treasure-chest-modal {
  cursor: none;
}

#treasure-chest-modal a,
#treasure-chest-modal button,
#treasure-chest-modal audio {
  cursor: none;
}

.content-section {
  padding: 3rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100vh - 70px - 50px);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
}

.section-content {
  background: rgba(13, 33, 80, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3rem 1.5rem;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.7);
}

#portfolio .section-content {
  padding: 3rem 1rem;
}

.content-section h2 {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 3rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--white-accent);
  position: relative;
}

.content-section h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--charcoal), var(--white-accent));
  margin: 1rem auto 0 auto;
}

/* About Section */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.about-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.about-text h3 {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: var(--white-accent);
  margin-bottom: 1rem;
  text-align: center;
}

.about-text p {
  font-family: "Karla", sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #FFFFFF;
  text-align: center;
  max-width: 900px;
}

.about-text ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.about-text ul li a {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: #d8d8d8;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
  padding-bottom: 5px;
}

.about-text ul li a:hover {
  border-color: var(--electric-blue);
  color: var(--white-accent);
}

/* Projects */
.projects {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 3rem;
  width: 100%;
  max-width: 100%;
}

.project {
  background: rgba(13, 33, 80, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  width: 300px;
  height: 300px; /* Make squares */
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-sizing: border-box; /* Include padding in width/height */
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px var(--electric-blue);
  border-color: var(--electric-blue);
}

.project h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--white-accent);
  flex-shrink: 0;
}

.project p {
  font-family: "Karla", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: #FFFFFF;
  flex: 1;
}

.project-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: auto;
  flex-shrink: 0;
}

.project-btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 20px;
  background: var(--charcoal);
  color: #d8d8d8;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  display: inline-block;
}

.project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

/* Music Section */
.music-content {
  text-align: center;
}

.music-content > p {
  font-family: "Karla", sans-serif;
  font-size: 1.2rem;
  color: #FFFFFF;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.music-note {
  font-family: "Karla", sans-serif;
  font-size: 1.1rem;
  color: #FFFFFF;
  font-style: italic;
  margin-top: 2rem;
}

/* Modeling Section */
.modeling-content {
  text-align: center;
}

.modeling-content p {
  font-family: "Karla", sans-serif;
  font-size: 1.2rem;
  color: #FFFFFF;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.coming-soon {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  margin-top: 2rem;
}

/* Resume Section */
#resume .section-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#resume p {
  font-family: "Karla", sans-serif;
  font-size: 1.25rem;
  color: #FFFFFF;
  max-width: 600px;
  margin-bottom: 2rem;
}

.btn {
  padding: 12px 30px;
  background: var(--charcoal);
  color: #d8d8d8;
  text-decoration: none;
  border-radius: 30px;
  font-weight: bold;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--electric-blue);
  border-color: var(--electric-blue);
  color: #FFFFFF;
}

/* Contact Section */
#contact .section-content {
  text-align: center;
}

#contact p {
  font-family: "Karla", sans-serif;
  font-size: 1.25rem;
  color: #FFFFFF;
  max-width: 600px;
  margin: 0 auto 2rem;
}

#contact ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

#contact ul li a {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: #FFFFFF;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
  padding-bottom: 5px;
}

#contact ul li a:hover {
  border-color: var(--electric-blue);
  color: var(--white-accent);
}

/* Footer Container - ensure no spacing */
#footer-container {
  margin: 0;
  padding: 0;
  line-height: 0;
  display: block;
  height: 0;
  overflow: visible;
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 0.5rem 2rem;
  margin: 0;
  background: rgba(13, 33, 80, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  z-index: 1001;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.site-footer p {
  font-family: "Space Grotesk", sans-serif;
  color: var(--white-accent);
  font-size: 0.85rem;
  margin: 0;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.footer-icon-link:hover {
  transform: translateY(-2px);
  opacity: 0.8;
  filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--electric-blue));
}

.footer-icon {
  width: 24px;
  height: 24px;
  image-rendering: crisp-edges;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

.itch-icon {
  width: 24px;
  height: 24px;
}

.footer-icon-link:hover .footer-icon {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--electric-blue));
}

/* Scroll Animations */
.content-section {
  opacity: 1;
  transform: translateY(0);
  transition: none;
}

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

/* Responsive Styles */
@media (max-width: 992px) {
  .content-section h2 {
      font-size: 2.5rem;
  }

  .about-text p, #resume p {
      font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  /* Header adjustments */
  .site-header {
    padding: 0.75rem 1rem;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

  .header-icons {
    gap: 1rem;
  }

  .header-icon {
    width: 28px;
    height: 28px;
  }

  .header-icon.itch-icon {
    width: 28px;
    height: 28px;
  }

  /* Canvas */
  #gameCanvas {
    width: 100%;
    height: auto;
  }

  /* Instructions */
  .instructions {
    font-size: 14px;
    padding: 0 1rem;
    top: 20px;
  }

  /* Section preview */
  .section-preview {
    width: 90%;
    max-width: 400px;
    height: auto;
    min-height: 200px;
    padding: 1.5rem;
  }

  /* Projects */
  .project {
    width: 80%;
    margin: 0 auto;
  }

  .about-content {
    flex-direction: column;
  }

  /* Buttons */
  .back-home-btn,
  .treasure-modal-close-btn,
  .btn {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  /* Modal */
  #treasure-chest-modal > div {
    padding: 2rem 1.5rem;
    margin: 1rem;
    max-width: 90%;
  }

  /* Content sections */
  .content-section {
    padding: 2rem 1rem;
  }

  .section-content {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  /* Header */
  .site-header {
    padding: 0.5rem 0.75rem;
  }

  .site-header h1 {
    font-size: 1.25rem;
  }

  .header-icons {
    gap: 0.75rem;
  }

  .header-icon {
    width: 24px;
    height: 24px;
  }

  .header-icon.itch-icon {
    width: 24px;
    height: 24px;
  }

  /* Instructions */
  .instructions {
    font-size: 12px;
    padding: 0 0.5rem;
    top: 15px;
  }

  /* Content sections */
  .content-section h2 {
      font-size: 2rem;
  }

  .project {
    width: 90%;
  }

  .about-text p, #resume p, #contact p {
    font-size: 1rem;
  }

  .section-preview {
    width: 95%;
    padding: 1rem;
  }

  .section-preview h3 {
    font-size: 1.5rem;
  }

  .section-preview p {
    font-size: 0.9rem;
  }

  /* Buttons */
  .back-home-btn,
  .treasure-modal-close-btn,
  .btn {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  /* Modal */
  #treasure-chest-modal > div {
    padding: 1.5rem 1rem;
    margin: 0.5rem;
  }

  #treasure-chest-modal p {
    font-size: 0.9rem;
  }

  /* Footer */
  .site-footer {
    padding: 1rem 0.5rem;
    font-size: 0.85rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .header-icon-link {
    padding: 0.25rem;
  }

  .back-home-btn,
  .treasure-modal-close-btn,
  .btn,
  .explore-btn {
    min-height: 44px; /* iOS recommended touch target */
  }

  /* Disable hover effects on touch devices */
  .header-icon-link:hover {
    transform: none;
    opacity: 1;
  }
}

html {
  scroll-behavior: smooth;
}
