/* Strona główna: trzy drzwi. Noxadus stoi pośrodku, w jego drzwiach gra ostatnia praca,
   a jego zielone światło rozlewa się po obu szwach. Zostało po dawnej szczelinie. */

@property --tri-a {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 43%;
}

@property --tri-b {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 77%;
}

/* --tri-a i --tri-b to górne końce szwów; na dole każdy szew jest o --tri-slant bardziej w lewo. */
.tri-landing {
  --tri-a: 43%;
  --tri-b: 77%;
  --tri-slant: 20%;
  --tri-pad: clamp(28px, 4.4vw, 64px);
  background: #020a08;
  transition: --tri-a 640ms cubic-bezier(.2, .8, .2, 1), --tri-b 640ms cubic-bezier(.2, .8, .2, 1);
}

.tri-landing:has(.tri-pro:hover) { --tri-a: 46%; --tri-b: 78.5%; }
.tri-landing:has(.tri-nox:hover) { --tri-a: 41%; --tri-b: 79%; }
.tri-landing:has(.tri-lat:hover) { --tri-a: 41.5%; --tri-b: 74%; }

.tri-panel {
  position: absolute;
  inset: 0;
  isolation: isolate;
}

.tri-pro {
  clip-path: polygon(0 0, var(--tri-a) 0, calc(var(--tri-a) - var(--tri-slant)) 100%, 0 100%);
  background: #fbfbf7;
  color: var(--ink);
}

.tri-nox {
  clip-path: polygon(var(--tri-a) 0, var(--tri-b) 0, calc(var(--tri-b) - var(--tri-slant)) 100%, calc(var(--tri-a) - var(--tri-slant)) 100%);
  background: #020a08;
  color: #e3fff4;
}

.tri-lat {
  clip-path: polygon(var(--tri-b) 0, 100% 0, 100% 100%, calc(var(--tri-b) - var(--tri-slant)) 100%);
  background:
    linear-gradient(90deg, rgba(7, 7, 8, .1), rgba(7, 7, 8, .52)),
    url("../assets/images/latarnik-light.png") center / cover;
  color: #f4f1e8;
}

/* Cały panel jest linkiem; napisy przepuszczają kliknięcie, a „teraz” to osobny link na wierzchu. */
.tri-cover {
  position: absolute;
  z-index: 2;
  inset: 0;
  -webkit-tap-highlight-color: transparent;
}

.tri-cover:focus-visible {
  outline: 2px solid #8eeacb;
  outline-offset: -8px;
}

.tri-copy {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.tri-copy a {
  pointer-events: auto;
}

.tri-pro .tri-copy {
  top: var(--tri-pad);
  left: var(--tri-pad);
  max-width: min(30vw, 470px);
}

.tri-lat .tri-copy {
  right: var(--tri-pad);
  bottom: var(--tri-pad);
  max-width: min(34vw, 520px);
  text-align: right;
}

/* Napis Noxadusa stoi pod pracą jak podpis pod obrazem (66% wysokości drzwi)
   i trzyma się środka drzwi na tej wysokości także wtedy, gdy szwy się przesuwają. */
.tri-nox .tri-copy {
  top: 66%;
  left: calc((var(--tri-a) + var(--tri-b)) / 2 - var(--tri-slant) * .66);
  width: min(28vw, 420px);
  text-align: center;
  transform: translate(-50%, -50%);
}

.tri-title {
  display: block;
  font-size: clamp(40px, 5vw, 78px);
  font-weight: 700;
  line-height: .95;
  letter-spacing: 0;
  transition: transform 320ms ease, text-shadow 320ms ease;
}

/* Panel Latarnika przy dole jest węższy niż dawniej, więc „Wszechświata” nie może być szersze niż on. */
.tri-lat .tri-title {
  font-size: clamp(36px, 4.4vw, 68px);
}

.tri-nox .tri-title {
  font-size: clamp(42px, 5.2vw, 84px);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(142, 234, 203, .85), 0 0 64px rgba(63, 184, 148, .7);
}

.tri-panel:hover .tri-title {
  transform: translateY(-6px) scale(1.02);
}

.tri-nox:hover .tri-title {
  text-shadow: 0 0 20px rgba(170, 250, 222, .95), 0 0 80px rgba(63, 184, 148, .85);
}

.tri-line {
  max-width: 27ch;
  margin: 18px 0 0;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 450;
  line-height: 1.45;
  text-wrap: balance;
}

.tri-pro .tri-line { color: var(--muted); }
.tri-nox .tri-line { max-width: 34ch; margin-inline: auto; color: rgba(227, 255, 244, .82); }
.tri-lat .tri-line { margin-left: auto; color: rgba(244, 241, 232, .8); }

.tri-now {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.tri-now:hover,
.tri-now:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.tri-now-work { color: #a2412b; }

.tri-now-work::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c0533a;
  animation: work-pulse 2.8s ease-in-out infinite;
}

.tri-lat .tri-now { color: var(--gold); }

/* „Teraz” w drzwiach Noxadusa: bursztyn tarczy z reklamy, znak przewijania wstecz. */
.tri-now-rewind,
.m-home-now {
  gap: 10px;
  padding: 10px 16px 10px 14px;
  border: 1px solid rgba(248, 192, 120, .55);
  border-radius: 999px;
  background: rgba(10, 8, 5, .58);
  color: #f8c078;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 34px rgba(243, 154, 18, .18);
  transition: background 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

.tri-now-rewind:hover,
.tri-now-rewind:focus-visible,
.m-home-now:hover,
.m-home-now:focus-visible {
  background: rgba(24, 16, 6, .78);
  color: #ffd9a3;
  text-decoration: none;
  box-shadow: 0 0 46px rgba(243, 154, 18, .34);
}

.rw-icon {
  width: 17px;
  height: 11px;
  flex: 0 0 auto;
  fill: currentColor;
}

/* Kadr z ostatniej pracy (teraz bransoleta Just Rewind w świetle studia). Wypełnia prostokąt opisany
   na drzwiach, więc nadąża za szwami, i powoli oddycha, żeby drzwi żyły bez pętli wideo. */
.tri-film {
  position: absolute;
  z-index: 0;
  top: 0;
  left: calc(var(--tri-a) - var(--tri-slant));
  width: calc(var(--tri-b) - var(--tri-a) + var(--tri-slant));
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  filter: brightness(.94);
  transform-origin: 57% 30%;
  animation: tri-breathe 12s ease-in-out infinite alternate;
  transition: filter 400ms ease;
}

@keyframes tri-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}

.tri-nox::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 10, 8, .12), rgba(2, 10, 8, 0) 34%, rgba(2, 10, 8, .5) 60%, rgba(2, 10, 8, .9));
}

