/**
 * SparkEXP — Master Stylesheet
 * =========================================================
 * Shared across all pages.
 *
 * Contents:
 *  00. DIN Pro @font-face (self-hosted; falls back to Barlow)
 *  01. CSS Variables (Design Tokens)
 *  02. Reset & Base
 *  03. Custom Cursor
 *  04. Progress Bar
 *  05. Grid Background & Scanline
 *  06. Navigation
 *  07. Mobile Drawer
 *  08. Ticker / Marquee
 *  09. Sections — shared utilities
 *  10. Scroll Reveal
 *  11. Buttons
 *  12. Footer
 *  13. Smart Popup (contact & career forms)
 *  14. i18n visibility helpers
 *  15. Keyframe animations
 * =========================================================
 */

/* =========================================================
   00. DIN Pro — @font-face
   =========================================================
   DIN Pro is a commercial Monotype typeface. Place your
   licensed font files in a /fonts/ directory next to this
   CSS file, then uncomment the rules below.

   Expected files (OTF or WOFF2 preferred):
     fonts/DINPro-Light.woff2        (weight 300)
     fonts/DINPro-Regular.woff2      (weight 400)
     fonts/DINPro-Medium.woff2       (weight 500)
     fonts/DINPro-Bold.woff2         (weight 700)
     fonts/DINPro-Black.woff2        (weight 900)

   Until the files are added, the stack falls through to
   Barlow (Google Fonts, loaded in <head>) which is the
   closest freely available DIN-style grotesque.
   ========================================================= */

/*
@font-face {
  font-family: 'DIN Pro';
  src: url('../fonts/DINPro-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../fonts/DINPro-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../fonts/DINPro-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../fonts/DINPro-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DIN Pro';
  src: url('../fonts/DINPro-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
*/

/* =========================================================
   01. CSS Variables
   ========================================================= */
:root {
  /* Palette */
  --black:       #050608;
  --black2:      #080a0d;
  --surface:     #0d1017;
  --surface2:    #131820;
  --border:      rgba(159,196,25,.12);
  --border-dim:  rgba(255,255,255,.05);
  --text:        #dde3ec;
  --muted:       #a8b8cc;
  --muted2:      #7a8a9a;
  --accent:      #9fc419;
  --accent2:     #c8ff00;
  --electric:    #00ff88;
  --cyan:        #00d4ff;

  /* Grid overlay colour */
  --grid-color:  rgba(159,196,25,.04);

  /* Typography
     --ff-body  = DIN Pro (self-hosted) → Barlow (Google Fonts) → system sans
     --ff-mono  = JetBrains Mono (labels, code, UI chrome)
     --ff-head  = alias for --ff-body (headings also use DIN Pro)
  */
  --ff-body: 'DIN Pro', 'Barlow', system-ui, sans-serif;
  --ff-head: 'DIN Pro', 'Barlow', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', monospace;

  /* Easing */
  --ease: cubic-bezier(.16,1,.3,1);
}

/* =========================================================
   02. Reset & Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  background: var(--black);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   03. Custom Cursor
   ========================================================= */
#cursor {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width .2s, height .2s;
}

#cursor-ring {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 32px; height: 32px;
  border: 1px solid rgba(159,196,25,.4); border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width .3s, height .3s, border-color .3s;
}

/* Ring grows on interactive element hover */
body:has(a:hover)      #cursor-ring,
body:has(button:hover) #cursor-ring { width: 48px; height: 48px; border-color: var(--accent); }

/* =========================================================
   04. Progress Bar
   ========================================================= */
#progress {
  position: fixed; top: 0; left: 0; z-index: 9000;
  height: 1px; width: 0%;
  background: var(--accent); transition: width .05s linear;
}

/* =========================================================
   05. Grid Background & Scanline
   ========================================================= */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 60px 60px;
}
.grid-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 40%, var(--black) 100%);
}

#scanline {
  position: fixed; left: 0; right: 0; height: 1px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(159,196,25,.3), transparent);
  animation: scan 8s linear infinite;
}

/* =========================================================
   06. Navigation
   ========================================================= */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
}
#nav::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(5,6,8,.95) 0%, transparent 100%);
  transition: backdrop-filter .3s;
}
#nav.scrolled::after { backdrop-filter: blur(20px); }
#nav.scrolled        { border-bottom: 1px solid var(--border-dim); }

/* Logo */
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo-img {
  height: 28px;
  width: auto;
  display: block;
  /* SVG has white + accent built-in — no filter needed */
}
/* Mobile: slightly smaller */
@media (max-width: 768px) {
  .nav-logo-img { height: 22px; }
}

/* Center links */
.nav-center { display: flex; gap: 40px; list-style: none; }
.nav-center a {
  font-family: var(--ff-mono); font-size: .80rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: #8a9bb0; text-decoration: none;
  transition: color .2s;
  position: relative; padding-bottom: 2px;
}
.nav-center a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width .25s var(--ease);
}
.nav-center a:hover,
.nav-center a.active            { color: var(--accent); }
.nav-center a:hover::after,
.nav-center a.active::after     { width: 100%; }

