/* ══════════════════════════════════════════════════════════════
   PATRYK SOBCZYŃSKI — CSS MAIN
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:    #050a14;
  --bg-card:    rgba(15, 35, 63, 0.7);
  --ink:        #e0e6ed;
  --ink-58:     rgba(224,230,237,0.58);
  --ink-38:     rgba(224,230,237,0.38);
  --green:      #8CC63F;
  --blue:       #32b9ff;
  --purple:     #9b59b6;
  --white:      #ffffff;
  --white-85:   rgba(255,255,255,0.85);
  --white-60:   rgba(255,255,255,0.60);
  
  --font-head:  'Orbitron', sans-serif;
  --font-body:  'Poppins', sans-serif;
  
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --ease-exit:  cubic-bezier(0.4, 0, 1, 1);
  --ease-cross: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-reveal: 220ms;
  --dur-scene:  340ms;
}

html, body {
  width: 100%; min-height: 100vh;
  background: var(--bg-dark);
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.lock-scroll {
  overflow: hidden;
}

/* ── MATRIX CANVAS ── */
#matrix-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; display: block;
  pointer-events: none;
}
body::before {
  content: ''; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at center, #0F233F 0%, #050a14 100%);
  z-index: -1;
}

/* ── CINEMATIC PAGE WASH ── */
.page-wash {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  --wash-color: var(--bg-dark);
}
.wash-layer {
  position: absolute; inset: 0;
  background-color: var(--wash-color);
  transform-origin: top;
}
/* By default, wash is hidden above */
.wash-a { transform: translateY(-100%); }
.wash-b { transform: translateY(100%); }

.page-wash.curtain-close .wash-a {
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(0.4, 0, 0.2, 1);
}
.page-wash.curtain-close .wash-b {
  transform: translateY(0);
  transition: transform 360ms cubic-bezier(0.4, 0, 0.2, 1);
}

.page-wash.is-covered .wash-a { transform: translateY(0); }
.page-wash.is-covered .wash-b { transform: translateY(0); }

.page-wash.curtain-open .wash-a {
  transform: translateY(-100%);
  transition: transform 360ms cubic-bezier(0.4, 0, 0.2, 1);
}
.page-wash.curtain-open .wash-b {
  transform: translateY(100%);
  transition: transform 360ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── HEADER NAVIGATION ── */
.global-header {
  position: fixed; top: 0; left: 0; width: 100%; height: 60px;
  z-index: 100; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(5,10,20,0.9) 0%, rgba(5,10,20,0) 100%);
}
.logo-link {
  display: block; width: 140px;
  transition: transform 300ms var(--ease-cross);
}
.logo-link img {
  width: 100%; height: auto; display: block;
}
.logo-link:hover { transform: scale(1.05); }

.header-right { display: flex; align-items: center; gap: 40px; }
.lang-switcher {
  display: flex; gap: 8px; font-family: var(--font-head);
  font-size: 11px; font-weight: 700; color: var(--ink-58);
}
.lang-switcher a {
  color: var(--ink-58); text-decoration: none; transition: color 0.3s;
}
.lang-switcher a:hover, .lang-switcher a.is-active {
  color: var(--green);
}

.main-nav { display: flex; gap: 30px; }
.main-nav a {
  font-family: var(--font-head);
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--ink-38); text-decoration: none;
  transition: color 200ms var(--ease-cross);
  text-transform: uppercase;
}
.main-nav a:hover, .main-nav a.is-active {
  color: var(--white);
}

/* ── ASYMMETRIC GRID (Index) ── */
.home-layout {
  position: relative; z-index: 2;
  display: flex; width: 100%; height: 100vh;
  padding: 60px 40px 40px 40px;
  gap: 20px;
}
.home-left {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding-right: 40px;
}
.home-right {
  flex: 1; display: flex; flex-direction: column; gap: 20px;
}

.intro-title {
  font-family: var(--font-head); font-size: 4rem;
  font-weight: 900; line-height: 1.1; color: var(--white);
  text-shadow: 0 0 30px rgba(140,198,63,0.2);
  margin-bottom: 20px;
}
.intro-subtitle {
  font-size: 1.2rem; color: var(--green);
  font-family: 'Courier New', monospace; margin-bottom: 30px;
}
.intro-desc {
  font-size: 1rem; color: var(--ink-58); max-width: 450px;
  line-height: 1.6; margin-bottom: 40px;
}

.service-panel {
  flex: 1; position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: flex-end; padding: 30px;
  text-decoration: none; color: inherit; cursor: pointer;
  background-size: cover; background-position: center;
  border-radius: 4px;
}
.service-panel::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,10,20,0.95) 0%, rgba(5,10,20,0.4) 100%);
  transition: opacity 300ms var(--ease-cross);
}
.service-panel:hover::before { opacity: 0.6; }

