/* 
===============================
  Corrafinium Inc Stylesheet
  Theme: Pastel Dreamwave
  Author: You!
===============================
*/

/* Global reset for layout consistency */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styling */
body {
  font-family: 'Poppins', sans-serif;
  color: #2e1f47;
  background: #ffeaf7;
  overflow-x: hidden;
}

/* ===== Featured Projects Heading ===== */
#projects h2 {
  text-align: center;
  font-size: 3.2em; /* bigger for more presence */
  background: linear-gradient(90deg, #ff77aa, #8353d6, #4a90e2);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientMove 4s ease-in-out infinite alternate,
             pulseSize 6s ease-in-out infinite;
}

/* Gradient animation */
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Smooth “breathing” scale animation */
@keyframes pulseSize {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08); /* grows 8% larger mid-animation */
  }
}

/* ===== Soft Animated Background ===== */
.background-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;

  /* Gentle, airy pink–blue–lavender gradient */
  background: linear-gradient(270deg,
    #fce7ef,
    #dfeaff,
    #f7e9ff,
    #e8f6ff
  );
  background-size: 600% 600%;
  animation: gradientShift 30s ease infinite;
  opacity: 0.8; /* slightly transparent for a softer look */
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Header ===== */
header {
  text-align: center; 
  padding: 60px 20px 40px;
}
.logo {
  color: #9b5de5;
  font-size: 3em;
  text-shadow: 0 0 10px rgba(155, 93, 229, 0.4);
  
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  
  white-space: nowrap;        /* Keep it all on one line */
  word-break: keep-all;       /* Prevent breaking mid-word */
  overflow: hidden;           /* Prevent overflow causing wrapping */
  text-align: center;
  display: inline-block;
  max-width: 100%;            /* Don’t overflow container */
}

.tagline {
  font-style: italic;
  color: #6a4c93;
  margin-bottom: 20px;
}

/* Navigation styling */
nav a {
  margin: 0 10px;
  color: #5a189a;
  text-decoration: none;
  transition: color 0.3s;
}
nav a:hover {
  color: #ff8fab;
}

/* ===== Main Content ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Section titles */
h2 {
  text-align: center;
  color: #6a4c93;
  margin-bottom: 10px;
}

/* ===== Project Cards ===== */
.project-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin-top: 20px;
}
.project-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  width: 250px;
  padding: 15px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, outline-color 0.3s ease;
  
  outline: 2px solid transparent;  /* Invisible outline initially */
  outline-offset: 6px;             /* Space between outline and card */
  cursor: default;
}
.project-card:hover {
  outline-color: #a06cd5; /* Pastel purple outline on hover */
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(155, 93, 229, 0.2);
  cursor: pointer; /* Shows pointer cursor on hover */
}
.project-card img {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 10px;
}
.project-card h3 a {
  text-decoration: none;
  color: #9b5de5;
}
.project-card p {
  font-size: 0.9em;
  color: #4a3a69;
}

#projects h2,
#projects p {
  max-width: 600px;        /* limit width so it doesn’t span too wide */
  margin: 0 auto 40px;     /* auto left/right centers it */
  text-align: center; 
  font-size: 1.1em;          /* slightly larger text for balance */
}

.project-card a {
  text-decoration: none;  /* Remove underline */
  color: inherit;         /* Keep text color same as surrounding */
  display: block;         /* Ensure link fills the card */
}

.project-card a:hover {
  text-decoration: none;  /* No underline on hover either */
  /* You can add other hover styles like color or box-shadow here */
}

.video-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px; /* space between videos */
  justify-content: center;
}

.video-container iframe {
  flex: 1 1 300px; /* flexible width, minimum 300px */
  max-width: 560px;
  height: 315px;
  border: none;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px;
  color: #5a189a;
  font-size: 0.9em;
}
footer a {
  color: #9b5de5;
  text-decoration: none;
}
footer a:hover {
  color: #ff8fab;
}

#intro {
  margin-bottom: 60px; /* adjust as you like */
}

#intro p {
  margin-bottom: 30px; /* Adjust the gap size here */
}

/* ===== Logo Fade and Letter Float Animation with Glow ===== */
.logo {
  display: inline-block;
  font-size: 3em;
  font-weight: 600;
  color: #a06cd5;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: logoFade 1.5s ease forwards;
  text-align: center;
}

/* Fade the whole logo in */
@keyframes logoFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Each letter animation */
.logo span {
  display: inline-block;
  animation: 
    letterFloat 2.5s ease-in-out infinite,
    letterColor 2.5s ease-in-out infinite;
  
  text-shadow: 0 0 8px rgba(240, 200, 255, 0.4);
}

/* New keyframes for color shift */
@keyframes letterColor {
  0%, 100% {
    color: #a06cd5; /* original pastel purple */
  }
  50% {
    color: #85c1f9; /* pastel blue */
  }
}

