:root{
  color-scheme: dark;
  --accent: linear-gradient(90deg, #5ad1ff, #b48cff 45%, #ff7ac8 75%, #ffc46b);
}
*{ box-sizing: border-box; }
html{
  background: #000;
  touch-action: pan-y;
  overscroll-behavior: none;
  scrollbar-width: none;
  -webkit-tap-highlight-color: transparent;
}
html::-webkit-scrollbar{ display: none; }
body{ margin: 0; background: #000; }

.portofoliu,.redare{
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #666;
  border-radius: 999px;
  background: rgb(0 0 0 / 80%);
  color: #fff;
  font: 500 0.875rem/1.2 system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.portofoliu{ top: max(10px, env(safe-area-inset-top)); }
.redare{ bottom: max(10px, env(safe-area-inset-bottom)); }
.redare[hidden],.fara-webgl .redare{ display: none; }
:is(.portofoliu,.redare):active{ background: #333; }
:is(.portofoliu,.redare):focus-visible{ outline: 2px solid #fff; outline-offset: 3px; }

.ecran{
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.gata .ecran{ opacity: 1; }

.scena{ height: 190vh; height: 190lvh; }
.scena:last-child{ height: 200vh; height: 200lvh; }

.navigatie{
  position: fixed;
  top: 50%;
  right: max(10px, env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  flex-direction: column;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 1s ease 0.6s;
}
.gata .navigatie{ opacity: 1; }
.navigatie button{
  position: relative;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.navigatie button::before{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transition: transform 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
.navigatie button:hover::before{ background: rgba(255, 255, 255, 0.85); transform: scale(1.3); }
.navigatie button[aria-current]::before{
  background: #fff;
  transform: scale(1.7);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}
.navigatie button:focus-visible{ outline: none; }
.navigatie button:focus-visible::before{ box-shadow: 0 0 0 3px rgba(90, 209, 255, 0.9); }

@media (pointer: coarse){
  .navigatie button{ width: 44px; height: 44px; }
}
@media (pointer: coarse) and (max-height: 640px){
  .navigatie{ display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, 44px); }
}
@media (pointer: coarse) and (max-height: 370px){
  .navigatie{ grid-template-rows: repeat(4, 44px); }
}

.progres{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.progres span{
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  box-shadow: 0 0 12px rgba(180, 140, 255, 0.8);
}

.indiciu{
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 3;
  width: 1px;
  height: 56px;
  margin-left: -0.5px;
  overflow: hidden;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28));
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.indiciu::after{
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 18px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
  animation: cade 1.8s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}
.gata .indiciu{ opacity: 1; transition-delay: 3s; }
.gata.derulat .indiciu{ opacity: 0; transition-delay: 0s; }
@keyframes cade{
  from{ transform: translateY(-20px); }
  to{ transform: translateY(60px); }
}

.incarcare{
  --p: 0;
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 1s ease, visibility 1s;
}
.gata .incarcare{ opacity: 0; visibility: hidden; }
.inel{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 0turn, #fff calc(var(--p)*1turn), rgba(255, 255, 255, 0.1) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: roteste 1.6s linear infinite;
}
@keyframes roteste{ to{ transform: rotate(1turn); } }

.fara-webgl .ecran,
.fara-webgl .incarcare,
.fara-webgl .navigatie{ display: none; }
.fara-webgl body{
  background: linear-gradient(125deg, #07021a, #04283a, #2a0634, #1a1204, #07021a);
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: deriva 24s ease-in-out infinite;
}
@keyframes deriva{
  0%, 100%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce){
  .ecran,.incarcare,.navigatie,.navigatie button::before{ transition: none; }
  .indiciu::after,.inel{ animation: none; }
  .fara-webgl body{ animation: none; }
}
.in-pauza .indiciu::after{ animation-play-state: paused; }
