/* --- Variables & Reset --- */
:root {
  --bg-color: #020617;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(148, 163, 184, 0.1);
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --font-display: 'Orbitron', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Utilities --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.blink {
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --- Background Grid --- */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-cyan);
  letter-spacing: 2px;
}

.nav-links a {
  margin-left: 2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px var(--accent-cyan);
}

/* --- Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 8rem 4rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  z-index: 2;
  padding-right: 2rem;
}

.tech-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--accent-cyan);
  margin-bottom: 1.5rem;
  background: rgba(6, 182, 212, 0.1);
}

h1 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.highlight-text {
  color: transparent;
  -webkit-text-stroke: 1px var(--accent-cyan);
  position: relative;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.code-comment {
  display: block;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Hero Visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hex-frame {
  position: relative;
  width: 600px;
  height: 500px;
  clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
  border-radius: 4px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(110%) brightness(0.9) saturate(1.2);
}

.overlay-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 50%, rgba(6, 182, 212, 0.2) 50%, transparent 51%);
  background-size: 100% 10px;
  animation: scan 4s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 0 100%;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
  position: relative;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-primary:hover {
  background: #fff;
  box-shadow: 0 0 20px var(--accent-cyan);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.75rem 1.5rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.btn-disabled {
  background: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  border: 1px solid #334155;
  padding: 0.75rem 1.5rem;
}

/* --- Portfolio Section --- */
.portfolio-section {
  padding: 6rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 4rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-primary);
  margin-right: 1.5rem;
}

.line-deco {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
}

.project-card {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -10px rgba(6, 182, 212, 0.3);
  border-color: var(--accent-cyan);
}

.card-visual {
  height: 250px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.placeholder-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #0f172a, #1e293b);
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  color: var(--text-secondary);
}

.status-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.status-badge.live {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #34d399;
}

.status-badge.dev {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #fbbf24;
}

.card-content {
  padding: 2rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.project-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.tech-stack {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tech-stack span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-blue);
}

/* --- About Section --- */
.about-section {
  max-width: 800px;
  margin: 6rem auto;
  padding: 4rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.about-text {
  font-size: 1.5rem;
  line-height: 1.5;
  margin-top: 2rem;
}

.mono-prefix {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.highlight-cyan {
  color: var(--accent-cyan);
  font-weight: 600;
}

.about-text-small {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

/* --- Footer --- */
.footer-section {
  border-top: 1px solid var(--glass-border);
  padding: 4rem;
  background: #010409;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-col h4 {
  font-family: var(--font-display);
  margin-bottom: 1.5rem;
  color: #fff;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.system-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #34d399;
  display: flex;
  align-items: center;
  margin-top: 1rem;
}

.indicator {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  margin-right: 0.5rem;
  box-shadow: 0 0 8px #34d399;
}

.indicator.active {
  animation: bg-pulse 2s infinite;
}

@keyframes bg-pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero-section {
    padding: 6rem 2rem;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    padding-right: 0;
    margin-bottom: 4rem;
  }

  .hero-visual {
    width: 100%;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero-sub {
    margin: 0 auto 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    /* Simplification for now, usually would add hamburger */
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-section {
    padding: 2rem;
  }

  .footer-grid {
    flex-direction: column;
  }
}

/* =========================================
   RATUNEK DLA TELEFONU (MOBILE FIX)
   Wklej to na samym końcu pliku style.css
   ========================================= */

@media screen and (max-width: 768px) {

  /* 1. Zmuś główne kontenery do szerokości ekranu */
  div,
  section,
  header,
  footer,
  main,
  .container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 2. Jeśli coś ma sztywne marginesy, zresetuj je */
  body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    /* Ukrywa to, co mimo wszystko wystaje */
    width: 100%;
  }

  /* 3. Dodaj mały margines wewnątrz, żeby tekst nie dotykał krawędzi ekranu */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  ul,
  li {
    max-width: 100% !important;
    overflow-wrap: break-word;
    /* Łamie za długie słowa */
  }

  /* === NAPRAWA PRZYCISKÓW (WERSJA DLA TEKSTOWYCH BUTTONÓW) === */

  /* 1. Kontener przycisków - ustawiamy w pionie */
  .card-actions {
    display: flex !important;
    flex-direction: column !important;
    /* Jeden pod drugim */
    width: 100% !important;
    /* Pełna szerokość */
    gap: 15px !important;
    /* Odstęp między nimi */
    margin-top: 20px !important;
  }

  /* 2. Same przyciski - rozciągamy na maksa */
  .card-actions button,
  .card-actions .btn {
    width: 100% !important;
    /* Szerokość od krawędzi do krawędzi */
    display: block !important;
    margin: 0 !important;
    /* Usuwamy stare marginesy */
    white-space: normal !important;
    /* Pozwala tekstowi się zawinąć, jeśli jest za długi */
  }
}

/* === OSTATECZNA NAPRAWA PRZYCISKÓW === */
@media screen and (max-width: 768px) {

  /* 1. Kontener przycisków: Zmień układ na pionowy */
  .card-actions {
    display: flex !important;
    flex-direction: column !important;
    /* To ustawia je jeden pod drugim */
    width: 100% !important;
    /* Szerokość na cały ekran */
    align-items: center !important;
    gap: 15px !important;
    /* Odstęp między przyciskami */
  }

  /* 2. Same przyciski: Rozciągnij je */
  .card-actions .btn {
    display: block !important;
    width: 100% !important;
    /* Rozciągnij przycisk na całą szerokość */
    max-width: 100% !important;
    /* Zabezpieczenie */
    margin: 0 !important;
    /* Usuń stare marginesy */
  }

  /* === FIX NA NAPIS COMING SOON (Ostateczny) === */
  .status-badge {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    /* Odsuń od lewej krawędzi */
    right: auto !important;
    /* Odczep od prawej */
    width: fit-content !important;
    /* Szerokość tylko taka jak tekst */
    white-space: nowrap !important;
    /* Nie łam tekstu */
  }
}