/* =====================================================================
   Mateusz Olesiuk — portfolio. Vanilla CSS, zero zależności.
   Design tokens wg karty projektu (premium-minimal, paleta zielona).
   ===================================================================== */

:root {
  /* ---- Kolor ---- */
  --bg: #F9F8F6;
  --surface: #FFFFFF;
  --ink: #111110;
  --ink-secondary: #5A5A57;
  --ink-tertiary: #6E6E6A;
  --accent: #1A3A2A;
  --accent-light: #2D5A40;
  --accent-on-dark: #8FBF9E;
  --accent-muted: #E8EDE9;
  --border: #E4E3DF;
  --border-strong: #C8C7C2;

  /* ---- Typografia ---- */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* ---- Ruch ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- Rytm / kształt ---- */
  --section-pad-y: 7rem;
  --section-pad-x: 3rem;
  --radius-card: 1.125rem;
  --radius-icon: 10px;
  --radius-pill: 100px;
  --maxw: 1120px;
}

/* ---- Reset minimalny ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---- Typografia skala (fluid) ---- */
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.75rem, 6vw, 5rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; margin: 0; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); font-weight: 600; margin: 0 0 1.25rem;
  display: inline-block;
}
.section-dark .label { color: var(--accent-on-dark); }

.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-secondary); max-width: 60ch; }

/* ---- Layout sekcji ---- */
section { padding: var(--section-pad-y) var(--section-pad-x); }
.container { max-width: var(--maxw); margin-inline: auto; }
.section-head { max-width: 60ch; margin-bottom: 3.5rem; }
@media (max-width: 768px) {
  :root { --section-pad-y: 4rem; --section-pad-x: 1.5rem; }
  .section-head { margin-bottom: 2.5rem; }
}

/* ---- Skip-link ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--surface); padding: .75rem 1.25rem;
  border-radius: 0 0 .5rem 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* =====================================================================
   Nawigacja
   ===================================================================== */
header.nav {
  position: sticky; top: 0; z-index: 50;
  transition: background .3s var(--ease-out), backdrop-filter .3s var(--ease-out);
}
header.nav.scrolled {
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem var(--section-pad-x);
}
.nav__brand { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; }
.nav__links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; color: var(--ink-secondary); font-size: .95rem; font-weight: 500; transition: color .2s var(--ease-out); }
.nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: .75rem; }
section[id] { scroll-margin-top: 5.5rem; }

/* Hamburger / menu mobilne */
.nav__toggle { display: none; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; place-items: center; }
.nav__toggle span { display: block; width: 22px; height: 2px; margin: 4px auto; border-radius: 2px; background: var(--ink); transition: transform .3s var(--ease-out), opacity .2s var(--ease-out); }

@media (max-width: 1040px) {
  .nav__toggle { display: grid; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
    transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), visibility .25s;
  }
  .nav.open .nav__menu { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .nav__links { flex-direction: column; gap: 0; padding: .5rem 0; }
  .nav__links a { display: block; padding: .85rem var(--section-pad-x); }
  .nav.open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav.open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* =====================================================================
   Przyciski
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: var(--radius-pill); padding: .85rem 1.6rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-light { background: var(--surface); color: var(--ink); }
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
  .btn-secondary:hover { border-color: var(--ink); transform: translateY(-2px); }
  .btn-light:hover { transform: translateY(-2px); }
}

/* =====================================================================
   Karty (wspólne)
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem;
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
@media (hover: hover) {
  .card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(17,17,16,.06); }
}
.card__icon {
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-icon);
  background: var(--accent-muted); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 1.25rem;
}
.card__icon svg { width: 1.4rem; height: 1.4rem; }
.card h3 { margin-bottom: .65rem; }
.card p { color: var(--ink-secondary); }

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  padding-top: 4.5rem;
  position: relative;
  overflow: clip;
  isolation: isolate;
}
.hero__grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 3.5rem; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .85rem; color: var(--ink-secondary); font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  padding: .45rem .9rem; border-radius: var(--radius-pill); margin-bottom: 1.75rem;
}
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent-light); display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: pulse 2s var(--ease-in-out) infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
}
.hero h1 { margin-bottom: 1.5rem; }
.hero .lead { margin-bottom: 2.25rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .85rem; }

.stats { display: grid; gap: 1rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.4rem 1.6rem;
}
.stat__num { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; letter-spacing: -0.02em; color: var(--accent); line-height: 1; }
.stat__desc { font-size: .9rem; color: var(--ink-secondary); margin-top: .5rem; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* =====================================================================
   O mnie
   ===================================================================== */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about__text p { color: var(--ink-secondary); }
