/* Cesta z mesta v2 - shared base: riso paper poster system (owned by orchestrator, do not edit in page tasks) */
@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500..700&family=Fraunces:opsz,wght,SOFT,WONK@9..144,600..900,0..100,0..1&family=Shantell+Sans:ital,wght,BNCE,INFM@0,300..800,-100..100,0..100&display=swap");

:root {
  /* paper */
  --paper: #f3ead7;
  --paper-2: #ebdfc6;
  --paper-3: #e0d0ae;
  --cream: #fbf5e8;
  /* inks (refs/ref1 permaculture tiles + ref2 riso + ref4 petroglyph) */
  --forest: #1e3a28;
  --leaf: #2f7a45;
  --mustard: #d7a13f;
  --clay: #c0582f;
  --berry: #c9343e;
  --soil: #4a3322;
  --olive: #7a7238;

  --ink: var(--forest);
  --ink-soft: rgba(30, 58, 40, 0.74);
  --line: rgba(30, 58, 40, 0.22);

  --font-poster: "Fraunces", Georgia, serif;
  --font-hand: "Shantell Sans", "Comic Neue", system-ui, sans-serif;
  --font-note: "Caveat", "Shantell Sans", cursive;

  --fs-poster: clamp(3.4rem, 1.2rem + 9vw, 9.5rem);
  --fs-h2: clamp(1.9rem, 1.2rem + 2.4vw, 3.2rem);
  --fs-h3: clamp(1.15rem, 1rem + 0.5vw, 1.45rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-note: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);

  --r-tile: 3px;
  --r-pill: 999px;
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 44px);
  --section-y: clamp(72px, 10vw, 140px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("../assets/texture/mottle.png");
  background-size: 600px 600px;
  font-family: var(--font-hand);
  font-size: var(--fs-body);
  font-variation-settings: "INFM" 35, "BNCE" 0;
  line-height: 1.62;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* fine film-grain noise over the whole page (neutral grey tile, overlay blend) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: url("../assets/texture/noise.png") repeat; background-size: 180px 180px;
  mix-blend-mode: overlay; opacity: 0.42;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 { margin: 0; letter-spacing: 0; text-wrap: balance; }
h2 {
  font-family: var(--font-hand); font-weight: 800; font-size: var(--fs-h2); line-height: 1.08;
  font-variation-settings: "INFM" 60, "BNCE" 25;
}
h3 {
  font-family: var(--font-hand); font-weight: 700; font-size: var(--fs-h3); line-height: 1.22;
  font-variation-settings: "INFM" 45, "BNCE" 10;
}

/* big riso poster type: chunky soft serif, caps, like ref2 "A RADICAL GARDEN" */
.poster {
  font-family: var(--font-poster); font-weight: 900; font-size: var(--fs-poster);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  line-height: 0.86; text-transform: uppercase; color: var(--berry);
}
.poster--forest { color: var(--forest); }
.poster--clay { color: var(--clay); }

/* handwritten margin note (Caveat), optional arrow image after it */
.note {
  font-family: var(--font-note); font-weight: 600; font-size: var(--fs-note); line-height: 1.1;
  color: var(--clay);
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { position: relative; padding-block: var(--section-y); }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--clay); outline-offset: 3px; border-radius: 3px; }

/* ---------- poster tiles (ref1): hand-cut edges, flat ink colours ---------- */
.tile {
  position: relative; border-radius: var(--r-tile); overflow: hidden;
  clip-path: polygon(0.6% 0.9%, 99.2% 0%, 100% 98.8%, 0.3% 100%);
}
.tile:nth-child(3n) { clip-path: polygon(0% 0.4%, 100% 1.2%, 99.4% 100%, 0.8% 99.1%); }
.tile:nth-child(3n+1) { clip-path: polygon(1% 0%, 99.6% 0.7%, 99% 99.6%, 0% 98.9%); }
.t-forest { background: var(--forest); color: var(--cream); }
.t-leaf { background: var(--leaf); color: var(--cream); }
.t-mustard { background: var(--mustard); color: var(--forest); }
.t-clay { background: var(--clay); color: var(--cream); }
.t-berry { background: var(--berry); color: var(--cream); }
.t-soil { background: var(--soil); color: var(--paper); }
.t-olive { background: var(--olive); color: var(--paper); }
.t-paper { background: var(--paper-2); color: var(--forest); }

