/* Octopus Software — landing (light = default, dark alternates every 2 min) */

:root {
  --font-serif: "Playfair Display", "Times New Roman", Times, serif;
  --font-sans: "Montserrat", system-ui, -apple-system, sans-serif;
  /* Płynna zmiana motywu: dłużej + łagodniejsza krzywa */
  --ease-theme: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-theme: 2.15s;
  --transition-theme: background var(--duration-theme) var(--ease-theme),
    background-color var(--duration-theme) var(--ease-theme),
    color var(--duration-theme) var(--ease-theme),
    opacity var(--duration-theme) var(--ease-theme),
    filter var(--duration-theme) var(--ease-theme),
    border-color var(--duration-theme) var(--ease-theme);
  --transition-theme-fast: opacity 0.7s var(--ease-theme),
    filter var(--duration-theme) var(--ease-theme);
  --grain-svg: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.theme-light {
  --bg-base: #ebeae6;
  --bg-center: #f5f4f0;
  --bg-edge: #dedcd6;
  --bg-vignette: rgba(55, 48, 40, 0.06);
  --text-title: #2a2a2a;
  --text-body: #6d6d6d;
  --text-muted: #2c2c2c;
  --link: #2a4a6b;
  --link-hover: #1a2f4a;
}

.theme-dark {
  --bg-base: #070910;
  --bg-center: #0d1018;
  --bg-edge: #03050a;
  --bg-vignette: rgba(0, 25, 60, 0.5);
  --text-title: #f2f4fc;
  --text-body: rgba(236, 238, 248, 0.88);
  --text-muted: rgba(215, 220, 235, 0.5);
  --link: #9ec5ff;
  --link-hover: #d8e8ff;
  --logo-shadow-dark: 0 20px 56px rgba(0, 0, 0, 0.65),
    0 0 48px rgba(80, 130, 255, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-body);
  background-color: var(--bg-base);
  transition: background-color var(--duration-theme) var(--ease-theme),
    color var(--duration-theme) var(--ease-theme);
  -webkit-font-smoothing: antialiased;
}

/* Crossfade tła: dwa pełnoekranowe panele (jasny / ciemny) */
.theme-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  isolation: isolate;
}

.theme-backdrop__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--duration-theme) var(--ease-theme);
}

.theme-light .theme-backdrop__panel--light,
.theme-dark .theme-backdrop__panel--dark {
  opacity: 1;
}

.theme-backdrop__layer {
  position: absolute;
  inset: 0;
}

.theme-backdrop__base--light {
  background: radial-gradient(
      ellipse 125% 90% at 50% 32%,
      #f5f4f0 0%,
      #ebeae6 48%,
      #dedcd6 100%
    ),
    radial-gradient(
      ellipse 90% 70% at 50% 85%,
      #ebeae6 0%,
      color-mix(in srgb, #dedcd6 88%, #000) 100%
    );
  transition: var(--transition-theme);
}

.theme-backdrop__base--dark {
  background: radial-gradient(
      ellipse 125% 90% at 50% 32%,
      #0d1018 0%,
      #070910 48%,
      #03050a 100%
    ),
    radial-gradient(
      ellipse 90% 70% at 50% 85%,
      #070910 0%,
      color-mix(in srgb, #03050a 88%, #000) 100%
    );
  transition: var(--transition-theme);
}

.theme-backdrop__dof--light {
  z-index: 1;
  background: radial-gradient(
      ellipse 98% 78% at 50% 30%,
      transparent 0%,
      transparent 28%,
      color-mix(in srgb, #ebeae6 45%, transparent) 62%,
      #ebeae6 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 38%,
      color-mix(in srgb, #ebeae6 45%, transparent) 82%,
      #ebeae6 100%
    );
  transition: var(--transition-theme);
}

.theme-backdrop__dof--dark {
  z-index: 1;
  background: radial-gradient(
      ellipse 98% 78% at 50% 30%,
      transparent 0%,
      transparent 28%,
      color-mix(in srgb, #070910 50%, transparent) 62%,
      #070910 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 38%,
      color-mix(in srgb, #070910 50%, transparent) 82%,
      #070910 100%
    );
  transition: var(--transition-theme);
}

.theme-backdrop__grain--light {
  z-index: 2;
  opacity: 0.052;
  mix-blend-mode: multiply;
  background-image: var(--grain-svg);
  background-repeat: repeat;
  background-size: 220px 220px;
  transition: opacity var(--duration-theme) var(--ease-theme);
}

.theme-backdrop__grain--dark {
  z-index: 2;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: var(--grain-svg);
  background-repeat: repeat;
  background-size: 220px 220px;
  transition: opacity var(--duration-theme) var(--ease-theme);
}

.theme-backdrop__vignette--light {
  z-index: 3;
  background: radial-gradient(
    ellipse 92% 80% at 50% 45%,
    transparent 38%,
    rgba(55, 48, 40, 0.06) 100%
  );
  transition: var(--transition-theme);
}

.theme-backdrop__vignette--dark {
  z-index: 3;
  background: radial-gradient(
    ellipse 92% 80% at 50% 45%,
    transparent 38%,
    rgba(0, 25, 60, 0.5) 100%
  );
  transition: var(--transition-theme);
}

/* tsParticles */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: normal;
  opacity: 1;
  transition: var(--transition-theme-fast);
}

body.theme-switching #tsparticles {
  opacity: 0;
  transition: opacity 0.65s var(--ease-theme);
}

.theme-light #tsparticles {
  filter: blur(0.35px);
}

.theme-dark #tsparticles {
  filter: none;
}

#tsparticles canvas {
  opacity: 0.62;
  transition: opacity var(--duration-theme) var(--ease-theme);
}

.theme-dark #tsparticles canvas {
  opacity: 0.48;
}

