:root {
  --bg: #F8F7F4;
  --fg: #141414;
  --muted: #666666;
  --line: #dddddd;
  --panel: #eeede9;
  --radius: 2px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Skip to content ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 100;
  background: #141414;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
}
.skip:focus { left: 1rem; }

/* ---------- Nav ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3vw;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 247, 244, 0.94);
  backdrop-filter: blur(6px);
  z-index: 50;
}
.brand-wrap { display: flex; align-items: center; gap: 1.5rem; }
.brand { font-weight: 900; font-size: 1.1rem; letter-spacing: 0.12em; text-transform: uppercase; }
.brand span { font-weight: 400; opacity: 0.4; }
.brand-imgs { display: flex; gap: 0.75rem; align-items: center; }
.brand-imgs img { height: 90px; width: auto; display: block; opacity: 0.9; }
.brand-imgs img:hover { opacity: 1; }
.nav-links {
  display: flex;
  gap: 0;
}
.nav-links a {
  margin-left: 2rem;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  padding: 0.75rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a.active { opacity: 1; text-decoration: underline; border-bottom-color: var(--fg); }

/* ---------- Hamburger ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  z-index: 60;
}
.nav-toggle[aria-expanded="true"] { background: var(--fg); color: var(--bg); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .navbar { height: 56px; padding: 0 1.5rem; }
  .brand-wrap { gap: 1rem; }
  .brand-imgs { gap: 0.5rem; }
  .brand-imgs img { height: 36px !important; }
  .brand { font-size: 1rem; }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 56px 0 0 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    flex-direction: column;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 55;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    opacity: 1;
  }
  .nav-links a.active { border-bottom-color: var(--fg); }

  .canvas-controls { bottom: 1rem; gap: 0.5rem; padding: 0.6rem 1rem; }
  .canvas-controls button { font-size: 0.65rem; padding: 0.4rem 0.8rem; }

  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 1.5rem; }
  .team-card { padding: 1.25rem; }
  .section { padding: 7vh 4vw; }
  .container { max-width: 100%; }

  .canvas-wrap { aspect-ratio: 16 / 10; min-height: 300px; }
  .canvas-hint { font-size: 0.6rem; top: 0.5rem; right: 0.5rem; }

  footer { padding: 4vh 4vw; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; padding: 5vh 0; }
  .footer-bottom { padding: 3vh 0; }

  form { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Hero / scroll animation placeholder ---------- */
.scroll-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.scroll-hero canvas { width: 100%; height: 100%; display: block; }
/* Ukrycie navbaru podczas trwania animacji scroll (toggle'owane w hero-animation.js) */
.navbar-hidden { display: none !important; }
.hero-placeholder {
  text-align: center;
  color: #fff;
  opacity: 0.3;
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  mix-blend-mode: difference;
}

/* ---------- Sections ---------- */
.section { padding: 10vh 5vw; }
.section.alt { background: var(--panel); }
.container { max-width: 1200px; margin: 0 auto; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 1.5rem; text-transform: uppercase; line-height: 1.1; }
h3 { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
p.lead { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 48ch; margin-bottom: 2rem; }
p.meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 2rem; }

/* ---------- Intro / cards ---------- */
.intro { margin-bottom: 3rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.card { border: 1px solid var(--line); padding: 2rem; background: var(--bg); }
.card h3 { margin-top: 0; }
.card p { color: var(--muted); font-size: 0.95rem; max-width: 40ch; }
.card ul { color: var(--muted); font-size: 0.95rem; padding-left: 1.2rem; }
.card ul li { margin-bottom: 0.5rem; }

/* ---------- Team ---------- */
.team { margin-top: 3rem; }
.team-list { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.team-card { border: 1px solid var(--line); padding: 1.5rem; background: var(--bg); flex: 1; min-width: 200px; }
.team-card strong { display: block; margin-bottom: 0.25rem; }

/* ---------- 3D canvas ---------- */
.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 450px;
  background: #141414;
  border-radius: var(--radius);
  overflow: hidden;
}
.canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.canvas-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; background: #141414; font-size: 1rem;
}
.canvas-hint {
  position: absolute; top: 1rem; right: 1rem; z-index: 30;
  font-size: 0.65rem; color: rgba(255,255,255,0.4); letter-spacing: 0.08em;
  line-height: 1.5; text-align: right;
}
.canvas-controls {
  position: absolute;
  bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.75rem; z-index: 30;
  background: rgba(20, 20, 20, 0.85); padding: 0.75rem 1.25rem; border-radius: 40px;
  backdrop-filter: blur(4px);
}
.canvas-controls button {
  border: 1px solid rgba(255,255,255,0.35); background: transparent; color: #fff;
  padding: 0.5rem 1rem; font: inherit; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.12em; cursor: pointer; border-radius: 4px;
}
.canvas-controls button.active { background: #fff; color: #141414; }
.canvas-controls button:hover { background: #333; }

/* ---------- Kontakt ---------- */
#kontakt .grid-2 { align-items: start; }
form { display: flex; flex-direction: column; gap: 1rem; max-width: 42ch; }
label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
input, textarea {
  border: 1px solid var(--line); background: #fff; color: #000;
  padding: 0.75rem 1rem; font: inherit; font-size: 0.9rem; border-radius: 4px;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid #141414; outline-offset: 2px; }
button[type="submit"] {
  border: 1px solid #141414; background: #141414; color: #fff;
  padding: 0.75rem 1.5rem; font: inherit; font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.12em; cursor: pointer; border-radius: 4px; align-self: flex-start;
}
button[type="submit"]:hover { background: #2a2a2a; }

/* ---------- Footer ---------- */
.footer {
  background: #141414;
  color: #fff;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6vh 5vw;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4vw;
  border-bottom: 1px solid var(--line);
}
.footer-brand .brand { color: #fff; font-size: 1.3rem; margin-bottom: 1rem; display: block; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; max-width: 34ch; line-height: 1.6; }
.footer-links h4,
.footer-contact h4 {
  color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 1rem; font-weight: 700;
}
.footer-links a {
  display: block; color: var(--muted); text-decoration: none; font-size: 0.9rem;
  margin-bottom: 0.75rem; letter-spacing: 0.04em;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-contact p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; line-height: 1.6; }
.footer-legal h4 {
  color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 1rem; font-weight: 700;
}
.footer-legal a {
  display: block; color: var(--muted); text-decoration: none; font-size: 0.9rem;
  margin-bottom: 0.75rem; letter-spacing: 0.04em;
}
.footer-legal a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding: 4vh 5vw;
  font-size: 0.75rem; color: var(--muted); text-align: center; letter-spacing: 0.08em;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .canvas-controls { bottom: 1rem; gap: 0.5rem; padding: 0.6rem 1rem; }
  .canvas-controls button { font-size: 0.65rem; padding: 0.4rem 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}