/* ============================================================
   style.css — Jakub Radomyski portfolio
   Dark · Acid green accent · System font · CSS Grid throughout
============================================================ */

/* ================================
   ROOT & RESET
================================ */
:root {
  --bg:        #0c0c0c;
  --bg-2:      #141414;
  --bg-3:      #1c1c1c;
  --accent:    #b5ff2d;
  --text:      #f0f0f0;
  --text-muted:#888888;
  --mono:      'Courier New', Courier, monospace;
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w:     1200px;
  --sp:        clamp(4rem, 8vw, 10rem);
  --border:    1px solid #2a2a2a;
  --ease:      0.3s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; text-decoration: none; }

/* ================================
   FOCUS VISIBLE (accessibility)
================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ================================
   NAV
================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.25rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--ease), backdrop-filter var(--ease), border-color var(--ease);
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: #2a2a2a;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.nav-monogram {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-social-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--ease);
}
.nav-social-icon:hover { color: var(--accent); }
.nav-social-icon svg { width: 18px; height: 18px; fill: currentColor; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--ease);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
}
.nav-toggle svg { width: 24px; height: 24px; fill: currentColor; }

/* ================================
   HERO
================================ */
.hero-wrap {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background-image: radial-gradient(circle, #252525 1px, transparent 1px);
  background-size: 32px 32px;
}

.hero {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1.5rem, 5vw, 3rem) 4rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Small all-caps name above H1 */
.hero-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.75rem, 5.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--text);
}

.hero-sub {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.65;
}

/* Stats: three numbers side by side */
.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a2a;
  flex-wrap: wrap;
  align-items: flex-start;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-stat-num {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.45;
  max-width: 100px;
}

.hero-cta {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

/* Portrait photo */
.hero-portrait {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: end;
}

.hero-portrait img {
  width: 220px;
  height: 310px;
  object-fit: cover;
  object-position: top center;
  border: var(--border);
  display: block;
}

/* Legacy */
.hero-photo  { display: none; }
.hero-avatar { display: none; }
.hero-stat-ctx { display: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.875rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0c0c0c;
  border-color: var(--accent);
}
.btn-primary:hover { background: #ccff5a; }
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover { background: rgba(181,255,45,0.07); }

/* Hero photo (hidden — replaced by .hero-avatar) */
.hero-photo { display: none; }

/* ================================
   SECTION COMMON
================================ */
section {
  padding: var(--sp) clamp(1.5rem, 5vw, 3rem);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

/* ================================
   WYNIKI — METRICS
================================ */
#wyniki { background: var(--bg); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-2);
  border: var(--border);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color var(--ease), transform var(--ease);
}
.metric-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.metric-client {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.metric-num {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 0.25rem;
}

.metric-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.metric-div {
  width: 28px;
  height: 1px;
  background: #2a2a2a;
  margin: 0.2rem 0;
}

.metric-ctx {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.metric-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

/* ================================
   CASE STUDIES
================================ */
#case-studies { background: var(--bg-2); }

.case-studies {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 6rem);
}

.case-study {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.case-study.reverse { direction: rtl; }
.case-study.reverse > * { direction: ltr; }

.cs-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.cs-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.cs-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.cs-article-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid rgba(181,255,45,0.35);
  padding-bottom: 0.1rem;
  transition: border-color var(--ease), opacity var(--ease);
  margin-bottom: 1.5rem;
}
.cs-article-link:hover {
  border-color: var(--accent);
  opacity: 0.85;
}

/* Lighthouse badges */
.lh-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.lh-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  gap: 0.1rem;
}
.lh-badge.green {
  background: rgba(12, 206, 107, 0.08);
  border: 2px solid #0CCE6B;
  color: #0CCE6B;
}

.lh-score {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.lh-cat {
  font-size: 0.42rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.3;
  color: inherit;
  opacity: 0.8;
}

/* Core Web Vitals grid */
.cwv {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--mono);
  margin-top: 0.5rem;
}
.cwv-item { display: flex; flex-direction: column; gap: 0.1rem; }
.cwv-val { font-size: 1rem; color: var(--accent); }
.cwv-key { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Before/after images */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ba-wrap { position: relative; }
.ba-label {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(12,12,12,0.85);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border: var(--border);
  z-index: 1;
}
.ba-wrap img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: var(--border);
}
.ba-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-3);
  border: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Big stat */
.cs-big-num {
  font-family: var(--mono);
  font-size: clamp(4rem, 9vw, 7rem);
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

/* CS visual side placeholder */
.cs-visual-placeholder {
  background: var(--bg-3);
  border: var(--border);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Real case study hero images */
.cs-hero-img {
  width: 100%;
  height: auto;
  display: block;
  border: var(--border);
  object-fit: cover;
}

/* ================================
   KLIENCI — LOGOS
================================ */
#klienci { background: var(--bg); }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  align-items: center;
  gap: 1.5rem 2rem;
}

.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
}
.logo-item img {
  max-height: 44px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.65;
  transition: filter var(--ease), opacity var(--ease);
}
.logo-item img:hover {
  filter: none;
  opacity: 1;
}
/* Lovlisilk logo is already white/light — no brightness inversion needed */
.logo-lovli img {
  filter: none;
  opacity: 0.75;
}
.logo-lovli img:hover {
  filter: none;
  opacity: 1;
}

/* Raster logos (JPG/AVIF) with white backgrounds:
   brightness(0) would kill them → use invert(1) only
   white bg → black (blends with dark page), dark logo → white */
.logo-raster img {
  filter: grayscale(1) invert(1);
  opacity: 0.72;
  transition: filter var(--ease), opacity var(--ease);
}
.logo-raster:hover img {
  filter: none;
  opacity: 1;
}
.logo-raster:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Dark logos (black fills / dark AVIF) — hover reveals on white card
   filter: none on dark bg = invisible, so we lift a white background */
.logo-dark {
  transition: background var(--ease), box-shadow var(--ease);
  border-radius: 2px;
}
.logo-dark img {
  filter: brightness(0) invert(1);
  opacity: 0.65;
  transition: filter var(--ease), opacity var(--ease);
}
.logo-dark:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.logo-dark:hover img {
  filter: none;
  opacity: 1;
}

/* Logo grid — force fewer columns when only 2 logos */
.logo-grid--few {
  grid-template-columns: repeat(auto-fill, minmax(160px, 200px));
  justify-content: flex-start;
}

/* Second client sub-section */
.clients-trusted {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.clients-trusted-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.logo-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2.5rem;
}

/* ================================
   NARZĘDZIA — TOOLS
================================ */
#narzedzia { background: var(--bg-2); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
}