/* Right area */
.nav-right { display: flex; align-items: center; gap: 16px; }

/* Language toggle */
.lang-toggle {
  display: flex; gap: 2px;
  background: var(--surface); border: 1px solid var(--border-dim); border-radius: 3px; overflow: hidden;
}
.lang-btn {
  padding: 6px 10px; cursor: pointer; background: transparent; border: none;
  color: var(--muted); font-family: var(--ff-mono); font-size: .76rem; font-weight: 700;
  letter-spacing: .1em; transition: all .2s;
}
.lang-btn.active { background: var(--accent); color: var(--black); }

/* CTA button */
.nav-cta {
  font-family: var(--ff-mono); font-size: .80rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 20px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
  text-decoration: none; position: relative; overflow: hidden;
  transition: color .25s;
}
.nav-cta::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent); transform: translateX(-101%);
  transition: transform .25s var(--ease);
}
.nav-cta:hover         { color: var(--black); }
.nav-cta:hover::before { transform: translateX(0); }
.nav-cta span          { position: relative; z-index: 1; }

/* Mobile hamburger */
.mob-toggle { display: none; background: none; border: none; cursor: none; padding: 4px; }
.mob-toggle span { display: block; width: 20px; height: 1px; background: var(--text); margin: 5px 0; transition: .3s; }

@media(max-width:900px) {
  .nav-center, .nav-right { display: none; }
  .mob-toggle { display: block; }
  #nav { padding: 0 24px; }
}

/* =========================================================
   07. Mobile Drawer
   ========================================================= */
#mob-drawer {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: var(--black);
  flex-direction: column; align-items: center; justify-content: center; gap: 32px;
}
#mob-drawer.open { display: flex; }
#mob-drawer a {
  font-family: var(--ff-head); font-size: 2.5rem; font-weight: 700;
  color: var(--text); text-decoration: none;
}
#mob-drawer a:hover { color: var(--accent); }
#mob-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: none; }
.mob-lang { display: flex; gap: 12px; margin-top: 12px; }
.mob-lang .lang-btn { font-size: 1rem; padding: 10px 20px; }

/* =========================================================
   08. Ticker / Marquee
   ========================================================= */
.ticker {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim);
  background: var(--black2); overflow: hidden;
}
.ticker-track { display: flex; width: max-content; animation: ticker 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
  display: flex; align-items: center; gap: 0;
  padding: 14px 28px;
  font-family: var(--ff-mono); font-size: .90rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; border-right: 1px solid var(--border-dim);
}
.ticker-item .t-accent { color: var(--accent); }
.ticker-sep            { color: var(--muted2); margin: 0 8px; }

/* =========================================================
   09. Sections — shared utilities
   ========================================================= */
.section {
  position: relative; z-index: 1;
  padding: clamp(80px,12vw,140px) 48px;
}
@media(max-width:768px) { .section { padding: 80px 24px; } }

.s-wrap { max-width: 1280px; margin: 0 auto; }

.s-eyebrow {
  font-family: var(--ff-mono); font-size: .76rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.s-eyebrow::before { content: attr(data-index); color: var(--muted2); }

.s-title {
  font-size: clamp(2.4rem,5vw,5rem); font-weight: 700;
  letter-spacing: -.035em; line-height: .95; color: var(--text);
}
.s-title em      { font-style: normal; color: var(--accent); }
.s-title .outline {
  -webkit-text-stroke: 2px var(--accent);
  color: transparent; font-weight: 700;
}

/* =========================================================
   10. Scroll Reveal
   ========================================================= */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.delay-1 { transition-delay: .1s !important; }
.delay-2 { transition-delay: .2s !important; }
.delay-3 { transition-delay: .3s !important; }
.delay-4 { transition-delay: .4s !important; }
.delay-5 { transition-delay: .5s !important; }

/* =========================================================
   11. Buttons
   ========================================================= */
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 32px;
  background: var(--accent); color: var(--black);
  font-family: var(--ff-mono); font-size: .95rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  transition: background .2s;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.btn-primary:hover { background: var(--accent2); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: .80rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .2s; padding: 8px 0;
}
.btn-secondary:hover     { color: var(--text); }
.btn-secondary svg       { transition: transform .25s; }
.btn-secondary:hover svg { transform: translateX(4px); }

/* =========================================================
   12. Footer
   ========================================================= */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border-dim);
  background: var(--black2);
  padding: 60px 48px 40px;
}
@media(max-width:768px) { footer { padding: 48px 24px 32px; } }

/* Three-column grid: brand | site links | career links */
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px;
  max-width: 1280px; margin: 0 auto 48px;
}

