/* turansky.sk — papierová vizitka na webe: e-mailový podpis ITING (okrúhla fotka, červená linka,
   štvorčeky #c1272d) na kartičke s jemným tieňom a 3D náklonom. Po ťuknutí sa otočí — zadná strana
   má QR kód a uloženie do kontaktov. Na mobile je vizitka na výšku. Len svetlá téma (Tomáš 5. 10. 2026). */
:root {
  --ink: #16181b;
  --tlm: #5c626a;
  --jemna: #8c929a;
  --cervena: #c1272d;
  --stol: #e3e7ea;
  --kota: #7d8791;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--stol); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  color: var(--ink); overflow-x: hidden;
  /* technický papier: milimetrová mriežka (1 + 5 dielov) na tlmenom sivomodrom podklade */
  background-color: var(--stol);
  background-image:
    linear-gradient(rgba(40, 60, 80, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 60, 80, .075) 1px, transparent 1px),
    linear-gradient(rgba(40, 60, 80, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 60, 80, .035) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
  background-position: center top;
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--cervena); }
img { display: block; max-width: 100%; height: auto; }
p, h1, figure { margin: 0; }
button { font: inherit; color: inherit; }

.jazyky { display: flex; justify-content: flex-end; gap: 14px; padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 0 20px; }
.jazyky a { font-size: 13px; color: var(--jemna); }
.jazyky a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.stol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 28px 20px 36px; }

/* Karta: 3D (perspektíva + náklon z JS cez --rx/--ry, otočenie cez --otoc) */
.karta { --rx: 0deg; --ry: 0deg; --otoc: 0deg; perspective: 1400px; width: min(320px, calc(100vw - 74px), calc((100svh - 230px) * .625)); aspect-ratio: 5 / 8; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.karta-vnutro {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--otoc)));
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.karta.hybe .karta-vnutro { transition: transform .12s ease-out; }
.karta.otocena { --otoc: 180deg; }
.strana {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: #fff;
  /* jemná textúra papiera */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 1px rgba(20, 30, 40, .06), 0 1px 2px rgba(20, 30, 40, .1), 0 4px 8px rgba(20, 30, 40, .06), 0 18px 34px -12px rgba(20, 30, 40, .28), 0 40px 70px -30px rgba(20, 30, 40, .35);
}
/* lesk, ktorý sa pohne s náklonom */
.strana::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(calc(115deg + var(--ry) * 3), rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .55) 48%, rgba(255, 255, 255, 0) 62%);
  mix-blend-mode: soft-light; opacity: .9;
}
.zadna { transform: rotateY(180deg); }

.predna { padding: 34px 28px 26px; display: flex; flex-direction: column; }
.podpis { display: flex; flex-direction: column; gap: 22px; margin: auto 0; }
.foto { flex: none; }
.foto img { width: 112px; height: 112px; border-radius: 50%; }
.cast { border-left: 3px solid var(--cervena); padding: 2px 0 2px 16px; min-width: 0; }
h1 { font-size: 23px; line-height: 1.2; font-weight: 700; letter-spacing: -.2px; }
.funkcia { margin: 3px 0 14px; font-size: 14.5px; }
.kontakty { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14.5px; }
.kontakty li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.kontakty a { overflow-wrap: anywhere; }
.nz { white-space: nowrap; }
.bod { flex: none; width: 6px; height: 6px; margin-top: .66em; background: var(--cervena); }
.logo { width: 72px; opacity: .9; }

.roh {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--jemna); cursor: pointer; display: grid; place-items: center;
}
.roh:hover, .roh:focus-visible { color: var(--cervena); background: rgba(193, 39, 45, .07); }
.roh svg, .tl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.zadna { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px; text-align: center; }
.qr svg { width: 190px; height: 190px; display: block; margin: 0 auto; }
.zadna-text { display: grid; gap: 18px; justify-items: center; }
.zadna-text p { font-size: 14px; color: var(--tlm); max-width: 22ch; }

