/* Custom Fonts */
@font-face {
  font-family: 'police';
  src: url('police.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Iceland';
  src: url('Iceland-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* CSS Variables for Color Scheme */
:root {
  --primary-color: #0A3D07;
  --secondary-color: #00344A;
  --accent-burgundy: #63122B;
  --accent-black: #000000;
  --text-dark: #051c35d5;
  --text-medium: #0f2d34d5;
  --bg-overlay: rgba(255, 255, 255, 0.85);
}

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

body {
  margin: 0;
  font-family: 'Iceland', sans-serif;
  padding: 0;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: hidden;
  color: var(--text-dark);
  height: 100vh;
}

/* Video Background */
video#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.8;
}

/* Music Controls */
#music-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.95em;
  z-index: 1000;
}

#music-controls button {
  margin-left: 10px;
  padding: 4px 12px;
  border: none;
  background: var(--accent-black);
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'police', sans-serif;
  transition: background 0.3s ease;
}

#music-controls button:hover {
  background: var(--accent-burgundy);
}

#music-controls input[type="range"] {
  margin-left: 10px;
}

/* Header */
header {
  background: var(--bg-overlay);
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2em;
  color: var(--text-dark);
  margin: 0;
  font-family: 'police', sans-serif;
}

header .name {
  font-size: 1.5em;
  color: var(--secondary-color);
  font-family: 'police', sans-serif;
}

/* Hero Section */
.hero {
  background: var(--bg-overlay);
  padding: 40px 30px;
  margin: 30px auto;
  max-width: 900px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 30px;
}

.hero-content {
  flex: 1;
}

.hero-content h2 {
  font-size: 2em;
  color: var(--primary-color);
  margin-bottom: 15px;
  font-family: 'police', sans-serif;
}

.hero-content p {
  font-size: 1.25em;
  line-height: 1.6;
  color: var(--text-dark);
}

.hero-image {
  flex: 0 0 250px;
}

.hero-image img {
  width: 100%;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border: 5px solid var(--accent-black);
}

/* Projects Section */
.projects {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  background: var(--bg-overlay);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.projects h2 {
  font-size: 2em;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 30px;
  font-family: 'police', sans-serif;
}

.project-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.project-card {
  background: white;
  padding: 25px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--text-dark);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border: 3px solid transparent;
  width: 100%;
}

.project-card:hover {
  transform: translateX(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border-color: var(--accent-burgundy);
}

.project-card h3 {
  font-size: 1.5em;
  color: var(--secondary-color);
  margin-bottom: 12px;
  font-family: 'police', sans-serif;
}

.project-card p {
  font-size: 1.2em;
  line-height: 1.5;
  color: var(--text-medium);
}

/* Project Page Styles */
.project-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 40px;
  background: var(--bg-overlay);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.back-button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 30px;
  transition: background 0.3s;
  font-size: 1.1em;
}

.back-button:hover {
  background: var(--secondary-color);
}

.project-container h1 {
  font-size: 3em;
  color: var(--primary-color);
  margin-bottom: 30px;
  border-bottom: 3px solid var(--secondary-color);
  padding-bottom: 15px;
  font-family: 'police', sans-serif;
}

.project-container h2 {
  font-size: 2em;
  color: var(--secondary-color);
  margin-top: 40px;
  margin-bottom: 20px;
  font-family: 'police', sans-serif;
}

