/* ---------- tokens ---------- */
:root {
  --desk: #161412;
  --paper: #efe9dd;
  --paper-white: #f6f3ec;
  --ink: #1d1b19;
  --pen: #24408f;
  --red: #c8141c;
  --pencil: #6d6862;
  --chalk: #ece6da;
  --sticky: #f1df6e;
  --tape: rgba(228, 216, 178, .82);
  --grid: rgba(64, 104, 170, .2);
  --noise: url("../assets/img/noise.png");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--desk);
  background-image: var(--noise);
  background-size: 200px;
  background-blend-mode: soft-light;
  color: var(--ink);
  font-family: "Caveat", "Neucha", cursive;
  font-size: 18px;
  line-height: 1.3;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px dashed var(--red);
  outline-offset: 4px;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.variant-switch {
  position: fixed; right: 12px; bottom: 12px; z-index: 50;
  padding: 7px 12px;
  background: rgba(22, 20, 18, .85);
  color: var(--chalk);
  font: 12px/1 "PT Mono", monospace;
  letter-spacing: .08em;
  text-decoration: none;
}
.variant-switch span { margin-right: 6px; opacity: .7; }
.variant-switch a { padding: 2px 5px; color: inherit; text-decoration: none; }
.variant-switch a:hover { color: var(--sticky); }
.variant-switch a[aria-current] { background: var(--red); color: var(--paper-white); }
[id] { scroll-margin-top: 24px; }