/* Tablet: 2-col grid, brand spans full width */
@media(max-width:900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: 36px; border-bottom: 1px solid var(--border-dim);
  }
  .footer-col { padding: 28px 0; border-bottom: 1px solid var(--border-dim); }
  .footer-col:nth-child(2) { border-right: 1px solid var(--border-dim); padding-right: 24px; }
  .footer-col:nth-child(3) { padding-left: 24px; }
}

/* Mobile: single column */
@media(max-width:480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col:nth-child(2) { border-right: none; padding-right: 0; }
  .footer-col:nth-child(3) { padding-left: 0; }
}

.footer-brand p { font-size: .93rem; color: var(--muted); margin-top: 16px; max-width: 280px; line-height: 1.7; }

.footer-col h5 {
  font-family: var(--ff-mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  font-size: .95rem; color: var(--muted); text-decoration: none;
  transition: color .2s; display: inline-block; padding: 2px 0;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border-dim); padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; max-width: 1280px; margin: 0 auto;
}
.footer-bottom p { font-family: var(--ff-mono); font-size: .74rem; color: var(--muted2); letter-spacing: .06em; }
@media(max-width:600px) { .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* =========================================================
   13. Smart Popup
   ========================================================= */
.sp-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.88); backdrop-filter: blur(14px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.sp-overlay.open { display: flex; animation: fadeIn .25s; }

.sp-box {
  background: var(--surface); border: 1px solid var(--border-dim);
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  animation: modalIn .35s var(--ease);
}

.sp-head {
  padding: 28px 32px 24px; border-bottom: 1px solid var(--border-dim);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.sp-badge {
  font-family: var(--ff-mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.sp-title    { font-size: 1.2rem; font-weight: 700; letter-spacing: -.025em; color: var(--text); line-height: 1.2; }
.sp-subtitle { font-size: .95rem; color: var(--muted); margin-top: 4px; }

.sp-close {
  width: 32px; height: 32px; border: 1px solid var(--border-dim);
  background: none; color: var(--muted); font-size: .9rem; cursor: none;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .2s;
}
.sp-close:hover { border-color: var(--accent); color: var(--accent); }

.sp-body { padding: 28px 32px 32px; }

.sp-f-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sp-f-group label {
  font-family: var(--ff-mono); font-size: .93rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: #aabbcc;
}
.sp-f-group input,
.sp-f-group textarea,
.sp-f-group select {
  background: var(--black); border: 1px solid var(--border-dim);
  padding: 11px 14px; color: var(--text);
  font-family: var(--ff-head); font-size: .95rem;
  transition: border-color .2s; width: 100%; outline: none;
}
.sp-f-group input::placeholder,
.sp-f-group textarea::placeholder { color: var(--muted2); }
.sp-f-group input:focus,
.sp-f-group textarea:focus,
.sp-f-group select:focus { border-color: var(--accent); }
.sp-f-group textarea { height: 100px; resize: vertical; }
.sp-f-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238a9bb0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.sp-f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:480px) { .sp-f-row { grid-template-columns: 1fr; } }

.sp-consent { display: flex; gap: 10px; margin-bottom: 18px; align-items: flex-start; }
.sp-consent input { width: 13px; height: 13px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.sp-consent label { font-size: .93rem; color: var(--muted); line-height: 1.55; }

.sp-msg { padding: 11px 14px; margin-bottom: 14px; font-size: .95rem; font-family: var(--ff-mono); display: none; }
.sp-msg.ok  { background: rgba(0,255,136,.06);  border: 1px solid rgba(0,255,136,.25);  color: var(--electric); display: block; }
.sp-msg.err { background: rgba(255,61,107,.06); border: 1px solid rgba(255,61,107,.25); color: #ff3d6b; display: block; }

.sp-submit {
  width: 100%; padding: 14px; background: var(--accent); color: var(--black);
  border: none; font-family: var(--ff-mono); font-size: .93rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; cursor: none;
  transition: background .2s;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.sp-submit:hover    { background: var(--accent2); }
.sp-submit:disabled { opacity: .4; }

.sp-to { font-family: var(--ff-mono); font-size: .74rem; color: var(--muted2); margin-top: 12px; text-align: center; letter-spacing: .06em; }

/* =========================================================
   14. i18n visibility helpers
   ========================================================= */
[data-lang="en"] [data-pl] { display: none !important; }
[data-lang="pl"] [data-en] { display: none !important; }

/* =========================================================
   15. Keyframe animations
   ========================================================= */
@keyframes scan    { 0% { top: -1px; opacity: 0; } 2% { opacity: 1; } 98% { opacity: 1; } 100% { top: 100vh; opacity: 0; } }
@keyframes ticker  { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { transform: translateY(32px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes wordUp  { to { transform: translateY(0); } }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}


.f-msg {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.f-msg.success {
  color: #2d6a4f;
  background: #d8f3dc;
}
.f-msg.error {
  color: #7b2d2d;
  background: #f8d7da;
}
.f-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}