/* =========================================================
   Jozef Bálint – homepage
   Fotky na celú obrazovku, pod myšou sa fotka mierne roztiahne,
   druhá jemne vybledne. Motto „Jeden hlas, dva rôzne svety.“ pod fotkami.
   ========================================================= */
:root {
  --bg: #f6f4ee;
  --ink: #16181d;
  --blue: #528fca;
  --blue-deep: 12, 28, 58;      /* rgb pre gradient */
  --gold: #cab752;
  --gold-deep: 58, 44, 10;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.65, .05, .2, 1);
  --pad: clamp(20px, 3.4vw, 140px);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }

/* ---------- horná lišta (nad fotkami) ---------- */
.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: clamp(18px, 1.8vw, 64px) var(--pad);
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(11px, .75vw, 26px);
  letter-spacing: .18em;
  text-transform: uppercase;
  pointer-events: none;
  animation: fadeDown 1s .3s var(--ease) both;
}
.topbar { align-items: center; }
.logo { display: block; line-height: 0; pointer-events: auto; }
.logo img {
  width: auto;
  height: clamp(17px, 1.2vw, 42px);
  filter: brightness(0) invert(1) drop-shadow(0 1px 8px rgba(0, 0, 0, .35));   /* biele logo na fotke */
}
.logo:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }
.topbar__role { opacity: .75; }

/* ---------- split ---------- */
.split {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  background: #000;
  overflow: hidden;
}

.panel {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  transition: flex-grow .9s var(--ease);
  animation: reveal 1.3s var(--ease) both;
}
.panel:nth-child(2) { animation-delay: .12s; }

.panel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: -2;
  transform: scale(1.03);
  transition: transform 1.4s var(--ease), filter .9s var(--ease), opacity .6s ease;
}
.panel__img--hover { opacity: 0; }

.panel__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  transition: opacity .9s var(--ease);
}
.panel--hovorca .panel__shade {
  background: linear-gradient(to top, rgba(var(--blue-deep), .95) 0%, rgba(var(--blue-deep), .55) 38%, rgba(var(--blue-deep), 0) 68%);
}
.panel--starejsi .panel__shade {
  background: linear-gradient(to top, rgba(var(--gold-deep), .95) 0%, rgba(var(--gold-deep), .5) 38%, rgba(var(--gold-deep), 0) 68%);
}

.panel__shade::after {               /* jemné stmavenie zhora pre vetu */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 32%;
  background: linear-gradient(to bottom, rgba(10, 12, 18, .55), rgba(10, 12, 18, 0));
}
.panel__quote {
  position: absolute;
  inset: clamp(76px, 9.5vh, 220px) var(--pad) auto var(--pad);
  z-index: 2;
  text-align: center;
  font-size: clamp(17px, 1.5vw, 50px);
  font-style: italic;
  line-height: 1.35;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
  transition: opacity .6s;
  animation: fadeDown 1s .5s var(--ease) both;
}
.panel__quote--gold { color: #f0e2a0; }
.panel__quote--blue { color: #b9d6f2; }

.panel__body {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 1.1vw, 40px);
  padding: var(--pad);
  padding-bottom: clamp(32px, 4.5vw, 170px);
  max-width: min(100%, 52vw);
  container-type: inline-size;
}
.tl { display: block; white-space: nowrap; }

.panel__index {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  font-family: var(--mono);
  font-size: clamp(11px, .75vw, 26px);
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .85;
}
.panel__index em {
  font-style: normal;
  padding: .35em .7em;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
}

.panel__title {
  font-size: min(clamp(22px, 2.2vw, 84px), 7.6cqi);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
}
.panel--starejsi .panel__title { max-width: none; }

.panel__text {
  max-width: 34ch;
  font-size: clamp(15px, 1.05vw, 38px);
  line-height: 1.5;
  opacity: .88;
}

.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 1em;
  margin-top: clamp(6px, .6vw, 20px);
  padding: 1em 1.5em;
  font-family: var(--mono);
  font-size: clamp(12px, .8vw, 28px);
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--ink);
  background: #fff;
  transition: background-color .4s, color .4s;
}
.arrow {
  position: relative;
  width: 1.6em;
  height: 1px;
  background: currentColor;
  transition: width .5s var(--ease);
}
.arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: .5em;
  height: .5em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