.about__text p strong { color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; padding: 0; list-style: none; }
.tag {
  font-size: .82rem; font-weight: 500; color: var(--accent);
  background: var(--accent-muted); border-radius: var(--radius-pill);
  padding: .4rem .85rem;
}
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---- Placeholder wideo (poster) ---- */
.video-trigger {
  position: relative; display: block; width: 100%; aspect-ratio: 16/9;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: linear-gradient(135deg, #1A3A2A 0%, #2D5A40 100%);
  cursor: pointer; overflow: hidden; padding: 0;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.video-trigger img { width: 100%; height: 100%; object-fit: cover; }
.video-trigger .play {
  position: absolute; inset: 0; margin: auto;
  width: 4.25rem; height: 4.25rem; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--accent);
  display: grid; place-items: center;
}
.video-trigger .play svg { width: 1.5rem; height: 1.5rem; margin-left: .2rem; }
.video-trigger .video-label {
  position: absolute; left: 1rem; bottom: 1rem; color: var(--surface);
  font-size: .85rem; font-weight: 500; opacity: .92;
}
@media (hover: hover) {
  .video-trigger:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(17,17,16,.12); }
}

/* =====================================================================
   Co robię — grid 3 karty
   ===================================================================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

/* =====================================================================
   Kompetencje
   ===================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.skill h3 { margin-bottom: .65rem; }
.skill > p { color: var(--ink-secondary); }
.skill-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .65rem; }
.skill-list li { position: relative; padding-left: 1.5rem; font-size: .95rem; }
.skill-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: .55rem; height: .55rem; border-radius: 3px; background: var(--accent-muted); border: 1.5px solid var(--accent); }
.section-meta { text-align: center; margin-top: 2.5rem; color: var(--ink-secondary); font-size: .95rem; }

/* =====================================================================
   Projekty — wyniki (osiągnięcia z liczbami)
   ===================================================================== */
.results__title { margin-top: 3.5rem; }
.results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 980px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .results-grid { grid-template-columns: 1fr; } }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.5rem; }
.result__num { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em; color: var(--accent); line-height: 1; }
.result__desc { font-size: .9rem; color: var(--ink-secondary); margin-top: .6rem; }
.more-projects { margin-top: 2.5rem; color: var(--ink-secondary); max-width: 62ch; }

/* =====================================================================
   Jak pracuję — sekcja ciemna
   ===================================================================== */
.section-dark { background: var(--ink); color: var(--surface); }
.section-dark .lead { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.steps-work { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
.work-step {
  border: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
  border-radius: var(--radius-card); padding: 1.5rem;
}
.work-step__num { font-family: var(--font-display); font-weight: 800; color: var(--accent-on-dark); font-size: 1.1rem; margin-bottom: .75rem; }
.work-step h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.work-step p { font-size: .9rem; color: color-mix(in srgb, var(--surface) 68%, transparent); }
@media (max-width: 980px) { .steps-work { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps-work { grid-template-columns: 1fr; } }

/* =====================================================================
   Kontakt
   ===================================================================== */
.contact__avatar { width: 112px; height: 112px; display: block; margin: 0 0 1.5rem; border-radius: 50%; }
.contact__links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 820px; margin-inline: auto; }
@media (max-width: 560px) { .contact__links { grid-template-columns: 1fr; } }
.contact-card {
  display: flex; align-items: center; gap: 1rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 1.15rem 1.4rem;
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
@media (hover: hover) { .contact-card:hover { border-color: var(--border-strong); transform: translateY(-2px); } }
.contact-card .card__icon { margin: 0; }
.contact-card__meta { flex: 1; }
.contact-card__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-tertiary); font-weight: 600; }
.contact-card__value { font-weight: 600; color: var(--ink); }
.contact-card__arrow { color: var(--ink-tertiary); }

/* =====================================================================
   Footer
   ===================================================================== */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem var(--section-pad-x);
}
.footer__inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  font-size: .85rem; color: var(--ink-tertiary);
}
.footer__inner a { color: var(--ink-secondary); text-decoration: none; }
.footer__inner a:hover { color: var(--ink); }

/* =====================================================================
   Strony prawne (polityka prywatności itp.)
   ===================================================================== */
