/* ================================
   mscode.cloud — DARK + green accent
=================================== */
:root{
  --bg:#0e1726;
  --bg-2:#0b1320;
  --txt:#e6e8ee;
  --muted:#9aa3b2;
  --brand:#41e08a;
  --brand-2:#1fb873;
  --card:#111c2f;
  --stroke:#1f2f4b;
  --glass:rgba(255,255,255,.06);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

/* ===== Base / reset ===== */
*{ box-sizing:border-box }
html,body{ width:100%; height:100%; overflow-x:hidden; overscroll-behavior:none }
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, #13243f 0%, transparent 60%), var(--bg);
  color:var(--txt);
}
img,svg,canvas{ display:block; max-width:100% }

/* Scrollbars */
*{ scrollbar-width:thin; scrollbar-color: var(--stroke) transparent }
::-webkit-scrollbar{ width:10px; height:10px }
::-webkit-scrollbar-track{ background:transparent }
::-webkit-scrollbar-thumb{
  background:var(--stroke); border-radius:10px; border:2px solid transparent; background-clip:padding-box;
}
::-webkit-scrollbar-thumb:hover{ background:linear-gradient(180deg,var(--brand-2),var(--brand)) }

/* ===== Preloader ===== */
#preloader{
  position:fixed; inset:0; z-index:9999; display:flex;
  flex-direction:column; gap:12px; align-items:center; justify-content:center;
  background:var(--bg);
  opacity:1; visibility:visible;
  transition:opacity .28s ease, visibility .28s ease;
}
#preloader.hide{ opacity:0; visibility:hidden; pointer-events:none }
.loader-logo{ font-weight:800; letter-spacing:.5px }
.loader-spinner{
  width:42px; height:42px; border-radius:50%;
  border:3px solid var(--glass); border-top-color:var(--brand);
  animation:spin 1s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg) } }

/* ===== Canvas background ===== */
#bg{ position:fixed; inset:0; z-index:-1 }

/* ===== Layout ===== */
.container{ width:min(1120px,92%); margin-inline:auto }
.section{ padding:clamp(32px,6vw,64px) 0 }
.section-lead{ color:var(--muted); margin-top:-6px; margin-bottom:22px }

/* ===== Topbar ===== */
.topbar{
  position:sticky; top:0; z-index:1000;
  background:linear-gradient(180deg, rgba(8,13,24,.85), rgba(8,13,24,.5));
  border-bottom:1px solid var(--stroke);
  backdrop-filter:saturate(160%) blur(10px);
}
.topbar-inner{ height:64px; display:flex; align-items:center; justify-content:space-between }

/* Brand (lewo) z „żyjącą” kropką */
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--txt); font-weight:800 }
.brand-dot{
  width:10px; height:10px; border-radius:50%;
  background:var(--brand);
  box-shadow:0 0 10px var(--brand), 0 0 24px rgba(65,224,138,.35);
  animation: dotPulse 1.8s ease-in-out infinite, dotDrift 6s ease-in-out infinite;
}
@keyframes dotPulse{ 0%,100%{ transform:scale(1) } 50%{ transform:scale(1.25) } }
@keyframes dotDrift{ 0%,100%{ translate:0 0 } 50%{ translate:.8px .4px } }

/* Prawa strona paska */
.nav-right{ display:flex; align-items:center; gap:14px }
.nav-right > a{
  color:var(--muted); text-decoration:none; font-weight:700;
  padding:8px 10px; border-radius:10px;
  -webkit-tap-highlight-color:transparent; outline:none;
}
/* hover myszą + focus z klawiatury */
.nav-right > a:hover,
.nav-right > a:focus-visible{ color:var(--txt); background:var(--glass) }
/* nie styluj focus po kliknięciu myszą */
.nav-right > a:focus{ background:transparent }

/* Dropdowny: podstrony + język */
.dropdown{ position:relative }
.drop-toggle{
  padding:8px 10px; border-radius:10px; border:1px solid var(--stroke);
  background:var(--glass); color:var(--txt); font-weight:700; cursor:pointer;
}
.drop-list{
  position:absolute; right:0; top:calc(100% + 8px);
  background:var(--card); border:1px solid var(--stroke);
  border-radius:12px; box-shadow:var(--shadow);
  padding:8px; display:none; min-width:220px;
}
.drop-list.show{ display:block }
.drop-list a, .drop-list button{
  display:flex; align-items:center; gap:8px;
  width:100%; text-align:left; padding:10px 12px;
  color:var(--txt); text-decoration:none; background:transparent; border:0; border-radius:10px; cursor:pointer;
}
.drop-list a:hover, .drop-list button:hover{ background:var(--glass) }
.drop-list.lang .flag{
  display:inline-grid; place-items:center; width:24px; height:24px;
  font-size:12px; border-radius:6px; background:#11223a; color:#b9c6d8; border:1px solid var(--stroke);
}