/* Float up and reset */
@keyframes letterFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Delay each letter for a cascading effect */
.logo span:nth-child(1)  { animation-delay: 0.1s; }
.logo span:nth-child(2)  { animation-delay: 0.2s; }
.logo span:nth-child(3)  { animation-delay: 0.3s; }
.logo span:nth-child(4)  { animation-delay: 0.4s; }
.logo span:nth-child(5)  { animation-delay: 0.5s; }
.logo span:nth-child(6)  { animation-delay: 0.6s; }
.logo span:nth-child(7)  { animation-delay: 0.7s; }
.logo span:nth-child(8)  { animation-delay: 0.8s; }
.logo span:nth-child(9)  { animation-delay: 0.9s; }
.logo span:nth-child(10) { animation-delay: 1.0s; }
.logo span:nth-child(11) { animation-delay: 1.1s; }
.logo span:nth-child(12) { animation-delay: 1.2s; }
.logo span:nth-child(13) { animation-delay: 1.3s; }
.logo span:nth-child(14) { animation-delay: 1.4s; }

/* ===== Buttons ===== */
.button {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: #9b5de5;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}
.button:hover {
  background: #ff8fab;
}

/* ===== Navigation Links ===== */
nav {
  text-align: center;
  margin-top: 10px;
}

nav a {
  position: relative;
  margin: 0 12px;
  color: #5a189a;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* Create the underline (hidden by default) */
nav a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #ffb3c6, #b388eb, #a0c4ff);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Hover effect: pastel underline expands */
nav a:hover::after {
  width: 100%;
}


/* ===== Utility Styles ===== */
.back-link {
  display: inline-block;
  margin: 20px;
  text-decoration: none;
  color: #9b5de5;
  transition: color 0.3s ease;
}
.back-link:hover {
  color: #ff8fab;
}

/* ===== Portfolio Page ===== */
.center-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.intro-text {
  font-size: 1.1rem;
  color: #4a3a69; /* matches the other pages' paragraph tone */
  margin-top: 1rem;
  line-height: 1.6;
}

/* ===== Demo Reel Section ===== */
.video-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Capsules ===== */
#portfolio-capsules {
  margin-top: 3rem;
}

.capsule-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1000px;
  margin: 2rem auto;
}