.tri-nox:hover .tri-film {
  filter: brightness(1.04);
}

/* Szwy: cienkie jasne linie z pulsującą zieloną poświatą. */
.tri-seam {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 1.5px;
  height: 128%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(236, 255, 248, .95) 22%, #f4fffb 50%, rgba(236, 255, 248, .95) 78%, transparent);
  box-shadow: 0 0 8px 1px rgba(142, 234, 203, .9);
  transform: translate(-50%, -50%) rotate(20deg);
}

.tri-seam-a { left: calc(var(--tri-a) - var(--tri-slant) / 2); }
.tri-seam-b { left: calc(var(--tri-b) - var(--tri-slant) / 2); }

.tri-seam::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(142, 234, 203, .3) 50%, transparent);
  filter: blur(12px);
  animation: seam-pulse 3.4s ease-in-out infinite;
}

.tri-seam-b::before {
  animation-delay: -1.7s;
}

/* Kąt szwów zależy od proporcji ekranu: przesunięcie o --tri-slant szerokości na całej wysokości. */
@supports (transform: rotate(atan2(1px, 1px))) {
  .tri-seam {
    transform: translate(-50%, -50%) rotate(atan2(20vw, calc(100dvh - 72px)));
  }
}

/* Stopka leży na dole panelu Corporate, który przy dole jest wąski. */
.tri-landing .site-footer-landing {
  max-width: calc(23vw - var(--tri-pad) - 18px);
}

@media (prefers-reduced-motion: reduce) {
  .tri-landing { transition: none; }
  .tri-film { animation: none; }
  .tri-seam::before,
  .tri-now-work::before { animation: none; }
  .tri-title { transition: none; }
}

/* Telefon: trzy pasy jeden pod drugim, Noxadus w środku z pętlą, świecące szwy na granicach. */
@media (max-width: 980px) {
  .m-home-nox {
    position: relative;
    z-index: 2;
    justify-content: center;
    align-items: center;
    padding: 18px 20px;
    background: #020a08;
    color: #e3fff4;
    text-align: center;
  }

  .m-home-nox::before,
  .m-home-nox::after {
    content: "";
    position: absolute;
    z-index: 4;
    right: 0;
    left: 0;
    height: 1.5px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(236, 255, 248, .95) 18%, #f4fffb 50%, rgba(236, 255, 248, .95) 82%, transparent);
    box-shadow: 0 0 10px 2px rgba(142, 234, 203, .75);
  }

  .m-home-nox::before { top: 0; }
  .m-home-nox::after { bottom: 0; }

  .m-home-film {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 57% 22%;
    filter: brightness(.9);
  }

  /* Pas Noxadusa: bransoleta u góry, podpis na dole na przyciemnieniu. */
  .m-home-panel.m-home-nox {
    justify-content: flex-end;
    padding-bottom: 20px;
  }

  .m-home-cover {
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 10, 8, 0) 28%, rgba(2, 10, 8, .55) 58%, rgba(2, 10, 8, .9));
    -webkit-tap-highlight-color: transparent;
  }

  .m-home-nox .m-home-copy {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    gap: 8px;
    pointer-events: none;
  }

  .m-home-nox .m-home-copy a {
    pointer-events: auto;
  }

  .m-home-nox span {
    margin: 0;
  }

  .m-home-panel.m-home-nox strong {
    max-width: none;
    font-size: clamp(36px, 11vw, 54px);
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(142, 234, 203, .85), 0 0 48px rgba(63, 184, 148, .7);
  }

  .m-home-nox p {
    max-width: 30ch;
    margin: 0;
    color: rgba(227, 255, 244, .86);
    font-size: 14px;
    line-height: 1.4;
    text-wrap: balance;
  }

  .m-home-panel.m-home-nox .m-home-now {
    display: inline-flex;
    align-items: center;
    margin: 6px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
  }
}