/* hand-drawn line boil */
@keyframes boil {
  0%      { filter: url(#boil-0); }
  33.33%  { filter: url(#boil-1); }
  66.66%  { filter: url(#boil-2); }
  100%    { filter: url(#boil-0); }
}
.boil { animation: boil .42s steps(1, end) infinite; }

/* ---------- paper sheets ---------- */
.slot { position: relative; width: min(100% - 24px, 1180px); margin: 0 auto; }

.sheet {
  position: relative;
  isolation: isolate;
  padding: clamp(24px, 5vw, 56px);
  transform: rotate(var(--r, 0deg));
}
/* soft shadow under the paper */
.sheet::before {
  content: "";
  position: absolute;
  inset: 14px 8px -10px;
  background: rgba(0, 0, 0, .55);
  filter: blur(14px);
  z-index: -2;
}
/* the paper itself; torn edges come from --tear (set in main.js) */
.sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image: var(--noise);
  background-size: 200px;
  background-blend-mode: soft-light;
  clip-path: var(--tear, none);
}
.sheet--plain::after { background-color: var(--paper-white); }
.sheet--grid::after {
  background-image:
    linear-gradient(90deg, transparent calc(100% - 46px), rgba(206, 46, 46, .5) calc(100% - 46px), rgba(206, 46, 46, .5) calc(100% - 44px), transparent calc(100% - 44px)),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--noise);
  background-size: 100% 100%, 22px 22px, 22px 22px, 200px;
  background-blend-mode: normal, multiply, multiply, soft-light;
}

/* masking tape */
.tape {
  position: absolute;
  z-index: 3;
  width: 118px;
  height: 32px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  clip-path: polygon(0 10%, 4% 0, 9% 12%, 14% 2%, 86% 0, 91% 10%, 96% 1%, 100% 12%, 100% 88%, 95% 100%, 90% 90%, 85% 100%, 12% 98%, 7% 88%, 3% 100%, 0 90%);
}
.tape--tl { top: -14px; left: -22px; transform: rotate(-32deg); }
.tape--tr { top: -12px; right: -24px; transform: rotate(28deg); }
.tape--tc { top: -16px; left: 50%; transform: translateX(-50%) rotate(-4deg); }

/* ---------- type ---------- */
.scrawl {
  margin: 0 0 .35em;
  font-family: "Neucha", cursive;
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 6.2rem);
  line-height: .9;
  letter-spacing: -.01em;
  transform: rotate(-2deg);
  transform-origin: left center;
  width: fit-content;
  padding-bottom: .18em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 15 C 40 6, 70 19, 110 11 S 180 6, 215 13 S 270 18, 297 8 M 18 19 C 70 13, 140 20, 200 15 S 260 12, 290 16' fill='none' stroke='%23c8141c' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% .32em;
}
.scrawl--light { color: var(--chalk); }

.hand { font-family: "Caveat", cursive; font-weight: 500; color: var(--pen); font-size: clamp(1.35rem, 3.6vw, 1.85rem); margin: .3em 0; }
.big { font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.12; }
.red { color: var(--red); }
.pen { color: var(--red); font-weight: 700; display: inline-block; transform: rotate(-3deg); }
.pencil { color: var(--pencil); font-family: "Caveat", cursive; font-weight: 500; }
s { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; color: var(--pencil); }

/* ---------- hero ---------- */
.slot--hero { width: auto; margin: 12px; }
.hero {
  min-height: calc(100svh - 24px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "nav" "logo" "tag" "char";
  align-content: start;
  padding: 16px 18px 0;
  overflow: hidden;
}
.scrawl-nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pen);
  padding-right: 40px; /* keep clear of the margin line */
}
.scrawl-nav a { text-decoration: none; display: inline-block; transform: rotate(-2deg); }
.scrawl-nav a:nth-child(2n) { transform: rotate(1.5deg) translateY(3px); }
.scrawl-nav a:nth-child(3n) { transform: rotate(-.5deg) translateY(-1px); }
.scrawl-nav a:hover { color: var(--red); text-decoration: underline wavy var(--red) 2px; text-underline-offset: 5px; }

.hero__logo { grid-area: logo; margin: 22px -6px 0; transform: rotate(-2.5deg); }
.hero__logo img { width: 100%; }
.hero__tag {
  grid-area: tag;
  margin: 10px 0 0;
  font-family: "Neucha", cursive;
  font-size: clamp(1.4rem, 4.6vw, 2.1rem);
  color: var(--ink);
  text-align: center;
}
.hero__char {
  grid-area: char;
  margin: 0 -8px 0 auto;
  width: min(82%, 520px);
  align-self: end;
}
.hero__char img {
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent);
          mask-image: linear-gradient(to bottom, #000 88%, transparent);
}
.sticky {
  position: absolute;
  left: 14px;
  bottom: 26px;
  z-index: 4;
  width: 138px;
  padding: 14px 12px 12px;
  background: var(--sticky);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1.05;
  transform: rotate(-6deg);
  box-shadow: 2px 6px 12px rgba(0, 0, 0, .28);
  transition: transform .15s steps(2);
}
.sticky b { display: block; font-family: "Neucha", cursive; font-weight: 400; font-size: 2.3rem; color: var(--red); margin: 2px 0; }
.sticky:hover { transform: rotate(-2deg) scale(1.04); }
.hero__margin-note { display: none; }

/* ---------- about ---------- */
.slot--about { width: min(100% - 24px, 680px); margin-top: 36px; }
.pillars { list-style: none; padding: 0; margin: .4em 0; }
.pillars li { margin: .1em 0; }
.pillars li::before { content: "— "; color: var(--pencil); }
.ring { position: relative; display: inline-block; }
.ring svg { position: absolute; left: -14%; top: -32%; width: 128%; height: 170%; color: var(--red); pointer-events: none; overflow: visible; }

/* ---------- band / setlist ---------- */
.slot--setlist { margin-top: 56px; }
.setlist { width: min(100%, 440px); margin: 0 auto; }
.slot--crew { margin-top: 48px; }
.marker {
  margin: 0 0 .3em;
  font-family: "Neucha", cursive;
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  letter-spacing: .04em;
  text-shadow: 0 0 1px var(--ink), .5px .5px 0 var(--ink);
}
.setlist__list { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.setlist__list li { counter-increment: s; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; padding: 4px 0; border-bottom: 1px dashed rgba(0,0,0,.12); }
.setlist__list li::before { content: counter(s) "."; font-family: "Neucha", cursive; color: var(--red); font-size: 1.6rem; width: 1.2em; }
.setlist__list b { font-family: "Neucha", cursive; font-weight: 400; font-size: clamp(2rem, 7vw, 2.6rem); line-height: 1.05; text-shadow: .4px .4px 0 var(--ink); }
.setlist__list i { font-style: normal; color: var(--pencil); font-size: 1.4rem; }
.setlist__foot { margin: 14px 0 0; text-align: right; color: var(--red); font-size: 1.4rem; font-weight: 700; transform: rotate(-2deg); }

.crew { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
.crew__card {
  position: relative;
  margin: 0;
  padding: 10px 10px 6px;
  background: var(--paper-white) var(--noise);
  background-size: auto, 200px;
  background-blend-mode: soft-light;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  transition: transform .2s steps(3);
}
.crew__card:hover { transform: rotate(0deg) scale(1.04); z-index: 2; }
.crew__card img { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; mix-blend-mode: multiply; }
.crew__card figcaption { font-family: "Neucha", cursive; font-size: 1.5rem; text-align: center; margin-top: 2px; }
.crew__card:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 8px); justify-self: center; }
.crew__empty {
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  color: var(--pencil);
  border: 2px dashed rgba(0, 0, 0, .18);
}
.crew__empty svg { width: 70%; height: auto; color: var(--pencil); }
.crew__empty span { font-size: 1.2rem; margin-top: -10%; }

/* ---------- gigs ---------- */
.slot--gigs { margin-top: 80px; }
.slot--gigs > .scrawl { margin-left: 4px; }
.wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 34px 28px; padding: 16px 0 8px; }
.flyer {
  position: relative;
  width: min(100%, 300px);
  padding: 22px 20px 18px;
  background: #f2efe8 var(--noise);
  background-size: auto, 200px;
  background-blend-mode: soft-light;
  color: #111;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 10px 22px rgba(0, 0, 0, .5);
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  filter: contrast(1.15);
}
.flyer::before { /* tape */
  content: "";
  position: absolute;
  top: -14px; left: 50%;
  width: 96px; height: 28px;
  transform: translateX(-50%) rotate(3deg);
  background: var(--tape);
  clip-path: polygon(0 10%, 5% 0, 10% 12%, 90% 0, 95% 10%, 100% 0, 100% 90%, 94% 100%, 88% 90%, 8% 100%, 3% 88%, 0 100%);
}
.flyer__kicker { margin: 0; font-weight: 700; letter-spacing: .14em; font-size: .95rem; }
.flyer__big { margin: 4px 0 0; font-weight: 700; font-size: 5.2rem; line-height: .9; letter-spacing: -.02em; }
.flyer__where { margin: 8px 0 0; font-weight: 500; font-size: 1.35rem; }
.flyer__note { margin: 10px 0 0; font-family: "Caveat", cursive; text-transform: none; font-size: 1.45rem; line-height: 1.05; color: var(--pen); font-weight: 700; transform: rotate(-2deg); }
.flyer__link { display: inline-block; margin-top: 12px; font-family: "Caveat", cursive; text-transform: none; font-size: 1.35rem; font-weight: 700; color: var(--red); }
.flyer--soon { background-color: #f1ede4; }
.flyer--soon .flyer__big { color: var(--red); }

/* stamped "БЫЛО" on past gigs */
.flyer.is-past::after {
  content: "БЫЛО";
  position: absolute;
  right: 14px; top: 64px;
  padding: 2px 10px;
  border: 3px solid var(--red);
  color: var(--red);
  font-family: "PT Mono", monospace;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: .12em;
  transform: rotate(-14deg);
  opacity: .82;
  mix-blend-mode: multiply;
}

/* tear-off tabs */
.tabs { display: flex; margin: 16px -20px -18px; border-top: 2px dashed rgba(0,0,0,.35); }
.tabs a, .tabs__gone {
  flex: 1;
  min-width: 0;
  height: 112px;
  border-right: 1px dashed rgba(0,0,0,.35);
}
.tabs a {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "PT Mono", monospace;
  font-size: .72rem;
  text-transform: none;
  text-decoration: none;
  letter-spacing: .02em;
}
.tabs a:hover { background: var(--sticky); }
.tabs__gone { background: var(--desk); clip-path: polygon(0 14%, 22% 9%, 48% 15%, 74% 8%, 100% 13%, 100% 100%, 0 100%); }
.tabs > :last-child { border-right: 0; }

/* ---------- watch ---------- */
.slot--watch { width: min(100% - 24px, 860px); margin-top: 84px; }
.screens { display: grid; grid-template-columns: 1fr; gap: 40px; justify-items: center; margin-top: 18px; }
.screen { position: relative; margin: 0; width: min(100%, 300px); transform: rotate(var(--r, 0deg)); }
.screen video { width: 100%; background: #000; border: 8px solid #111; box-shadow: 0 10px 22px rgba(0,0,0,.35); aspect-ratio: 9 / 16; object-fit: cover; }
.screen figcaption { margin-top: 8px; text-align: center; }

/* ---------- listen ---------- */
.slot--listen { width: min(100% - 24px, 720px); margin-top: 84px; }
.tracks { list-style: none; padding: 0; margin: 10px 0 0; }
.track { display: flex; align-items: center; gap: 14px; padding: 10px 44px 10px 0; }
.track__btn {
  flex: none;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border: 0; padding: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-family: "Neucha", cursive; font-size: 2.4rem;
}
.track__btn svg { width: 60px; height: 60px; }
.track__btn .i-pause { display: none; }
.track.is-playing .i-play { display: none; }
.track.is-playing .i-pause { display: block; }
.track__body { flex: 1; min-width: 0; }
.track__title { margin: 0; font-size: 1.55rem; font-weight: 700; color: var(--pen); line-height: 1.1; }
.track__title .pencil { font-weight: 500; font-size: 1.25rem; }
.track__bar {
  position: relative;
  height: 16px;
  margin: 8px 0 2px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C 50 5, 90 12, 150 8 S 250 6, 298 9' fill='none' stroke='%236d6862' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.track__bar span {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 16' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C 50 4, 90 13, 150 7 S 250 5, 298 10 M4 7 C 60 11, 120 5, 180 10 S 260 9, 296 7' fill='none' stroke='%23c8141c' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left center / 100% 100%;
  background-size: var(--bar-w, 600px) 100%;
}
.track__time { margin: 0; font-size: 1.15rem; }
.track--soon { opacity: .8; }
.track--soon .track__btn { color: var(--pencil); }
.stream-note { margin-top: 14px; }

/* ---------- organizers ---------- */
.slot--orgs { width: min(100% - 24px, 720px); margin-top: 84px; }
.sheet--typed { font-family: "PT Mono", monospace; font-size: 15px; line-height: 1.55; color: #222; }
.sheet--typed::after { background-color: #f3f1ec; }
.clip {
  position: absolute; z-index: 3;
  top: -22px; left: 34px;
  width: 26px; height: 72px;
  border: 3px solid #8b8f96;
  border-radius: 14px;
  transform: rotate(8deg);
}
.clip::after { content: ""; position: absolute; inset: 10px 4px 14px; border: 3px solid #8b8f96; border-top: 0; border-radius: 0 0 10px 10px; }
.typed__h { margin: 0 0 18px; font-family: "PT Mono", monospace; font-size: 1.15rem; letter-spacing: .2em; font-weight: 700; }
.typed__dl { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.typed__dl dt { font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .14em; color: #777; margin-top: 12px; }
.typed__dl dd { margin: 0; }
.typed__dl a { color: var(--red); }
.stamp-link {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 10px;
  border: 2px solid var(--red);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-decoration: none;
  transform: rotate(-2deg);
}
.stamp-link:hover { background: var(--red); color: var(--paper-white) !important; }

/* ---------- end ---------- */
.slot--end { margin-top: 110px; padding: 0 4px 48px; text-align: center; color: var(--chalk); }
.end__pre { color: var(--chalk); margin: 0; }
.end__big {
  display: inline-block;
  max-width: 100%;
  margin: 6px 0 0;
  font-family: "Neucha", cursive;
  font-size: clamp(2.4rem, 11vw, 7.5rem);
  line-height: 1;
  color: var(--red);
  text-decoration: none;
  transform: rotate(-3deg);
  overflow-wrap: anywhere;
}
.end__big:hover { text-decoration: underline wavy 3px; text-underline-offset: 10px; }
.end__arrow { display: block; width: 110px; height: 74px; margin: 4px auto 0; color: var(--chalk); transform: translateX(70px) scaleX(-1) rotate(-8deg); }
.end__fine { margin: 36px 0 0; font-family: "PT Mono", monospace; font-size: .8rem; color: rgba(236, 230, 218, .55); }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .screens { grid-template-columns: 1fr 1fr; }
  .typed__dl { grid-template-columns: 10em 1fr; gap: 6px 16px; }
  .typed__dl dt { margin-top: 3px; }
}

@media (min-width: 900px) {
  body { font-size: 20px; }
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 38%);
    grid-template-rows: auto 1fr 1fr;
    grid-template-areas:
      "nav  char"
      "logo char"
      "tag  char";
    padding: 26px 34px 0;
  }
  .scrawl-nav { font-size: 1.6rem; gap: 4px 26px; }
  .hero__logo { align-self: end; margin: 0 -40px 0 -10px; position: relative; z-index: 2; }
  .hero__tag { align-self: start; text-align: center; margin: 18px 0 0; }
  .hero__char { width: 100%; max-width: none; margin: 0 -10px 0 0; height: calc(100svh - 30px); display: flex; align-items: flex-end; justify-content: center; }
  .hero__char img { height: 100%; width: auto; object-fit: contain; }
  .sticky { left: 46px; bottom: 46px; width: 168px; font-size: 1.35rem; }
  .sticky b { font-size: 2.8rem; }
  .hero__margin-note {
    display: block;
    position: absolute;
    right: 6px; top: 46%;
    margin: 0;
    width: 40px;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--pencil);
    writing-mode: vertical-rl;
  }

  /* two sheets side by side, slightly off-grid */
  .duo {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 48px;
    align-items: start;
    width: min(100% - 48px, 1180px);
    margin: 0 auto;
  }
  .duo > .slot { width: auto; margin: 0; }
  .duo--a { margin-top: -30px; position: relative; z-index: 2; }
  .duo--a .slot--setlist { margin-top: 90px; }
  .duo--b { margin-top: 110px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .duo--b .slot--listen { margin-top: 150px; }

  .slot--crew { margin-top: 80px; }
  .crew { grid-template-columns: repeat(5, 1fr); gap: 18px; }
  .crew__card:last-child:nth-child(odd) { grid-column: auto; width: auto; }
  .slot--gigs { margin-top: 110px; }
  .wall { justify-content: flex-start; gap: 40px 48px; padding-left: 4%; }
  .slot--orgs { margin-top: 100px; margin-right: max(24px, calc(50% - 520px)); margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boil { animation: none; }
  .sticky, .crew__card { transition: none; }
}