.legal { padding: calc(var(--section-pad-y) - 1rem) var(--section-pad-x); }
.legal__inner { max-width: 760px; }
.legal h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 1rem; }
.legal h2 {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 3rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.legal h3 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; color: var(--accent); }
.legal p, .legal li { color: var(--ink-secondary); }
.legal .lead { margin-bottom: 1rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: .5rem; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--accent-light); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em; background: var(--accent-muted);
  padding: .1em .4em; border-radius: 6px; color: var(--accent);
}

/* =====================================================================
   Scroll-reveal
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(24px); filter: blur(6px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out), filter .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* =====================================================================
   Modal wideo
   ===================================================================== */
dialog.video-modal { border: none; padding: 0; background: transparent; max-width: min(90vw, 960px); width: 100%; }
dialog.video-modal::backdrop { background: rgba(17,17,16,.85); }
.video-modal__inner { position: relative; }
.video-frame { aspect-ratio: 16/9; width: 100%; border-radius: var(--radius-card); overflow: hidden; background: #000; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-modal__close {
  position: absolute; top: -3rem; right: 0;
  background: transparent; border: none; color: var(--surface);
  font-size: 1.5rem; cursor: pointer; line-height: 1; padding: .5rem;
}

/* =====================================================================
   Filmy 2 i 3 (blok wideo + tekst + przycisk galerii)
   ===================================================================== */
.film { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 3rem; }
.film--reverse .film__media { order: 2; }
.film__text .label { margin-bottom: 1rem; }
.film__text h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 1rem; }
.film__text p { color: var(--ink-secondary); }
.film__text .proj-open { margin-top: 1.5rem; }
@media (max-width: 860px) {
  .film { grid-template-columns: 1fr; gap: 1.75rem; margin-bottom: 2.5rem; }
  .film--reverse .film__media { order: 0; }
}

/* =====================================================================
   Modal galerii projektów
   ===================================================================== */
.proj-data[hidden] { display: none; }