.project-container p {
  font-size: 1.45em;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.project-container ul {
  font-size: 1.35em;
  line-height: 1.8;
  margin-left: 30px;
  color: var(--text-dark);
}

.project-container li {
  margin-bottom: 10px;
}

/* Credits Footer */
footer.credits {
  margin-top: auto;
  text-align: center;
  font-size: 1.15em;
  color: #3b3b3b;
  background: var(--bg-overlay);
  padding: 30px 20px;
  font-family: 'police', sans-serif;
}

footer.credits p {
  margin: 0;
}

/* Page Section Management for SPA */
.page-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-section.active {
  position: relative;
  visibility: visible;
  opacity: 1;
}

/* Project Page Image Sections */
.image-section {
  margin: 30px 0;
}

.image-section p {
  font-family: 'Iceland', sans-serif;
  font-size: 1.45em;
  line-height: 1.8;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Vertical graph layout for general analysis */
.image-grid-vertical {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.image-grid-vertical img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid-vertical img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Test Sections */
.test-section {
  margin: 40px 0;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.test-section h3 {
  font-family: 'police', sans-serif;
  font-size: 1.8em;
  color: var(--secondary-color);
  margin-bottom: 25px;
  border-bottom: 2px solid var(--accent-burgundy);
  padding-bottom: 10px;
}

.test-section img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.test-section p {
  font-family: 'Iceland', sans-serif;
  font-size: 1.45em;
  line-height: 1.8;
  margin-top: 25px;
  color: var(--text-dark);
}

/* Code Output Styling */
.code-output {
  margin: 25px 0;
  background: #f5f5f5;
  border-left: 4px solid var(--accent-burgundy);
  border-radius: 5px;
  overflow-x: auto;
}

.code-output pre {
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  line-height: 1.6;
  padding: 20px;
  margin: 0;
  color: #2d2d2d;
  white-space: pre;
  overflow-x: auto;
}

/* GitHub Links Styling */
.github-links {
  font-family: 'Iceland', sans-serif;
  font-size: 1.45em;
  color: var(--accent-burgundy);
  margin: 20px 0 40px 0;
  text-align: center;
  line-height: 1.8;
}

.github-links a {
  color: var(--accent-burgundy);
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.3s ease;
}

.github-links a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Section Bubbles */
.section-bubble {
  background: var(--bg-overlay);
  padding: 30px 40px;
  margin: 30px 0;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.section-bubble h2 {
  font-family: 'police', sans-serif;
  font-size: 2em;
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 20px;
}

.section-bubble p,
.section-bubble ul {
  font-family: 'Iceland', sans-serif;
  font-size: 1.45em;
  line-height: 1.8;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.section-bubble ul {
  margin-left: 30px;
}

.section-bubble li {
  margin-bottom: 10px;
}

/* Call to Action Text */
.call-to-action {
  font-family: 'Iceland', sans-serif;
  font-size: 1.5em;
  color: var(--accent-burgundy);
  text-align: center;
  margin: 40px 0;
  font-weight: bold;
  line-height: 1.8;
}

/* Test Images Horizontal Layout */
.test-images-vertical {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.test-images-vertical img {
  width: 48%;
  max-width: 450px;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }

  header h1 {
    font-size: 1.5em;
    text-align: center;
  }

  header .name {
    font-size: 1.2em;
  }

  .hero {
    flex-direction: column-reverse;
    padding: 40px 20px;
    margin: 20px;
  }

  .hero-image {
    flex: 0 0 200px;
  }

  .hero-content h2 {
    font-size: 1.6em;
  }

  .hero-content p {
    font-size: 1.15em;
  }

  .projects {
    margin: 20px;
    padding: 20px;
  }

  .projects h2 {
    font-size: 1.6em;
  }

  .project-cards {
    gap: 15px;
  }

  .project-container {
    margin: 20px;
    padding: 20px;
  }

  .project-container h1 {
    font-size: 2em;
  }

  .project-container h2 {
    font-size: 1.5em;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-grid-vertical {
    gap: 15px;
  }

  .test-section {
    padding: 20px;
  }

  .test-section h3 {
    font-size: 1.5em;
  }

  .code-output pre {
    font-size: 0.85em;
    padding: 15px;
  }

  #music-controls {
    bottom: 10px;
    right: 10px;
    font-size: 0.9em;
    padding: 6px 10px;
  }

  .section-bubble {
    padding: 20px;
    margin: 20px 0;
  }

  .section-bubble h2 {
    font-size: 1.5em;
  }

  .github-links {
    font-size: 1.2em;
  }

  .call-to-action {
    font-size: 1.3em;
  }

  .test-images-vertical {
    flex-direction: column;
  }

  .test-images-vertical img {
    width: 100%;
    max-width: 100%;
  }
}

/* Portfolio Under Construction Message */
.construction-message {
  text-align: center;
  margin-top: 100px;
  font-size: 2em;
}
