/* ===== Kolory marki ===== */
:root {
  --plum: #3B2230;
  --plum-2: #4A2D3D;
  --cream: #F5EBDD;
  --cream-2: #EDE2D3;
  --gold: #C8892A;

  --bg: var(--cream);
  --bg-alt: var(--cream-2);
  --surface: #FBF5EC;
  --text: var(--plum);
  --muted: #6E5663;
  --line: rgba(59, 34, 48, 0.14);
  --logo-ink: var(--plum);
  --logo-paper: var(--cream);
  --btn-bg: var(--plum);
  --btn-text: var(--cream);
  --shadow: 0 1px 2px rgba(59, 34, 48, .06), 0 8px 24px rgba(59, 34, 48, .08);

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 20px;
}

/* Ciemny motyw: automatycznie wg systemu, chyba że wybrano jasny przyciskiem */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--plum);
    --bg-alt: #331D29;
    --surface: var(--plum-2);
    --text: var(--cream);
    --muted: #C9B6AE;
    --line: rgba(245, 235, 221, 0.14);
    --logo-ink: var(--cream);
    --logo-paper: var(--plum);
    --btn-bg: var(--cream);
    --btn-text: var(--plum);
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
/* Ciemny motyw wybrany przyciskiem */
:root[data-theme="dark"] {
  --bg: var(--plum);
  --bg-alt: #331D29;
  --surface: var(--plum-2);
  --text: var(--cream);
  --muted: #C9B6AE;
  --line: rgba(245, 235, 221, 0.14);
  --logo-ink: var(--cream);
  --logo-paper: var(--plum);
  --btn-bg: var(--cream);
  --btn-text: var(--plum);
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ===== Podstawy ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

.logo-ink { fill: var(--logo-ink); }
.logo-paper { fill: var(--logo-paper); }
.logo-gold { fill: var(--gold); }

/* Migający kursor "_" jak w logo */
.cursor {
  display: inline-block;
  width: .5em; height: .09em;
  margin-left: .12em;
  background: var(--gold);
  border-radius: 2px;
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
.cursor.static { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* ===== Nawigacja ===== */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: .95rem; color: var(--muted); transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links { align-items: center; }

/* Przełącznik języka PL / EN */
.nav-links a.lang-switch {
  font-size: .8rem; font-weight: 600; letter-spacing: .06em;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text);
}
.nav-links a.lang-switch:hover { border-color: var(--text); }

/* Przycisk zmiany motywu: w ciemnym pokazuje słońce, w jasnym księżyc */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.theme-toggle:hover { border-color: var(--text); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ===== Hero ===== */
.hero { padding: 96px 0 104px; }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  margin: 0 0 14px;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
}
h1 { font-size: clamp(2.5rem, 5.5vw, 4.2rem); letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 24px 0 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: flex; justify-content: center; }
.hero-mark { width: min(340px, 100%); aspect-ratio: 1; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
@media (prefers-reduced-motion: reduce) { .hero-mark { animation: none; } }

/* ===== Przyciski ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* ===== Sekcje ===== */
.section { padding: 96px 0; scroll-margin-top: 68px; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 48px; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.015em; }
.section-sub { color: var(--muted); margin: 10px 0 0; font-size: 1.05rem; }

/* ===== Karty projektów ===== */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); }
.card-featured { grid-column: 1 / -1; flex-direction: row; }
.card-featured .card-visual { flex: 1 1 45%; }
.card-featured .card-body { flex: 1 1 55%; padding: 40px; }
.card-body { padding: 28px; }
.card h3 { font-size: 1.6rem; margin: 10px 0 10px; }
.card-featured h3 { font-size: 2.1rem; }
.card p { color: var(--muted); margin: 0; }
.card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.platform { font-size: .85rem; color: var(--muted); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-wip { color: var(--gold); }
.status-live { color: #4C8B5A; }
.status-idea { color: var(--muted); }

.tags { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .8rem; font-weight: 500;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--line);
}

.card-placeholder { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.card-placeholder:hover { transform: none; }

/* Mini-podgląd czatu w karcie KidsChat */
.visual-kidschat {
  background: var(--plum);
  display: flex; align-items: center; justify-content: center;
  padding: 36px 24px; min-height: 300px;
  background-image: radial-gradient(circle at 20% 15%, rgba(200,137,42,.25), transparent 45%);
}
.phone {
  width: 230px; padding: 20px 16px;
  background: var(--cream); border-radius: 28px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
  position: relative;
}
.bubble {
  font-size: .82rem; line-height: 1.35; color: var(--plum);
  padding: 9px 13px; border-radius: 16px; max-width: 85%;
}
.bubble.in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: #FFD966; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.short { padding: 7px 12px; }
.qr {
  position: absolute; right: -22px; bottom: -22px;
  width: 64px; height: 64px; padding: 9px;
  background: #fff; border-radius: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  transform: rotate(8deg);
}
.qr span { background: var(--plum); border-radius: 3px; }
.qr span:nth-child(4) { background: var(--gold); border-radius: 50%; }

/* ===== O mnie ===== */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }
.about-text p { margin: 0 0 18px; font-size: 1.08rem; color: var(--muted); }
.about-text p:first-child { color: var(--text); font-size: 1.2rem; }
.facts { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 0; }
.facts li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts span { color: var(--muted); text-align: right; }

/* ===== Kontakt ===== */
.contact { text-align: center; max-width: 560px; margin: 0 auto; }
.contact-mark { width: 72px; height: 72px; margin-bottom: 18px; }
.contact p { color: var(--muted); font-size: 1.1rem; margin: 14px 0 32px; }

/* ===== Stopka ===== */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .9rem; }
.brand.small .brand-mark { width: 26px; height: 26px; }
.brand.small .wordmark { font-size: 1.05rem; }

/* ===== Telefon / tablet ===== */
@media (max-width: 860px) {
  .hero { padding: 56px 0 72px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-mark { width: 160px; }
  .grid { grid-template-columns: 1fr; }
  .card-featured { flex-direction: column; }
  .card-featured .card-body { padding: 28px; }
  .about { grid-template-columns: 1fr; gap: 16px; }
  .section { padding: 72px 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: .88rem; }
  .wordmark { font-size: 1.1rem; }
  .nav .wordmark { display: none; }
  .facts li { flex-direction: column; gap: 2px; }
  .facts span { text-align: left; }
}