.capsule {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.capsule:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* ===== Capsule Media (Video) ===== */
.capsule-media {
  width: 50%;
  height: auto; /* or 225px if you want fixed */
}

.capsule-media video {
  width: 100%;
  height: auto;
  display: block;
  border: none;
  border-radius: 0;
  cursor: pointer;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

.capsule:hover video {
  filter: brightness(1);
}

/* ===== Fix GIF Previews in Capsules ===== */
.capsule-media img {
  width: 100%;               /* scale to fit width */
  height: auto;              /* preserve aspect ratio (no stretch) */
  display: block;
  object-fit: contain;       /* show whole GIF */
  object-position: center;
  border: none;
  filter: brightness(0.9);
  transition: filter 0.3s ease;
}

/* Brighten the GIF slightly on hover (same as video hover effect) */
.capsule:hover .capsule-media img {
  filter: brightness(1);
}

.capsule-text {
  padding: 1.5rem;
  text-align: left;
}

.capsule-text h4 {
  margin-bottom: 0.5rem;
  color: #fff;
}

.capsule-text p {
  color: #4a3a69; /* same as main site project-card text */
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Alternate capsule layout for rhythm */
.capsule:nth-child(even) {
  flex-direction: row-reverse;
}

/* Base title styles */
.project-card h3,
.project-card h3 a,
.capsule-text h4 {
  color: #9b5de5; /* pastel purple */
  transition: color 0.3s ease;
  position: relative; /* needed for underline */
  display: inline-block; /* to contain underline */
}

/* Dark mode title colors */
body.dark .project-card h3,
body.dark .project-card h3 a,
body.dark .capsule-text h4 {
  color: #caa8ff; /* lighter pastel purple */
}

/* Underline base (hidden) */
.project-card h3 a::after,
.capsule-text h4::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, #ffb3c6, #b388eb, #a0c4ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* On hover of the card/capsule, show underline and change text color to pastel pink */
.project-card:hover h3 a,
.project-card:hover h3,
.capsule:hover .capsule-text h4 {
  color: #ff8fab;
}

.project-card:hover h3 a::after,
.capsule:hover .capsule-text h4::after {
  width: 100%;
}

/* Dark mode: keep gradient underline on hover */
body.dark .project-card:hover h3 a,
body.dark .project-card:hover h3,
body.dark .capsule:hover .capsule-text h4 {
  color: #ff8fab;
}

body.dark .project-card:hover h3 a::after,
body.dark .capsule:hover .capsule-text h4::after {
  background: linear-gradient(90deg, #ffb3ef, #b388eb, #8cbfff);
  width: 100%;
}

a {
  text-decoration: none;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .capsule {
    flex-direction: column;
  }

  .capsule-media {
    width: 100%;
  }

  .capsule-text {
    text-align: center;
  }
}

/* ===== Scroll Reveal Animation (with stagger) ===== */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Capsule hover outline effect (matches main page) ===== */
.capsule {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, outline-color 0.3s ease;
  outline: 2px solid transparent;
  outline-offset: 6px;
  cursor: default;
}

.capsule:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(155, 93, 229, 0.2);
  outline-color: #a06cd5; /* same pastel purple as main page */
  cursor: pointer;
}

/* Dark mode version */
body.dark .capsule {
  background: rgba(35, 25, 50, 0.8);
  outline-color: transparent;
  box-shadow: 0 5px 15px rgba(155, 93, 229, 0.1);
}
body.dark .capsule:hover {
  outline-color: #b388eb; /* pastel violet glow */
  box-shadow: 0 5px 20px rgba(179, 136, 235, 0.3);
}



.image-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 40px; /* gap below gallery */
}

.image-gallery img {
  max-width: 600px;
  max-height: 350px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.image-gallery button {
  background: #333;
  color: white;
  border: none;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s ease;
}

.image-gallery button:hover {
  background: #555;
}

/* === Image Gallery === */
.image-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: nowrap;
}

.image-gallery img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.image-gallery button {
  background-color: #444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 5px;
  user-select: none;
  transition: background-color 0.3s;
}

/* Make gallery mobile-friendly */
@media (max-width: 600px) {
  .image-gallery {
    flex-direction: column;
  }

  .image-gallery button {
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
  }

  .image-gallery img {
    max-width: 90%;
  }
}

/* === Responsive YouTube video for project pages only === */
.project-video {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}

.project-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* === Back to Portfolio Link Styling === */
.back-link {
  position: relative;
  color: inherit;                /* Matches text color in dark/light mode */
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: 2rem;
  transition: color 0.3s ease;
}

/* Gradient underline effect */
.back-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px; /* Adjust underline offset */
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #ff006e, #8338ec, #3a86ff); /* Replace with your nav gradient */
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}

/* Hover state */
.back-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

a[href="portfolio.html"] {
  display: inline-block;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ============================================
   🌙 Dark Mode — Pastel Dreamwave (v1)
   ============================================ */
body.dark {
  background: #1a1224;
  color: #e8dcff;
}

/* Background gradient animation, dark version */
body.dark .background-gradient {
  background: linear-gradient(270deg,
    #2b183b,
    #1c2346,
    #2d1f3a,
    #18263e
  );
  opacity: 0.5;
}

/* Headings and logo */
body.dark .logo {
  color: #caa8ff;
  text-shadow: 0 0 10px rgba(202, 168, 255, 0.4);
}
body.dark .tagline {
  color: #c6b3ff;
}
body.dark h2 {
  color: #caa8ff;
}
body.dark #projects h2 {
  background: linear-gradient(90deg, #ffadc1, #b398f9, #7db9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation */
body.dark nav a {
  color: #caa8ff;
}
body.dark nav a:hover {
  color: #ffb3c6;
}
body.dark nav a::after {
  background: linear-gradient(90deg, #ffb3ef, #b388eb, #8cbfff);
}

/* Project cards */
body.dark .project-card {
  background: rgba(35, 25, 50, 0.8);
  outline-color: transparent;
  box-shadow: 0 5px 15px rgba(155, 93, 229, 0.1);
}
body.dark .project-card:hover {
  outline-color: #b388eb;
  box-shadow: 0 5px 20px rgba(179, 136, 235, 0.3);
}
body.dark .project-card h3 a {
  color: #caa8ff;
}
body.dark .project-card p {
  color: #d8cfff;
}

/* Buttons */
body.dark .button {
  background: #8353d6;
  color: #ffffff;
}
body.dark .button:hover {
  background: #ff8fab;
}

/* Footer */
body.dark footer {
  color: #caa8ff;
}
body.dark footer a {
  color: #b388eb;
}
body.dark footer a:hover {
  color: #ffb3c6;
}

/* Back link */
body.dark .back-link {
  color: #b388eb;
}
body.dark .back-link:hover {
  color: #ffb3ef;
}

/* Dark mode portfolio text */
body.dark .intro-text {
  color: #d8cfff; /* soft lavender for readability */
}

body.dark .capsule-text h4 {
  color: #caa8ff; /* same tone as logo/text highlights */
}

body.dark .capsule-text p {
  color: #d8cfff; /* gentle pastel purple for body text */
}

@media (max-width: 600px) {
  .logo {
    font-size: 2.2em;   /* Smaller so it fits on narrow screens */
    letter-spacing: 0.03em; /* Slightly tighter spacing */
  }
}