/* The imprint is the same scan of a loaded brush as the homepage’s “Nasze gry”. */
:root {
  --dry-brush: url("/obrazy/slad-tuszu.webp");
  --deep-ink: #203d42;
  --ink-join: var(--paper, #fcfbf7);
  --brush-type: 600 1rem/1.35 Barlow, "Segoe UI", sans-serif;
}

.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email,
.album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button,
.album-genre, .ink-label, .album-hero-study figcaption, .album-cover figcaption,
.album-landscapes figcaption, .album-cast-item small, .print-dialog .dialog-count {
  position: relative;
  isolation: isolate;
}

:is(.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email,
    .album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button,
    .album-genre, .ink-label, .album-hero-study figcaption, .album-cover figcaption,
    .album-landscapes figcaption, .album-cast-item small, .print-dialog .dialog-count)::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  margin: 0;
  pointer-events: none;
  background: linear-gradient(104deg, #365f64 0%, var(--stamp-color, var(--deep-ink)) 23%, var(--stamp-color, var(--deep-ink)) 74%, #42656a);
  -webkit-mask: var(--dry-brush) center / 100% 100% no-repeat;
  mask: var(--dry-brush) center / 100% 100% no-repeat;
  transform: rotate(-.8deg);
  transition: opacity .16s ease, transform .2s ease-out;
}

/* Let the paint grow into the menu's existing gaps, keeping the header in place. */
:is(.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email)::before {
  inset: .08em -.78em;
  opacity: 0;
  transform: rotate(-1.5deg) scaleX(.9);
}
:is(.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email):is(:hover, :focus-visible, :active) {
  color: #fff;
  text-decoration: none;
}
:is(.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email):is(:hover, :focus-visible, :active)::before {
  opacity: 1;
  transform: rotate(-.9deg) scaleX(1);
}
.mast nav a:is(:hover, :focus-visible, :active)::after { opacity: 0; }
.album-email:is(:hover, :focus-visible, :active)::after { opacity: 0; }
.album-email::before { inset: -.05em -.55em -.08em -.4em; }
.ink-footer :focus-visible, .masthead nav a:focus-visible { outline: 2px solid #244e55; outline-offset: 4px; }

.album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-height: 2.7rem;
  padding: .56rem 1.65rem .62rem 1.25rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: white;
  font: var(--brush-type);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.album-link::after { display: none; }
.print-dialog .full-print { color: white; }
:is(.album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button):is(:hover, :focus-visible) {
  background: transparent;
  color: white;
  text-decoration: none;
}
:is(.album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button):is(:hover, :focus-visible)::before {
  --stamp-color: #31555a;
  transform: rotate(.6deg) scale(1.035, 1.04);
}
.replay-intro[hidden] { display: none; }
.album-genre, .ink-label, .album-hero-study figcaption, .album-cover figcaption,
.album-landscapes figcaption, .album-cast-item small, .print-dialog .dialog-count {
  --stamp-color: color-mix(in srgb, var(--pigment, #36585b) 66%, #1a2e33);
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  padding: .28rem 1.85rem .34rem 1.05rem;
  color: white;
  font: 600 .94rem/1.4 Barlow, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}
.album-hero-study figcaption, .album-cast-item small { margin-inline: auto; }
.album-cast-item small { margin-top: .5rem; }
.album-jumps, .album-doc-links > div { gap: .45rem .65rem; }
.album-spread-copy > .album-genre { color: white; }
.album-link:focus-visible, .album-back:focus-visible, .ink-action:focus-visible {
  outline: 2px solid #20464b;
  outline-offset: 3px;
}

.ink-footer {
  position: relative;
  color: var(--ink, #1d3136);
  background: var(--paper, #fcfbf7);
}
/* Fade the actual paint underneath, including the margins of the legal pages. */
.ink-footer::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset-inline: 0;
  bottom: 100%;
  height: clamp(2.1rem, 4.5vw, 4rem);
  background: linear-gradient(to bottom,
    transparent,
    color-mix(in srgb, var(--ink-join) 12%, transparent) 25%,
    color-mix(in srgb, var(--ink-join) 67%, transparent) 64%,
    var(--ink-join) 99%);
}
.ink-footer-inner {
  width: min(calc(100% - var(--edge, clamp(1.25rem, 5.7vw, 6.25rem)) * 2), 82rem);
  margin-inline: auto;
}
.ink-footer-menu, .ink-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
}
.ink-footer-menu {
  min-height: clamp(4.4rem, 6vw, 5.9rem);
  border-bottom: 1px solid var(--line, #cdd4ce);
}
.ink-signature { display: inline-flex; flex: none; align-items: center; min-height: 44px; }
.wordmark, .ink-signature, .masthead .signature:hover { text-decoration: none; }
.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .12rem;
}
.brand-lockup picture, .brand-lockup picture img { display: block; }
@media screen and (prefers-reduced-motion: no-preference) {
  /* The animated SVG has a 218-unit viewBox around the original 208-unit
     signature. Let the moving tips use that margin without shrinking the ink. */
  .brand-lockup picture img { transform: scale(1.048077); }
}
.brand-subtitle {
  color: #57382e;
  font: 600 clamp(.56rem, .69vw, .65rem)/1.15 Barlow, "Segoe UI", sans-serif;
  letter-spacing: .39em;
  /* The intro tracks the gaps between glyphs, without a gap after the O. */
  padding-inline-start: .39em;
}
.ink-signature img {
  display: block;
  width: auto;
  height: clamp(2rem, 3.25vw, 2.8rem);
  max-width: 11.6rem;
}
.ink-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(1rem, 2.8vw, 2.9rem);
}
.ink-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: .7rem;
  font: 600 1rem/1.4 Barlow, "Segoe UI", sans-serif;
  color: inherit;
  text-decoration: none;
}
.ink-footer-meta { padding-block: .35rem .45rem; }
.ink-address {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #244b50;
  font: var(--brush-type);
  text-underline-offset: .2em;
  text-decoration-thickness: 1px;
}
.ink-footer .replay-intro { min-height: 44px; padding-inline: 1rem 1.3rem; }

/* Softer washes run out into the margins of long reading pages. */
body:has(.masthead) {
  --leaf-paper: #dee5d9;
  --margin-paper: #a7c7cb;
  --veil: #e5e9dede;
  background-color: var(--leaf-paper);
  background-image:
    linear-gradient(90deg, transparent, var(--veil) 26% 64%, transparent 98%),
    url("/obrazy/album/granat.webp"), url("/obrazy/album/wrzos.webp"),
    url("/obrazy/album/szmaragd.webp"), url("/obrazy/album/ochra.webp"),
    url("/obrazy/album/podmalowka-ziemna.webp"),
    linear-gradient(155deg, var(--margin-paper), var(--leaf-paper) 30%, #e8ddc8 57%, var(--margin-paper) 85%, var(--ink-join) 100%);
  background-position: center, right -10vw top 4rem, left -19vw top 45%, right -27vw bottom 27%, left -18vw bottom 8%, center top, center;
  background-size: 100% 100%, 56% auto, 65% auto, 70% auto, 67% auto, max(64rem, 100%) auto, 100% 100%;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat-y, no-repeat;
  background-blend-mode: normal, normal, normal, normal, normal, soft-light, normal;
}
body:has(.masthead a[href="/zaczarowana-polana/"]) {
  --leaf-paper: #e6e4cc;
  --margin-paper: #c3d6b7;
  --veil: #ede8d6de;
}
.masthead { background: color-mix(in srgb, var(--leaf-paper) 30%, #fcfbf7); }
body:has(.masthead) > main { padding-bottom: clamp(5rem, 11vw, 9rem); }
@media (max-width: 42.5rem) {
  .ink-signature img { height: 2.05rem; }
  .ink-footer-menu { min-height: auto; padding-block: .9rem; }
  .ink-footer nav { column-gap: 1.25rem; }
  .ink-footer nav a { padding-block: .5rem; }
}
@media (max-width: 31.99rem) {
  .ink-footer-menu { flex-direction: column; gap: .1rem; padding-block: .6rem .3rem; }
  .ink-footer nav { width: 100%; justify-content: space-between; gap: 0 .55rem; }
  .ink-footer-meta { gap: .2rem .65rem; }
  .ink-footer .replay-intro { padding-inline: .8rem 1rem; }
  .ink-footer nav a::before { inset-inline: -.48em; }
}
@media (max-width: 23rem) {
  .ink-footer-meta { column-gap: .4rem; }
  .ink-footer-meta :is(.ink-address, .replay-intro) { font-size: .94rem; }
  .ink-footer .replay-intro { padding-inline: .6rem .85rem; }
}
@media (max-width: 44rem) {
  .mast nav a::before { inset-inline: -.48em; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead nav a::before { transition: none; }
  .ink-footer :is(a, button)::before { transition: none !important; }
}
@media (forced-colors: active) {
  :is(.mast nav a, .masthead nav a, .ink-footer nav a, .ink-address, .album-email,
      .album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button,
      .album-genre, .ink-label, .album-hero-study figcaption, .album-cover figcaption,
      .album-landscapes figcaption, .album-cast-item small, .print-dialog .dialog-count)::before { display: none; }
  :is(.album-link, .album-back, .ink-action, .replay-intro, .full-print, .intro-actions button) { border: 1px solid ButtonText; }
  .ink-footer nav a, .mast nav a, .masthead nav a { text-decoration: underline; }
}
@media print {
  .ink-footer { display: none; }
  body:has(.masthead) { background: white; }
  body:has(.masthead) > main { padding: 0; }
}
