/* ==========================================================================
   CYBER SECURITY PORTFOLIO — Master Stylesheet
   Mobile-First · Golden Ratio · Mid Blue-Grey "Cyber" Mode · Anti-Theft
   --------------------------------------------------------------------------
   Palette: mid professional blue-grey base (#2A3B4C / #34495E),
            light text (#ECF0F1 / #FFFFFF), neon cyan (#00FFFF) +
            emerald green (#2ECC71) accents for interactive & security cues.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS CUSTOM PROPERTIES — Design Tokens
   Variable NAMES are preserved so all existing inline HTML styles keep working.
   -------------------------------------------------------------------------- */
:root {
  /* === PALETTE (Mid Blue-Grey "middle road" base — rozjaśniona dla mobile) === */
  --clr-bg-void:       #3B5268; /* Main page background — czytelniejsza "środkowa droga" */
  --clr-bg-deep:       #2F4152; /* Alternating / recessed sections */
  --clr-bg-surface:    #46617C; /* Raised surfaces */
  --clr-bg-card:       #46617C; /* Cards */
  --clr-bg-card-hover: #517091; /* Card hover */
  --clr-bg-glass:      rgba(59, 82, 104, 0.85);

  /* Neon Cyan — primary interactive / links */
  --clr-cyan:          #00FFFF;
  --clr-cyan-dim:      #00C8CE;
  --clr-cyan-muted:    rgba(0, 255, 255, 0.10);
  --clr-cyan-glow:     rgba(0, 255, 255, 0.25);

  /* Emerald Green — security / success / status */
  --clr-green:         #2ECC71;
  --clr-green-dim:     #27AE60;
  --clr-green-muted:   rgba(46, 204, 113, 0.12);
  --clr-green-glow:    rgba(46, 204, 113, 0.25);

  /* Warning / Danger */
  --clr-orange:        #F39C12;
  --clr-orange-muted:  rgba(243, 156, 18, 0.12);
  --clr-orange-glow:   rgba(243, 156, 18, 0.30);

  --clr-red:           #E74C3C;
  --clr-red-muted:     rgba(231, 76, 60, 0.12);
  --clr-red-glow:      rgba(231, 76, 60, 0.30);

  /* Text on dark base */
  --clr-text-primary:  #ECF0F1; /* Near-white for maximum readability */
  --clr-text-secondary:#BDC7D1;
  --clr-text-muted:    #8FA0B0;
  --clr-text-accent:   #00FFFF;

  --clr-border:        rgba(255, 255, 255, 0.10);
  --clr-border-hover:  rgba(0, 255, 255, 0.40);
  --clr-border-card:   rgba(255, 255, 255, 0.08);

  /* === GOLDEN RATIO TYPOGRAPHY SCALE (base 1rem × 1.618) === */
  --fs-xs:    0.618rem;
  --fs-sm:    0.764rem;
  --fs-base:  1rem;      /* Body */
  --fs-h3:    1.618rem;  /* H3 */
  --fs-h2:    2.618rem;  /* H2 */
  --fs-h1:    4.236rem;  /* H1 */

  /* === SPACING (Golden Ratio based) === */
  --sp-xs:   0.382rem;
  --sp-sm:   0.618rem;
  --sp-md:   1rem;
  --sp-lg:   1.618rem;
  --sp-xl:   2.618rem;
  --sp-2xl:  4.236rem;
  --sp-3xl:  6.854rem;

  /* === EFFECTS === */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-glow-cyan:  0 4px 18px rgba(0, 255, 255, 0.25);
  --shadow-glow-green: 0 4px 18px rgba(46, 204, 113, 0.25);
  --shadow-card:       0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 10px 28px rgba(0, 0, 0, 0.45);

  --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med:    300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:   600ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === FONTS === */
  --font-body:   system-ui, -apple-system, sans-serif;
  --font-mono:   'Courier New', monospace;
  --font-display:system-ui, -apple-system, sans-serif;
}

/* --------------------------------------------------------------------------
   RESET & BASE (MOBILE FIRST)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.618;
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-void);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 255, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(46, 204, 113, 0.06) 0%, transparent 60%);
  /* UWAGA: bez background-attachment: fixed — psuje renderowanie na mobile (iOS Safari) */
  overflow-x: hidden;

  /* ANTI-THEFT: Block text selection */
  user-select: none;
  -webkit-user-select: none;
}

/* Allow text selection in forms */
input, textarea, select {
  font-family: inherit;
  user-select: auto;
  -webkit-user-select: auto;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--clr-cyan); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--clr-green); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --------------------------------------------------------------------------
   GLOBAL GRID BACKGROUND (subtle light lines on dark base)
   -------------------------------------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1 { font-size: var(--fs-h1); line-height: 1.1; margin-bottom: var(--sp-lg); font-family: var(--font-display); font-weight: 900; }
h2 { font-size: var(--fs-h2); line-height: 1.2; margin-bottom: var(--sp-md); font-family: var(--font-display); font-weight: 700; }
h3 { font-size: var(--fs-h3); line-height: 1.3; margin-bottom: var(--sp-sm); font-family: var(--font-display); font-weight: 700; }

.text-cyan   { color: var(--clr-cyan); }
.text-green  { color: var(--clr-green); }
.text-orange { color: var(--clr-orange); }
.text-red    { color: var(--clr-red); }
.text-muted  { color: var(--clr-text-muted); }
.text-mono   { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   LAYOUT UTILITIES (MOBILE FIRST)
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  padding-inline: var(--sp-md);
  margin-inline: auto;
}

