/* ---------------------------------
   NEW: FADE-IN ANIMATION
   This provides the "cool animation" on page load.
---------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------
   STARFIELD BACKGROUND
---------------------------------- */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: #000;
}

/* ---------------------------------
   GLOBAL & BODY STYLES
   FIXED: Font-family now correctly uses the loaded Google Fonts.
---------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  /* FIXED: Using 'Lato' as the base font */
  font-family: 'Lato', Arial, sans-serif;
  background: transparent; /* Allows the starfield to show */
  color: #f0f0f0; /* Slightly softer white for text */
  font-size: 16px;
  line-height: 1.7;
}

/* Base link styles */
a {
  color: #00c6ff; /* Use a single, consistent bright blue */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
a:hover {
  color: #fff;
  text-shadow: 0 0 8px #00c6ff; /* Add a glow on hover */
}

/* FIXED: Using 'Montserrat' for all headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  color: #fff;
  margin-top: 0;
}

.site-title {
  font-weight: 600;
  margin-bottom: 15px;
}

/* ---------------------------------
   NEW: GLOBAL GLASS-PANEL STYLE
   This reusable class will be the base for our new design.
---------------------------------- */
.glass-panel {
  background: rgba(10, 10, 10, 0.7); /* Dark, 70% transparent */
  border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle white border */
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); /* Soft shadow */
  
  /* The "Frosted Glass" effect */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For Safari */
}

/* ---------------------------------
   HEADER (REDESIGNED)
   Now a permanent "glass" bar.
---------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  text-align: center;
  z-index: 1000;
  
  /* Apply the glass effect */
  background: rgba(10, 10, 10, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

nav a {
  margin: 0 15px;
}

/* ---------------------------------
   FIX FOR FIXED-HEADER LAYOUT
   (Increased padding-top to 150px)
---------------------------------- */
.home-section,
.about-section,
.writings-page,
.portfolio-page {
  padding-top: 150px; /* More space for the fixed header */
  padding-bottom: 40px;
  
  /* Apply the "cool animation" to all main content sections */
  animation: fadeIn 1s ease-out;
}

/* ---------------------------------
   HOME PAGE STYLES
   Applying the "glass-panel" style
---------------------------------- */
.home-section {
  text-align: center;
  min-height: 80vh;
}

.home-layout {
  display: block;
}

.home-right {
  width: 90%;
  max-width: 800px;
  margin: 40px auto 0 auto;
  
  /* Make it a "containing" block */
  position: relative; 
  overflow: hidden; /* Hide blob overflow */

  /* Old styles */
  background: rgba(20, 20, 20, 0.4);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #333;
}.home-right {
  width: 90%;
  max-width: 800px;
  margin: 40px auto 0 auto;
  
  /* Make it a "containing" block */
  position: relative; 
  overflow: hidden; /* Hide blob overflow */

  /* Old styles */
  background: rgba(20, 20, 20, 0.4);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #333;
}

/* ---------------------------------
   AUDIO BUTTONS
---------------------------------- */
.audio-control-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.audio-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.1s;
}
.audio-btn:hover {
  background-color: #0056b3;
}
.audio-btn:active {
  transform: scale(0.95);
}

/* ---------------------------------
   CONTACT SECTION
   Applying the "glass-panel" style
---------------------------------- */
.contact-section {
  padding: 40px;
  text-align: center;
  max-width: 800px;
  margin: 40px auto;
  
  /* Use the new glass style */
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contact-form {
  max-width: 600px;
  margin: 30px auto;
  text-align: left;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
  border-radius: 5px;
  box-sizing: border-box;
}

/* ---------------------------------
   ABOUT PAGE
   Applying the "glass-panel" style
---------------------------------- */
.about-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-left: 20px;
  padding-right: 20px;
  overflow: hidden;
  
  /* Use the glass style on the main text container */
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px;
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.about-section h2 {
    font-size: 2rem;
    margin-top: 20px;
}
.about-section p {
    font-size: 1.1rem;
    max-width: 800px;
    text-align: center;
}
.tapestry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  width: 100%;
  max-width: 1000px;
  margin: 20px 0;
  z-index: 1;
  border-radius: 8px;
  overflow: hidden; /* Clips the corners of the grid */
}
.tapestry-grid div {
  padding-top: 100%;
  background-size: cover;
  background-position: center;
}

