:root {
  --wall: #d9cfbb;
  --wall-shade: #c9bda5;
  --paper: #fbf9f2;
  --ink: #1d1c1a;
  --red: #a9232b;
  --blue: #174a8c;
  --yellow: #f4c81f;
  --white: #f6f3ea;
  --marker: #c0262c;
  --drop: rgb(55 40 20 / .28);
  --sign: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Literata", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: clip;
  background: var(--wall);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--text);
}

/* omítka */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--wall);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .19 0 0 0 0 .1 0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(168deg, rgb(255 252 240 / .35), transparent 55%, var(--wall-shade));
}

.wall {
  width: min(1040px, 100%);
  padding: clamp(28px, 5vh, 56px) clamp(18px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-areas:
    "street street"
    "notice post"
    "notice plate";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 6vw, 80px);
  row-gap: clamp(36px, 6vh, 56px);
}

/* ---------- uliční tabule ---------- */

.street { grid-area: street; justify-self: start; }

.street h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--sign);
  text-transform: uppercase;
}

.enamel {
  position: relative;
  display: block;
  padding: clamp(18px, 2.6vw, 28px) clamp(26px, 5vw, 62px) clamp(20px, 2.8vw, 30px);
  background:
    /* oprýskaný smalt v rohu */
    radial-gradient(ellipse 7px 4px at 97.6% 91%, #2b1a14 55%, #d8d2c4 62% 78%, transparent 82%),
    radial-gradient(ellipse 3px 2px at 96% 96%, #2b1a14 70%, transparent 74%),
    linear-gradient(112deg, transparent 18%, rgb(255 255 255 / .11) 32%, transparent 47%),
    var(--red);
  color: var(--white);
  text-align: center;
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 5px var(--red),
    inset 0 0 0 8px var(--white),
    inset 0 1px 0 9px rgb(0 0 0 / .12),
    0 2px 0 #6f151b,
    7px 12px 16px -4px var(--drop);
}

.enamel__district {
  display: block;
  font-size: clamp(1rem, 2.1vw, 1.4rem);
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.2;
}

.enamel__name {
  display: block;
  font-size: clamp(3.1rem, 9.6vw, 6.4rem);
  font-weight: 700;
  letter-spacing: .012em;
  line-height: .98;
}

.screw {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f1eee6, #8d887d 65%, #5d584f);
  box-shadow: 0 1px 2px rgb(0 0 0 / .5);
}
.screw::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 4.75px;
  height: 1.5px;
  background: #3d3931;
  transform: rotate(var(--turn, 28deg));
}
.screw--l { left: clamp(12px, 2vw, 22px); }
.screw--r { right: clamp(12px, 2vw, 22px); --turn: -61deg; }

.addon {
  align-self: flex-end;
  margin: 7px 18px 0 0;
  padding: 5px 18px 6px;
  background: var(--white);
  color: var(--ink);
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.15;
  border: 3px solid var(--ink);
  border-radius: 5px;
  box-shadow: 5px 8px 12px -4px var(--drop);
  transform: rotate(-.8deg);
}

/* ---------- papír na zdi ---------- */

.notice {
  grid-area: notice;
  position: relative;
  align-self: start;
  padding: clamp(30px, 4vw, 44px) clamp(24px, 3.6vw, 42px) clamp(28px, 3.6vw, 40px);
  background: var(--paper);
  box-shadow: 0 1px 1px rgb(55 40 20 / .22), 4px 14px 22px -12px var(--drop);
  transform: rotate(-1.15deg);
}

.tape {
  position: absolute;
  top: -13px;
  width: 92px;
  height: 28px;
  background: rgb(226 206 148 / .68);
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 3px, #000 calc(100% - 3px), transparent);
  mask: linear-gradient(90deg, transparent 0, #000 3px, #000 calc(100% - 3px), transparent);
  clip-path: polygon(0 6%, 4% 28%, 0 47%, 5% 70%, 1% 100%, 100% 94%, 95% 72%, 99% 51%, 95% 26%, 100% 0);
}
.tape--a { left: -24px; transform: rotate(-38deg); top: 6px; }
.tape--b { right: -26px; transform: rotate(41deg); top: 5px; }

.notice__kicker {
  font-family: var(--sign);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

.notice h2 {
  margin: 20px 0 18px;
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.012em;
  text-wrap: balance;
}

.marked {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.marked svg {
  position: absolute;
  left: -6%;
  bottom: -.34em;
  width: 114%;
  height: .52em;
  overflow: visible;
  pointer-events: none;
}
.marked path {
  fill: none;
  stroke: var(--marker);
  stroke-width: 4;
  stroke-linecap: round;
}

.notice > p:not(.notice__kicker) {
  font-size: clamp(1rem, 1.35vw, 1.09rem);
  line-height: 1.65;
  text-wrap: pretty;
}
.notice > p + p { margin-top: .85em; }

/* ---------- turistický rozcestník ---------- */

.post {
  grid-area: post;
  position: relative;
  align-self: end;
  padding-top: 8px;
}

.guide {
  display: block;
  color: var(--ink);
  text-decoration: none;
  filter: drop-shadow(5px 9px 7px var(--drop));
  transform: rotate(.9deg);
  transform-origin: left center;
  transition: transform .2s ease;
}

.guide__board {
  --tip: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px calc(var(--tip) + 8px) 20px 20px;
  background: var(--yellow);
  clip-path: polygon(0 0, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 0 100%);
}

/* pásová turistická značka */
.guide__mark {
  flex: none;
  width: 42px;
  height: 42px;
  background: linear-gradient(#fff 0 33.33%, var(--marker) 33.33% 66.66%, #fff 66.66%);
  outline: 2px solid var(--ink);
}

.guide__text {
  flex: 1;
  display: block;
  min-width: 0;
  font-family: var(--sign);
}

.guide__label {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.2;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ink);
}

.guide__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.guide__dest {
  font-size: clamp(2.5rem, 5.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
}

.guide__dist {
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
}

.guide:hover { transform: rotate(0deg) translateX(8px); }
.guide:active { transform: rotate(0deg) translateX(14px); }

/* outline je na odkazu, takže ho clip-path šipky neořízne */
.guide:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 6px;
}

/* ---------- domovní číslo ---------- */

.plate {
  grid-area: plate;
  justify-self: end;
  align-self: end;
  min-width: 196px;
  padding: 18px 28px 17px;
  background:
    linear-gradient(118deg, transparent 22%, rgb(255 255 255 / .12) 38%, transparent 54%),
    var(--blue);
  color: var(--white);
  font-family: var(--sign);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.15;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 4px var(--blue),
    inset 0 0 0 6px var(--white),
    0 2px 0 #0d2c57,
    6px 11px 14px -4px var(--drop);
  transform: rotate(.7deg);
}

.plate__top {
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .2em;
}

.plate__number {
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 1.02;
}

.plate__name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.plate__nick {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: none;
}

/* ---------- 404 ---------- */

.wall--lost {
  width: min(640px, 100%);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "street" "post";
  grid-template-rows: auto auto;
  justify-items: start;
}
.wall--lost .post { width: min(430px, 100%); }

/* ---------- pomocné ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- nízké obrazovky (notebooky) ---------- */

@media (min-width: 761px) and (max-height: 860px) {
  .wall { padding-block: 24px; row-gap: 30px; }
  .enamel { padding-block: 16px 18px; }
  .enamel__name { font-size: clamp(3.1rem, 9.6vw, 5.5rem); }
  .notice { padding-block: 28px 26px; }
  .notice h2 { margin: 14px 0 12px; font-size: 2.1rem; }
  .notice > p:not(.notice__kicker) { font-size: 1rem; line-height: 1.55; }
  .plate { padding-block: 14px 13px; }
  .plate__number { font-size: 3.7rem; }
}

/* ---------- mobil ---------- */

@media (max-width: 760px) {
  .wall:not(.wall--lost) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "street" "notice" "post" "plate";
    grid-template-rows: none;
    row-gap: 34px;
    max-width: 520px;
  }
  .street, .street h1 { width: 100%; }
  .enamel { align-self: stretch; padding-inline: 22px; }
  .enamel__district { letter-spacing: .14em; }
  .enamel__name { font-size: clamp(2.6rem, 15.2vw, 5rem); }
  .enamel__name span { display: block; }
  .screw { top: 22px; }
  .screw--l { left: 17px; }
  .screw--r { right: 17px; }
  .addon { margin-right: 10px; }
  .tape { width: 76px; }
  .tape--a { left: -17px; }
  .tape--b { right: -17px; }
  .post { padding-right: 8px; }
  .guide__board { --tip: 30px; gap: 14px; padding-left: 14px; }
  .guide__mark { width: 32px; height: 32px; }
}

@media (max-width: 360px) {
  .guide__mark, .guide__dist { display: none; }
}

/* ---------- večer: nad cedulí svítí lampa ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #1c1d22;
    --wall-shade: #121317;
    --paper: #d9d4c6;
    --red: #932027;
    --blue: #153f77;
    --yellow: #dcb31c;
    --white: #e9e4d6;
    --drop: rgb(0 0 0 / .65);
  }
  body::before {
    background-image:
      radial-gradient(ellipse 75% 70% at 28% -6%, rgb(255 190 104 / .24), transparent 70%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .7 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
      linear-gradient(168deg, transparent 40%, var(--wall-shade));
  }
  .guide:focus-visible { outline-color: var(--white); }
}

/* fix se dokreslí po načtení */
@media (prefers-reduced-motion: no-preference) {
  .marked path {
    animation: draw .45s .6s cubic-bezier(.5, 0, .3, 1) backwards;
  }
  .marked path + path { animation-delay: 1.1s; }
  @keyframes draw {
    from { clip-path: inset(-100% 100% -100% -10%); }
    to   { clip-path: inset(-100% -10% -100% -10%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide { transition: none; }
}

@media print {
  body::before { display: none; }
  html { background: #fff; }
}
