*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ========================================================= */
/* Light Mode  */
/* ========================================================= */
:root {
  --bg: #eeedf2;
  --bg-soft: #e2e0e8;
  --paper: #ffffff;
  --text: #151417;
  --muted: #5e5a66;
  --muted-2: #807a8a;
  --button: #141317;
  --button-text: #f2f0f5;

  --glow: #a35cff;
  --glow-light: #cfa8ff;

  --header-bg: rgba(238, 237, 242, 0.9);
  --hero-bg: #e2e0e8;
  --hover-bg: rgba(21, 20, 23, 0.05);
  --surface-bg: rgba(255, 255, 255, 0.25);
  --code-bg: rgba(21, 20, 23, 0.03);
  --line: rgba(21, 20, 23, 0.11);
  --line-soft: rgba(21, 20, 23, 0.07);
  --footer-bg: #000000;
  --footer-text: #e2e2e8;
  --footer-muted: #a0a0ab;
  --footer-line: rgba(255, 255, 255, 0.12);
  --footer-link-hover: #ffffff;

  --hero-grad-0: rgba(226, 224, 232, 0);
  --hero-grad-1: rgba(226, 224, 232, 0.05);
  --hero-grad-2: rgba(226, 224, 232, 0.18);

  --radius: 22px;
  --radius-sm: 14px;
  --max: 1180px;
}

/* ========================================================= */
/* Dark Mode              */
/* ========================================================= */
[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-soft: #16161a;
  --paper: #000000;
  --text: #e2e2e8;
  --muted: #a0a0ab;
  --muted-2: #6a6a75;
  --button: #e2e2e8;
  --button-text: #0d0d0f;

  --glow: #a35cff;
  --glow-light: #cfa8ff;

  --header-bg: rgba(13, 13, 15, 0.85);
  --hero-bg: #16161a;
  --hover-bg: rgba(255, 255, 255, 0.08);
  --surface-bg: rgba(255, 255, 255, 0.03);
  --code-bg: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.06);
  --footer-bg: #000000;
  --footer-text: #e2e2e8;
  --footer-muted: #a0a0ab;
  --footer-line: rgba(255, 255, 255, 0.12);
  --footer-link-hover: #ffffff;

  --hero-grad-0: rgba(22, 22, 26, 0);
  --hero-grad-1: rgba(22, 22, 26, 0.4);
  --hero-grad-2: rgba(22, 22, 26, 0.95);
}

/* ========================================================= */
/* GŁÓWNE STYLE STRONY                                       */
/* ========================================================= */

body {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease; /* Płynne przejścia dla motywów */
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s ease;
}

.header-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-wordmark {
  font-family: "Inter", sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  color: var(--text);
  font-size: 0.93rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--hover-bg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-toggle {
  position: relative;
  width: 68px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-bg);
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--text);
}

.theme-toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 8px;
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  width: 18px;
  height: 18px;
}

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--button);
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.theme-toggle[aria-checked="true"] .theme-toggle-thumb {
  transform: translate(80%, -50%);
}


.header-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 180ms ease;
}

.header-cta,
.btn-primary {
  padding: 0.82rem 1.05rem;
  background: var(--button);
  color: var(--button-text);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
}

.header-cta:hover,
.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  padding: 0.82rem 1.05rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--hover-bg);
}

.page-main {
  padding: 2.5rem 0 4.8rem;
}

.eyebrow,
.section-kicker,
.footer-kicker {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Hero */

.hero {
  display: grid;
  gap: 1.6rem;
  padding-top: 0.6rem;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 2.5rem;
  align-items: start;
}

.hero-main h1 {
  margin: 0.55rem 0 0;
  font-family: "Inter", sans-serif;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
  font-weight: 800;
  max-width: 9ch;
  color: var(--text);
}

.hero-side p {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.33;
  color: var(--text);
  max-width: 18ch;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.hero-stage-wrap {
  width: 100%;
  padding: 1.5rem 1.5rem;
}

.hero-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--hero-bg);
  border: 1px solid var(--line-soft);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hero-stage-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 3.4rem 1.5rem 0;
}

.hero-stage-copy h2,
.section-heading h2,
.page-hero h1,
.page-content h1,
.page-content h2,
.page-content h3,
.minimal-grid h3,
.spotlight-copy h2,
.split-block h2 {
  font-family: "Newsreader", Georgia, serif;
  letter-spacing: -0.05em;
}

.hero-stage-copy h2 {
  margin: 0;
  font-size: clamp(3.4rem, 7vw, 5.8rem);
  line-height: 0.94;
  font-weight: 500;
  color: var(--text);
}

