:root{
  --left-bg: #595c47;
  --right-bg: #000;
  --text-muted: rgba(255,255,255,.78);
  --cta: #b11217;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  background: #111;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Layout wrapper */
.landing{
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* tiles */
.landing-tile{
  height: 50vh;
  position: relative;
  overflow: hidden;
}

/* mobile: poprawne 50% nawet z paskiem URL */
@supports (height: 100svh){
  @media (max-width: 991.98px){
    .landing-tile{ height: 50svh; }
    .landing{ min-height: 100svh; }
  }
}

@supports (height: 100dvh){
  @media (max-width: 991.98px){
    .landing-tile{ height: 50dvh; }
    .landing{ min-height: 100dvh; }
  }
}

@media (min-width: 992px){
  .landing-tile{ height: 100vh; }
}

/* clickable full tile */
.tile-link{
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* shared tile look */
.tile{
  --cx: 50%;
  --cy: 52%;
  --content-w: 560px;
  --logo-nudge: 0px;
}

/* backgrounds */
.tile-left{ background: var(--left-bg); color:#111; }
.tile-right{ background: var(--right-bg); color:#fff; }

/* Ken Burns */
@keyframes slow-kenburns {
  0%   { transform: scale(1) translate3d(0,0,0); }
  100% { transform: scale(1.12) translate3d(-1.5%, -1.5%, 0); }
}

/* image layer */
.tile::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;

  transform: scale(1.08);
  opacity: 0;

  transition: opacity 450ms ease, transform 650ms ease;
  will-change: opacity, transform;

  animation: slow-kenburns 18s ease-in-out infinite alternate;
  animation-play-state: paused;
}

/* overlay */
.tile::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity 450ms ease;
}

/* center content */
.tile-center{
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  transform: translate(-50%, -50%);
  width: min(var(--content-w), 90%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 0 8px;
  z-index: 2;
}

/* logo */
.brand-logo{
  width: min(520px, 82%);
  height: auto;
  display: block;
  transform: translateY(var(--logo-nudge, 0px));
  transition: transform 350ms ease;
}

/* description */
.tile-desc{
  margin: 0;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
  font-weight: 400;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 280ms ease, transform 280ms ease;
}

/* CTA */
.tile-cta{
  position: relative;
  overflow: hidden;

  background: var(--cta);
  border: 0;
  color: #fff;

  font-weight: 700;
  letter-spacing: .35px;
  padding: 10px 18px;
  border-radius: 0;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 280ms ease, transform 280ms ease;
}

/* CTA always red */
.tile-cta,
.tile-cta:hover,
.tile-cta:focus,
.tile-cta:active{
  background-color: var(--cta);
  color: #fff;
}

/* CTA border */
.tile-cta::after{
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #fff;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms ease, opacity 160ms ease;
  pointer-events: none;
}

/* arrow */
.cta-arrow{
  margin-left: 10px;
  display: inline-block;
}

@keyframes arrow-move{
  0%{ transform: translateX(0); }
  50%{ transform: translateX(6px); }
  100%{ transform: translateX(0); }
}

.tile-cta:hover::after{
  opacity: 1;
  transform: scaleX(1);
}
.tile-cta:hover .cta-arrow{
  animation: arrow-move 0.6s ease-in-out infinite;
}

/* desktop hover */
@media (hover:hover) and (pointer:fine){
  .tile:hover::before{
    opacity: 1;
    transform: scale(1);
    animation-play-state: running;
    animation-delay: 250ms;
  }
  .tile:hover::after{ opacity: 1; }

  .tile:hover .brand-logo{
    transform: translateY(calc(var(--logo-nudge, 0px) - 10px));
  }

  .tile:hover .tile-desc,
  .tile:hover .tile-cta{
    opacity: 1;
    transform: translateY(0);
  }
}

/* MOBILE */
@media (max-width: 991.98px){
  .landing{
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .tile{ --cy: 50%; }

  .brand-logo{
    height: 56px;
    width: auto;
    max-width: 86%;
  }

  .tile-left{ --logo-nudge: 6px; }
  .tile-right{ --logo-nudge: 0px; }

  .tile-center{ gap: 12px; }

  /* tylko logo w stanie zamkniętym */
  .tile:not(.is-open) .tile-desc,
  .tile:not(.is-open) .tile-cta{
    display: none;
  }

  /* mobile font +1px */
  .tile-desc{
    font-size: 13px;
    line-height: 1.45;
  }

  /* otwarcie */
  .tile.is-open::before{
    opacity: 1;
    transform: scale(1);
    animation-play-state: running;
    animation-delay: 650ms;
  }
  .tile.is-open::after{ opacity: 1; }

  .tile.is-open .brand-logo{
    transform: translateY(calc(var(--logo-nudge, 0px) - 10px));
  }

  /* CTA niżej o 10px */
  .tile.is-open .tile-cta{
    margin-top: 10px;
  }

  .tile.is-open .tile-desc,
  .tile.is-open .tile-cta{
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FHTM trigger ===== */
.fhtm-trigger{
  appearance: none;
  border: 0;
  width: 100%;
  cursor: pointer;

  display: grid;
  place-items: center;
  padding: 28px 12px;
  background: #000;
}

.fhtm-trigger img{
  height: 42px;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}

/* mobile: logo FHTM mniejsze o ~30% */
@media (max-width: 991.98px){
  .fhtm-trigger img{
    height: 30px;
  }
}

/* desktop pinned */
@media (min-width: 992px){
  .fhtm-trigger{
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 20;

    width: auto;
    padding: 0;
    background: transparent;
  }
}

/* ===== Modal FHTM ===== */
.fhtm-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.fhtm-modal.is-open{ display: block; }

.fhtm-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.90);
}

.fhtm-modal__panel{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.fhtm-modal__content{
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 16px;
  max-width: 720px;
}

.fhtm-modal__logo{
  height: 54px;
}

.fhtm-modal__text{
  margin: 0;
  color: rgba(255,255,255,.85);
  font-size: 16px;
  line-height: 1.5;
}

.fhtm-modal__close{
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

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

.tile:hover .tile-cta,
.tile.is-open .tile-cta{
  margin-top: 10px;
}

@media (max-width: 991.98px){
  .fhtm-modal__logo{
    height: 43px; 
  }
}