/* --- ZMIENNE --- */
:root {
  --bg-color: #050505;
  --text-color: #ffffff;
  --accent-color: #8a2be2;
  --accent-glow: #c085ff;
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  --font-main: 'Montserrat', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --cursor-dot: #ffffff;
  --cursor-outline: rgba(255, 255, 255, 0.5);
}

body.light-mode {
  --bg-color: #f4f4f7;
  --text-color: #1a1a1a;
  --accent-color: #7c3aed;
  --accent-glow: #a78bfa;
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: rgba(124, 58, 237, 0.1);
  
  --cursor-dot: #000000;
  --cursor-outline: rgba(0, 0, 0, 0.3);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow-x: hidden;
  cursor: none;
  transition: background-color 0.5s ease, color 0.5s ease;
  min-height: 100vh;
}

a, button { cursor: none !important; }

/* --- CUSTOM CURSOR --- */
.cursor-dot, .cursor-outline {
  position: fixed; top: 0; left: 0; transform: translate(-50%, -50%);
  border-radius: 50%; z-index: 9999; pointer-events: none; will-change: transform;
}
.cursor-dot { width: 8px; height: 8px; background-color: var(--cursor-dot); transition: background-color 0.3s; }
.cursor-outline {
  width: 40px; height: 40px; border: 1px solid var(--cursor-outline);
  transition: width 0.2s, height 0.2s, border-color 0.3s;
}
body.hovering .cursor-outline {
  width: 60px; height: 60px; background-color: rgba(138, 43, 226, 0.1); border-color: var(--accent-color);
}
@media (pointer: coarse) {
  .cursor-dot, .cursor-outline { display: none; }
  body, a, button { cursor: auto !important; }
}

/* --- TŁO --- */
.animated-background {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.orb-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: var(--accent-color); animation: move1 20s infinite alternate; }
.orb-2 { bottom: -10%; right: -10%; width: 50vw; height: 50vw; background: var(--accent-glow); animation: move2 25s infinite alternate; }

@keyframes move1 { 0% { transform: translate(0,0); } 100% { transform: translate(20%, 20%); } }
@keyframes move2 { 0% { transform: translate(0,0); } 100% { transform: translate(-20%, -20%); } }

/* --- LAYOUT --- */
#main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 4rem;
  margin-top: 2rem;
}

h1 {
  font-size: 3rem;
  color: var(--accent-color);
  margin: 0 0 1rem 0;
  font-weight: 900;
}

/* Przycisk powrotu */
.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-color); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 8px 16px; border: 1px solid var(--glass-border); border-radius: 20px;
  background: rgba(255,255,255,0.05); transition: 0.3s;
}
.btn-back:hover {
  background: var(--accent-color); border-color: var(--accent-color);
}

/* Przełącznik Motywu */
#theme-toggle {
  position: fixed; top: 25px; right: 25px; z-index: 100;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-color); width: 45px; height: 45px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-size: 1.2rem; backdrop-filter: blur(5px); transition: all 0.3s ease;
}
body.light-mode #theme-toggle { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
#theme-toggle:hover { transform: scale(1.1); border-color: var(--accent-color); color: var(--accent-color); }

/* --- GRID PROJEKTÓW --- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  flex-grow: 1;
  justify-content: center;
  max-width: 680px; 
  margin: 0 auto;
}

/* KARTA PROJEKTU */
.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px var(--glass-shadow);
  border-color: var(--accent-color);
}

/* IKONY PROJEKTÓW */
.project-thumb {
  height: 180px;
  background: rgba(255,255,255,0.03);
  display: flex; justify-content: center; align-items: center;
  font-size: 3.5rem; 
  color: rgba(255,255,255,0.2); 
  border-bottom: 1px solid var(--glass-border);
  transition: color 0.3s ease;
}

body.light-mode .project-thumb {
  color: rgba(0, 0, 0, 0.8);
}

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: var(--text-color);
}

.desc {
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tech-stack {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem;
}

.tech-stack span {
  font-size: 0.7rem; font-family: var(--font-mono);
  background: rgba(138, 43, 226, 0.15); color: var(--accent-glow);
  padding: 4px 10px; border-radius: 12px;
  border: 1px solid rgba(138, 43, 226, 0.2);
}

/* Przycisk Zobacz więcej */
.btn-details {
  display: flex; justify-content: space-between; align-items: center;
  text-decoration: none;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  color: var(--text-color);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: 0.3s;
  border: 1px solid transparent;
}

.btn-details:hover {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

footer {
  text-align: center;
  margin-top: 4rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

/* Mobile */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  #main-container { padding: 1rem; }
  .portfolio-grid { 
    max-width: 100%; /* Usuwamy limit, aby na mobile zajęło całą szerokość */
    grid-template-columns: 1fr;
  }
}