:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --accent-blue: #00bfff;
  --accent-green: #39ff14;
  --accent-purple: #8a2be2;
  --gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-green));
}

[data-theme="light"] {
  --bg-primary: #fdfdfd;
  --bg-secondary: #f4f4f4;
  --text-primary: #222222;
  --text-secondary: #666666;
}

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

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

/* Accessibility - Visually Hidden Labels */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.logo {
  height: 60px;
  background: transparent;
  image-rendering: -webkit-optimize-contrast;
  mix-blend-mode: normal;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  margin-left: 2rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--accent-blue);
}

#theme-toggle {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.3s;
}

#theme-toggle:hover {
  transform: rotate(20deg);
}

/* Hero with Fixed Puzzle Mosaic Background */
.hero {
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.3), rgba(138, 43, 226, 0.3), rgba(57, 255, 20, 0.2)), url('../assets/herobg.jpg');
  background-size: 200% 200%, cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 20px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.cta {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(0,191,255,0.4);
}

/* Floating Puzzle Pieces Animation */
.puzzle-floaters {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.puzzle-floaters::before,
.puzzle-floaters::after {
  content: '';
  position: absolute;
  width: 280px; 
  height: 280px;
  background: linear-gradient(135deg, #00bfff, #8a2be2);
  opacity: 0.7;
  clip-path: polygon(
    20% 0%, 35% 0%, 38% 3%, 40% 8%, 42% 12%, 45% 14%, 
    50% 15%, 55% 14%, 58% 12%, 60% 8%, 62% 3%, 65% 0%, 80% 0%,
    80% 20%, 83% 22%, 88% 24%, 92% 26%, 94% 30%, 95% 35%,
    95% 50%, 94% 55%, 92% 58%, 88% 60%, 83% 62%, 80% 65%, 80% 80%,
    65% 80%, 62% 83%, 60% 88%, 58% 92%, 55% 94%, 50% 95%,
    45% 94%, 42% 92%, 40% 88%, 38% 83%, 35% 80%, 20% 80%,
    20% 65%, 17% 62%, 12% 60%, 8% 58%, 6% 55%, 5% 50%,
    6% 45%, 8% 42%, 12% 40%, 17% 38%, 20% 35%, 20% 20%
  );
  filter: 
    drop-shadow(2px 0 0 rgba(0, 0, 0, 0.8))
    drop-shadow(-2px 0 0 rgba(0, 0, 0, 0.8))
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(0 -2px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(-1px -1px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(1px -1px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(-1px 1px 0 rgba(0, 0, 0, 0.8))
    drop-shadow(0 12px 30px rgba(0,191,255,0.6));
}

.puzzle-floaters::before {
  top: 20%; left: 10%;
  animation: float 22s infinite ease-in-out;
}

.puzzle-floaters::after {
  bottom: 25%; right: 15%;
  animation: float 28s infinite ease-in-out reverse;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.7; }
  50% { transform: translate(40px, -40px) rotate(180deg); opacity: 1; }
  100% { transform: translate(0, 0) rotate(360deg); opacity: 0.7; }
}

/* Sections & Grid */
.section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Portfolio section - wider for better showcase */
#portfolio.section {
  max-width: 1600px;
  padding: 80px 3%;
}

h2 {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* Portfolio grid - horizontal expansion */
#portfolio .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 100%;
}

@media (max-width: 1400px) {
  #portfolio .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  #portfolio .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #portfolio .grid {
    grid-template-columns: 1fr;
  }
}

.card, .portfolio-card {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  transition: transform 0.4s, box-shadow 0.4s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.card:hover, .portfolio-card.snap:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0,191,255,0.3);
}

.portfolio-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.portfolio-card .card-content {
  padding: 0.5rem 0;
}

.portfolio-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.portfolio-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Matrix Theme - Green glowing cyberpunk */
.portfolio-card.matrix-theme {
  border: 2px solid rgba(57, 255, 20, 0.3);
}

.portfolio-card.matrix-theme:hover {
  box-shadow: 0 18px 40px rgba(57, 255, 20, 0.4);
  border-color: rgba(57, 255, 20, 0.6);
}

.portfolio-card.matrix-theme h3 {
  color: #39ff14;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

/* SMOIFS Theme - Orange/Amber audio professional */
.portfolio-card.smoifs-theme {
  border: 2px solid rgba(255, 140, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.05), rgba(255, 69, 0, 0.05));
}

.portfolio-card.smoifs-theme:hover {
  box-shadow: 0 18px 40px rgba(255, 140, 0, 0.5);
  border-color: rgba(255, 140, 0, 0.8);
}

.portfolio-card.smoifs-theme h3 {
  color: #ff8c00;
  text-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
}

/* Jhymn Art Gallery Theme - Artistic purple/magenta gallery */
.portfolio-card.jhymn-theme {
  border: 2px solid rgba(186, 85, 211, 0.4);
  background: linear-gradient(135deg, rgba(186, 85, 211, 0.08), rgba(147, 51, 234, 0.05));
}

.portfolio-card.jhymn-theme:hover {
  box-shadow: 0 18px 40px rgba(186, 85, 211, 0.5);
  border-color: rgba(186, 85, 211, 0.8);
}

.portfolio-card.jhymn-theme h3 {
  color: #ba55d3;
  text-shadow: 0 0 10px rgba(186, 85, 211, 0.6);
}

/* Form Styles */
form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Honeypot field - hidden from real users */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input, textarea {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--text-secondary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  resize: vertical;
}

/* Form Message Styles */
.form-message {
  padding: 1rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  display: none;
  font-weight: 500;
}

.form-message.success {
  display: block;
  background-color: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: #39ff14;
}

.form-message.error {
  display: block;
  background-color: rgba(255, 69, 0, 0.1);
  border: 1px solid rgba(255, 69, 0, 0.3);
  color: #ff4500;
}

button[type="submit"] {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 1rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.3s;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Parallax Behavior */
@media (prefers-reduced-motion: no-preference) {
  .hero {
    background-attachment: fixed;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
  .hero p { font-size: 1.25rem; }
}

@media (max-width: 768px) {
  header { flex-direction: column; gap: 1rem; }
  nav { order: 3; }
  .cta { width: 100%; }
}

/* Mosaic Animation for Portfolio Cards */
.mosaic .snap:nth-child(1) { animation-delay: 0.1s; }
.mosaic .snap:nth-child(2) { animation-delay: 0.2s; }
.mosaic .snap:nth-child(3) { animation-delay: 0.3s; }
.mosaic .snap:nth-child(4) { animation-delay: 0.4s; }

@keyframes snap {
  0% { opacity: 0; transform: translateY(50px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Footer */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Portfolio Hero Banner */
.portfolio-hero {
  width: 100%;
  height: 60vh;
  background: url('../assets/portfolio-hero.png') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portfolio-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.portfolio-hero .hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
}

.portfolio-hero h2 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* INDIVIDUAL PORTFOLIO COLOR THEMES */
.matrix {
  border-top: 4px solid #39ff14;
}
.matrix:hover {
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.5);
}

.smoifs {
  border-top: 4px solid #ffa500;
}
.smoifs:hover {
  box-shadow: 0 0 25px rgba(255, 165, 0, 0.5);
}

.jhymn {
  border-top: 4px solid #ba55d3;
  background: linear-gradient(150deg, rgba(186,85,211,0.15), rgba(0,0,0,0.4));
}
.jhymn:hover {
  box-shadow: 0 0 25px rgba(186,85,211,0.6);
  text-shadow: 0 0 10px rgba(186,85,211,0.6);
}

.unsubscribe {
  border-top: 4px solid #14b8a6;
  background: linear-gradient(150deg, rgba(20,184,166,0.12), rgba(139,92,246,0.08));
  position: relative;
  overflow: hidden;
}

.unsubscribe::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(139, 92, 246, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.unsubscribe a,
.unsubscribe h3,
.unsubscribe p {
  position: relative;
  z-index: 1;
}

.unsubscribe:hover {
  box-shadow: 0 0 25px rgba(20, 184, 166, 0.6), 0 0 40px rgba(139, 92, 246, 0.4);
}

.unsubscribe h3 {
  background: linear-gradient(135deg, #14b8a6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* About Hero Banner - Matching Portfolio Style */
.about-hero {
  width: 100%;
  height: 60vh;
  background: url('../assets/about-hero.png') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 60px;
  margin-bottom: 0;
}

.about-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.about-hero .hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.about-hero h2 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 20px rgba(0, 191, 255, 0.3);
}

/* Contact Hero Banner - Matching Portfolio & About Style */
.contact-hero {
  width: 100%;
  height: 60vh;
  background: url('../assets/contact-hero.png') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 60px;
  margin-bottom: 0;
}

.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.contact-hero .hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.contact-hero h2 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 20px rgba(0, 191, 255, 0.3);
}