.section {
  padding-block: var(--sp-2xl);
  position: relative;
  z-index: 1;
}

.section--alt {
  background: var(--clr-bg-deep);
}

.section-header {
  margin-bottom: var(--sp-xl);
}

/* Spacing helpers — collapse padding where hero meets the next section */
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }

/* Mobile grids - stacked by default */
.grid-golden,
.grid-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
}

/* --------------------------------------------------------------------------
   COMPONENTS
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-xl);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  transition: all var(--transition-med);
  width: 100%; /* Full width on mobile */
  text-align: center;
}

.btn--primary {
  /* Neon cyan fill with dark text for AA contrast on the bright accent */
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-cyan-dim));
  color: #10222E;
  border: 1px solid var(--clr-cyan);
}

.btn--primary:hover {
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--clr-cyan);
  border: 1px solid var(--clr-cyan);
}

.btn--outline:hover {
  background: var(--clr-cyan-muted);
  box-shadow: var(--shadow-glow-cyan);
}

/* Cards */
.card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-med);
}

.card:hover {
  background: var(--clr-bg-card-hover);
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   NAVBAR & HAMBURGER (Mobile First)
   -------------------------------------------------------------------------- */
.navbar {
  padding: var(--sp-md) 0;
  background: var(--clr-bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.navbar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar__nav {
  /* Mobile: rozwijany panel — animowany przez max-height/opacity.
     NIE używamy display:none, bo display nie podlega animacji (stąd
     poprzedni brak płynności). Stan domyślny = ZWINIĘTY. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: var(--sp-md);
  background: var(--clr-bg-surface);
  border: 0 solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-align: center;

  /* Stan zwinięty (zerowy ślad w layoucie, brak fokusa) */
  max-height: 0;
  margin-top: 0;
  padding: 0 var(--sp-lg);
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition:
    max-height var(--transition-med),
    padding var(--transition-med),
    margin-top var(--transition-med),
    border-width var(--transition-med),
    opacity var(--transition-med),
    visibility 0s linear var(--transition-med);
}

.navbar__nav.is-active {
  /* Stan rozwinięty — klasa dodawana przez menu.js */
  max-height: 420px;
  margin-top: var(--sp-md);
  padding: var(--sp-lg);
  border-width: 1px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    max-height var(--transition-med),
    padding var(--transition-med),
    margin-top var(--transition-med),
    border-width var(--transition-med),
    opacity var(--transition-med),
    visibility 0s;
}

/* Poszanowanie preferencji dostępności — bez animacji */
@media (prefers-reduced-motion: reduce) {
  .navbar__nav { transition: none; }
  .hamburger span { transition: none; }
}

.navbar__link:hover {
  color: var(--clr-cyan) !important;
}

/* Hamburger Icon */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--clr-text-primary);
  border-radius: 2px;
  transition: all var(--transition-med);
}

.hamburger.is-active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Forms */
.form-group {
  margin-bottom: var(--sp-md);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: var(--sp-md);
  background: var(--clr-bg-deep);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text-primary);
  font-size: var(--fs-base);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--clr-text-muted);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 3px var(--clr-cyan-muted);
}

/* --------------------------------------------------------------------------
   DESKTOP VIEW (MIN-WIDTH: 992px) — Golden Ratio Grid
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  .container {
    max-width: 1200px;
    padding-inline: var(--sp-xl);
  }

  .section {
    padding-block: var(--sp-3xl);
  }

  /* Golden Ratio Grid (61.8% / 38.2%) */
  .grid-golden {
    display: grid;
    grid-template-columns: 61.8% 38.2%;
    gap: var(--sp-2xl);
    align-items: start;
  }

  /* 3-column Card Grid */
  .grid-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-xl);
  }

  .btn {
    width: auto; /* Auto width on desktop */
  }

  /* Desktop Navbar Overrides */
  .hamburger {
    display: none;
  }

  .navbar__header {
    width: auto;
  }

  .navbar__inner {
    flex-direction: row;
    justify-content: space-between;
  }

  .navbar__nav {
    display: flex !important; /* Zawsze widoczne na desktopie */
    flex-direction: row;
    align-items: center;
    gap: var(--sp-xl);
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-top: 0;
    width: auto;
    /* Reset stanu zwiniętego z widoku mobilnego */
    max-height: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    pointer-events: auto;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   STICKY CTA (tylko mobile — przypięty przycisk kontaktu na dole ekranu)
   -------------------------------------------------------------------------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  padding-bottom: max(var(--sp-sm), env(safe-area-inset-bottom));
  background: var(--clr-bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--clr-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.sticky-cta .btn { width: 100%; }

/* Rezerwa miejsca, by pasek nie zasłaniał stopki (tylko na stronach z paskiem) */
@media (max-width: 991px) {
  body:has(.sticky-cta) { padding-bottom: 76px; }
}

/* Ukryty na desktopie */
@media (min-width: 992px) {
  .sticky-cta { display: none; }
}

/* --------------------------------------------------------------------------
   ANTI-THEFT: PRINT PROTECTION (centered warning message)
   -------------------------------------------------------------------------- */
.no-print-message {
  display: none;
}

@media print {
  /* Hide all content */
  body > *:not(.no-print-message) {
    display: none !important;
  }

  /* Reset body styling for print & center the warning */
  body {
    background: #fff !important;
    color: #000 !important;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
  }

  /* Show centered warning message */
  .no-print-message {
    display: block !important;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #000;
    padding: 40px;
    max-width: 80%;
  }
}