/* ---------- interakcia ---------- */
@media (hover: hover) and (min-width: 768px) {
  .panel:hover { flex-grow: 1.15; }
  .panel:hover .panel__img { transform: scale(1); }
  .panel:hover .panel__img--hover { opacity: 1; }
  .split:hover .panel:not(:hover) .panel__img { filter: grayscale(.5) brightness(.78); }
  .split:hover .panel:not(:hover) .panel__body { opacity: .78; }
  .split:hover .panel:not(:hover) .panel__quote { opacity: .7; }
  .panel__body { transition: opacity .6s; }
  .panel:hover .arrow { width: 3.2em; }
  .panel--hovorca:hover .panel__cta  { background: var(--blue); color: #fff; }
  .panel--starejsi:hover .panel__cta { background: var(--gold); color: #fff; }
}
.panel:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.panel:focus-visible .panel__img--hover { opacity: 1; }

/* ---------- motto ---------- */
.motto {
  padding: clamp(48px, 5vw, 180px) var(--pad);
  text-align: center;
}
.motto__text {
  margin: 0 auto;
  font-size: clamp(34px, 4.2vw, 120px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.motto__text span {
  font-weight: 300;
  font-style: italic;
  letter-spacing: -.02em;
}

/* ---------- pätička ---------- */
.footer {
  margin: 0 var(--pad);
  padding: clamp(24px, 1.8vw, 64px) 0;
  border-top: 1px solid rgba(0, 0, 0, .12);
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(13px, .8vw, 28px);
  color: rgba(22, 24, 29, .45);
}

/* ---------- mobil ---------- */
@media (max-width: 767px) {
  .split { flex-direction: column; height: auto; min-height: 0; }
  .panel { flex: none; min-height: 78svh; }
  .panel__body { max-width: 100%; padding: 24px 22px 32px; }
  .panel__title { font-size: min(clamp(24px, 7vw, 32px), 7.6cqi); }
  .topbar__role { display: none; }
  .panel__cta { width: 100%; justify-content: space-between; }
  .panel__quote { inset: 64px 22px auto 22px; }
  .motto__text span { display: block; }
}

/* ---------- animácie ---------- */
@keyframes reveal {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}

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

/* ---------- mobil: akčná fotka sa objaví pri posúvaní ---------- */
@media (hover: none), (max-width: 767px) {
  .panel__img--hover { transition: opacity 1.4s ease; }
  .panel__img { transition: transform 2.4s var(--ease), opacity 1.4s ease; }
  .panel.is-live .panel__img--hover { opacity: 1; }
  .panel.is-live .panel__img { transform: scale(1); }
}

/* =========================================================
   PLYNULOSŤ – pri roztiahnutí panelu sa nemení veľkosť fotiek
   ani zalamovanie textu (len sa posúva orez), tmavnutie druhého
   panelu je cez vrstvu s priehľadnosťou namiesto filtra.
   ========================================================= */
.panel__title { margin: 0; }
.panel { contain: paint; }
.panel__img { will-change: transform, opacity; backface-visibility: hidden; }
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;                       /* nad fotkou, pod textom */
  background: rgba(14, 14, 16, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
@media (min-width: 768px) {
  /* fotka má pevnú šírku (najväčšia šírka panelu) a je vycentrovaná */
  .panel__img { left: 50%; width: 54vw; transform: translateX(-50%) scale(1.03); }
  .panel__body { width: calc(46.5vw); max-width: none; container-type: normal; }
  .panel__title { font-size: min(clamp(22px, 2.2vw, 84px), calc((46.5vw - 2 * var(--pad)) * .076)); }
  .panel__quote { left: 50%; right: auto; width: calc(46.5vw - 2 * var(--pad)); transform: translateX(-50%); animation-name: fadeDownC; }
}
@media (hover: hover) and (min-width: 768px) {
  .panel:hover .panel__img { transform: translateX(-50%) scale(1); }
  .split:hover .panel:not(:hover) .panel__img { filter: none; }
  .split:hover .panel:not(:hover)::after { opacity: 1; }
  .panel { transition: flex-grow .8s var(--ease); }
}
@keyframes fadeDownC {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Podpis autora webu v pätičke */
.footer-made { display: block; margin-top: 0.6em; text-transform: none; letter-spacing: 0.02em; font-weight: 400; font-size: 0.92em; opacity: 0.85; }
.footer-made a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(128, 128, 128, 0.45); transition: text-decoration-color 0.3s ease, opacity 0.3s ease; }
.footer-made a:hover { text-decoration-color: currentColor; opacity: 1; }