main.site-main {
  position: relative;
  z-index: 5;
  padding-block: 2.5rem;
}

.site-logo-wrap {
  margin-bottom: 1.35rem;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: min(280px, 52vw);
}

.site-logo-wrap > .site-logo {
  grid-area: 1 / 1;
}

.site-logo {
  display: block;
  margin-inline: auto;
  max-width: min(260px, 70vw);
  height: auto;
  transition: opacity var(--duration-theme) var(--ease-theme),
    filter var(--duration-theme) var(--ease-theme), transform 0.35s ease;
}

@media (min-width: 768px) {
  .site-logo {
    max-width: 400px;
  }

  .site-logo-wrap {
    min-height: 400px;
  }
}

.theme-light .site-logo--for-light {
  opacity: 1;
  mix-blend-mode: multiply;
  filter: contrast(1.05);
  z-index: 1;
}

.theme-light .site-logo--for-dark {
  opacity: 0;
  pointer-events: none;
  filter: none;
  z-index: 0;
}

.theme-dark .site-logo--for-light {
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: normal;
  filter: none;
  z-index: 0;
}

.theme-dark .site-logo--for-dark {
  opacity: 1;
  filter: drop-shadow(var(--logo-shadow-dark)) brightness(1.06) saturate(1.05);
  z-index: 1;
}

.site-logo:hover {
  transform: scale(1.015);
}

.site-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: 0.02em;
  color: var(--text-title);
  margin: 0 0 1.35rem;
  transition: color var(--duration-theme) var(--ease-theme);
}

.site-lead {
  font-size: clamp(0.95rem, 2.1vw, 1.05rem);
  font-weight: 300;
  line-height: 1.85;
  max-width: 26rem;
  margin-inline: auto;
  margin-bottom: 0;
  color: var(--text-body);
  transition: color var(--duration-theme) var(--ease-theme);
}

.site-footer {
  margin-top: 2.75rem;
  padding-top: 0.5rem;
}

.site-footer a {
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text-title);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-theme) var(--ease-theme),
    border-color 0.25s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--link);
  border-bottom-color: currentColor;
}

.theme-dark .site-footer a:hover,
.theme-dark .site-footer a:focus-visible {
  color: var(--link-hover);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-theme: 0.01ms;
  }

  body,
  .theme-backdrop__panel,
  .theme-backdrop__base--light,
  .theme-backdrop__base--dark,
  .theme-backdrop__dof--light,
  .theme-backdrop__dof--dark,
  .theme-backdrop__grain--light,
  .theme-backdrop__grain--dark,
  .theme-backdrop__vignette--light,
  .theme-backdrop__vignette--dark,
  .site-title,
  .site-lead,
  .site-logo,
  #tsparticles,
  #tsparticles canvas,
  .site-footer a {
    animation: none !important;
    transition: none !important;
  }

  body.theme-switching #tsparticles {
    opacity: 1;
  }

  .theme-light #tsparticles {
    filter: none;
  }

  .site-logo:hover {
    transform: none;
  }
}