.tools-col-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-size: 0.775rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-3);
  border: 1px solid #2a2a2a;
  color: var(--text-muted);
  border-radius: 2px;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}
.pill:hover { border-color: #555; color: var(--text); }
.pill.featured {
  border-color: var(--accent);
  color: var(--text);
}

/* ================================
   O MNIE
================================ */
#o-mnie { background: var(--bg); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-photo {
  width: 240px;
  height: auto;
  display: block;
  border: var(--border);
  margin-top: -1.5rem;
}

.about-text {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 620px;
}

/* ================================
   PROJEKTY
================================ */
#projekty { background: var(--bg-2); }

.projekty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.proj-links-list {
  display: flex;
  flex-direction: column;
}

.proj-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.1rem 0;
  border-bottom: var(--border);
  transition: border-color var(--ease);
}
.proj-link:first-child { padding-top: 0; }
.proj-link:hover { border-bottom-color: var(--accent); }

.proj-link-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--ease);
}
.proj-link:hover .proj-link-name { color: var(--accent); }
.proj-link-sub { font-size: 0.72rem; color: var(--text-muted); }

.ext-arrow { font-size: 0.8em; opacity: 0.5; }

/* Active project block */
.active-project {
  border: 1px solid rgba(181,255,45,0.35);
  box-shadow: 0 0 24px rgba(181,255,45,0.08);
  background: rgba(181,255,45,0.025);
  padding: 1.75rem;
}

.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.75); }
}

.ap-logo {
  max-height: 32px;
  width: auto;
  margin-bottom: 0.75rem;
}

.ap-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.25rem;
}

.ap-url {
  font-size: 0.78rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
  transition: opacity var(--ease);
}
.ap-url:hover { opacity: 0.75; }

.ap-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ================================
   KONTAKT
================================ */
#kontakt { background: var(--bg); }

.kontakt-big {
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-bottom: 2.5rem;
}

.kontakt-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.kontakt-item {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--ease);
  width: fit-content;
}
.kontakt-item:hover { color: var(--accent); }

/* ================================
   FOOTER
================================ */
footer {
  background: var(--bg-2);
  border-top: var(--border);
  padding: 1.4rem clamp(1.5rem, 5vw, 3rem);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.footer-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  transition: color var(--ease);
}
.footer-icon:hover { color: var(--accent); }
.footer-icon svg { width: 17px; height: 17px; fill: currentColor; }

/* ================================
   RESPONSIVE — 768px
================================ */
@media (max-width: 768px) {
  .hero {
    padding: 5rem clamp(1.5rem, 5vw, 3rem) 3rem;
    min-height: auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo {
    width: 140px;
  }

  nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg-2);
    border-bottom: var(--border);
    flex-direction: column;
    padding: 1.25rem clamp(1.5rem, 5vw, 3rem);
    gap: 1.25rem;
    align-items: flex-start;
  }
  nav .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .metrics-grid { grid-template-columns: 1fr 1fr; }

  .case-study,
  .case-study.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .case-study.reverse > * { direction: ltr; }

  .before-after { grid-template-columns: 1fr; }

  .tools-grid { grid-template-columns: 1fr; gap: 2rem 0; }

  .projekty-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .lh-badges { gap: 0.5rem; }
  .lh-badge { width: 64px; height: 64px; }
}

/* ================================
   REDUCED MOTION
================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .pulse-dot { animation: none; opacity: 1; }
}

/* ================================
   PRINT
================================ */
@media print {
  nav,
  .hero-wrap,
  .hero-cta,
  footer { display: none !important; }

  body { background: #fff; color: #000; }

  section { padding: 1.5rem 0; }

  .metrics-grid,
  .tools-grid,
  .projekty-grid { display: block; }

  .metric-card,
  .case-study { page-break-inside: avoid; }
}
