/* ---------- Písma (SIL Open Font License 1.1, uložená přímo na webu) ---------- */
@font-face {
  font-family: 'Cinzel Decorative';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/cinzel-decorative-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/cinzel-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/eb-garamond-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/eb-garamond-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Základ ---------- */
:root {
  --pozadi: #1c1712;
  --pergamen: #f8eed8;
  --inkoust: #2b1b08;
  --hneda: #6b4410;
  --zlato: #c99a3e;
  --vh: 100vh;
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --vh: 100dvh; }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--pozadi); }
body {
  font-family: 'EB Garamond', Georgia, serif;
  color: #f6ecd6;
  overflow: hidden;
}
.jen-pro-ctecky {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Scéna ---------- */
.scena {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.scena__pozadi {
  position: absolute;
  inset: -10%;
  background: url(../img/pozadi.webp) center / cover no-repeat;
  filter: blur(30px) saturate(1.15) brightness(0.78);
}
.scena::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(12, 8, 4, 0) 50%, rgba(12, 8, 4, 0.4) 100%);
}

/* Výchozí: čtvercová malba (notebooky, běžné monitory, tablety na šířku).
   Okraje malby se ztrácejí v rozmazaném pozadí. */
.platno {
  --velikost: 12%;
  position: relative;
  z-index: 1;
  width: min(100vw, var(--vh));
  height: min(100vw, var(--vh));
}
.platno picture { display: contents; }
.platno img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 70%, transparent 100%);
  user-select: none;
}
.listek { left: var(--x-c); top: var(--y-c); }

/* Mobily a tablety na výšku: malba na výšku vyplní celou obrazovku. */
@media (max-aspect-ratio: 3/4) {
  .scena { display: block; }
  .platno {
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100vw, calc(var(--vh) * 1116 / 2000));
    height: max(var(--vh), calc(100vw * 2000 / 1116));
    transform: translate(-50%, -50%);
  }
  .platno img { -webkit-mask-image: none; mask-image: none; }
  .listek { left: var(--x-v); top: var(--y-v); }
}

/* Ultraširoké monitory (21:9, 32:9): panorama přes celou obrazovku. */
@media (min-aspect-ratio: 21/10) {
  .scena { display: block; }
  .platno {
    --velikost: 4%;
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100vw, calc(var(--vh) * 2000 / 557));
    height: max(var(--vh), calc(100vw * 557 / 2000));
    transform: translate(-50%, -50%);
  }
  .platno img { -webkit-mask-image: none; mask-image: none; }
  .listek { left: var(--x-p); top: var(--y-p); }
}

/* ---------- Lístky s iniciálami ---------- */
.listek {
  position: absolute;
  width: max(44px, var(--velikost));
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  display: block;
}
.listek svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  transition: transform 0.3s ease;
}
.listek text,
.karta__listek text {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  font-size: 40px;
  fill: url(#zlate-pismo);
  stroke: #2a1604;
  stroke-width: 2.6px;
  stroke-linejoin: round;
  paint-order: stroke;
  filter: url(#relief);
}
button.listek {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.listek::before {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--zare) 0%, rgba(255, 240, 200, 0) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
button.listek:hover::before,
button.listek:focus-visible::before,
button.listek[aria-expanded='true']::before { opacity: 1; }
button.listek:hover svg,
button.listek:focus-visible svg { transform: scale(1.12); }
button.listek:focus-visible { outline: 3px solid #fff1c8; outline-offset: 2px; }
.listek__jmeno {
  position: absolute;
  left: 50%;
  top: 92%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 2px 10px 3px;
  border-radius: 999px;
  background: rgba(28, 18, 8, 0.72);
  color: #fff3d6;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
button.listek:hover .listek__jmeno,
button.listek:focus-visible .listek__jmeno { opacity: 1; }

/* ---------- Karta s odkazy ---------- */
.karta {
  width: min(380px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--pergamen);
  color: var(--inkoust);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 0 0 2px var(--zlato), inset 0 0 0 6px var(--pergamen), inset 0 0 0 7px #dcb96e;
}
.karta::backdrop {
  background: rgba(12, 8, 18, 0.5);
}
.karta__obsah {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}
.karta__zavrit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hneda);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.karta__zavrit:hover { background: rgba(107, 68, 16, 0.1); }
.karta__zavrit:focus-visible { outline: 3px solid var(--hneda); outline-offset: 0; }
.karta__zavrit svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.karta__hlava {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 40px;
}
.karta__listek {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-image: url(../img/strom-ctverec-900.webp);
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px var(--zlato), 0 6px 14px rgba(0, 0, 0, 0.3);
}
.karta__listek svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.karta__listek text { stroke-width: 3px; }
.karta h2 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0.03em;
}
.karta__odkazy {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.karta__odkazy[hidden] { display: none; }
.odkaz {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffaf0;
  border: 1px solid #e0c98f;
  color: var(--inkoust);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.odkaz:hover { background: #fff3da; border-color: var(--zlato); }
.odkaz:focus-visible { outline: 3px solid var(--hneda); outline-offset: 2px; }
.odkaz__ikona, .odkaz__sipka { flex: none; fill: none; stroke: #8a5a1a; stroke-linecap: round; stroke-linejoin: round; }
.odkaz__ikona { width: 22px; height: 22px; stroke-width: 1.8; }
.odkaz__sipka { width: 18px; height: 18px; stroke-width: 2; }
.odkaz__texty { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.odkaz__popis {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--hneda);
}
.odkaz__adresa { font-size: 19px; overflow-wrap: anywhere; }

/* Na úzkých displejích se karta vysune zespodu. */
@media (max-width: 520px) {
  .karta {
    width: 100%;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5), inset 0 2px 0 #dcb96e;
  }
  .karta__obsah { padding: 22px 20px calc(28px + env(safe-area-inset-bottom)); }
  .karta h2 { font-size: 24px; }
}

/* ---------- Bez JavaScriptu ---------- */
.bez-skriptu {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(28, 18, 8, 0.75);
  font-size: 18px;
}
.bez-skriptu a { color: #ffe7a6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
