/* ===========================
   FONT
=========================== */
@font-face {
  font-family: 'DesignerBlock';
  src: url('../fonts/DesignerBlock.woff2') format('woff2'),
       url('../fonts/DesignerBlock.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===========================
   TOKENS
=========================== */
:root {
  --blue:  #38bdf8;
  --glow:  rgba(56, 189, 248, 0.5);
  --text:  #e2f4ff;
  --muted: rgba(180, 220, 255, 0.4);
}

/* ===========================
   RESET
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: 'DesignerBlock', sans-serif;
  color: var(--text);
  user-select: none;
  overflow-x: hidden;
  /* culoarea de fallback vizibilă instant, înainte să se încarce gif-ul */
  background: #04101f;
}

/* ===========================
   BACKGROUND
=========================== */
.bg-gif {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../images/background.gif') center / cover no-repeat;
  filter: brightness(0.4) saturate(1.3) hue-rotate(10deg);
}

.bg-tint {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(4, 16, 40, 0.6) 0%,
    rgba(2, 8, 24, 0.75) 100%
  );
}

.bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
}

/* ===========================
   AMBIENT ORBS
=========================== */
.orb {
  position: fixed;
  z-index: 2;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.3;
}
.orb-1 {
  width: 500px; height: 500px;
  top: -120px; left: -100px;
  background: radial-gradient(circle, rgba(14,165,233,0.7), transparent 70%);
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.orb-2 {
  width: 400px; height: 400px;
  bottom: -80px; right: -80px;
  background: radial-gradient(circle, rgba(56,189,248,0.5), transparent 70%);
  animation: orbFloat 9s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat {
  from { transform: translate(0, 0); }
  to   { transform: translate(30px, 20px); }
}

/* ===========================
   CARD
   — fără backdrop-filter deloc,
     cauza principală a negrului pe iOS
=========================== */
.card {
  position: relative;
  z-index: 10;
  width: 88%;
  max-width: 440px;
  /* background opac, nu mai depinde de blur */
  background: rgba(5, 14, 30, 0.90);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 22px;
  padding: 52px 40px 48px;
  margin: clamp(40px, 8vh, 100px) auto 60px;

  box-shadow:
    0 0 0 1px rgba(56,189,248,0.06),
    0 0 50px rgba(56,189,248,0.10),
    0 30px 70px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.05);

  /* animație simplă, fără transform conflictual cu iOS */
  animation: cardIn 0.5s ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Linie luminoasă sus pe card */
.card-border-top {
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  box-shadow: 0 0 14px var(--glow);
}

/* ===========================
   AVATAR
=========================== */
.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 28px;
}

/* Inelul rotitor */
.avatar-halo {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--blue) 0%,
    #0369a1 30%,
    transparent 48%,
    transparent 52%,
    #0369a1 70%,
    var(--blue) 100%
  );
  animation: haloSpin 3s linear infinite;
  z-index: 0;
}
@keyframes haloSpin {
  to { transform: rotate(360deg); }
}

/* Masca dintre inel și avatar */
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #060f1e;
  z-index: 1;
}

.avatar {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ===========================
   NUME
=========================== */
.name-section {
  text-align: center;
  margin-bottom: 36px;
}

.name {
  font-family: 'DesignerBlock', sans-serif;
  font-size: clamp(34px, 9vw, 48px);
  font-weight: normal;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow:
    0 0 20px rgba(56,189,248,0.5),
    0 0 60px rgba(56,189,248,0.18);
  line-height: 1;
}

.name-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.name-bar {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  box-shadow: 0 0 6px var(--glow);
}
.name-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 6px var(--glow);
  animation: dotPulse 2.4s ease-in-out infinite alternate;
}
.name-dot:last-child { animation-delay: 0.4s; }
@keyframes dotPulse {
  from { opacity: 0.4; transform: scale(0.8); }
  to   { opacity: 1;   transform: scale(1.2); }
}

/* ===========================
   ANIMAȚII STAGGERED
   — iOS Safari fix: opacity 0 explicit
     + animation-fill-mode: forwards
     (nu "both" care buguiește pe Safari)
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.name-section {
  opacity: 0;
  animation: fadeUp 0.4s 0.2s forwards;
}

.links .btn {
  opacity: 0;
}
.links .btn:nth-child(1) { animation: fadeUp 0.4s 0.30s forwards; }
.links .btn:nth-child(2) { animation: fadeUp 0.4s 0.38s forwards; }
.links .btn:nth-child(3) { animation: fadeUp 0.4s 0.46s forwards; }
.links .btn:nth-child(4) { animation: fadeUp 0.4s 0.54s forwards; }

/* ===========================
   BUTOANE
=========================== */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  background: rgba(8, 24, 52, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.18s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Spotlight urmărind mouse-ul (setat din JS) */
.btn-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

/* Bara de accent stânga */
.btn::after {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 2px;
  border-radius: 2px;
  background: var(--blue);
  opacity: 0;
  box-shadow: 0 0 8px var(--glow);
  transition: opacity 0.25s;
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    0 0 20px rgba(56,189,248,0.15),
    0 6px 20px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 22px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  flex-shrink: 0;
}
.btn-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.82;
}

.btn-text {
  flex: 1;
  font-family: 'DesignerBlock', sans-serif;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.btn-arrow {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}
.btn:hover .btn-arrow {
  color: var(--blue);
  transform: translate(2px, -2px);
}

/* ===========================
   MOBILE — iOS & Android
=========================== */
@media (max-width: 480px) {
  .card {
    width: 88%;
    padding: 42px 26px 38px;
    /* Safe area pentru notch și home bar pe iPhone */
    padding-bottom: max(38px, env(safe-area-inset-bottom, 38px));
    margin-top: max(40px, env(safe-area-inset-top, 40px));
  }
  .avatar-wrap { width: 92px; height: 92px; }
  .btn-inner { padding: 15px 18px; }
  .btn-text { font-size: 17px; }
}
