/* ── Reset & zmienne ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold:       #C9A84C;
  --gold-light: #E8C96A;
  --gold-dim:   #8B6914;
  --black:      #080808;
  --surface:    rgba(255,255,255,0.03);
  --border:     rgba(201,168,76,0.2);
  --text:       rgba(240,232,213,0.75);
  --text-dim:   rgba(240,232,213,0.4);
}

html {
  scroll-behavior: smooth;
}

body {
  width: 100%;
  background: var(--black);
  font-family: 'Josefin Sans', sans-serif;
  color: var(--text);
  cursor: none;
  overflow-x: hidden;
}

/* Strona card blokuje przewijanie */
body.page-card {
  height: 100%;
  overflow: hidden;
}

html:has(body.page-card) {
  height: 100%;
  overflow: hidden;
}

/* ── Cursor ── */
#cursor {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

#cursor-ring {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 32px; height: 32px;
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring {
  width: 48px; height: 48px;
  border-color: var(--gold);
}

/* ── Canvas BG ── */
#bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

/* ── Animacje ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* ════════════════════════════════════════════════
   CARD PAGE
   ════════════════════════════════════════════════ */

.page {
  position: relative; z-index: 1;
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
}

.card {
  display: flex; flex-direction: column; align-items: center;
  gap: 28px;
  padding: 56px 64px;
  background: rgba(8,8,8,0.6);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp 1.2s cubic-bezier(0.22,1,0.36,1) both;
  position: relative;
}

.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 40px; height: 40px;
  border-color: var(--gold);
  border-style: solid;
}
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.card::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* Avatar */
.avatar-wrap {
  position: relative;
  animation: fadeUp 1.2s 0.1s cubic-bezier(0.22,1,0.36,1) both;
}
.avatar-ring {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 4px;
  position: relative;
}
.avatar-ring::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--gold);
  animation: spin 4s linear infinite;
}
.avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 300;
  color: var(--gold);
  letter-spacing: 2px;
  overflow: hidden;
}
.avatar-img img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.avatar-img img.loaded { display: block; }

/* Name block */
.name-block {
  text-align: center;
  animation: fadeUp 1.2s 0.2s cubic-bezier(0.22,1,0.36,1) both;
}
.name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 300;
  color: #f0e8d5;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.title-line {
  margin-top: 8px;
  font-size: 10px; font-weight: 100;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--gold);
}

/* Divider */
.divider {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: fadeUp 1.2s 0.3s cubic-bezier(0.22,1,0.36,1) both;
}

/* Bio */
.bio {
  max-width: 340px; text-align: center;
  font-size: 12px; font-weight: 100;
  line-height: 2; letter-spacing: 1px;
  color: rgba(240,232,213,0.55);
  animation: fadeUp 1.2s 0.35s cubic-bezier(0.22,1,0.36,1) both;
}
.bio span.span-highlight {
  color: var(--gold);
  font-weight: 300;
}