.sp-content { position: relative; z-index: 2; width: 100%; display: flex; justify-content: space-between; align-items: flex-end; }
.sp-title {
  font-family: var(--font-head); font-size: 2.5rem; font-weight: 900;
  color: var(--white); line-height: 1; margin-bottom: 8px;
}
.sp-desc { font-size: 0.9rem; color: var(--white-85); }
.sp-arrow { font-size: 1.5rem; color: var(--white); opacity: 0; transform: translateX(-10px); transition: all 300ms var(--ease-cross); }
.service-panel:hover .sp-arrow { opacity: 1; transform: translateX(0); }

/* Animation Classes */
body.loading .intro-title, body.loading .intro-subtitle, body.loading .intro-desc, body.loading .service-panel { opacity: 0; transform: translateY(20px); }
body.page-loaded .intro-title { animation: slideUp 400ms var(--ease-enter) 100ms both; }
body.page-loaded .intro-subtitle { animation: slideUp 400ms var(--ease-enter) 200ms both; }
body.page-loaded .intro-desc { animation: slideUp 400ms var(--ease-enter) 300ms both; }
body.page-loaded .service-panel:nth-child(1) { animation: slideUp 400ms var(--ease-enter) 400ms both; }
body.page-loaded .service-panel:nth-child(2) { animation: slideUp 400ms var(--ease-enter) 500ms both; }
body.page-loaded .service-panel:nth-child(3) { animation: slideUp 400ms var(--ease-enter) 600ms both; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── SUBPAGE LAYOUT ── */
.subpage-hero {
  position: relative; width: 100%; height: 60vh;
  display: flex; align-items: center; padding: 0 10%;
  background-size: cover; background-position: center;
}
.subpage-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(5,10,20,0.95) 0%, rgba(5,10,20,0.2) 100%);
}
.subpage-content { position: relative; z-index: 2; }
.sub-title { font-family: var(--font-head); font-size: 4rem; color: var(--white); margin-bottom: 20px; line-height: 1; }
.sub-desc { font-size: 1.1rem; color: var(--white-85); max-width: 500px; line-height: 1.6; }

.subpage-body {
  padding: 80px 10%;
  position: relative; z-index: 2;
  background: var(--bg-dark);
}
.grid-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
}
.body-text h2 {
  font-family: var(--font-head); font-size: 2rem; color: var(--green);
  margin-bottom: 30px; text-transform: uppercase;
}
.body-text p {
  color: var(--ink-58); line-height: 1.8; margin-bottom: 20px;
}
.body-features ul { list-style: none; }
.body-features li {
  padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--ink); display: flex; align-items: center; gap: 15px;
}
.body-features li i { 
  color: var(--green); font-size: 1.2rem; 
}

/* ── TYPEWRITER ── */
.typewriter {
  font-size: 1.2rem; color: var(--green); margin-bottom: 20px;
  font-family: 'Courier New', monospace;
  border-right: 2px solid var(--green);
  animation: blink 0.7s infinite;
  display: inline-block; white-space: pre;
  width: max-content; padding-right: 5px;
  min-height: 1.5rem;
}
@keyframes blink { 50% { border-color: transparent; } }

/* ── PORTFOLIO ── */
.portfolio-section { margin-top: 60px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 40px; }
.portfolio-title { color: inherit; font-size: 1.8rem; margin-bottom: 30px; font-family: var(--font-head); }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.portfolio-item {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px;
  padding: 30px 20px; text-align: center; transition: 0.4s; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.portfolio-item:hover { border-color: var(--blue); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(50,185,255,0.1); background: var(--bg-card); }
.portfolio-item img { max-width: 100%; max-height: 60px; margin-bottom: 20px; filter: grayscale(100%) opacity(0.7); transition: 0.4s; }
.portfolio-item:hover img { filter: none; }
.portfolio-overlay { color: var(--blue); font-family: var(--font-head); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; opacity: 0; transition: 0.4s; transform: translateY(10px); }
.portfolio-item:hover .portfolio-overlay { opacity: 1; transform: translateY(0); }

.mobile-toggle { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .home-layout { flex-direction: column; padding: 80px 20px 20px; height: auto; }
  .home-left { padding-right: 0; margin-bottom: 40px; }
  .intro-title { font-size: 2.5rem; }
  .service-panel { min-height: 200px; }
  .grid-2col { grid-template-columns: 1fr; gap: 40px; }
  .sub-title { font-size: 2.5rem; }
  .global-header { padding: 0 20px; }
  
  .mobile-toggle {
    display: block !important;
    background: none; border: none;
    color: var(--white); font-size: 1.8rem;
    cursor: pointer; z-index: 10001;
    margin-left: 15px;
  }
  
  .main-nav {
    position: fixed; top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid rgba(255,255,255,0.05);
    flex-direction: column; justify-content: center; align-items: center;
    gap: 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
    transition: right 0.4s cubic-bezier(0.22,1,0.36,1);
    z-index: 10000;
  }
  
  .main-nav.is-open { right: 0; }
  
  .main-nav a { font-size: 1.2rem; }
  
  .lang-switcher { margin-right: 10px; }
}