.hero-stage-copy p {
  margin: 0.85rem auto 0;
  max-width: 30rem;
  font-size: 1rem;
  color: var(--muted);
}

.hero-orb {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-orb img,
.hero-orb svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  transform: scale(1.25);
}

.hero-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 28%,
      var(--hero-grad-0) 0%,
      var(--hero-grad-1) 48%,
      var(--hero-grad-2) 100%
    );
  transition: background 0.3s ease;
}

/* Sections */

.minimal-section,
.page-layout,
.page-hero {
  margin-top: 2.2rem;
}

.minimal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.minimal-grid h3 {
  margin: 0.55rem 0 0;
  font-size: 1.65rem;
  line-height: 1.05;
  font-weight: 500;
}

.split-block {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.split-block h2,
.page-hero h1 {
  margin: 0.55rem 0 0;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1;
}

.workflow-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.workflow-list article {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.workflow-list strong {
  margin: 0;
  color: var(--text);
}

.workflow-list p,
.page-lead,
.page-content p,
.page-content li,
.footer-copy,
.spotlight-copy p,
.rich-copy p {
  color: var(--muted);
}

.spotlight-card-minimal {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.spotlight-copy h2 {
  margin: 0.55rem 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.spotlight-copy p {
  margin: 0.9rem 0 0;
  max-width: 38rem;
}

.spotlight-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 180px;
}

.spotlight-links a {
  font-weight: 600;
}

/* Page layouts */

.page-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}

.page-sidecard,
.page-content {
  background: var(--surface-bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.page-sidecard ul,
.side-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.page-sidecard a,
.side-list li {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
}

.page-sidecard a:hover,
.page-sidecard a.is-active {
  background: var(--hover-bg);
}

.side-list li {
  background: var(--code-bg);
  color: var(--muted);
}

.side-cta {
  margin-top: 1rem;
  width: 100%;
}

.page-content h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.page-content h2 {
  margin-top: 1.8rem;
  font-size: 1.9rem;
}

.page-content h3 {
  margin-top: 1.3rem;
  font-size: 1.35rem;
}

.page-content p,
.page-content ul,
.page-content ol,
.page-content pre,
.page-content blockquote {
  margin-top: 0.9rem;
}

.page-content ul,
.page-content ol {
  padding-left: 1.2rem;
}

.page-content pre,
.page-content blockquote {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--line-soft);
}

.page-content code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
}

/* Footer */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 0 0 2.5rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  margin-top: 2.4rem;
  border-top: 1px solid var(--footer-line);
}

.footer-intro {
  max-width: 360px;
}

.footer-copy {
  margin: 0.45rem 0 0;
  color: var(--footer-muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--footer-muted);
}

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

/* Responsive */
@media (max-width: 980px) {
  .hero-top,
  .split-block,
  .page-layout,
  .spotlight-card-minimal {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .minimal-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-main h1 {
    max-width: none;
    font-size: clamp(2.9rem, 8vw, 4.8rem);
  }

  .hero-side p {
    max-width: 28ch;
  }

  .hero-stage {
    min-height: 540px;
  }

  .hero-stage-copy h2 {
    font-size: clamp(2.7rem, 9vw, 4.6rem);
  }

  .hero-orb {
    height: 100%;
  }

  .hero-orb img,
  .hero-orb svg {
    object-position: center 76%;
    transform: scale(1.3);
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 1rem);
  }

  .header-row {
    min-height: auto;
    padding: 0.85rem 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .theme-switcher {
    justify-content: center;
    align-self: center;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .hero-main h1,
  .hero-stage-copy h2,
  .split-block h2,
  .spotlight-copy h2,
  .page-hero h1,
  .page-content h1 {
    font-size: clamp(2.3rem, 11vw, 4.2rem);
    max-width: none;
  }

  .hero-side p {
    font-size: 1.15rem;
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .header-cta {
    width: 100%;
  }

  .hero-stage-wrap {
    padding: 0.5rem 0.5rem;
  }

  .hero-stage {
    min-height: 430px;
  }

  .hero-stage-copy {
    padding-top: 2.6rem;
  }

  .hero-stage-copy p {
    font-size: 0.95rem;
  }

  .hero-orb {
    height: 100%;
  }

  .hero-orb img,
  .hero-orb svg {
    object-position: center 85%;
    transform: scale(1.6);
  }

  .workflow-list article {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .footer-row,
  .footer-links {
    flex-direction: column;
  }
}