/* Zrzut / placeholder zrzutu */
.proj-shot { aspect-ratio: 16/10; overflow: hidden; background: #000; }
.proj-shot img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; }
.proj-shot--ph {
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(135deg, #1A3A2A 0%, #2D5A40 100%);
  color: color-mix(in srgb, #fff 82%, transparent); font-size: .9rem; font-weight: 500; padding: 1rem;
}

dialog.proj-modal { border: none; padding: 0; background: transparent; max-width: min(96vw, 1600px); width: 100%; }
dialog.proj-modal::backdrop { background: rgba(17,17,16,.85); }
.proj-modal__shell { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; max-height: 94vh; }

.proj-modal__head { display: flex; align-items: center; gap: 1rem; padding: .7rem .7rem .7rem 1.25rem; border-bottom: 1px solid var(--border); }
.proj-tabs { display: flex; gap: .5rem; overflow-x: auto; flex: 1; padding-bottom: .2rem; scrollbar-width: thin; }
.proj-tab {
  white-space: nowrap; border: 1px solid var(--border); background: var(--bg); color: var(--ink-secondary);
  border-radius: var(--radius-pill); padding: .5rem 1rem; font: inherit; font-size: .86rem; font-weight: 500; cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.proj-tab[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.proj-modal__close { flex: none; width: 2.5rem; height: 2.5rem; border: none; background: transparent; color: var(--ink-secondary); font-size: 1.6rem; line-height: 1; cursor: pointer; border-radius: 50%; }
@media (hover: hover) { .proj-modal__close:hover { background: var(--accent-muted); color: var(--ink); } }

/* Wybór projektu na mobile — lista rozwijana zamiast przewijanych zakładek */
.proj-select {
  display: none; flex: 1; min-width: 0;
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink);
  background-color: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: .6rem 2.4rem .6rem 1.1rem;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111110' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: .8rem;
  text-overflow: ellipsis;
}

.proj-modal__body { display: grid; grid-template-columns: 1.6fr 1fr; align-items: start; overflow: hidden; min-height: 0; }

/* Karuzela — slot dokładnie 16:9 (proporcja zrzutów), żeby nie przycinać boków */
.proj-carousel { position: relative; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.proj-carousel__track { display: flex; height: 100%; transition: transform .4s var(--ease-out); }
.proj-carousel__track > * { flex: 0 0 100%; min-width: 100%; }
.proj-carousel__track .proj-shot { aspect-ratio: auto; height: 100%; }
.proj-carousel__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: none; background: color-mix(in srgb, #fff 90%, transparent); color: var(--ink); font-size: 1.4rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.proj-carousel__nav--prev { left: .6rem; } .proj-carousel__nav--next { right: .6rem; }
.proj-carousel__nav[hidden] { display: none; }
.proj-carousel__dots { position: absolute; bottom: .7rem; left: 0; right: 0; display: flex; justify-content: center; gap: .4rem; }
.proj-carousel__dots:empty { display: none; }
.proj-carousel__dots button { width: .5rem; height: .5rem; padding: 0; border: none; border-radius: 50%; background: color-mix(in srgb, #fff 45%, transparent); cursor: pointer; }
.proj-carousel__dots button[aria-current="true"] { background: #fff; }

/* Opis projektu */
.proj-detail { padding: 1.75rem; overflow-y: auto; }
.proj-detail .label { margin-bottom: 1rem; }
.proj-detail dl { margin: 0; display: grid; gap: .85rem; }
.proj-detail dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-tertiary); font-weight: 600; margin-bottom: .15rem; }
.proj-detail dd { margin: 0; color: var(--ink-secondary); }
.proj-detail dd.efekt { color: var(--accent); font-weight: 500; }
.proj-detail .disclaimer { font-size: .9rem; font-style: italic; color: var(--ink-tertiary); border-left: 2px solid var(--border-strong); padding-left: 1rem; margin: 1.25rem 0 0; }

@media (max-width: 820px) {
  dialog.proj-modal { max-width: 100vw; width: 100vw; }
  .proj-modal__shell { border-radius: 0; height: 100dvh; max-height: 100dvh; }
  .proj-tabs { display: none; }            /* przewijane zakładki → chowamy na mobile */
  .proj-select { display: block; }         /* … w zamian czytelna lista rozwijana */
  .proj-modal__body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: stretch; overflow-y: auto; }
  .proj-carousel { min-height: 0; aspect-ratio: 16 / 9; }
  .proj-carousel__track .proj-shot { aspect-ratio: auto; height: 100%; }
  .proj-detail { padding: 1.25rem 1.25rem 2rem; }
}

/* =====================================================================
   Focus + reduced motion
   ===================================================================== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.section-dark :focus-visible { outline-color: var(--accent-on-dark); }

/* =====================================================================
   Życie / nowoczesność — hero wow (głównie desktop), tekstura, akcenty
   ===================================================================== */

/* Tło hero: aurora w akcencie (powolny dryf) */
.hero__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero__aurora::before, .hero__aurora::after { content: ""; position: absolute; border-radius: 50%; filter: blur(72px); }
.hero__aurora::before {
  width: 48vw; height: 48vw; left: -10vw; top: -14vw; opacity: .5;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%);
  animation: aurora1 28s var(--ease-in-out) infinite alternate;
}
.hero__aurora::after {
  width: 42vw; height: 42vw; right: -8vw; top: 0; opacity: .42;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-light) 30%, transparent), transparent 70%);
  animation: aurora2 34s var(--ease-in-out) infinite alternate;
}
@keyframes aurora1 { to { transform: translate(7vw, 6vw) scale(1.12); } }
@keyframes aurora2 { to { transform: translate(-6vw, 4vw) scale(1.08); } }

/* Poświata podążająca za kursorem (tylko desktop / hover) */
.hero__glow {
  position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease-out);
  background: radial-gradient(520px circle at var(--mx, 72%) var(--my, 28%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%);
}
@media (hover: hover) and (pointer: fine) { .hero:hover .hero__glow { opacity: 1; } }

/* Wejście strony — kaskadowe blur-in (efekt wow) */
[data-reveal] { animation: enterUp .95s var(--ease-out) backwards; animation-delay: calc(var(--d, 0) * 0.09s + 0.05s); }
@keyframes enterUp { from { opacity: 0; transform: translateY(28px); filter: blur(9px); } to { opacity: 1; transform: none; filter: none; } }

/* Nawigacja — subtelne wejście */
header.nav { animation: navIn .8s var(--ease-out) backwards; }
@keyframes navIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Akcent w H1 — gradient na słowie-kluczu */
.hero h1 .accent {
  background: linear-gradient(115deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Subtelna tekstura (grain) — premium feel */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .03; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fallback bez JS — treść zawsze widoczna (nie znika, gdy JS nie działa) */
html:not(.js) .reveal,
html:not(.js) [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }

/* =====================================================================
   Reduced motion (twarda reguła) — wyłącza ruch i efekty
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
  header.nav { opacity: 1 !important; transform: none !important; }
  .hero__glow { display: none; }
}