/* ---------------------------------
   WRITINGS PAGE
   Applying the "glass-panel" style
---------------------------------- */
.writings-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 30px;
  
  /* Use the new glass style */
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.writings-intro,
.creative-piece {
  text-align: center;
  border-bottom: 2px solid #444;
  padding-bottom: 20px;
  margin-bottom: 30px;
}
.journal-excerpt {
  background: #1a1a1a; /* Darker interior background */
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #333;
}
.journal-excerpt header { padding-bottom: 10px; border-bottom: 1px solid #333; margin-bottom: 15px; }
.journal-excerpt h3 { margin: 0; color: #00c6ff; }
.journal-excerpt time { font-size: 0.9rem; color: #aaa; font-style: italic; }
.journal-excerpt blockquote { margin: 0; padding-left: 20px; border-left: 4px solid #007bff; font-style: italic; color: #ddd; line-height: 1.7; }
.journal-excerpt blockquote p { margin-bottom: 15px; }
.section-divider { border: 0; height: 1px; background: #555; margin: 40px 0; }

/* ---------------------------------
   PORTFOLIO PAGE
---------------------------------- */
.portfolio-page {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}
.portfolio-intro {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px;
  
  /* Use the new glass style */
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.portfolio-grid {
  /* We are replacing the 'display: grid' properties */
  column-count: 3; /* Default for desktop (e.g., 3 columns) */
  column-gap: 20px;
}
.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  background: #222;
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  /* NEW: Replaces grid-gap and controls flow */
  margin-bottom: 20px;
  break-inside: avoid; /* This prevents an item from splitting across columns */
}
.portfolio-item img {
  display: block;
  width: 100%;
  height: auto; /* REVERTED: Allows image's natural height */
  /* REMOVED: height: 300px; */
  /* REMOVED: object-fit: cover; */
  transition: transform 0.3s ease;
}
.portfolio-caption { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0, 0, 0, 0.85); color: #fff; padding: 15px; box-sizing: border-box; transform: translateY(100%); transition: transform 0.3s ease-in-out; }
.portfolio-item:hover .portfolio-caption { transform: translateY(0); }
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-caption h3 { margin: 0 0 5px 0; color: #00c6ff; }
.portfolio-caption p { margin: 0; font-size: 0.9rem; }

/* ---------------------------------
   NAVIGATION ACTIVE STATE
---------------------------------- */
nav a.active {
  color: #fff;
  text-shadow: 0 0 8px #00c6ff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------------------------------
   FOOTER
---------------------------------- */
footer {
  background: transparent;
  border-top: 1px solid #333;
  padding: 15px;
  text-align: center;
  color: #ccc;
  position: relative;
  z-index: 10;
  margin-top: 40px;
}

/* ---------------------------------
   ANIMATED GRADIENT TEXT (OPTION 1)
---------------------------------- */
.animated-gradient {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;

  /* 1. Create a "trippy" gradient background */
  background: linear-gradient(120deg, 
    #00c6ff, /* Cyan */
    #ff00f3, /* Magenta */
    #ffb800, /* Gold */
    #00c6ff  /* Back to Cyan */
  );
  
  /* 2. Set the background to be huge */
  background-size: 300% 300%;

  /* 3. Clip the background to the SHAPE of the text */
  -webkit-background-clip: text;
  background-clip: text;

  /* 4. Make the text color transparent to show the gradient */
  color: transparent;

  /* 5. Animate the background-position */
  animation: gradient-shift 6s ease-in-out infinite alternate;
}

/* This @keyframes rule moves the gradient */
@keyframes gradient-shift {
  from {
    background-position: 0% 0%;
  }
  to {
    background-position: 100% 100%;
  }
}

/* Delete the old @keyframes glow rule */

/* ---------------------------------
   MEDIA QUERIES FOR MOBILE
---------------------------------- */
@media (max-width: 768px) {
  .site-title {
    font-size: 1.5rem;
  }
  nav a {
    margin: 0 10px;
    font-size: 0.9rem;
  }
  .home-right {
    width: 95%;
    padding: 20px;
  }
  .animated-gradient {
    font-size: 2rem;
  }
  .contact-section,
  .writings-page,
  .portfolio-intro,
  .about-section {
    width: auto;
    margin-left: 10px;
    margin-right: 10px;
    padding: 20px;
  }
}

/* ---------------------------------
   VOLUME SLIDER STYLES
---------------------------------- */
.volume-slider {
  width: 180px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 5px;
  outline: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(5px);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #00c6ff;
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #00c6ff;
}
/* ---------------------------------
   NEW: MASONRY MEDIA QUERIES
---------------------------------- */
@media (max-width: 992px) {
  .portfolio-grid {
    column-count: 2; /* 2 columns for tablets */
  }
}

@media (max-width: 576px) {
  .portfolio-grid {
    column-count: 1; /* 1 column for phones */
  }
}
/* ---------------------------------
   NEW FADE-IN ANIMATIONS
---------------------------------- */

/* 1. This is the "storyboard" for the animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px); /* Start 30px lower */
  }
  to {
    opacity: 1;
    transform: translateY(0); /* End at original position */
  }
}

/* 2. This applies the animation to the new sub-headline */
.fade-in-up {
  font-size: 1.25rem;
  color: #ccc;
  margin-top: 10px;
  margin-bottom: 30px;
  
  /* Animation: 'fadeInUp' name, 1s duration, 'ease-out' timing,
     '0.3s' delay, and 'forwards' to stay at the end state */
  animation: fadeInUp 1s ease-out 0.3s forwards;
  
  /* Start hidden */
  opacity: 0;
}

/* 3. This applies a longer delay to the button */
.fade-in-up-delay {
  animation: fadeInUp 1s ease-out 0.6s forwards;
  opacity: 0; /* Start hidden */
}
/* ---------------------------------
   LAVA LAMP EFFECT (OPTION 2)
---------------------------------- */

.lava-lamp-container {
  /* This is the magic: */
  /* 1. Blur the blobs */
  filter: blur(25px); 
  /* 2. Sharpen the edges where they meet */
  /* This creates the "merging" effect */
  contrast: 40; 
  
  /* Container setup */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lava-blob {
  position: absolute;
  border-radius: 50%;
  /* Using the same gradient as the text */
  background: linear-gradient(120deg, 
    #00c6ff, 
    #ff00f3
  );
  opacity: 0.7;
  
  /* This calls the animation */
  animation: move-blob 15s infinite alternate;
}

/* Create 4 blobs of different sizes/speeds */
.lava-blob:nth-child(1) {
  width: 250px; height: 250px;
  top: 10%; left: 10%;
  animation-duration: 15s;
}
.lava-blob:nth-child(2) {
  width: 200px; height: 200px;
  top: 50%; left: 60%;
  animation-duration: 12s;
  animation-direction: alternate-reverse;
}
.lava-blob:nth-child(3) {
  width: 150px; height: 150px;
  top: 70%; left: 10%;
  animation-duration: 18s;
}
.lava-blob:nth-child(4) {
  width: 180px; height: 180px;
  top: 20%; left: 80%;
  animation-duration: 10s;
  animation-direction: alternate-reverse;
}

/* Defines the movement for the blobs */
@keyframes move-blob {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(50%, 50%) rotate(360deg);
  }
}

/* This container holds the text */
.hero-content {
  position: relative;
  z-index: 10; /* Sits ON TOP of the lava lamp */
  text-align: center;
}