/* Design tokens — zgodne z makietą */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --accent: #a3e635;
  --accent-dark: #84cc16;
  --border: rgba(255, 255, 255, 0.12);
  --radius-pill: 999px;
  --radius-card: 16px;
  --header-h: 72px;
  --max-w: 1200px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#home,
#portfolio,
#about,
#contact {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.text-accent {
  color: var(--accent);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  z-index: 2;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  z-index: 2;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-header.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn-header:hover {
  border-color: var(--accent);
  background: rgba(163, 230, 53, 0.06);
}

.btn-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-header:hover .btn-icon-circle {
  border-color: var(--accent);
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.4);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 28px rgba(163, 230, 53, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-wide {
  min-width: min(100%, 320px);
}

.btn-icon {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

/* Hero — ta sama szerokość i padding co .section-inner (portfolio, kontakt) */
.hero {
  position: relative;
  padding: 3rem 0 4rem;
  min-height: min(70vh, 820px);
}

.hero-inner {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0 1.25rem;
  align-items: center;
}

.hero-social {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  justify-self: center;
}

.hero-social-line {
  width: 1px;
  flex: 1;
  min-height: 80px;
  background: linear-gradient(to bottom, transparent, var(--border), var(--accent));
  border-radius: 2px;
}

.hero-social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-social-link {
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.hero-social-link:hover {
  color: var(--accent);
  transform: scale(1.08);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  align-items: center;
  min-width: 0;
}

.hero-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 32rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-orbit {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
}

.hero-glow {
  position: absolute;
  inset: 10%;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.22) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-img {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 40px rgba(163, 230, 53, 0.15));
}

/* Portfolio */
.portfolio {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.portfolio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(163, 230, 53, 0.4);
}

.chip.is-active {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sort-select {
  appearance: none;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.45rem 2rem 0.45rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a3a3a3' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}

.sort-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.project-card {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: 0.75rem;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: rgba(163, 230, 53, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.project-card.is-hidden {
  display: none;
}

/** Cała karta klikalna — jeden link (bez zagnieżdżonych linków). */
.project-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-card);
}

.project-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  margin-bottom: 0.85rem;
  background-size: cover;
  background-position: center;
}

.project-thumb--1 {
  background-image: linear-gradient(135deg, #1a2a1a 0%, #0d1f0d 50%, #1a3018 100%);
}

.project-thumb--2 {
  background-image: linear-gradient(135deg, #1a1a2a 0%, #12122a 50%, #252540 100%);
}

.project-thumb--3 {
  background-image: linear-gradient(135deg, #2a1a1a 0%, #301010 50%, #401818 100%);
}

.project-thumb--4 {
  background-image: linear-gradient(135deg, #1a2520 0%, #0f2520 40%, #163528 100%);
}

.project-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.project-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.project-desc {
  margin: 0 0 2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-arrow {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/** Na stronie głównej strzałka jest dekoracją — klik idzie przez nią do .project-card-link. */
span.project-arrow {
  pointer-events: none;
}

/** Osobny link (np. lista na projects.html) — strzałka zawsze prowadzi do case study. */
a.project-arrow {
  pointer-events: auto;
  text-decoration: none;
  color: inherit;
}

a.project-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-card:hover .project-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
  transform: scale(1.05);
}

.portfolio-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* About + contact */
.about-contact {
  position: relative;
  padding: 4rem 0 3rem;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.about-contact-bg {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.9;
}

.monstera-deco {
  max-width: min(380px, 45vw);
  height: auto;
}

.about-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.about-avatar-wrap {
  margin-bottom: 1.25rem;
}

.about-avatar {
  border-radius: 50%;
  border: 2px solid rgba(163, 230, 53, 0.35);
}

.about-heading {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 1rem;
}

.text-muted-heading {
  color: var(--text-muted);
  font-weight: 500;
}

.about-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
  max-width: 28rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.2s ease;
}

.text-link:hover {
  gap: 0.55rem;
}

.services-title {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.services-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--text);
}

.services-icon {
  color: var(--accent);
  display: flex;
}

.cta-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cta-heading {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.email-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.btn-email {
  width: 100%;
  max-width: 100%;
  justify-content: space-between;
  text-transform: none;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  padding: 1rem 1.1rem;
}

.copy-icon {
  opacity: 0.85;
}

.copy-toast {
  min-height: 1.25rem;
  font-size: 0.8rem;
  color: var(--accent);
}

.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* Site footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--border);
}

/* Tablet */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
    justify-items: stretch;
  }

  .hero-social {
    grid-row: 1;
    flex-direction: row;
    justify-content: center;
    justify-self: center;
  }

  .hero-social-line {
    display: none;
  }

  .hero-grid {
    grid-row: 2;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-visual {
    order: -1;
    max-width: 360px;
    margin: 0 auto;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-col {
    grid-column: 1 / -1;
    max-width: 420px;
  }

  .monstera-deco {
    max-width: 280px;
    opacity: 0.5;
  }
}

/* Mobile nav + layout */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .btn-header {
    display: none;
  }

  .main-nav {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: var(--bg);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-top: 1px solid var(--border);
  }

  .site-header.is-open .main-nav {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 2rem;
    min-height: auto;
  }

  .hero-social {
    margin-bottom: 0;
  }

  .hero-social-list {
    flex-direction: row;
  }

  .portfolio-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-chips {
    justify-content: flex-start;
  }

  .sort-wrap {
    justify-content: space-between;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-contact-bg {
    right: -20%;
    opacity: 0.35;
    top: 20%;
    transform: none;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Podstrony: lista projektów + case study ----- */

.page-sub {
  padding-bottom: 4rem;
}

.sub-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.sub-hero-title {
  margin: 0.75rem 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub-hero-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  opacity: 0.45;
  user-select: none;
}

.project-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (min-width: 900px) {
  .project-grid--full {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Case study */
.detail-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.detail-header {
  max-width: 40rem;
  margin-bottom: 1.5rem;
}

.detail-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.detail-role {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.detail-cover {
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 180px;
  max-height: 380px;
  border-radius: var(--radius-card);
  margin: 0 0 2rem;
  background-size: cover;
  background-position: center;
}

.detail-lead {
  margin: 0 auto 2.5rem;
  max-width: 38rem;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text);
}

.detail-prose {
  max-width: 38rem;
  margin: 0 auto;
}

.detail-block {
  margin-bottom: 2.25rem;
}

.detail-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.detail-block p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.detail-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 38rem;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.detail-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.detail-pager-link:hover:not(.is-disabled) {
  border-color: rgba(163, 230, 53, 0.35);
}

.detail-pager-link--next {
  text-align: right;
}

.detail-pager-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-pager-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.detail-pager-link.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.detail-back {
  margin: 2rem auto 0;
  max-width: 38rem;
  text-align: center;
}

.detail-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
