/* ============ amedev — style.css ============ */

:root {
  --bg: #0b0d12;
  --bg-elev: #12151d;
  --bg-card: #151924;
  --border: #232939;
  --text: #e8ebf2;
  --text-dim: #9aa3b5;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 18px;
  --shadow: 0 20px 60px -20px rgb(0 0 0 / .6);
  --header-h: 72px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--accent); color: #fff; }

/* Płynna typografia */
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 1rem; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .75rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin: 0 0 .5rem; }

.container { width: min(1160px, 92vw); margin-inline: auto; }

/* Dostępność */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 10px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

/* Pasek postępu scrolla */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--gradient); z-index: 120;
}

/* ============ Nagłówek ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  display: flex; align-items: center; z-index: 100;
  background: transparent;
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.site-header.scrolled {
  background: rgb(11 13 18 / .8);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 8px 30px -12px rgb(0 0 0 / .5);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.3rem; text-decoration: none; color: var(--text);
  letter-spacing: -0.02em;
}
.logo img { width: 34px; height: 34px; }
.logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.main-nav { display: flex; align-items: center; gap: 1.75rem; }
.main-nav a {
  color: var(--text-dim); text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: color .2s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav .btn { color: #fff; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: .5rem;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: transform .3s, opacity .3s; }

/* ============ Przyciski ============ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 0; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 10px 30px -10px rgb(124 92 255 / .6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -10px rgb(124 92 255 / .8); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  position: relative; overflow: clip;
  padding: calc(var(--header-h) + 4rem) 0 4rem;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 20% 20%, rgb(124 92 255 / .22), transparent 65%),
    radial-gradient(700px 500px at 80% 70%, rgb(0 212 255 / .14), transparent 65%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image:
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
}
.hero-content { text-align: center; max-width: 820px; margin-inline: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: 1.25rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent-2); }
.eyebrow::after  { content: ""; width: 28px; height: 1px; background: var(--accent-2); }

.hero .gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim); max-width: 620px; margin: 0 auto 2.25rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: clamp(1.5rem, 5vw, 4rem); justify-content: center;
  margin-top: 3.5rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat b { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: .85rem; color: var(--text-dim); }

/* ============ Sekcje ============ */
section { padding: clamp(4rem, 9vw, 7rem) 0; }
section:not(.hero) { content-visibility: auto; contain-intrinsic-size: auto 700px; }

.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head p { color: var(--text-dim); margin: 0; }

/* ============ Usługi ============ */
.services-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; position: relative; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-5px); border-color: rgb(124 92 255 / .5); box-shadow: var(--shadow); }
.card .icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: rgb(124 92 255 / .12); margin-bottom: 1.1rem; font-size: 1.4rem;
}
.card p { color: var(--text-dim); font-size: .95rem; margin: 0; }

/* ============ Portfolio ============ */
.portfolio-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.project {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project:hover { transform: translateY(-6px); border-color: rgb(0 212 255 / .5); box-shadow: var(--shadow); }
.project figure { margin: 0; aspect-ratio: 8 / 5; overflow: hidden; background: var(--bg-elev); }
.project img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease, opacity .6s ease, filter .6s ease;
}
.project:hover img { transform: scale(1.04); }
.project-body { padding: 1.4rem 1.5rem 1.6rem; }
.project-body p { color: var(--text-dim); font-size: .93rem; margin: .25rem 0 .9rem; }
.tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.tag {
  font-size: .75rem; font-weight: 600; padding: .28rem .7rem; border-radius: 999px;
  background: rgb(124 92 255 / .12); color: #b9a8ff; border: 1px solid rgb(124 92 255 / .25);
}
.tag.cyan { background: rgb(0 212 255 / .1); color: #7fe8ff; border-color: rgb(0 212 255 / .25); }
.project .link-hint { font-size: .85rem; font-weight: 600; color: var(--accent-2); }

.badge-live {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgb(52 211 153 / .15); color: #34d399; border: 1px solid rgb(52 211 153 / .4);
  padding: .3rem .7rem; border-radius: 999px; backdrop-filter: blur(6px);
}
.badge-soon {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgb(251 191 36 / .12); color: #fbbf24; border: 1px solid rgb(251 191 36 / .35);
  padding: .3rem .7rem; border-radius: 999px; backdrop-filter: blur(6px);
}
.project { position: relative; }

/* Lazy loading — efekt blur-up */
img.lazy { opacity: 0; filter: blur(14px); }
img.lazy.loaded { opacity: 1; filter: blur(0); }

/* ============ Proces ============ */
.process { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { counter-increment: step; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.step::before {
  content: "0" counter(step);
  display: block; font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .9rem;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.step p { color: var(--text-dim); font-size: .93rem; margin: 0; }

/* ============ Kontakt ============ */
.contact-box {
  background: linear-gradient(160deg, rgb(124 92 255 / .12), rgb(0 212 255 / .06));
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4);
  padding: clamp(2rem, 6vw, 4rem); text-align: center;
}
.contact-box p { color: var(--text-dim); max-width: 520px; margin: 0 auto 2rem; }
.contact-mail { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 700; color: var(--accent-2); text-decoration: none; }
.contact-mail:hover { text-decoration: underline; }

/* ============ Stopka ============ */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-footer p { margin: 0; color: var(--text-dim); font-size: .88rem; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text); }

/* ============ Animacje reveal ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }

/* ============ Mobile ============ */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgb(11 13 18 / .97); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: .5rem 4vw 1.25rem;
    transform: translateY(-130%); transition: transform .3s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: .9rem 0; font-size: 1.05rem; }
  .main-nav .btn { justify-content: center; margin-top: .5rem; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============ Ograniczenie animacji ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  img.lazy { opacity: 1; filter: none; }
}