/* riso halftone photos are transparent PNGs in one ink: let paper/tile show through */
.riso { mix-blend-mode: multiply; }
.t-paper .riso, .t-mustard .riso { mix-blend-mode: multiply; }

/* colour photo as a taped print */
.print {
  background: var(--cream); padding: 8px 8px 10px; box-shadow: 0 1px 0 rgba(30, 58, 40, 0.08), 0 10px 24px -14px rgba(30, 58, 40, 0.45);
}
.print img { width: 100%; height: 100%; object-fit: cover; }

/* art stickers that float around (positioned by pages, moved by motion.js) */
.sticker { position: absolute; z-index: 3; pointer-events: none; width: clamp(56px, 7vw, 110px); }
.sticker img { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sticker img { width: 100%; height: auto; }
@media (max-width: 640px) { .sticker { width: 52px; } .sticker.hide-sm { display: none; } }

/* ---------- buttons ---------- */
/* primary: true pill in clay with a riso misregistration outline (thin, offset) */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-pill);
  background: var(--clay); color: var(--cream);
  font-family: var(--font-hand); font-weight: 700; font-size: 1.02rem; line-height: 1;
  font-variation-settings: "INFM" 50, "BNCE" 0;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 220ms var(--ease-back), background-color 220ms var(--ease-out);
}
.btn::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  border: 1.5px solid var(--forest); transform: translate(4px, 4px);
  transition: transform 260ms var(--ease-back);
}
.btn .ico { width: 22px; height: 22px; }
.btn:hover { transform: scale(1.045); }
.btn:hover::after { transform: translate(7px, 7px); }
.btn:active { transform: scale(0.97); }
.btn:active::after { transform: translate(1px, 1px); }
.btn--forest { background: var(--forest); }
.btn--forest::after { border-color: var(--clay); }
.btn--mustard { background: var(--mustard); color: var(--forest); }
.btn--paper { background: var(--cream); color: var(--forest); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 0.95rem; }

