:root,
html[data-theme="dark"] {
  --bg: #17211d;
  --bg-rgb: 23, 33, 29;
  --bg-alt: #1f2a25;
  --card: #1f2a25;
  --border: #33403a;
  --text: #e9e5d6;
  --text-dim: #a3a396;
  --violet: #F5C500;
  --violet-2: #d9ac00;
  --grad: linear-gradient(135deg, var(--violet-2), var(--violet));
}

html[data-theme="light"] {
  --bg: #dcded3;
  --bg-rgb: 220, 222, 211;
  --bg-alt: #cfd2c3;
  --card: #ffffff;
  --border: #b7bcac;
  --text: #20302B;
  --text-dim: #5b6158;
  --violet: #8a6800;
  --violet-2: #d9ac00;
  --grad: linear-gradient(135deg, var(--violet-2), #F5C500);
}

body { transition: background-color 0.2s ease, color 0.2s ease; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; }

.section-eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--violet);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(var(--bg-rgb), 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}
.nav__mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
}
.nav__brand {
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav__name {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.nav__links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
}
.nav__links a:hover { color: var(--text); }
.nav__cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg) !important;
  font-weight: 700 !important;
}
.nav__cta:hover { opacity: 0.88; }
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--violet); transform: translateY(-1px); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 100px;
}
.hero__glow {
  position: absolute;
  top: -220px;
  right: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(139,92,246,0.35), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero__headline {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.h-line1, .h-line2, .h-line3, .h-line4 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
}
.h-line1 em, .h-line2 {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.h-line3 {
  font-weight: 400;
  color: var(--text-dim);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 6px 0;
}
.h-dot { color: var(--violet); }
.h-tiny {
  font-size: 0.32em;
  font-weight: 600;
  vertical-align: baseline;
}
.h-tiny--light {
  font-weight: 400;
  color: var(--text-dim);
}

.hero__lead {
  margin-top: 24px;
  max-width: 480px;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero__cta { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--grad); color: #fff; }
.btn--primary:hover { opacity: 0.92; }
.btn--ghost { border: 1px solid var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--card); }

.hero__eyebrow { margin-bottom: 14px; }

.hero__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 13px 4px;
}
.hero__phone:hover { color: var(--text); }
.hero__phone span { color: var(--violet); }

/* Bot doradca w hero: scripted flow z pytaniami, patrz chat.js */
.chat {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.chat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: var(--grad);
}
.hero__form-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--violet);
}
.hero__form-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.3;
}
.chat__log {
  flex: 1;
  min-height: 160px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 14px;
}
.chat__msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.chat__msg--bot {
  align-self: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat__msg--user {
  align-self: flex-end;
  background: var(--grad);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat__composer {
  display: flex;
  gap: 8px;
}
.chat__input {
  flex: 1;
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 12px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat__input::placeholder { color: #6a6a86; }
.chat__input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}
.chat__send {
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  padding: 12px 20px;
}
.chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chat__chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chat__chip:hover { border-color: var(--violet); color: var(--text); }
.chat__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  max-width: 88%;
}
.chat__error {
  color: #f16565;
  font-size: 0.82rem;
  margin: 2px 0 0;
}

/* Work / Portfolio */
.work {
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px 24px;
}
.work__title, .contact h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 40px;
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.work__item {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.work__item--live:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
}
.work__thumb {
  aspect-ratio: 21/9;
  position: relative;
  overflow: hidden;
}
.work__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.work__meta { padding: 22px; }
.work__meta h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.work__meta h3 .dim { color: var(--text-dim); }
.work__meta p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}
.work__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.work__tags li {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
/* Contact */
.contact {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 100px;
}
.contact__card {
  background: var(--grad);
  border-radius: 24px;
  padding: 64px 48px;
  position: relative;
  overflow: hidden;
}
.contact__card .section-eyebrow { color: rgba(255,255,255,0.85); }
.contact h2 {
  color: #fff;
  margin-bottom: 8px;
}
.contact h2 .dot { color: #0b0b14; }
.contact__lead {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
  margin: 0 0 32px;
}
.contact__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact__list a {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  border-bottom: 2px solid transparent;
}
.contact__list a:hover { border-color: #0b0b14; }

/* Footer */
.footer {
  padding: 24px;
  text-align: center;
}
.footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero { padding: 72px 18px 72px; }
  .work, .contact { padding-left: 18px; padding-right: 18px; }
  .contact__card { padding: 40px 26px; }
  .chat { padding: 22px 18px 18px; max-height: none; }

  /* Nawigacja nie miescila sie w jednym rzedzie i dawala poziomy scroll:
     ukrywamy nazwisko i sciskamy odstepy miedzy linkami. */
  .nav__inner { gap: 10px; padding: 14px 18px; }
  .nav__name { display: none; }
  .nav__links { gap: 16px; }
  .nav__links a { font-size: 0.85rem; }
  .nav__cta { padding: 8px 14px; }
}

@media (max-width: 400px) {
  .nav__links { gap: 12px; }
  .nav__links a { font-size: 0.8rem; }
  .nav__brand { font-size: 0.95rem; }
}
