/* ============================================
   ELEKT Design Tokens & Styles
   ============================================ */

:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   Light Mode — Engineering Blue palette
   ============================================ */
:root,
[data-theme='light'] {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #fafbfc;
  --color-surface-offset: #eef0f4;
  --color-surface-offset-2: #e4e7ed;
  --color-surface-dynamic: #dbe0e8;
  --color-divider: #d1d6e0;
  --color-border: #c4cad6;

  --color-text: #1a1d24;
  --color-text-muted: #5c6370;
  --color-text-faint: #9ca3af;
  --color-text-inverse: #f5f6f8;

  --color-primary: #214986;
  --color-primary-hover: #1a3a6c;
  --color-primary-active: #132b52;
  --color-primary-highlight: #d4dff0;

  --color-accent: #c0392b;
  --color-accent-hover: #a53125;
  --color-accent-active: #8b291f;

  --shadow-sm: 0 1px 2px oklch(0.25 0.02 240 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.02 240 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.25 0.02 240 / 0.12);
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme='dark'] {
  --color-bg: #0f1117;
  --color-surface: #161920;
  --color-surface-2: #1c1f28;
  --color-surface-offset: #1a1d25;
  --color-surface-offset-2: #22262f;
  --color-surface-dynamic: #2a2e38;
  --color-divider: #2e3340;
  --color-border: #3a4050;

  --color-text: #d1d5de;
  --color-text-muted: #7b8291;
  --color-text-faint: #4e5563;
  --color-text-inverse: #1a1d24;

  --color-primary: #5b8fd4;
  --color-primary-hover: #4478bc;
  --color-primary-active: #3566a4;
  --color-primary-highlight: #1e2940;

  --color-accent: #e05a4f;
  --color-accent-hover: #c84a40;
  --color-accent-active: #a63d34;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1117;
    --color-surface: #161920;
    --color-surface-2: #1c1f28;
    --color-surface-offset: #1a1d25;
    --color-surface-offset-2: #22262f;
    --color-surface-dynamic: #2a2e38;
    --color-divider: #2e3340;
    --color-border: #3a4050;
    --color-text: #d1d5de;
    --color-text-muted: #7b8291;
    --color-text-faint: #4e5563;
    --color-text-inverse: #1a1d24;
    --color-primary: #5b8fd4;
    --color-primary-hover: #4478bc;
    --color-primary-active: #3566a4;
    --color-primary-highlight: #1e2940;
    --color-accent: #e05a4f;
    --color-accent-hover: #c84a40;
    --color-accent-active: #a63d34;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
  }
}

/* ============================================
   Header
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.header-logo svg,
.header-logo img {
  height: 56px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding: var(--space-1) 0;
}

.header-nav a:hover,
.header-nav a:focus {
  color: var(--color-text);
}

.lang-toggle {
  font-size: var(--text-xs) !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-1) var(--space-2) !important;
  color: var(--color-text-muted) !important;
  transition: border-color 0.2s, color 0.2s;
}

.lang-toggle:hover,
.lang-toggle:focus {
  border-color: var(--color-primary);
  color: var(--color-primary) !important;
}

.lang-toggle::after {
  display: none !important;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-nav a:hover::after {
  width: 100%;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* Mobile nav toggle */
.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: flex;
  }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
  }
  .header-nav.open {
    display: flex;
  }
  .header-nav a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
  }
  .header-nav a:hover {
    background: var(--color-surface-offset);
  }
  .header-nav a::after {
    display: none;
  }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-4);
  position: relative;
  overflow: hidden;
}

/* Logo watermark in hero background — fixed position */
.hero-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(700px, 85vw, 1200px);
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

[data-theme='dark'] .hero-watermark {
  opacity: 0.05;
  filter: brightness(2);
}

.hero-watermark img {
  width: 100%;
  height: auto;
}

.hero-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1.2fr 1fr;
  }
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-tagline::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  letter-spacing: 0.01em;
}

.hero-cta:hover {
  background: var(--color-primary-hover);
}

.hero-cta:active {
  background: var(--color-primary-active);
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-graphic {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  position: relative;
}

.hero-svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   Section Common
   ============================================ */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-4);
}

.section-alt {
  background: var(--color-surface);
}

.section-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--color-primary);
  display: inline-block;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

/* ============================================
   Services Grid
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-6);
}

.service-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] .service-card,
.section-alt .service-card {
  background: var(--color-surface-2);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: oklch(from var(--color-primary) l c h / 0.2);
  transform: translateY(-2px);
}

.service-icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.service-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ============================================
   Competencies / Tech Grid
   ============================================ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--space-4);
}

.tech-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-md);
}

[data-theme='dark'] .tech-item {
  background: var(--color-surface-2);
}

.tech-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: 7px;
}

.tech-item-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.tech-item-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}



/* ============================================
   About / Founder section
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.about-text p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.about-sidebar {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-lg);
}

[data-theme='dark'] .about-sidebar {
  background: var(--color-surface-2);
}

.about-sidebar h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.about-sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.about-sidebar li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.about-sidebar li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 3px;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.contact-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(from var(--color-primary) l c h / 0.08);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  flex-shrink: 0;
}

.contact-item-icon svg {
  width: 20px;
  height: 20px;
}

.contact-item-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.contact-item-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.contact-item-value {
  font-size: var(--text-base);
  color: var(--color-text);
}

.contact-item-value a {
  color: var(--color-primary);
  text-decoration: none;
}

.contact-item-value a:hover {
  text-decoration: underline;
}

.company-details {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-lg);
}

[data-theme='dark'] .company-details {
  background: var(--color-surface-2);
}

.company-details h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.company-details dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
}

.company-details dt {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.company-details dd {
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--space-8) var(--space-4);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
}

.footer-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text);
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger-children .fade-in:nth-child(1) { transition-delay: 0ms; }
.stagger-children .fade-in:nth-child(2) { transition-delay: 80ms; }
.stagger-children .fade-in:nth-child(3) { transition-delay: 160ms; }
.stagger-children .fade-in:nth-child(4) { transition-delay: 240ms; }
.stagger-children .fade-in:nth-child(5) { transition-delay: 320ms; }
.stagger-children .fade-in:nth-child(6) { transition-delay: 400ms; }

/* ============================================
   Skip Link
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: var(--space-2);
}

/* ============================================
   Number Stats
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8) 0;
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  margin-bottom: var(--space-8);
}

.stat {
  text-align: left;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}



/* Email obfuscation — fallback widoczny gdy JS nie zdążył/odmówił */
.contact-jit-fallback {
  color: inherit;
  font-size: inherit;
}
.contact-jit-fallback strong {
  color: var(--color-primary);
  font-weight: 600;
}
.contact-item-value.contact-jit a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.contact-item-value.contact-jit a:hover {
  border-bottom-color: var(--color-primary);
}
.contact-jit-footer a {
  color: inherit;
  text-decoration: none;
}
.contact-jit-footer a:hover {
  text-decoration: underline;
}