/* Socials */
.socials {
  display: flex; gap: 20px;
  animation: fadeUp 1.2s 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.social-link {
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  color: rgba(201,168,76,0.6);
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
  position: relative; overflow: hidden;
  cursor: none;
}
.social-link::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(201,168,76,0.07);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.social-link:hover::before { transform: translateY(0); }
.social-link:hover {
  color: var(--gold-light);
  border-color: rgba(201,168,76,0.6);
  transform: translateY(-2px);
}
.social-link svg { width: 16px; height: 16px; fill: currentColor; }

/* CTA button */
.cta {
  margin-top: 4px;
  padding: 10px 32px;
  border: 1px solid var(--border);
  color: var(--gold);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 9px; letter-spacing: 4px; font-weight: 300;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  position: relative; overflow: hidden;
  cursor: none;
  transition: color 0.3s, border-color 0.3s;
  animation: fadeUp 1.2s 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.cta::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.cta:hover { color: #080808; border-color: var(--gold); }
.cta:hover::before { transform: scaleX(1); }
.cta span { position: relative; z-index: 1; }


/* ════════════════════════════════════════════════
   BLOG / ARTICLE PAGE
   ════════════════════════════════════════════════ */

/* Layout */
.wrap {
  position: relative; z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 48px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: rgba(8,8,8,.85);
  backdrop-filter: blur(16px);
}
.site-header .logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 300;
  letter-spacing: 3px; text-transform: uppercase;
  color: #f0e8d5;
  text-decoration: none;
  cursor: none;
}
.site-header .back {
  font-size: 9px; letter-spacing: 4px; font-weight: 100; text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  cursor: none;
  transition: opacity .2s;
}
.site-header .back:hover { opacity: .6; }

/* Hero */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 1s cubic-bezier(.22,1,.36,1) both;
}
.eyebrow {
  font-size: 9px; letter-spacing: 5px; font-weight: 100; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 300; letter-spacing: 2px;
  color: #f0e8d5;
  line-height: 1.15;
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-sub {
  margin-top: 20px;
  font-size: 12px; font-weight: 100; letter-spacing: 1px; line-height: 2;
  color: var(--text-dim);
  max-width: 520px;
}

/* Sections */
.section {
  padding: 64px;
  margin-top: 1rem;
  border-bottom: 1px solid var(--border);
  animation: fadeUp .9s cubic-bezier(.22,1,.36,1) both;
  background-color: #101010;
}
.section:last-child { border-bottom: none; }

.section-label {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.section-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px; font-weight: 400;
  color: var(--gold-dim);
  letter-spacing: 2px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 400;
  letter-spacing: 3px; text-transform: uppercase;
  color: #f0e8d5;
}
.section-tick {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* Prose */
p.prose {
  font-size: 12px; font-weight: 100; letter-spacing: .8px; line-height: 2.1;
  color: var(--text);
  margin-bottom: 20px;
}
p.prose:last-child { margin-bottom: 0; }
p.prose strong { color: #f0e8d5; font-weight: 300; }
p.prose em { color: var(--gold); font-style: normal; }

/* Code block */
.code-wrap {
  margin: 28px 0;
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.code-wrap::before {
  content: attr(data-label);
  display: block;
  padding: 8px 20px;
  font-size: 8px; letter-spacing: 4px; font-weight: 300; text-transform: uppercase;
  color: var(--gold-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(201,168,76,.04);
}
.code-wrap::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 40px; height: 40px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 1px 1px 0 0;
}
pre {
  padding: 24px 20px;
  overflow-x: auto;
  background: transparent;
}
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 300;
  line-height: 1.9;
  color: rgba(240,232,213,.8);
  white-space: pre;
}
.tok-keyword { color: var(--gold); }
.tok-fn      { color: #a8d8f0; }
.tok-string  { color: #9de4b4; }
.tok-comment { color: rgba(240,232,213,.28); font-style: italic; }
.tok-num     { color: #f0a8a8; }
.tok-var     { color: #f0e8d5; }

/* Callout */
.callout {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 2px solid var(--gold);
  background: rgba(201,168,76,.04);
}
.callout p {
  font-size: 11px; font-weight: 100; letter-spacing: .8px; line-height: 2;
  color: rgba(240,232,213,.6);
}
.callout p strong { color: var(--gold); font-weight: 300; }

/* Flow diagram */
.flow {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 0;
  margin: 28px 0;
}
.flow-step {
  display: flex; flex-direction: column;
  padding: 14px 20px;
  border: 1px solid var(--border);
}
.flow-step .fs-num   { font-size: 8px; letter-spacing: 3px; color: var(--gold-dim); margin-bottom: 6px; }
.flow-step .fs-label { font-size: 10px; letter-spacing: 2px; color: #f0e8d5; font-weight: 300; }
.flow-arr { font-size: 10px; color: var(--gold-dim); padding: 0 8px; }

/* Table */
.data-table {
  width: 100%; border-collapse: collapse;
  margin: 28px 0;
}
.data-table th {
  text-align: left;
  font-size: 8px; letter-spacing: 4px; font-weight: 300; text-transform: uppercase;
  color: var(--gold-dim);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  font-size: 11px; font-weight: 100; letter-spacing: .5px;
  color: var(--text);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(201,168,76,.07);
  vertical-align: top; line-height: 1.8;
}
.data-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #9de4b4;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }

/* Uzupełnienia dla elementów bez odpowiednika w style.css */

.badge-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.6rem; }
.badge {
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase; font-weight: 100;
  padding: 5px 14px;
  border: 1px solid rgba(201,168,76,0.2);
  color: rgba(201,168,76,0.5);
}
.badge.active { border-color: rgba(201,168,76,0.5); color: #C9A84C; background: rgba(201,168,76,0.06); }
.badge.inactive { border-color: rgba(240,232,213,0.08); color: rgba(240,232,213,0.2); }
.badge.dev { border-color: rgba(201,168,76,0.2); color: rgba(201,168,76,0.45); }

.arch {
  display: grid; grid-template-columns: 1fr;
  gap: 1px; background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  margin: 28px 0;
}
.arch-row {
  display: grid; grid-template-columns: 160px 1fr;
  background: #080808;
  transition: background .2s;
}
.arch-row:hover { background: #0f0f0f; }
.arch-row.arch-header { background: rgba(201,168,76,0.03); }
.arch-label {
  padding: 12px 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 300;
  color: #9de4b4;
  border-right: 1px solid rgba(201,168,76,0.1);
  display: flex; align-items: center;
}
.arch-row.arch-header .arch-label,
.arch-row.arch-header .arch-desc {
  font-size: 8px; letter-spacing: 4px; text-transform: uppercase; font-weight: 100;
  color: rgba(201,168,76,0.35);
}
.arch-desc {
  padding: 12px 18px; font-size: 11px; font-weight: 100; letter-spacing: .5px;
  color: rgba(240,232,213,0.5); display: flex; align-items: center;
  line-height: 1.7; flex-wrap: wrap; gap: 4px;
}
.arch-desc code { white-space: nowrap; }

.module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px; background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  margin: 28px 0;
}
.module-card {
  background: #080808; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .2s;
}
.module-card:hover { background: #0f0f0f; }
.module-name { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 300; color: #f0e8d5; }
.module-desc { font-size: 10px; font-weight: 100; letter-spacing: .5px; color: rgba(240,232,213,0.4); line-height: 1.8; }
.module-status {
  display: inline-block; margin-top: 4px;
  font-size: 7px; letter-spacing: 3px; text-transform: uppercase; font-weight: 100;
  padding: 3px 8px; width: fit-content;
}
.status-active { background: rgba(74,222,128,0.08); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.status-dev    { background: rgba(201,168,76,0.06); color: #C9A84C; border: 1px solid rgba(201,168,76,0.2); }
.status-off    { background: transparent; color: rgba(240,232,213,0.2); border: 1px solid rgba(240,232,213,0.1); }

.contract-box {
  background: rgba(201,168,76,0.03);
  border: 1px solid rgba(201,168,76,0.2);
  margin: 28px 0;
}
.contract-box h4 {
  padding: 10px 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 4px;
  text-transform: uppercase; font-weight: 300; color: rgba(201,168,76,0.5);
  border-bottom: 1px solid rgba(201,168,76,0.1);
}
.method-row {
  display: grid; grid-template-columns: 180px 100px 1fr;
  gap: 0; padding: 12px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.06);
  align-items: start;
}
.method-row:last-child { border-bottom: none; }
.method-name { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 300; color: #a8d8f0; }
.method-ret  { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 300; color: #c084fc; }
.method-desc { font-size: 10px; font-weight: 100; letter-spacing: .5px; color: rgba(240,232,213,0.45); line-height: 1.8; }

.tok-class { color: #c084fc; }

/* Flow — nadpisanie style.css: wrap + mniejszy padding żeby nie wychodził poza układ */
.flow { flex-wrap: wrap; }
.flow-step { padding: 10px 13px; }
.flow-step .fs-label { font-size: 9px; letter-spacing: 1px; white-space: nowrap; }
.flow-arr { padding: 0 4px; }





/* ── Responsive ── */
@media (max-width: 600px) {
  .site-header { padding: 20px 24px; }
  .wrap { padding: 48px 20px 80px; }
  .flow { flex-direction: column; align-items: flex-start; }
  .flow-arr { transform: rotate(90deg); }
}

@media (max-width: 600px) {
  .arch-row { grid-template-columns: 1fr; }
  .arch-label { border-right: none; border-bottom: 1px solid rgba(201,168,76,0.1); }
  .method-row { grid-template-columns: 1fr; gap: 4px; }
}