/* secondary: handwritten link with a hand-drawn squiggle underline */
.link-hand {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-hand); font-weight: 700; text-decoration: none; color: inherit;
  font-variation-settings: "INFM" 60, "BNCE" 0;
  padding-bottom: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 5 Q 5 1 10 4 T 20 4 T 30 4 T 40 4' fill='none' stroke='%23c0582f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left bottom / 40px 8px;
}
.link-hand .arr { display: inline-block; transition: transform 260ms var(--ease-back); }
.link-hand:hover .arr { transform: translateX(5px) rotate(-8deg); }
.link-hand:hover { color: var(--clay); }
.on-dark .link-hand { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 5 Q 5 1 10 4 T 20 4 T 30 4 T 40 4' fill='none' stroke='%23d7a13f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.on-dark .link-hand:hover { color: var(--mustard); }

/* small functional label printed like a stamp (audience, price) */
.stamp {
  display: inline-block; padding: 3px 10px; border: 1.5px solid currentColor; border-radius: var(--r-pill);
  font-family: var(--font-hand); font-weight: 700; font-size: 0.8rem; line-height: 1.35;
  transform: rotate(-2deg);
}

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  padding-block: 20px;
}
.brand { display: inline-block; width: 124px; }
.brand img { width: 100%; height: auto; }
.nav ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 26px; }
.nav a {
  display: inline-block; padding: 8px 2px; text-decoration: none;
  font-weight: 600; font-size: 1rem; font-variation-settings: "INFM" 70, "BNCE" 0;
  transition: transform 220ms var(--ease-back), color 200ms var(--ease-out);
}
.nav a:hover { color: var(--clay); transform: translateY(-2px); }
.nav a:hover:not([aria-current="page"]) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 5 Q 5 1 10 4 T 20 4 T 30 4 T 40 4' fill='none' stroke='%23d7a13f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left bottom / 40px 8px;
}
.nav a[aria-current="page"] {
  color: var(--clay);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 5 Q 5 1 10 4 T 20 4 T 30 4 T 40 4' fill='none' stroke='%23c0582f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x left bottom / 40px 8px;
}
.menu-toggle { display: none; }
@media (max-width: 1280px) { .nav ul { gap: 4px 18px; } .nav a { font-size: 0.95rem; } }
@media (max-width: 1080px) {
  .site-header { grid-template-columns: 1fr auto; padding-block: 14px; }
  .brand { width: 104px; }
  .nav, .header-cta { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px;
    border: 1.5px solid var(--forest); border-radius: var(--r-pill); background: var(--cream);
    font-weight: 700; cursor: pointer;
  }
}
.mobile-menu {
  position: fixed; inset: 0; z-index: 95; background: var(--paper) url("../assets/texture/mottle.png");
  padding: 14px var(--gutter) 28px; display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu .mm-top { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu ul { margin-top: 28px; display: grid; }
.mobile-menu ul a {
  display: block; padding: 12px 0; text-decoration: none; border-bottom: 1.5px dashed var(--line);
  font-family: var(--font-poster); font-weight: 900; font-size: 2.1rem; text-transform: uppercase; line-height: 1;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
.mobile-menu ul li:nth-child(odd) a { color: var(--clay); }
.mobile-menu .mm-art { display: flex; gap: 14px; margin: 26px 0; }
.mobile-menu .mm-art img { width: 56px; }
.mobile-menu .mm-foot { margin-top: auto; display: grid; gap: 14px; justify-items: start; }
/* open: the panel grows softly out of the Menu button (origin set in base.js), then content follows */
.mobile-menu {
  opacity: 0; scale: 0.88; border-radius: 32px;
  transition: opacity 220ms var(--ease-out), scale 480ms var(--ease-back), border-radius 480ms var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; scale: 1; border-radius: 0; }
.mobile-menu ul li, .mobile-menu .mm-foot {
  opacity: 0; translate: 0 18px;
  transition: opacity 260ms var(--ease-out), translate 500ms var(--ease-back);
}
.mobile-menu.is-open ul li, .mobile-menu.is-open .mm-foot { opacity: 1; translate: 0 0; }
.mobile-menu.is-open ul li:nth-child(1) { transition-delay: 80ms; }
.mobile-menu.is-open ul li:nth-child(2) { transition-delay: 120ms; }
.mobile-menu.is-open ul li:nth-child(3) { transition-delay: 160ms; }
.mobile-menu.is-open ul li:nth-child(4) { transition-delay: 200ms; }
.mobile-menu.is-open ul li:nth-child(5) { transition-delay: 240ms; }
.mobile-menu.is-open .mm-foot { transition-delay: 320ms; }
.mobile-menu .mm-art img { scale: 0; rotate: -35deg; transition: scale 460ms var(--ease-back), rotate 460ms var(--ease-back); }
.mobile-menu.is-open .mm-art img { scale: 1; rotate: 0deg; }
.mobile-menu.is-open .mm-art img:nth-child(1) { transition-delay: 260ms; }
.mobile-menu.is-open .mm-art img:nth-child(2) { transition-delay: 310ms; }
.mobile-menu.is-open .mm-art img:nth-child(3) { transition-delay: 360ms; }
.mobile-menu.is-open .mm-art img:nth-child(4) { transition-delay: 410ms; }

/* ---------- footer: forest band with petroglyph parade ---------- */
.site-footer { position: relative; background: var(--forest); color: var(--paper); padding-top: 64px; overflow: hidden; }
.site-footer a { color: inherit; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 44px; border-bottom: 1.5px dashed rgba(243, 234, 215, 0.25);
}
.footer-grid h3 { font-family: var(--font-note); font-size: 1.6rem; font-weight: 700; color: var(--mustard); margin-bottom: 8px; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--mustard); }
.footer-brand img { width: 150px; margin-bottom: 14px; }
.footer-brand p { max-width: 30ch; opacity: 0.85; }
.footer-medweb {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
  padding-block: 18px 26px; font-size: var(--fs-small); opacity: 0.72;
}
.footer-medweb a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- motion states (only when html.motion is set by the inline head script) ---------- */
.motion [data-reveal] .w { display: inline-block; opacity: 0; transform: translateY(0.55em) rotate(3deg); }
.motion [data-type] .ch { opacity: 0; }
.motion [data-pop] { opacity: 0; transform: scale(0.82) rotate(var(--pop-rot, -3deg)); }
.motion [data-pop-group] > * { opacity: 0; transform: scale(0.82) rotate(var(--pop-rot, -3deg)); }
[data-reveal] .w { display: inline-block; }

/* ---------- hover kit: every art icon / sticker / button icon gets its own move ----------
   base.js assigns hv-spin|hv-wiggle|hv-pulse|hv-bounce|hv-swing|hv-jelly|hv-tilt|hv-flip to the
   closest hover host of each art image (unless the page set one). Keyframes use the individual
   rotate/scale/translate properties so they compose with GSAP transforms. */
@keyframes hv-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes hv-wiggle { 0%, 100% { rotate: 0deg; } 18% { rotate: -11deg; } 38% { rotate: 9deg; } 58% { rotate: -5deg; } 78% { rotate: 3deg; } }
@keyframes hv-pulse { 0% { scale: 1; } 30% { scale: 1.2; } 55% { scale: 0.92; } 76% { scale: 1.06; } 100% { scale: 1; } }
@keyframes hv-bounce { 0%, 100% { translate: 0 0; } 28% { translate: 0 -16px; } 50% { translate: 0 0; } 68% { translate: 0 -6px; } 84% { translate: 0 0; } }
@keyframes hv-swing { 0%, 100% { rotate: 0deg; } 22% { rotate: 16deg; } 46% { rotate: -11deg; } 68% { rotate: 6deg; } 86% { rotate: -2deg; } }
@keyframes hv-jelly { 0%, 100% { scale: 1 1; } 22% { scale: 1.22 0.8; } 42% { scale: 0.86 1.14; } 62% { scale: 1.08 0.94; } 80% { scale: 0.97 1.03; } }
@keyframes hv-flip { from { rotate: y 0deg; } to { rotate: y 360deg; } }
@keyframes hv-boop { 0% { scale: 1; rotate: 0deg; } 35% { scale: 1.35; rotate: 200deg; } 70% { scale: 0.9; rotate: 340deg; } 100% { scale: 1; rotate: 360deg; } }

:is(.hv-spin, .hv-wiggle, .hv-pulse, .hv-bounce, .hv-swing, .hv-jelly, .hv-tilt, .hv-flip) img[src*="/art/"] { transform-origin: 50% 55%; }
.hv-swing img[src*="/art/"] { transform-origin: 50% 0%; }
.hv-jelly img[src*="/art/"], .hv-bounce img[src*="/art/"] { transform-origin: 50% 100%; }
.hv-tilt img[src*="/art/"] { transition: rotate 320ms var(--ease-back), scale 320ms var(--ease-back); }

html :is(.hv-spin:hover, .hv-spin:focus-visible) img[src*="/art/"],
html .sticker.hv-spin img:hover { animation: hv-spin 760ms var(--ease-back); }
html :is(.hv-wiggle:hover, .hv-wiggle:focus-visible) img[src*="/art/"],
html .sticker.hv-wiggle img:hover { animation: hv-wiggle 620ms ease-in-out; }
html :is(.hv-pulse:hover, .hv-pulse:focus-visible) img[src*="/art/"],
html .sticker.hv-pulse img:hover { animation: hv-pulse 620ms ease-out; }
html :is(.hv-bounce:hover, .hv-bounce:focus-visible) img[src*="/art/"],
html .sticker.hv-bounce img:hover { animation: hv-bounce 680ms ease-out; }
html :is(.hv-swing:hover, .hv-swing:focus-visible) img[src*="/art/"],
html .sticker.hv-swing img:hover { animation: hv-swing 900ms ease-in-out; }
html :is(.hv-jelly:hover, .hv-jelly:focus-visible) img[src*="/art/"],
html .sticker.hv-jelly img:hover { animation: hv-jelly 700ms ease-out; }
html :is(.hv-flip:hover, .hv-flip:focus-visible) img[src*="/art/"],
html .sticker.hv-flip img:hover { animation: hv-flip 820ms var(--ease-out); }
html :is(.hv-tilt:hover, .hv-tilt:focus-visible) img[src*="/art/"],
html .sticker.hv-tilt img:hover { rotate: -14deg; scale: 1.12; }
html .sticker img.boop, html img[src*="/art/"].boop { animation: hv-boop 700ms var(--ease-out) !important; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.bob { animation: bob 4.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