/* Hamburger (mobile) */
.topbar-burger{
  display:none; width:40px; height:40px; border:1px solid var(--stroke);
  border-radius:10px; background:var(--card); gap:4px; align-items:center; justify-content:center;
}
.topbar-burger span{ width:20px; height:2px; background:#9fb0c7; display:block }

/* ===== Topbar — mobile panel ===== */
@media (max-width: 900px){
  .topbar-burger{ display:flex }

  .nav-right{
    position:fixed; z-index:1001;
    right:12px; left:12px; top:72px;
    max-height:calc(100dvh - 96px); overflow:auto;
    display:none; flex-direction:column; align-items:stretch; gap:8px;
    background:var(--card); border:1px solid var(--stroke);
    border-radius:12px; padding:12px; box-shadow:var(--shadow);
    -webkit-overflow-scrolling:touch;
  }
  .nav-right.open{ display:flex }

  .nav-right > a{ width:100%; padding:12px 14px }

  .dropdown{ width:100% }
  .drop-toggle{ width:100%; text-align:left; padding:12px 14px }
  .drop-list{
    position:static; display:none; min-width:unset; margin-top:6px;
    border:1px solid var(--stroke); border-radius:10px; padding:6px; box-shadow:none; background:var(--card);
  }
  .drop-list.show{ display:block }

  .drop-list a, .drop-list button{ width:100%; padding:10px 12px }

  @media (hover:none){
    .nav-right > a:hover{ background:transparent }
  }
}

/* ===== Hero ===== */
.hero{ display:grid; place-items:center; min-height:72svh }
.hero-inner{ text-align:center; padding:64px 0 }
h1{ font-size:clamp(28px,5vw,48px); line-height:1.1; margin:0 0 14px }
.subtitle{ color:var(--muted); max-width:760px; margin:0 auto 26px }
.cta-row{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap }

/* Buttons */
.btn{
  padding:12px 18px; border-radius:12px; font-weight:700;
  text-decoration:none; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid transparent; transition:.2s ease;
}
.btn-primary{ background:var(--brand); color:#0b1b2d }
.btn-primary:hover{ transform:translateY(-1px) }
.btn-ghost{ background:transparent; border-color:var(--stroke); color:var(--txt) }
.btn-ghost:hover{ background:var(--glass) }

/* ===== Works (cards) ===== */
.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(auto-fit, minmax(clamp(220px, 45vw, 340px), 1fr));
  align-items:stretch;
}
.card{
  position:relative; padding:20px; border-radius:16px;
  background:var(--card); border:1px solid var(--stroke);
  box-shadow:var(--shadow);
  height:100%;
  display:flex; flex-direction:column;
  overflow:hidden; isolation:isolate;
}
.card::before{
  content:""; position:absolute; inset:-1px; border-radius:16px; pointer-events:none; z-index:-1;
  background:
    radial-gradient(400px 200px at 10% -10%, rgba(65,224,138,.12), transparent 60%),
    radial-gradient(300px 180px at 90% 120%, rgba(65,224,138,.08), transparent 60%);
}
.card h3{ margin:0 0 8px }
.card p{ color:var(--muted); margin:0 0 12px }
.card-link{ margin-top:auto; color:var(--brand); font-weight:700; text-decoration:none }

/* ===== Contact ===== */
.contact{
  display:grid; gap:12px;
  grid-template-columns:1fr 1fr;
}
.contact label{ display:flex; flex-direction:column; gap:6px }
.contact input,.contact textarea{
  width:100%;
  background:#0f1a2d; border:1px solid var(--stroke);
  color:var(--txt); padding:12px 14px; border-radius:12px; outline:none;
}
.contact textarea{ resize:vertical }
.contact .btn{ grid-column:1/-1; width:fit-content }
.form-note{ color:var(--muted); font-size:.9rem }

/* ===== Footer ===== */
.site-footer{ border-top:1px solid var(--stroke); background:var(--bg-2); margin-top:40px }
.footer-inner{ padding:18px 0; color:var(--muted); font-size:.95rem }
.footer-inner a{ color:var(--txt); text-decoration:none }

/* ===== Cookies banner ===== */
#cookie-banner{ position:fixed; left:0; right:0; bottom:18px; z-index:1100; display:none }
.cookie-inner{
  width:min(980px,92%); margin-inline:auto;
  background:var(--card); border:1px solid var(--stroke); border-radius:14px;
  padding:14px 16px; display:flex; gap:12px; align-items:center; box-shadow:var(--shadow)
}
.cookie-inner p{ margin:0; color:var(--txt) }
.cookie-actions{ margin-left:auto; display:flex; gap:8px }

/* ===== Responsive dopracowanie ===== */
@media (max-width:960px){
  .contact{ grid-template-columns:1fr }
}
@media (max-width:360px){
  .cta-row .btn{ width:100% }
  h1{ font-size:clamp(22px,7.5vw,30px) }
  .cookie-actions{ width:100%; justify-content:stretch }
  .cookie-actions .btn{ flex:1 }
}