.tl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.tl:hover { background: var(--cervena); border-color: var(--cervena); color: #fff; }
.tl-svetle { background: #fff; color: var(--ink); border-color: #d6d8db; }
.tl-svetle:hover { background: #fff; color: var(--cervena); border-color: var(--cervena); }

.pod-kartou { display: flex; gap: 10px; width: min(354px, 100%); }
.pod-kartou .tl:first-child { flex: 1; }
.napoveda { font-size: 13px; color: var(--jemna); margin-top: -12px; }

.pata {
  /* pätička ako rohová pečiatka výkresu */
  align-self: center; margin: 0 20px max(20px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: center;
  border: 1px solid var(--kota); background: rgba(255, 255, 255, .55); font-size: 11.5px; color: #4f5861; line-height: 1.4;
}
.pata span { padding: 6px 12px; border-right: 1px solid rgba(125, 135, 145, .55); }
.pata span:last-child { border-right: 0; }
.pata span:first-child { font-weight: 600; color: var(--ink); }
.pata .autor { color: var(--jemna); }
.pata .autor a { color: inherit; text-decoration: underline; text-decoration-color: rgba(125, 135, 145, .5); text-underline-offset: 2px; }
.pata .autor a:hover { color: var(--cervena); }

/* Kóty okolo vizitky (ako na výkrese) — dokreslia sa pri načítaní */
.vykres { position: relative; padding: 34px 34px 0 0; }
.kota { position: absolute; color: var(--kota); font: 600 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; pointer-events: none; }
.kota b { position: absolute; font-weight: 600; background: var(--stol); padding: 0 6px; }
.kota i { font-style: normal; }
.kota-h { left: 0; right: 34px; top: 0; height: 26px; border-left: 1px solid; border-right: 1px solid; transform-origin: center; animation: kota-x .9s .35s cubic-bezier(.3, .7, .2, 1) both; }
.kota-h::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; border-top: 1px solid; }
.kota-h b { left: 50%; top: 9px; transform: translate(-50%, -50%); }
.kota-v { top: 34px; bottom: 0; right: 0; width: 26px; border-top: 1px solid; border-bottom: 1px solid; transform-origin: center; animation: kota-y .9s .55s cubic-bezier(.3, .7, .2, 1) both; }
.kota-v::before { content: ""; position: absolute; top: 0; bottom: 0; right: 9px; border-left: 1px solid; }
.kota-v b { right: 9px; top: 50%; transform: translate(50%, -50%) rotate(-90deg); }
.sip { position: absolute; width: 0; height: 0; border: 4px solid transparent; }
.sip-l { left: 0; top: 5px; border-right: 9px solid; border-left: 0; }
.sip-r { right: 0; top: 5px; border-left: 9px solid; border-right: 0; }
.sip-t { top: 0; right: 5px; border-bottom: 9px solid; border-top: 0; }
.sip-b { bottom: 0; right: 5px; border-top: 9px solid; border-bottom: 0; }
.kota b { animation: zjav .5s 1.1s both; }
.na-sirku { display: none; }
@keyframes kota-x { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kota-y { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zjav { from { opacity: 0; } to { opacity: 1; } }

/* Na šírku: klasická vizitka 90 × 50 */
@media (max-width: 639px) {
  .pata { display: grid; grid-template-columns: auto 1fr; }
  .pata span { border-bottom: 1px solid rgba(125, 135, 145, .55); }
  .pata span:nth-child(2n) { border-right: 0; }
  .pata .autor { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}
@media (min-width: 640px) {
  .karta { width: min(640px, calc(100vw - 74px)); aspect-ratio: 9 / 5; }
  .na-sirku { display: inline; }
  .na-vysku { display: none; }
  .vykres { padding-left: 34px; }
  .kota-h { left: 34px; }
  .predna { padding: 40px 44px; justify-content: center; }
  .podpis { flex-direction: row; align-items: center; gap: 30px; }
  .foto img { width: 128px; height: 128px; }
  .cast { padding-left: 22px; }
  h1 { font-size: 27px; }
  .funkcia, .kontakty { font-size: 15px; }
  .logo { position: absolute; left: 44px; bottom: 26px; width: 64px; }
  .zadna { flex-direction: row; gap: 40px; justify-content: center; text-align: left; }
  .qr svg { width: 176px; height: 176px; margin: 0; }
  .zadna-text { justify-items: start; }
  .zadna-text p { max-width: 20ch; font-size: 15px; }
  .pod-kartou { width: auto; }
}
/* nízke okno na šírku (mobil otočený) */
@media (min-width: 640px) and (max-height: 520px) {
  .jazyky { position: absolute; top: 0; right: 0; }
  .stol { padding: 14px 20px; gap: 14px; }
  .karta { width: min(600px, calc((100svh - 100px) * 1.8)); }
  .predna { padding: 22px 32px; }
  .podpis { gap: 24px; }
  .foto img { width: 92px; height: 92px; }
  h1 { font-size: 21px; }
  .funkcia, .kontakty { font-size: 13.5px; }
  .funkcia { margin-bottom: 8px; }
  .kontakty { gap: 1px; }
  .logo, .napoveda, .pata, .kota { display: none; }
  .vykres { padding: 0; }
  .qr svg { width: 140px; height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .karta-vnutro, .karta.hybe .karta-vnutro { transition: none; }
  .strana::after { display: none; }
  .kota, .kota b { animation: none; }
}
