/* styles.css - Rozszerzona wersja */
:root {
  --primary: #00C2FF;
  --primary-dark: #0A1B2E;
  --accent: #FF3EA5;
  --bg: #FFFFFF;
  --text: #0E0E12;
  --muted: #6B6B78;
  --surface: #F4F6FA;
  --border: #E5E7EB;

  --radius: 12px;
  --shadow: 0 8px 24px rgba(10,27,46,0.12);
  --glow: 0 0 20px rgba(0,194,255,0.3);
}

:root[data-theme="dark"] {
  --bg: #0A0F14;
  --text: #F4F6FA;
  --muted: #B9BDC7;
  --surface: #0F151D;
  --border: #1F2732;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --glow: 0 0 30px rgba(0,194,255,0.4);
}

:root[data-theme="retro"] {
  --bg: #000000;
  --text: #00FF66;
  --muted: #33FF99;
  --surface: #001a0d;
  --border: #003322;
  --primary: #00FF66;
  --accent: #33FF99;
  --shadow: 0 0 20px rgba(0,255,102,0.3);
  --glow: 0 0 25px rgba(0,255,102,0.6);
  font-family: 'VT323', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  transition: all 0.3s ease;
  overflow-x: hidden;
}

body[data-theme="retro"] {
  background: var(--bg);
  color: var(--text);
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.6);
  animation: textGlow 2s ease-in-out infinite alternate;
}

/* Particle Background */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0.6;
}

/* Scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,102,0.05),
    rgba(0,255,102,0.05) 2px,
    transparent 2px,
    transparent 4px
  );
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-theme="retro"] .scanlines {
  opacity: 1;
}

/* Cursor Trail */
.cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;
}

/* Loading Animation */
.loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--surface);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes textGlow {
  from { text-shadow: 0 0 6px rgba(0,255,102,0.6); }
  to { text-shadow: 0 0 12px rgba(0,255,102,0.8); }
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(120%) blur(8px);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav.scrolled {
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  box-shadow: var(--shadow);
}

.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px;
}

.brand { 
  display: inline-flex; align-items: center; gap: 10px; 
  text-decoration: none; color: var(--text); font-weight: 700;
  transition: transform 0.3s ease;
}

.brand:hover {
  transform: scale(1.05);
}

.brand__icon {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 700;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.menu { display: flex; gap: 16px; align-items: center; }
.menu a { 
  color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px;
  transition: all 0.3s ease;
}
.menu a:hover { 
  background: var(--surface); 
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; 
  transition: all 0.3s ease;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn--primary {
  background: var(--primary); color: #04121c; font-weight: 700;
  box-shadow: var(--shadow);
}
.btn--primary:hover { 
  filter: brightness(1.1); 
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.btn-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: var(--shadow); }
  to { box-shadow: var(--glow); }
}

.btn--ghost { 
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface);
  transform: translateY(-2px);
}

.btn--link { 
  background: transparent; color: var(--primary);
  position: relative;
}
.btn--link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: var(--primary);
  transition: width 0.3s ease;
}
.btn--link:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative; overflow: hidden;
  padding: 120px 0 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__inner { 
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero-title {
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.1;
  margin: 0 0 24px;
}

.title-line {
  display: block;
  animation: slideUp 0.8s ease-out;
}

.title-line:nth-child(2) {
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-description {
  font-size: 1.2em;
  max-width: 480px;
  margin: 0 0 32px;
  color: var(--muted);
  animation: slideUp 0.8s ease-out 0.4s both;
}

.actions {
  display: flex;
  gap: 16px;
  align-items: center;
  animation: slideUp 0.8s ease-out 0.6s both;
}

.hero-visual {
  position: relative;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.floating-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-header {
  background: var(--primary-dark);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.code-dots {
  display: flex;
  gap: 8px;
}

.code-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}

.code-dots span:nth-child(1) { background: #FF5F57; }
.code-dots span:nth-child(2) { background: #FFBD2E; }
.code-dots span:nth-child(3) { background: #28CA42; }

.hero__bg {
  position: absolute; inset: -20% -10% auto -10%; height: 300px; z-index: -1;
  background:
    radial-gradient(600px 200px at 40% 40%, color-mix(in oklab, var(--primary) 35%, transparent) 0, transparent 60%),
    radial-gradient(600px 200px at 60% 60%, color-mix(in oklab, var(--accent) 30%, transparent) 0, transparent 60%);
  opacity: 0.7;
}

/* Sections */
.section { padding: 80px 0; position: relative; }
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 16px;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.section__lead { 
  color: var(--muted); 
  margin-top: 8px;
  font-size: 1.1em;
}

/* Cards */
.grid.cards {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--glow);
}

.card-hover:hover::before {
  transform: scaleX(1);
}

.card-icon {
  font-size: 2em;
  margin-bottom: 16px;
}

.card h3 { margin-top: 0; margin-bottom: 12px; }
.card p { color: var(--muted); margin-bottom: 20px; }

/* Code Blocks */
.code-container {
  position: relative;
  margin-top: 32px;
}

.code {
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, var(--primary), var(--accent)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 32px;
  overflow: auto;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text);
  font-size: 0.9em;
  line-height: 1.5;
  position: relative;
}

.code-animated {
  animation: codeAppear 1s ease-out;
}

@keyframes codeAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.copy-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8em;
}

.copy-btn:hover {
  background: var(--primary);
  color: var(--bg);
}

/* Forms */
.form { display: grid; gap: 16px; max-width: 600px; margin-top: 32px; }
.form__row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-input {
  width: 100%; padding: 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 20%, transparent);
}

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 80px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; }
.footer__links { display: flex; gap: 24px; }
.footer__links a { color: var(--muted); text-decoration: none; transition: color 0.3s ease; }
.footer__links a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 968px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  
  .hero-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  .footer__inner { flex-direction: column; gap: 16px; }
  .form__row { grid-template-columns: 1fr; }
  .menu { flex-wrap: wrap; justify-content: center; }
  .nav__inner { flex-direction: column; gap: 16px; padding: 16px 0; }
  
  .hero {
    padding: 100px 0 60px;
  }
  
  .section {
    padding: 60px 0;
  }
}

@media (max-width: 480px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    text-align: center;
  }
}